blob: 0e1e562056e15a19087605f7d1cac481df4db092 [file] [log] [blame]
Douglas Gregord0c87372009-05-27 17:30:49 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregor2bba76b2009-05-27 17:07:49 +00002
3namespace N {
4 struct Outer {
5 struct Inner {
6 template<typename T>
7 struct InnerTemplate {
8 struct VeryInner {
9 typedef T type;
10
11 static enum K1 { K1Val = sizeof(T) } Kind1;
Douglas Gregor8dbc3c62009-05-27 17:20:35 +000012 static enum { K2Val = sizeof(T)*2 } Kind2;
Douglas Gregord0c87372009-05-27 17:30:49 +000013 enum { K3Val = sizeof(T)*2 } Kind3;
Douglas Gregor2bba76b2009-05-27 17:07:49 +000014
15 void foo() {
16 K1 k1 = K1Val;
17 Kind1 = K1Val;
18 Outer::Inner::InnerTemplate<type>::VeryInner::Kind2 = K2Val;
Douglas Gregord0c87372009-05-27 17:30:49 +000019 Kind3 = K3Val;
Douglas Gregor2bba76b2009-05-27 17:07:49 +000020 }
Douglas Gregord0c87372009-05-27 17:30:49 +000021
22 struct UeberInner {
23 void bar() {
24 K1 k1 = K1Val;
25 Kind1 = K1Val;
26 Outer::Inner::InnerTemplate<type>::VeryInner::Kind2 = K2Val;
Douglas Gregored961e72009-05-27 17:54:46 +000027
28 InnerTemplate t;
29 InnerTemplate<type> t2;
Douglas Gregord0c87372009-05-27 17:30:49 +000030 }
31 };
Douglas Gregor2bba76b2009-05-27 17:07:49 +000032 };
33 };
34 };
35 };
36}
37
38typedef int INT;
39template struct N::Outer::Inner::InnerTemplate<INT>::VeryInner;
Douglas Gregord0c87372009-05-27 17:30:49 +000040template struct N::Outer::Inner::InnerTemplate<INT>::UeberInner; // expected-error{{'UeberInner' does not name a tag member}}