ec686eec456f46ae0b536e9c364a187feab826f9
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / regress / template-function1.C
1 // PR c++/38647
2 // { dg-do compile }
3 // { dg-options "-std=c++0x" }
4
5 template<const char *, int> struct A {};
6 const char func[] = "abc";
7 template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid" }
8
9 char a1[1];
10 A<a1, 0> a;
11
12 template<const char *, int> struct B {};
13 template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid" }
14
15 char b1[1];
16 B<b1, 0> b;
17
18 template<const char *, int> struct C {};
19 template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid" }
20
21 char c1[1];
22 C<c1, 0> c;
23
24 template<const char *, int> struct D {};
25 template<int N> struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope" }
26
27 char d1[1];
28 D<d1, 0> d;