summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Type.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 8f22a1b197a..1d064b135e3 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -3023,8 +3023,10 @@ static TagDecl *getInterestingTagDecl(TagDecl *decl) {
if (I->isCompleteDefinition() || I->isBeingDefined())
return I;
}
- // If there's no definition (not even in progress), return what we have.
- return decl;
+ // If there's no definition (not even in progress), return the most recent
+ // declaration. This is important for template specializations, in order to
+ // pick the declaration with the most complete TemplateSpecializationKind.
+ return decl->getMostRecentDecl();
}
TagDecl *TagType::getDecl() const {
OpenPOWER on IntegriCloud