Commit ef604d0
committed
[clang-format] Make some binary operations imply requires clause
This patch adjusts the requires clause/expression lookahead heuristic to
assume that some binary operation mean that the requires keyword refers
to a clause.
This partially reverts the removed case clauses from
9b68c09, with an additional check that
we're not in a type parameter.
This is quite a band-aid fix, it may be worth it to rewrite that whole
heuristic to track more state in the future, instead of just blindly
marching forward across multiple unrelated definitions, since right now,
the definition following the one with the requires clause can influence
whether the heuristic chooses clause or expression.
Fixes #1104851 parent 6c7a3f8 commit ef604d0
File tree
2 files changed
+26
-0
lines changed- clang
- lib/Format
- unittests/Format
2 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3528 | 3528 | | |
3529 | 3529 | | |
3530 | 3530 | | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
3531 | 3542 | | |
3532 | 3543 | | |
3533 | 3544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1299 | 1314 | | |
1300 | 1315 | | |
1301 | 1316 | | |
| |||
0 commit comments