]> granicus.if.org Git - clang/commitdiff
Test instantiations of out-of-line member definitions of nested templates.
authorDouglas Gregor <dgregor@apple.com>
Fri, 28 Aug 2009 21:15:08 +0000 (21:15 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 28 Aug 2009 21:15:08 +0000 (21:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80395 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaTemplate/instantiate-member-template.cpp

index d72028df8a5db22f50fdc10f855ebbc3e6d44849..ebc3a5293f2bbbcbc2b874615b96c6f5e42f3afa 100644 (file)
@@ -54,8 +54,24 @@ struct X1 {
     }
   };
   
+  template<typename U>
+  struct Inner4;
+};
+
+template<typename T>
+template<typename U>
+struct X1<T>::Inner4 {
+  template<typename V>
+  V f2(T t, U u, V);
 };
 
+template<typename T>
+template<typename U>
+template<typename V>
+V X1<T>::Inner4<U>::f2(T t, U u, V) {
+  return t + u; // expected-error{{incompatible type}}
+}
+
 void test_X1(int *ip, int i, double *dp) {
   X1<void>::Inner0<int> *xvip; // okay
   X1<void>::Inner0<int> xvi; // expected-note{{instantiation}}
@@ -74,4 +90,7 @@ void test_X1(int *ip, int i, double *dp) {
   
   X1<int*>::Inner3<double*> id3b;
   id3b.f0(ip, dp); // expected-note{{instantiation}}
+  
+  X1<int*>::Inner4<int> id4;
+  id4.f2(ip, i, dp); // expected-note{{instantiation}}
 }