diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-25 21:23:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-25 21:23:52 +0000 |
commit | d048bb79f5c3b3751878aec038bce28a5ce0f439 (patch) | |
tree | de894d4422b2a868d3e8591dfc01e8bf9749b553 | |
parent | d475b8d9e6f5ff0e6ab8d15667ce8a64c7cb9a4d (diff) |
Fix notes regarding the instantiation of member classes (and test 'em).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67708 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 3 | ||||
-rw-r--r-- | test/SemaTemplate/instantiate-member-class.cpp | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 60423f9f47..f6e36bf779 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -683,8 +683,7 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, } Pattern = PatternDef; - InstantiatingTemplate Inst(*this, Instantiation->getLocation(), - Instantiation); + InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation); if (Inst) return true; diff --git a/test/SemaTemplate/instantiate-member-class.cpp b/test/SemaTemplate/instantiate-member-class.cpp index 26fddcfb34..fab65cef2e 100644 --- a/test/SemaTemplate/instantiate-member-class.cpp +++ b/test/SemaTemplate/instantiate-member-class.cpp @@ -6,7 +6,7 @@ public: struct C { T &foo(); }; struct D { - struct E { T &bar(); }; + struct E { T &bar(); }; // expected-error{{cannot form a reference to 'void'}} struct F; // expected-note{{member is declared here}} }; }; @@ -31,3 +31,8 @@ void test_instantiation(X<double>::C *x, f->foo(); // expected-error{{implicit instantiation of undefined member 'struct X<float>::D::F'}} } + + +X<void>::C *c3; // okay +X<void>::D::E *e1; // okay +X<void>::D::E e2; // expected-note{{in instantiation of member class 'struct X<void>::D::E' requested here}} |