Debian Codegraph @

gcc/testsuite/g++.dg/diagnostic/local1.C

raw
1 // PR c++/99213
2 // { dg-do compile { target c++14 } }
3
4 template <class T>
5 struct A {
6 template <class U>
7 static auto f() {
8 struct S1{};
9 return S1{};
10 }
11 };
12
13 using type = void;
14 using type = decltype(A<int>::f<char>()); // { dg-error "A<int>::f<char>\\(\\)::S1" }
15
16 template <class T>
17 struct B {
18 static auto f() {
19 struct S2{};
20 return S2{};
21 }
22 };
23
24 using type = void;
25 using type = decltype(B<int>::f()); // { dg-error "B<int>::f\\(\\)::S2" }