Commit 7b4e71b
[clang-format] Don't annotate left brace of class as FunctionLBrace
The l_brace of class/struct/union was incorrectly annotated as
TT_FunctionLBrace in the presence of attributes. This in turn
would cause the RemoveSemicolon option to remove the semicolon
at the end of the declaration, resulting in invalid code being
generated.
Fixes llvm#61188.
Differential Revision: https://reviews.llvm.org/D145344
(cherry picked from commit a02c3af)1 parent a146bdc commit 7b4e71b
File tree
3 files changed
+12
-8
lines changed- clang
- lib/Format
- unittests/Format
3 files changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3849 | 3849 | | |
3850 | 3850 | | |
3851 | 3851 | | |
| 3852 | + | |
3852 | 3853 | | |
3853 | 3854 | | |
3854 | 3855 | | |
3855 | | - | |
3856 | 3856 | | |
3857 | 3857 | | |
3858 | | - | |
| 3858 | + | |
3859 | 3859 | | |
3860 | 3860 | | |
3861 | 3861 | | |
| |||
3873 | 3873 | | |
3874 | 3874 | | |
3875 | 3875 | | |
3876 | | - | |
| 3876 | + | |
3877 | 3877 | | |
3878 | 3878 | | |
3879 | 3879 | | |
3880 | | - | |
3881 | | - | |
3882 | | - | |
3883 | | - | |
3884 | | - | |
3885 | 3880 | | |
3886 | 3881 | | |
3887 | 3882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25207 | 25207 | | |
25208 | 25208 | | |
25209 | 25209 | | |
| 25210 | + | |
| 25211 | + | |
| 25212 | + | |
| 25213 | + | |
| 25214 | + | |
25210 | 25215 | | |
25211 | 25216 | | |
25212 | 25217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
281 | 285 | | |
282 | 286 | | |
283 | 287 | | |
| |||
0 commit comments