OSDN Git Service

PR c++/52685
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / function1.C
1 // PR c++/38647
2 // { dg-do compile }
3 // { dg-prune-output "note" }
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|constant expression" }
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|constant expression" }
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|constant expression" }
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|constant expression" }
26
27 char d1[1];
28 D<d1, 0> d;