1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 template<class T
> struct a
{ // expected-note {{here}}
6 return typename
T::x();
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 template<class T
> struct test4
{ T
b() { return typename ::a
; } }; // expected-error{{refers to non-type member}} expected-error{{expected '(' for function-style cast or type construction}}
23 namespace PR12884_original
{
24 template <typename T
> struct A
{
26 template <typename U
> struct X
{};
30 typedef B::X
<typename
B::arg
> x
; // expected-error {{missing 'typename'}}
34 template <> struct A
<int>::B
{
35 template <int N
> struct X
{};
36 static const int arg
= 0;
41 namespace PR12884_half_fixed
{
42 template <typename T
> struct A
{
44 template <typename U
> struct X
{};
48 typedef typename
B::X
<typename
B::arg
> x
; // expected-error {{use 'template'}} expected-error {{refers to non-type}}
52 template <> struct A
<int>::B
{
53 template <int N
> struct X
{};
54 static const int arg
= 0; // expected-note {{here}}
57 A
<int>::C::x a
; // expected-note {{here}}
59 namespace PR12884_fixed
{
60 template <typename T
> struct A
{
62 template <typename U
> struct X
{};
66 typedef typename
B::template X
<B::arg
> x
;
70 template <> struct A
<int>::B
{
71 template <int N
> struct X
{};
72 static const int arg
= 0;