summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-18 05:50:57 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-18 05:50:57 +0000
commita5510af53e9e18ae106a222f84fde38b524989bf (patch)
tree18979fce280146e8829e3ad7c5ff80848b8039eb /clang/lib/Format/UnwrappedLineParser.cpp
parent45d9f4b569d388a66bbc7f99fdc4778195a7f89b (diff)
downloadbcm5719-llvm-a5510af53e9e18ae106a222f84fde38b524989bf.tar.gz
bcm5719-llvm-a5510af53e9e18ae106a222f84fde38b524989bf.zip
Formatter: After case blocks, "break" goes on the same line as the "}", PR14907.
Before: switch (foo) { case a: { int a = g(); h(a); } break; } Now: switch (foo) { case a: { int a = g(); h(a); } break; } llvm-svn: 172789
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 89ab0ed169d..1f71b5b7dac 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -487,6 +487,8 @@ void UnwrappedLineParser::parseLabel() {
--Line->Level;
if (FormatTok.Tok.is(tok::l_brace)) {
parseBlock();
+ if (FormatTok.Tok.is(tok::kw_break))
+ parseStructuralElement(); // "break;" after "}" goes on the same line.
}
addUnwrappedLine();
Line->Level = OldLineLevel;
OpenPOWER on IntegriCloud