// RUN: clang-cc -fsyntax-only -verify %s namespace N { struct Outer { struct Inner { template struct InnerTemplate { struct VeryInner { typedef T type; static enum K1 { K1Val = sizeof(T) } Kind1; static enum { K2Val = sizeof(T)*2 } Kind2; enum { K3Val = sizeof(T)*2 } Kind3; void foo() { K1 k1 = K1Val; Kind1 = K1Val; Outer::Inner::InnerTemplate::VeryInner::Kind2 = K2Val; Kind3 = K3Val; } struct UeberInner { void bar() { K1 k1 = K1Val; Kind1 = K1Val; Outer::Inner::InnerTemplate::VeryInner::Kind2 = K2Val; InnerTemplate t; InnerTemplate t2; } }; }; }; }; }; } typedef int INT; template struct N::Outer::Inner::InnerTemplate::VeryInner; template struct N::Outer::Inner::InnerTemplate::UeberInner; // expected-error{{'UeberInner' does not name a tag member}} namespace N2 { struct Outer2 { template struct Inner { void foo() { enum { K1Val = sizeof(T) } k1; enum K2 { K2Val = sizeof(T)*2 } k2a; K2 k2b = K2Val; struct S { T x, y; } s1; struct { U x, y; } s2; s1.x = s2.x; // expected-error{{incompatible}} typedef T type; type t2 = s1.x; typedef struct { T z; } type2; type2 t3 = { s1.x }; Inner i1; i1.foo(); Inner i2; i2.foo(); } }; }; } template struct N2::Outer2::Inner; template struct N2::Outer2::Inner; // expected-note{{instantiation}}