summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
-rw-r--r--clang/unittests/Format/FormatTest.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index c6ffd8a9778..e52650be07f 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1400,7 +1400,8 @@ static bool isFunctionDeclarationName(const FormatToken &Current) {
if (Tok->is(tok::kw_const) || Tok->isSimpleTypeSpecifier() ||
Tok->isOneOf(TT_PointerOrReference, TT_StartOfName))
return true;
- if (Tok->isOneOf(tok::l_brace, tok::string_literal) || Tok->Tok.isLiteral())
+ if (Tok->isOneOf(tok::l_brace, tok::string_literal, TT_ObjCMethodExpr) ||
+ Tok->Tok.isLiteral())
return false;
}
return false;
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 0f2545105ee..6e2b9505238 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5698,6 +5698,8 @@ TEST_F(FormatTest, BreaksLongVariableDeclarations) {
" LoooooooooooooooooooooooooooooooooooooooongVariable(a);");
verifyFormat("LoooooooooooooooooooooooooooooooooooooooongType\n"
" LoooooooooooooooooooooooooooooooooooooooongVariable({});");
+ verifyFormat("LoooooooooooooooooooooooooooooooooooooooongType\n"
+ " LoooooooooooooooooooooooooooooooooooooongVariable([A a]);");
}
TEST_F(FormatTest, BreaksLongDeclarations) {
OpenPOWER on IntegriCloud