diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-18 21:02:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-18 21:02:14 +0000 |
commit | c42c219d5794b9b747ffeb147ba7a0b1f2ebe0ed (patch) | |
tree | 83b2281c33f8e87eadf52382326108946d51a592 /clang | |
parent | acbe42baddd720bf9467c40dcd6ec1412b8fb2fe (diff) | |
download | bcm5719-llvm-c42c219d5794b9b747ffeb147ba7a0b1f2ebe0ed.tar.gz bcm5719-llvm-c42c219d5794b9b747ffeb147ba7a0b1f2ebe0ed.zip |
Simplify and add FIXME. No functionality change.
llvm-svn: 204181
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/AST/DeclTemplate.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index 8e017e61271..d55582a1610 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/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<CXXRecordDecl *>( this)->getMostRecentDecl(); @@ -1520,17 +1525,11 @@ public: llvm::PointerUnion<ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl *> getInstantiatedFrom() const { - if (getSpecializationKind() != TSK_ImplicitInstantiation && - getSpecializationKind() != TSK_ExplicitInstantiationDefinition && - getSpecializationKind() != TSK_ExplicitInstantiationDeclaration) + if (!isTemplateInstantiation(getSpecializationKind())) return llvm::PointerUnion<ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl *>(); - if (SpecializedPartialSpecialization *PartialSpec - = SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>()) - return PartialSpec->PartialSpecialization; - - return SpecializedTemplate.get<ClassTemplateDecl*>(); + return getSpecializedTemplateOrPartial(); } /// \brief Retrieve the class template or class template partial |