1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s 2 3 // Examples from CWG1056. 4 namespace Example1 { 5 template<class T> struct A; 6 template<class T> using B = A<T>; 7 8 template<class T> struct A { 9 struct C {}; 10 B<T>::C bc; // ok, B<T> is the current instantiation. 11 }; 12 13 template<class T> struct A<A<T>> { 14 struct C {}; 15 B<B<T>>::C bc; // ok, B<B<T>> is the current instantiation. 16 }; 17 18 template<class T> struct A<A<A<T>>> { 19 struct C {}; 20 B<B<T>>::C bc; // expected-error {{missing 'typename'}} 21 }; 22 } 23 24 namespace Example2 { 25 template<class T> struct A { 26 void g(); 27 }; 28 template<class T> using B = A<T>; g()29 template<class T> void B<T>::g() {} // ok. 30 } 31