Index: clang/lib/Format/TokenAnnotator.cpp =================================================================== --- clang/lib/Format/TokenAnnotator.cpp +++ clang/lib/Format/TokenAnnotator.cpp @@ -3479,10 +3479,6 @@ return true; if (Right.Previous->IsUnterminatedLiteral) return true; - if (Right.is(tok::lessless) && Right.Next && - Right.Previous->is(tok::string_literal) && - Right.Next->is(tok::string_literal)) - return true; if (Right.Previous->ClosesTemplateDeclaration && Right.Previous->MatchingParen && Right.Previous->MatchingParen->NestingLevel == 0 && Index: clang/lib/Format/UnwrappedLineParser.cpp =================================================================== --- clang/lib/Format/UnwrappedLineParser.cpp +++ clang/lib/Format/UnwrappedLineParser.cpp @@ -2741,8 +2741,7 @@ for (std::list::const_iterator I = Line.Tokens.begin(), E = Line.Tokens.end(); I != E; ++I) { - llvm::dbgs() << I->Tok->Tok.getName() << "[" - << "T=" << I->Tok->getType() + llvm::dbgs() << I->Tok->Tok.getName() << "[" << "T=" << I->Tok->getType() << ", OC=" << I->Tok->OriginalColumn << "] "; } for (std::list::const_iterator I = Line.Tokens.begin(), Index: clang/unittests/Format/FormatTest.cpp =================================================================== --- clang/unittests/Format/FormatTest.cpp +++ clang/unittests/Format/FormatTest.cpp @@ -15597,6 +15597,13 @@ "aaaallvm::outs()\n <<"); } +TEST_F(FormatTest, TreatLessLessStringNormally) { + verifyFormat("os << \"from\" << \"asdf\";"); + verifyFormat("os << \"from\" << 1;"); + verifyFormat("os << \"from\" << 1 << \"foo\";"); + verifyFormat("os << \"from\" << 1 << \"foo\" << \"bar\";"); +} + TEST_F(FormatTest, HandleUnbalancedImplicitBracesAcrossPPBranches) { std::string code = "#if A\n" "#if B\n"