From: Daniel Jasper Date: Thu, 16 Apr 2015 07:02:19 +0000 (+0000) Subject: clang-format: Undo r214508. It was essentially always removing the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10644e20afc3f237f0e22bfbc3e5b0bb09d68e19;p=clang clang-format: Undo r214508. It was essentially always removing the space where we already had the flag ObjCSpaceBeforeProtocolList to control it. I don't know what I was thinking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235076 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index ff674e9e81..5b148eab6b 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -1664,7 +1664,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, if (Right.isOneOf(tok::semi, tok::comma)) return false; if (Right.is(tok::less) && - (Left.isOneOf(tok::kw_template, tok::r_paren) || + (Left.is(tok::kw_template) || (Line.Type == LT_ObjCDecl && Style.ObjCSpaceBeforeProtocolList))) return true; if (Left.isOneOf(tok::exclaim, tok::tilde)) diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index e38759910a..9791e2a5fb 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -6751,7 +6751,7 @@ TEST_F(FormatTest, FormatObjCInterface) { "+ (id)init;\n" "@end"); - verifyGoogleFormat("@interface Foo (HackStuff) \n" + verifyGoogleFormat("@interface Foo (HackStuff)\n" "+ (id)init;\n" "@end"); @@ -6793,7 +6793,7 @@ TEST_F(FormatTest, FormatObjCInterface) { FormatStyle OnePerLine = getGoogleStyle(); OnePerLine.BinPackParameters = false; - verifyFormat("@interface aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa () <\n" + verifyFormat("@interface aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ()<\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n"