From e44a2adf41f2cde4f8d10b7a13dd2b85fe6c7104 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 27 May 2009 23:11:45 +0000 Subject: Reimplement much of the way that we track nested classes in the parser. Rather than placing all of the delayed member function declarations and inline definitions into a single bucket corresponding to the top-level class, we instead mirror the nesting structure of the nested classes and place the delayed member functions into their appropriate place. Then, when we actually parse the delayed member function declarations, set up the scope stack the same way as it was when we originally saw the declaration, so that we can find, e.g., template parameters that are in scope. llvm-svn: 72502 --- clang/test/SemaTemplate/instantiate-declref.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'clang/test/SemaTemplate/instantiate-declref.cpp') diff --git a/clang/test/SemaTemplate/instantiate-declref.cpp b/clang/test/SemaTemplate/instantiate-declref.cpp index 0e1e562056e..1a5f2166399 100644 --- a/clang/test/SemaTemplate/instantiate-declref.cpp +++ b/clang/test/SemaTemplate/instantiate-declref.cpp @@ -38,3 +38,24 @@ namespace N { 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 }; + + K2 k2 = K2Val; + + Inner i1; + i1.foo(); + Inner i2; + i2.foo(); + } + }; + }; +} + +// FIXME: template struct N2::Outer2::Inner; -- cgit v1.2.3