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