1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 // PR4364
4 template<class T> struct a {
5   T b() {
6     return typename T::x();
7   }
8 };
9 struct B {
10   typedef B x;
11 };
12 B c() {
13   a<B> x;
14   return x.b();
15 }
16 
17 // Some extra tests for invalid cases
18 template<class T> struct test2 { T b() { return typename T::a; } }; // expected-error{{expected '(' for function-style cast or type construction}}
19 template<class T> struct test3 { T b() { return typename a; } }; // expected-error{{expected a qualified name after 'typename'}}
20