Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / template / nontype3.C
blob5f245620a838fe0eb888d5d3b4085d0cfdd2f3a8
1 // { dg-do compile }
2 // Origin: <drow at gcc dot gnu dot org>,
3 //         <giovannibajo at gcc dot gnu dot org>
4 // c++/13243: Template parameters of non integral or enumeration type can't be
5 //  used for integral constant expressions. ADDR_EXPR and INDIRECT_REF are
6 //  invalid too.
8 template <int T> class foo {};
9 template <int *T> class bar {};
11 template <int *PI>
12 void dep5(bar<PI> *);
14 template <int *PI>
15 void dep6(bar<PI+1> *); // { dg-error "" "integral or enumeration" }
17 template <int I>
18 void dep7(bar<I+1> *);
20 template <int *PI>
21 void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" }
23 template <int PI[1]>
24 void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" }
26 template <int PI[1]>
27 void dep9a(foo< sizeof(*PI) > *);
29 template <int PI[1]>
30 void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" }
32 template <int I>
33 void dep11(foo< *&I > *); // { dg-error "" "constant-expression" }
35 template <int I>
36 void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }