1 // PR c++/8736
2 // Origin: Peter Kolloch <pkolloch@gmx.ne>
3 // { dg-do compile }
4 
5 template <typename T> struct A
6 {
7     template <typename U> struct B
8     {
9         typedef int X;
10     };
11 };
12 
foo()13 template <typename T> void foo()
14 {
15     typedef typename A<T>::B<T>::X Y; // { dg-error "non-template" "non" }
16     // { dg-error "not declare" "decl" { target *-*-* } .-1 }
17     // { dg-message "note" "note" { target *-*-* } .-2 }
18 }
19 
bar()20 void bar()
21 {
22     foo<int>();
23 }
24