Commit 812c96e
authored
[clang-format] Handle pointer/reference in macro definitions (llvm#107074)
A macro definition needs its own scope stack in the annotator, so we add
the MacroBodyScopes stack and use ScopeStack to refer to it when in the
macro definition body.
Also, we need to have a scope type for a child block because its parent
line is parsed (and thus the scope type for the braces is popped off the
scope stack) before the lines in the child block are.
Fixes llvm#99271.1 parent 8d08166 commit 812c96e
File tree
3 files changed
+36
-11
lines changed- clang
- lib/Format
- unittests/Format
3 files changed
+36
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | 140 | | |
142 | | - | |
| 141 | + | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| |||
400 | 399 | | |
401 | 400 | | |
402 | 401 | | |
403 | | - | |
| 402 | + | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| |||
3649 | 3649 | | |
3650 | 3650 | | |
3651 | 3651 | | |
3652 | | - | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
3653 | 3657 | | |
3654 | 3658 | | |
3655 | | - | |
3656 | | - | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
3657 | 3667 | | |
3658 | 3668 | | |
3659 | 3669 | | |
| |||
3671 | 3681 | | |
3672 | 3682 | | |
3673 | 3683 | | |
3674 | | - | |
| 3684 | + | |
3675 | 3685 | | |
3676 | 3686 | | |
3677 | 3687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
330 | 345 | | |
331 | 346 | | |
332 | 347 | | |
| |||
0 commit comments