summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-08-24 13:23:37 +0000
committerDaniel Jasper <djasper@google.com>2015-08-24 13:23:37 +0000
commitb86e2727f0540917e1b29afa4377796e7e9ed41b (patch)
tree3010b03ac8a99864a68b07171c1ca98354ebdbb1 /clang/lib/Format
parente5197af4507c3cfe5b3af850597b841d7de404e0 (diff)
downloadbcm5719-llvm-b86e2727f0540917e1b29afa4377796e7e9ed41b.tar.gz
bcm5719-llvm-b86e2727f0540917e1b29afa4377796e7e9ed41b.zip
clang-format: Properly handle braced lists in macros.
Before: #define A \ { a, a } \ , After: #define A {a, a}, llvm-svn: 245837
Diffstat (limited to 'clang/lib/Format')
-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 1bea7a9500e..e628072c639 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -284,6 +284,8 @@ void UnwrappedLineParser::parseLevel(bool HasOpeningBrace) {
case tok::l_brace:
// FIXME: Add parameter whether this can happen - if this happens, we must
// be in a non-declaration context.
+ if (!FormatTok->is(TT_MacroBlockBegin) && tryToParseBracedList())
+ continue;
parseBlock(/*MustBeDeclaration=*/false);
addUnwrappedLine();
break;
OpenPOWER on IntegriCloud