Skip to content

Commit c5755f4

Browse files
[clang-format] Handle unions like structs and classes
There is no reason why unions should be handled differently, I think they are just forgotten since they are not used that often. No test case added, since that would be complicated to produce. Differential Revision: https://reviews.llvm.org/D135872
1 parent 11b8795 commit c5755f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
31573157
return 160;
31583158
if (Left.is(TT_CastRParen))
31593159
return 100;
3160-
if (Left.isOneOf(tok::kw_class, tok::kw_struct))
3160+
if (Left.isOneOf(tok::kw_class, tok::kw_struct, tok::kw_union))
31613161
return 5000;
31623162
if (Left.is(tok::comment))
31633163
return 1000;

0 commit comments

Comments
 (0)