PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / tc1 / dr49.C
blob753d96b6977174804e3f2ea0caa1bf5256cfb23e
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 "argument" }
14 template struct S<ptr>; // { dg-error "argument" }
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