PR c++/85765 - SFINAE and non-type default template arg.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / alias-decl-2.C
blobb70b7d4d68bf2f63d2383ab728af9d153bf63641
1 // { dg-do compile { target c++11 } }
3 template<class T> struct S0 {};
4 template<class T> using AS0 = S0<T>;
6 template<template<class> class TT>
7 void f(TT<int>);
9 template class AS0<char>; // { dg-error "alias templ\[^\n\r\]*specialization\[^\n\r\]*after\[^\n\r\]*class" }
11 void
12 foo()
14   AS0<int> a;
15   f(a);
18 template<class T, class U> struct Vector{};
19 template<class T> struct Alloc {};
21 template<class T> using Vec = Vector<T, Alloc<T> >;
23 template<class T> void g(Vector<T, Alloc<T> >);
25 template<template<class T> class TT> void h(TT<int>); // { dg-message "" }
27 void
28 bar()
30   Vec<int> a;
31   g(a);
32   h(a); // { dg-error "no matching function|wrong number of template arguments" }