if (Right.is(tok::lessless)) {
if (Left.is(tok::string_literal)) {
StringRef Content = Left.TokenText;
- Content = Content.drop_back(1).drop_front(1).trim();
+ if (Content.startswith("\""))
+ Content = Content.drop_front(1);
+ if (Content.endswith("\""))
+ Content = Content.drop_back(1);
+ Content = Content.trim();
if (Content.size() > 1 &&
(Content.back() == ':' || Content.back() == '='))
return 25;
verifyFormat(
"llvm::errs() << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
" .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();");
+
+ // Incomplete string literal.
+ EXPECT_EQ("llvm::errs() << \"\n"
+ " << a;",
+ format("llvm::errs() << \"\n<<a;"));
}
TEST_F(FormatTest, UnderstandsEquals) {