[cfe-commits] r99174 - in /cfe/trunk/lib/Sema: SemaDeclCXX.cpp SemaTemplate.cpp

Rafael Espindola rafael.espindola at gmail.com
Mon Mar 22 07:43:42 PDT 2010


Author: rafael
Date: Mon Mar 22 09:43:41 2010
New Revision: 99174

URL: http://llvm.org/viewvc/llvm-project?rev=99174&view=rev
Log:
When handling a TSK_ExplicitInstantiationDefinition after a
TSK_ExplicitInstantiationDeclaration make sure we call
MaybeMarkVirtualMembersReferenced with a method attached to the definition.

Remove the hack that forced vtable emition with declarations.


Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaTemplate.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=99174&r1=99173&r2=99174&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Mar 22 09:43:41 2010
@@ -5889,7 +5889,7 @@
     break;
 
   case TSK_ExplicitInstantiationDeclaration:
-    return true; //FIXME: This looks wrong.
+    return false;
 
   case TSK_ExplicitInstantiationDefinition:
     // This is method of a explicit instantiation; mark all of the virtual

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=99174&r1=99173&r2=99174&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Mon Mar 22 09:43:41 2010
@@ -4388,8 +4388,12 @@
   // Instantiate the members of this class template specialization.
   Def = cast_or_null<ClassTemplateSpecializationDecl>(
                                        Specialization->getDefinition());
-  if (Def)
+  if (Def) {
+    // Fix a TSK_ExplicitInstantiationDeclaration followed by a
+    // TSK_ExplicitInstantiationDefinition
+    Def->setTemplateSpecializationKind(TSK);
     InstantiateClassTemplateSpecializationMembers(TemplateNameLoc, Def, TSK);
+  }
 
   return DeclPtrTy::make(Specialization);
 }





More information about the cfe-commits mailing list