diff options
| author | Daniel Jasper <djasper@google.com> | 2014-08-05 12:06:20 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-08-05 12:06:20 +0000 |
| commit | d9670878d46372e402f67372361cd408f98c54ef (patch) | |
| tree | d1fd766c66eea68fd183965da6f44ead63f0ea5f /clang/unittests/Format/FormatTest.cpp | |
| parent | 202f3c5346ffe0aa64ec3c9f87da56f1b85d806b (diff) | |
| download | bcm5719-llvm-d9670878d46372e402f67372361cd408f98c54ef.tar.gz bcm5719-llvm-d9670878d46372e402f67372361cd408f98c54ef.zip | |
clang-format: Break before 'else' in Stroustrup style.
Seems to be the desired thing to do according to:
http://www.stroustrup.com/Programming/PPP-style-rev3.pdf
Patch by Jarkko Hietaniemi, thank you!
llvm-svn: 214857
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 8089b3e36ec..e0841caa4c7 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -7677,6 +7677,17 @@ TEST_F(FormatTest, StroustrupBraceBreaking) { "}", BreakBeforeBrace); + verifyFormat("void foo()\n" + "{\n" + " if (a) {\n" + " a();\n" + " }\n" + " else {\n" + " b();\n" + " }\n" + "}\n", + BreakBeforeBrace); + verifyFormat("#ifdef _DEBUG\n" "int foo(int i = 0)\n" "#else\n" |

