]> granicus.if.org Git - clang/commit
Fix bug in DynTypedMatcher::constructVariadic() that would cause false negatives.
authorSamuel Benzaquen <sbenza@google.com>
Mon, 6 Oct 2014 13:14:30 +0000 (13:14 +0000)
committerSamuel Benzaquen <sbenza@google.com>
Mon, 6 Oct 2014 13:14:30 +0000 (13:14 +0000)
commitea9c99d214345b0c6f97f7293708b78b7744eaf3
tree840c5709d59856e4b3b4f1d2d5c743a1239355b9
parenteca23c650c05e215fe5e289cc98be029eded3a91
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
include/clang/AST/ASTTypeTraits.h
lib/AST/ASTTypeTraits.cpp
lib/ASTMatchers/ASTMatchersInternal.cpp
unittests/AST/ASTTypeTraitsTest.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
unittests/ASTMatchers/Dynamic/RegistryTest.cpp