summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-declref.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-27 23:11:45 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-27 23:11:45 +0000
commite44a2adf41f2cde4f8d10b7a13dd2b85fe6c7104 (patch)
treea847169f43e3e599af71199fe24120c45ad78673 /clang/test/SemaTemplate/instantiate-declref.cpp
parentb5f33c1634394b3e66ce0a2e945475016d4c5716 (diff)
downloadbcm5719-llvm-e44a2adf41f2cde4f8d10b7a13dd2b85fe6c7104.tar.gz
bcm5719-llvm-e44a2adf41f2cde4f8d10b7a13dd2b85fe6c7104.zip
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
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-declref.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-declref.cpp21
1 files changed, 21 insertions, 0 deletions
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<INT>::VeryInner;
template struct N::Outer::Inner::InnerTemplate<INT>::UeberInner; // expected-error{{'UeberInner' does not name a tag member}}
+
+namespace N2 {
+ struct Outer2 {
+ template<typename T>
+ struct Inner {
+ void foo() {
+ enum { K1Val = sizeof(T) } k1;
+ enum K2 { K2Val = sizeof(T)*2 };
+
+ K2 k2 = K2Val;
+
+ Inner i1;
+ i1.foo();
+ Inner<T> i2;
+ i2.foo();
+ }
+ };
+ };
+}
+
+// FIXME: template struct N2::Outer2::Inner<float>;
OpenPOWER on IntegriCloud