From b86e2727f0540917e1b29afa4377796e7e9ed41b Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 24 Aug 2015 13:23:37 +0000 Subject: clang-format: Properly handle braced lists in macros. Before: #define A \ { a, a } \ , After: #define A {a, a}, llvm-svn: 245837 --- clang/lib/Format/UnwrappedLineParser.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Format') 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; -- cgit v1.2.3