summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
index 856e4297af5..733e791c2bc 100644
--- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-10.C
@@ -3,16 +3,24 @@
template <class T> using Ptr = T*;
Ptr<unsigned>; // { dg-error "does not declare anything" }
Ptr<char><int>; // { dg-error "not a template|does not declare anything" }
-template class Ptr<int>;//{ dg-error "explicit instantiation|non-class templ|does not decl|anything" }
+template class Ptr<int>;//{ dg-error "alias template specialization\[^\n\r\]*after\[^\n\r\]*class" }
template <class T> using Arg = T;
struct A {};
-template class Arg<A>;// { dg-error "explicit instantiation|non-class templ" }
+template class Arg<A>;// { dg-error "alias templ\[^\n\r\]*specialization\[^\n\r\]*Arg<A>\[^\n\r\]*after\[^\n\r\]*class" }
template <template <class> class TT, class T> using Instantiate = TT<T>;
template <class> struct Vector {};
-template class Instantiate<Vector, int>; // OK Vector<int> can be explicitely instantiated
+
+// The below is not OK, because of [dcl.type.elab]:
+//
+// If the identifier resolves to a typedef-name or the
+// simple-template-id resolves to an alias template
+// specialization, the elaborated-type-specifier is ill-formed.
+//
+template class Instantiate<Vector, int>;//{ dg-error "alias template specialization\[^\n\r\]*after\[^\n\r\]*class" }
template <class T> struct S {};
template<class T> using SFor = S<T>;
-template class SFor<int>; // OK, S<int> can be explicitely instantiated
+// Likewise, this is not OK.
+template class SFor<int>; //{ dg-error "alias template specialization\[^\n\r\]*after\[^\n\r\]*class" }