1 // PR c++/79650 2 // { dg-do compile { target c++11 } } 3 // { dg-options "" } 4 5 typedef __INTPTR_TYPE__ intptr_t; 6 template<intptr_t> struct A {}; 7 8 void foo()9foo () 10 { 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" } 20 } 21