diff options
author | mydeveloperday <mydeveloperday@gmail.com> | 2020-04-13 15:03:36 +0100 |
---|---|---|
committer | paulhoad <paul.hoad@gmail.com> | 2020-04-13 15:03:36 +0100 |
commit | 072ae7c1e64f8dd1b5e9db17838c93b150f8b487 (patch) | |
tree | 54d1760b92badf88028a8347bbc9589bc9ae24c1 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 401cbe373b078ff3325df3b41847713369d2132c (diff) | |
download | llvm-072ae7c1e64f8dd1b5e9db17838c93b150f8b487.zip llvm-072ae7c1e64f8dd1b5e9db17838c93b150f8b487.tar.gz llvm-072ae7c1e64f8dd1b5e9db17838c93b150f8b487.tar.bz2 |
[clang-format] Always break line after enum opening brace
Summary:
clang-format currently puts the first enumerator on the same line as the
enum keyword and opening brace if it fits (for example, for anonymous
enums if IndentWidth is 8):
$ echo "enum { RED, GREEN, BLUE };" | clang-format -style="{BasedOnStyle: llvm, ColumnLimit: 15, IndentWidth: 8}"
enum { RED,
GREEN,
BLUE };
This doesn't seem to be intentional, as I can't find any style guide that
suggests wrapping enums this way. Always force the enumerator to be on a new
line, which gets us the desired result:
$ echo "enum { RED, GREEN, BLUE };" | ./bin/clang-format -style="{BasedOnStyle: llvm, ColumnLimit: 15, IndentWidth: 8}"
enum {
RED,
GREEN,
BLUE
};
Test Plan:
New test added. Confirmed test failed without change and passed with change by
running:
$ ninja FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewed By: MyDeveloperDay
Patch By: osandov
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D77682
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions