]> granicus.if.org Git - clang/commitdiff
Add back accidentally deleted line and add test for it.
authorDaniel Jasper <djasper@google.com>
Thu, 16 May 2013 04:26:02 +0000 (04:26 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 16 May 2013 04:26:02 +0000 (04:26 +0000)
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

lib/Format/Format.cpp
unittests/Format/FormatTest.cpp

index 9fd8ac6916f015a0ae8eae52c6e8ec3b5769a31e..7db75b715b8a80825f052551bac215c493af150a 100644 (file)
@@ -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;
index 58dbffd863e06d9e12001658b97e4cc1580550a9..b39280edd810ea6ea93ad59c939962aecfe9703d 100644 (file)
@@ -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"