diff options
author | Daniel Jasper <djasper@google.com> | 2012-09-18 14:17:42 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-09-18 14:17:42 +0000 |
commit | 08f0c53175bba899e7af6c6cc2cab25caf64ef2a (patch) | |
tree | 6a81f1409a78623de41bf74996e47290708d9a44 /lib/ASTMatchers | |
parent | e6d2a96cc9689be584c3bfc09ac527a03a25b3bc (diff) |
Fix isDerivedFrom matcher.
Without this patch, the isDerivedFrom matcher asserts in the
"assert(ClassDecl != NULL);" in the new test, as a
DependentTemplateSpecilizationType is not a sub-type of
TemplateSpecializationType and also does not offer getAsCXXRecordDecl().
I am not sure why this did not cause problems before. It is now (after
the changed implementation of isDerivedFrom) easier to write a matcher
that actually gets into this branch of the code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ASTMatchers')
-rw-r--r-- | lib/ASTMatchers/ASTMatchFinder.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ASTMatchers/ASTMatchFinder.cpp b/lib/ASTMatchers/ASTMatchFinder.cpp index cba2e50337..80ea16aa52 100644 --- a/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/lib/ASTMatchers/ASTMatchFinder.cpp @@ -487,6 +487,7 @@ bool MatchASTVisitor::classIsDerivedFrom(const CXXRecordDecl *Declaration, // Type::getAs<...>() drills through typedefs. if (TypeNode->getAs<DependentNameType>() != NULL || + TypeNode->getAs<DependentTemplateSpecializationType>() != NULL || TypeNode->getAs<TemplateTypeParmType>() != NULL) // Dependent names and template TypeNode parameters will be matched when // the template is instantiated. |