[cfe-commits] r80395 - /cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp

Douglas Gregor dgregor at apple.com
Fri Aug 28 14:15:08 PDT 2009


Author: dgregor
Date: Fri Aug 28 16:15:08 2009
New Revision: 80395

URL: http://llvm.org/viewvc/llvm-project?rev=80395&view=rev
Log:
Test instantiations of out-of-line member definitions of nested templates.

Modified:
    cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp

Modified: cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp?rev=80395&r1=80394&r2=80395&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-member-template.cpp Fri Aug 28 16:15:08 2009
@@ -54,8 +54,24 @@
     }
   };
   
+  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 @@
   
   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}}
 }





More information about the cfe-commits mailing list