c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / template / dependent-name15.C
blob1c34bc704f962c71e2b4be73bb9196bb44a99215
1 // { dg-do compile { target c++11 } }
2 template <int N> struct A { static void foo(){} };
3 template <> struct A<sizeof(char)> { using foo = int; };
5 template <class T> void f(T t1) { 
6     A<sizeof(t1)>::foo();
9 template <class T> void g(T t2) { 
10     /* if the comparing_specializations check breaks in cp_tree_equal
11     case PARM_DECL, the error will incorrectly report A<sizeof (t1)> */
12     A<sizeof(t2)>::foo(); // { dg-error "dependent-name .A<sizeof .t2.>::foo" }
15 void h() {
16     f(0);
17     g('0');