Commit 462fc6f
committed
[clang][ASTMatcher] Fix execution order of hasOperands submatchers
The `hasOperands` matcher does not always execute matchers in the order they are
written. This can cause issues in code using bindings when one operand matcher
is relying on a binding set by the other. With this change, the first matcher
present in the code is always executed first and any binding it sets are
available to the second matcher.1 parent 13a6a79 commit 462fc6f
File tree
3 files changed
+16
-1
lines changed- clang
- docs
- include/clang/ASTMatchers
- unittests/ASTMatchers
3 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6027 | 6027 | | |
6028 | 6028 | | |
6029 | 6029 | | |
6030 | | - | |
| 6030 | + | |
6031 | 6031 | | |
6032 | 6032 | | |
6033 | 6033 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1745 | 1745 | | |
1746 | 1746 | | |
1747 | 1747 | | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
1748 | 1760 | | |
1749 | 1761 | | |
1750 | 1762 | | |
| |||
0 commit comments