]> granicus.if.org Git - clang/commitdiff
Fix notes regarding the instantiation of member classes (and test 'em).
authorDouglas Gregor <dgregor@apple.com>
Wed, 25 Mar 2009 21:23:52 +0000 (21:23 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 25 Mar 2009 21:23:52 +0000 (21:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67708 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiate.cpp
test/SemaTemplate/instantiate-member-class.cpp

index 60423f9f472ac94ada67c8b13742b83e5b5479b4..f6e36bf77914718b12957916b73e7ccbba5d85f6 100644 (file)
@@ -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;
 
index 26fddcfb344cf9d5835f6be5e5f0b1c907f8aa96..fab65cef2e4584b107abdca828d17242bb472511 100644 (file)
@@ -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}}