LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 16517 - More compact formatting for enums with one enumerant.
Summary: More compact formatting for enums with one enumerant.
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Formatter (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-01 18:51 PDT by Sean Silva
Modified: 2016-08-18 12:50 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Silva 2013-07-01 18:51:23 PDT
One recurring diff chunk that seems to come up is one like:

-  enum { NumInlineContentCommentBits = NumCommentBits + 1 };
+  enum {
+    NumInlineContentCommentBits = NumCommentBits + 1
+  };

It would be nice if clang-format formatted the enum on one line (or had an option to do so).
Comment 1 Anatoly Borodin 2016-08-18 12:45:27 PDT
Now, how to make it other way around (to list every item on a separate line)?
Comment 2 Anatoly Borodin 2016-08-18 12:50:27 PDT
BraceWrapping:
    AfterEnum:       true

also puts { on the next line, so not quite the solution...