gcc/testsuite/g++.dg/parse/typename11.C
raw| 1 | // PR c++/11987 |
| 2 | |
| 3 | template <int dim> struct X { |
| 4 | struct I { I(); }; |
| 5 | }; |
| 6 | |
| 7 | template <int dim> struct Y : X<dim> { |
| 8 | typedef typename X<dim>::I I; |
| 9 | }; |
| 10 | |
| 11 | // note: I is nested type in X, not Y! |
| 12 | template <int dim> |
| 13 | Y<dim>::I::I () {} // { dg-error "expected|dependent typedef" "typedef" } |
| 14 | // { dg-error "no type|dependent type" "no type" { target c++17_down } .-1 } |
| 15 | |
| 16 | template struct Y<1>; |