1 // { dg-do compile { target c++11 } }
3 template <class T> using Ptr = T*;
4 Ptr<unsigned>; // { dg-error "does not declare anything" }
5 Ptr<char><int>; // { dg-error "not a template|does not declare anything" }
6 template class Ptr<int>;//{ dg-error "alias template specialization\[^\n\r\]*after\[^\n\r\]*class" }
8 template <class T> using Arg = T;
10 template class Arg<A>;// { dg-error "alias templ\[^\n\r\]*specialization\[^\n\r\]*Arg<A>\[^\n\r\]*after\[^\n\r\]*class" }
12 template <template <class> class TT, class T> using Instantiate = TT<T>;
13 template <class> struct Vector {};
15 // The below is not OK, because of [dcl.type.elab]:
17 // If the identifier resolves to a typedef-name or the
18 // simple-template-id resolves to an alias template
19 // specialization, the elaborated-type-specifier is ill-formed.
21 template class Instantiate<Vector, int>;//{ dg-error "alias template specialization\[^\n\r\]*after\[^\n\r\]*class" }
23 template <class T> struct S {};
24 template<class T> using SFor = S<T>;
25 // Likewise, this is not OK.
26 template class SFor<int>; //{ dg-error "alias template specialization\[^\n\r\]*after\[^\n\r\]*class" }