Commit fdaba64
committed
[ASTMatchers] Fix matching
The `->` operator does not have a corresponding `UnaryOperatorKind`,
and so was unsupported by the `hasOperatorName` and `hasUnaryOperand`
matchers.
Instead of trying to determine the equivalent unary or binary operator
and then deriving the opcode string, we consult `OperatorKinds.def`
directly (through `getOperatorSpelling`).
For `hasUnaryOperand` support, we special case the arrow operator
specifically.CXXOperatorCallExpr of ->
1 parent 741fef3 commit fdaba64
File tree
2 files changed
+28
-21
lines changed- clang
- include/clang/ASTMatchers
- unittests/ASTMatchers
2 files changed
+28
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2161 | 2161 | | |
2162 | 2162 | | |
2163 | 2163 | | |
2164 | | - | |
| 2164 | + | |
| 2165 | + | |
2165 | 2166 | | |
| 2167 | + | |
2166 | 2168 | | |
2167 | 2169 | | |
2168 | 2170 | | |
| |||
2223 | 2225 | | |
2224 | 2226 | | |
2225 | 2227 | | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
2234 | 2231 | | |
2235 | 2232 | | |
2236 | 2233 | | |
| |||
2271 | 2268 | | |
2272 | 2269 | | |
2273 | 2270 | | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
2281 | | - | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
2282 | 2274 | | |
2283 | 2275 | | |
2284 | 2276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2025 | 2025 | | |
2026 | 2026 | | |
2027 | 2027 | | |
2028 | | - | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
2029 | 2032 | | |
2030 | 2033 | | |
2031 | 2034 | | |
2032 | | - | |
| 2035 | + | |
2033 | 2036 | | |
2034 | | - | |
2035 | | - | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
2036 | 2046 | | |
2037 | 2047 | | |
2038 | 2048 | | |
2039 | 2049 | | |
2040 | 2050 | | |
2041 | 2051 | | |
2042 | 2052 | | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
2043 | 2058 | | |
2044 | 2059 | | |
2045 | 2060 | | |
| |||
0 commit comments