[cfe-commits] r67708 - in /cfe/trunk: lib/Sema/SemaTemplateInstantiate.cpp test/SemaTemplate/instantiate-member-class.cpp

Douglas Gregor dgregor at apple.com
Wed Mar 25 14:23:52 PDT 2009


Author: dgregor
Date: Wed Mar 25 16:23:52 2009
New Revision: 67708

URL: http://llvm.org/viewvc/llvm-project?rev=67708&view=rev
Log:
Fix notes regarding the instantiation of member classes (and test 'em).

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
    cfe/trunk/test/SemaTemplate/instantiate-member-class.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=67708&r1=67707&r2=67708&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Wed Mar 25 16:23:52 2009
@@ -683,8 +683,7 @@
   }
   Pattern = PatternDef;
 
-  InstantiatingTemplate Inst(*this, Instantiation->getLocation(),
-                             Instantiation);
+  InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation);
   if (Inst)
     return true;
 

Modified: cfe/trunk/test/SemaTemplate/instantiate-member-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-member-class.cpp?rev=67708&r1=67707&r2=67708&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-member-class.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-member-class.cpp Wed Mar 25 16:23:52 2009
@@ -6,7 +6,7 @@
   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 @@
   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}}





More information about the cfe-commits mailing list