From: Daniel Jasper Date: Thu, 16 May 2013 04:26:02 +0000 (+0000) Subject: Add back accidentally deleted line and add test for it. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a2f8d07bf820b524c7b23f6f625f206cad3bf96;p=clang Add back accidentally deleted line and add test for it. Before: f("a", "b" "c"); After: f("a", "b" "c"); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181980 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 9fd8ac6916..7db75b715b 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -744,6 +744,7 @@ private: State.StartOfStringLiteral = State.Column; } else if (!Current.isOneOf(tok::comment, tok::identifier, tok::hash, tok::string_literal)) { + State.StartOfStringLiteral = 0; } State.Column += Current.FormatTok.TokenLength; diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 58dbffd863..b39280edd8 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -2238,6 +2238,8 @@ TEST_F(FormatTest, AlignsStringLiterals) { verifyFormat("a = a + \"a\"\n" " \"a\"\n" " \"a\";"); + verifyFormat("f(\"a\", \"b\"\n" + " \"c\");"); verifyFormat( "#define LL_FORMAT \"ll\"\n"