aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Format/Format.cpp2
-rw-r--r--unittests/Format/FormatTest.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index aca5d36aef..44a91a96ec 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -692,7 +692,7 @@ private:
State.Stack.pop_back();
}
- if (Current.is(tok::string_literal) && State.StartOfStringLiteral == 0) {
+ if (Current.is(tok::string_literal)) {
State.StartOfStringLiteral = State.Column;
} else if (Current.isNot(tok::comment)) {
State.StartOfStringLiteral = 0;
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index ab4825b314..ca522084d5 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1452,6 +1452,9 @@ TEST_F(FormatTest, AlignsStringLiterals) {
"\"aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaa "
"aaaaaaaaaaaaaaaaaaaaa\" "
"\"aaaaaaaaaaaaaaaa\";"));
+ verifyFormat("a = a + \"a\"\n"
+ " \"a\"\n"
+ " \"a\";");
}
TEST_F(FormatTest, AlignsPipes) {