Fix bug in DynTypedMatcher::constructVariadic() that would cause false negatives.
Summary: DynTypedMatcher::constructVariadic() where the restrict kind of the different matchers are not related causes the matcher to have a "None" restrict kind. This causes false negatives for anyOf and eachOf. Change the logic to get a common ancestor if there is one. Also added regression tests that fail without the fix. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5580 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219118 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/AST/ASTTypeTraits.h 14 additions, 0 deletionsinclude/clang/AST/ASTTypeTraits.h
- lib/AST/ASTTypeTraits.cpp 16 additions, 0 deletionslib/AST/ASTTypeTraits.cpp
- lib/ASTMatchers/ASTMatchersInternal.cpp 4 additions, 24 deletionslib/ASTMatchers/ASTMatchersInternal.cpp
- unittests/AST/ASTTypeTraitsTest.cpp 39 additions, 0 deletionsunittests/AST/ASTTypeTraitsTest.cpp
- unittests/ASTMatchers/ASTMatchersTest.cpp 5 additions, 0 deletionsunittests/ASTMatchers/ASTMatchersTest.cpp
- unittests/ASTMatchers/Dynamic/RegistryTest.cpp 1 addition, 1 deletionunittests/ASTMatchers/Dynamic/RegistryTest.cpp
Loading
Please register or sign in to comment