[cfe-commits] r68136 - /cfe/trunk/test/SemaTemplate/metafun-apply.cpp

Douglas Gregor dgregor at apple.com
Tue Mar 31 13:07:16 PDT 2009


Author: dgregor
Date: Tue Mar 31 15:07:16 2009
New Revision: 68136

URL: http://llvm.org/viewvc/llvm-project?rev=68136&view=rev
Log:
Improve the dependent nested-name-specifier test a bit

Modified:
    cfe/trunk/test/SemaTemplate/metafun-apply.cpp

Modified: cfe/trunk/test/SemaTemplate/metafun-apply.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/metafun-apply.cpp?rev=68136&r1=68135&r2=68136&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/metafun-apply.cpp (original)
+++ cfe/trunk/test/SemaTemplate/metafun-apply.cpp Tue Mar 31 15:07:16 2009
@@ -14,9 +14,17 @@
   };
 };
 
+struct bogus {
+  struct apply {
+    typedef int type;
+  };
+};
+
 template<typename MetaFun, typename T>
 struct apply1 {
-  typedef typename MetaFun::template apply<T>::type type; // expected-note{{in instantiation of template class 'struct add_reference::apply<void>' requested here}}
+  typedef typename MetaFun::template apply<T>::type type; // expected-note{{in instantiation of template class 'struct add_reference::apply<void>' requested here}} \
+  // expected-error{{'apply' following the 'template' keyword does not refer to a template}} \
+  // FIXME: expected-error{{type 'MetaFun::template apply<int>' cannot be used prior to '::' because it has no members}}
 };
 
 int i;
@@ -27,4 +35,9 @@
 void test() {
   apply1<add_reference, void>::type t; // expected-note{{in instantiation of template class 'struct apply1<struct add_reference, void>' requested here}} \
   // FIXME: expected-error{{unexpected type name 'type': expected expression}}
+
+  apply1<bogus, int>::type t2; // expected-note{{in instantiation of template class 'struct apply1<struct bogus, int>' requested here}} \
+  // FIXME: expected-error{{unexpected type name 'type': expected expression}}
 }
+
+





More information about the cfe-commits mailing list