Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / g++.dg / tc1 / dr49.C
blobf880e2ac36ac6c164a288e4a449c8d8276ee6662
1 // { dg-do compile }
2 // Contributed by: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
3 // DR 49: Non-constant pointers are invalid template arguments.
5 template<int *a> struct R { /* ... */ };
6 template<int b[5]> struct S { /* ... */ };
8 int p;
9 template struct R<&p>; // OK
10 template struct S<&p>; // OK due to parameter adjustment
12 int *ptr;
13 template struct R<ptr>; // { dg-error "constant" }
14 template struct S<ptr>; // { dg-error "constant" }
16 int v[5];
17 template struct R<v>; // OK due to implicit argument conversion
18 template struct S<v>; // OK due to both adjustment and conversion