Commit 631dce0
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 issue 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 e0d173d commit 631dce0
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 | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
| |||
| 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