From: Richard Smith Date: Tue, 18 Mar 2014 21:02:14 +0000 (+0000) Subject: Simplify and add FIXME. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=771ed34680836f96111061f631c7c95714ba41dc;p=clang Simplify and add FIXME. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204181 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 8e017e6127..d55582a161 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -1452,6 +1452,11 @@ public: void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const override; + // FIXME: This is broken. CXXRecordDecl::getMostRecentDecl() returns a + // different "most recent" declaration from this function for the same + // declaration, because we don't override getMostRecentDeclImpl(). But + // it's not clear that we should override that, because the most recent + // declaration as a CXXRecordDecl sometimes is the injected-class-name. ClassTemplateSpecializationDecl *getMostRecentDecl() { CXXRecordDecl *Recent = static_cast( this)->getMostRecentDecl(); @@ -1520,17 +1525,11 @@ public: llvm::PointerUnion getInstantiatedFrom() const { - if (getSpecializationKind() != TSK_ImplicitInstantiation && - getSpecializationKind() != TSK_ExplicitInstantiationDefinition && - getSpecializationKind() != TSK_ExplicitInstantiationDeclaration) + if (!isTemplateInstantiation(getSpecializationKind())) return llvm::PointerUnion(); - if (SpecializedPartialSpecialization *PartialSpec - = SpecializedTemplate.dyn_cast()) - return PartialSpec->PartialSpecialization; - - return SpecializedTemplate.get(); + return getSpecializedTemplateOrPartial(); } /// \brief Retrieve the class template or class template partial