summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Format/Format.cpp2
-rw-r--r--clang/unittests/Format/FormatTest.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 64a6224b0b9..727e85fa4f9 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1149,6 +1149,8 @@ private:
(Tok.is(tok::equal) || Tok.Parent->is(tok::equal)))
return false;
+ if (Tok.Parent->is(tok::comma))
+ return true;
if (Tok.Type == TT_IncludePath)
return Tok.is(tok::less) || Tok.is(tok::string_literal);
if (Tok.Type == TT_CtorInitializerColon || Tok.Type == TT_ObjCBlockLParen)
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 984732571e0..a46c9b685bc 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -121,6 +121,7 @@ TEST_F(FormatTest, FormatsNestedBlockStatements) {
TEST_F(FormatTest, FormatsNestedCall) {
verifyFormat("Method(f1, f2(f3));");
verifyFormat("Method(f1(f2, f3()));");
+ verifyFormat("Method(f1(f2, (f3())));");
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud