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.
Details
Diff Detail
Event Timeline
Overall, I think Anything and Nothing are not intuitive names for me here... Perhaps more docs will make it clear what they should be called.
| include/clang/AST/ASTTypeTraits.h | ||
|---|---|---|
| 87–91 | a) why return anything()? (document the decisions, seems kinda arbitrary) | |
| 98–99 | Can you document what Nothing and Anything is in NodeKind land, and document that? | |
| lib/AST/ASTTypeTraits.cpp | ||
| 23–32 | I just realize this all might need some documentation. | |
| unittests/ASTMatchers/Dynamic/RegistryTest.cpp | ||
| 350 | Is this test change related? | |
Reverted a lot of the change.
Please review against the base.
| include/clang/AST/ASTTypeTraits.h | ||
|---|---|---|
| 87–91 | Removed the concept of 'anything'. was not necessary and the name was not correct. | |
| 98–99 | Reverted this. | |
| lib/AST/ASTTypeTraits.cpp | ||
| 23–32 | Reverted this. | |
| unittests/ASTMatchers/Dynamic/RegistryTest.cpp | ||
| 350 | Yes. The change triggered the bug. | |
a) why return anything()? (document the decisions, seems kinda arbitrary)
b) typo: Ancestor