From 565ed5ed08fda3af5d26d6f0a47f4bb36d3e8b57 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 22 May 2014 13:53:55 +0000 Subject: clang-format: Don't use Allman brace breaking for ObjC blocks. It just seems wrong. This fixes llvm.org/PR19736. llvm-svn: 209440 --- clang/lib/Format/TokenAnnotator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format') diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index ce847d6427e..f057ef7f3e7 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1595,7 +1595,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, Style.BreakConstructorInitializersBeforeComma && !Style.ConstructorInitializerAllOnOneLineOrOnePerLine) { return true; - } else if (Right.is(tok::l_brace) && (Right.BlockKind == BK_Block)) { + } else if (Right.is(tok::l_brace) && Right.BlockKind == BK_Block && + Right.Type != TT_ObjCBlockLBrace) { return Style.BreakBeforeBraces == FormatStyle::BS_Allman || Style.BreakBeforeBraces == FormatStyle::BS_GNU; } else if (Right.is(tok::string_literal) && -- cgit v1.2.3