PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / pr79650.C
blob72c781409426cb036990ff71a2ef8191d36e839d
1 // PR c++/79650
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
5 typedef __INTPTR_TYPE__ intptr_t;
6 template<intptr_t> struct A {};
8 void
9 foo ()
11   static int a, b;
12 lab1:
13 lab2:
14   A<(intptr_t)&&lab1 - (__INTPTR_TYPE__)&&lab2> c;      // { dg-error "not a constant integer" }
15   A<(intptr_t)&&lab1 - (__INTPTR_TYPE__)&&lab1> d;
16   A<(intptr_t)&a - (intptr_t)&b> e;                     // { dg-error "is not a constant expression" }
17   A<(intptr_t)&a - (intptr_t)&a> f;
18   A<(intptr_t)sizeof(a) + (intptr_t)&a> g;              // { dg-error "not a constant integer" }
19   A<(intptr_t)&a> h;                                    // { dg-error "conversion from pointer type" }