diff options
| author | Daniel Jasper <djasper@google.com> | 2016-04-06 16:41:39 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2016-04-06 16:41:39 +0000 |
| commit | 2cce7b728b88d846713f8f1e69f9cc58623024c2 (patch) | |
| tree | 66cd63894e9abb4a43ed1438fed0c00349ef54ca /clang/lib/Format | |
| parent | 3768f7005d442fb7ff40e1324d2ca9630d255f35 (diff) | |
| download | bcm5719-llvm-2cce7b728b88d846713f8f1e69f9cc58623024c2.tar.gz bcm5719-llvm-2cce7b728b88d846713f8f1e69f9cc58623024c2.zip | |
clang-format: Fix label-in-if statement in macros where it is actually used.
Before:
#define A \
if (a) \
label: \
f()
After:
#define A \
if (a) \
label: \
f()
llvm-svn: 265557
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 29635bf706e..e36d7efffd2 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -1573,8 +1573,10 @@ void UnwrappedLineParser::parseLabel() { addUnwrappedLine(); } Line->Level = OldLineLevel; - if (FormatTok->isNot(tok::l_brace)) + if (FormatTok->isNot(tok::l_brace)) { parseStructuralElement(); + addUnwrappedLine(); + } } void UnwrappedLineParser::parseCaseLabel() { |

