diff options
author | Daniel Jasper <djasper@google.com> | 2017-05-08 15:08:00 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2017-05-08 15:08:00 +0000 |
commit | 7fdbb3feda32fa3af4202c01ff49a3a7f050b1a2 (patch) | |
tree | 9cac9fe1effb95b8cdf7972a10618e960107f462 /clang/unittests/Format/FormatTestSelective.cpp | |
parent | 988e7e4fe8b0276ae59ba1a8022f2bca3372b2f2 (diff) | |
download | bcm5719-llvm-7fdbb3feda32fa3af4202c01ff49a3a7f050b1a2.tar.gz bcm5719-llvm-7fdbb3feda32fa3af4202c01ff49a3a7f050b1a2.zip |
[clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding
DontAlign
This converts the clang-format option AlignEscapedNewlinesLeft from a
boolean to an enum, named AlignEscapedNewlines, with options Left (prev.
true), Right (prev. false), and a new option DontAlign.
When set to DontAlign, the backslashes are placed just after the last token in each line:
#define EXAMPLE \
do { \
int x = aaaaa; \
int b; \
int dddddddddd; \
} while (0)
Patch by jtbandes. Thank you!
llvm-svn: 302428
Diffstat (limited to 'clang/unittests/Format/FormatTestSelective.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestSelective.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTestSelective.cpp b/clang/unittests/Format/FormatTestSelective.cpp index 8046d7fab2d..9ee87b34c21 100644 --- a/clang/unittests/Format/FormatTestSelective.cpp +++ b/clang/unittests/Format/FormatTestSelective.cpp @@ -325,7 +325,7 @@ TEST_F(FormatTestSelective, WrongIndent) { } TEST_F(FormatTestSelective, AlwaysFormatsEntireMacroDefinitions) { - Style.AlignEscapedNewlinesLeft = true; + Style.AlignEscapedNewlines = FormatStyle::ENAS_Left; EXPECT_EQ("int i;\n" "#define A \\\n" " int i; \\\n" @@ -467,7 +467,7 @@ TEST_F(FormatTestSelective, ReformatRegionAdjustsIndent) { TEST_F(FormatTestSelective, UnderstandsTabs) { Style.IndentWidth = 8; Style.UseTab = FormatStyle::UT_Always; - Style.AlignEscapedNewlinesLeft = true; + Style.AlignEscapedNewlines = FormatStyle::ENAS_Left; EXPECT_EQ("void f() {\n" "\tf();\n" "\tg();\n" |