aboutsummaryrefslogtreecommitdiff
path: root/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
commit94fb72932c806c549f5c51f4bfa99fa7b481324a (patch)
tree4358c7fc2b93a8dd9044a45fee7c6dd24bbe50fb /lib/Format/UnwrappedLineParser.cpp
parent5dfe9b47a5d52b97ba6452d40edb7ea0e04c4435 (diff)
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; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--lib/Format/UnwrappedLineParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index 89ab0ed169..1f71b5b7da 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/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;