Index: clang/lib/Format/BreakableToken.cpp =================================================================== --- clang/lib/Format/BreakableToken.cpp +++ clang/lib/Format/BreakableToken.cpp @@ -380,6 +380,8 @@ break; if (!Content[i].empty() && i + 1 != e && Decoration.startswith(Content[i])) continue; + if (Content[i].startswith("*\t")) + continue; while (!Content[i].startswith(Decoration)) Decoration = Decoration.substr(0, Decoration.size() - 1); } Index: clang/unittests/Format/FormatTest.cpp =================================================================== --- clang/unittests/Format/FormatTest.cpp +++ clang/unittests/Format/FormatTest.cpp @@ -11137,6 +11137,16 @@ FormatStyle Style = getLLVMStyle(); Style.ColumnLimit = 20; + // See PR41213 + EXPECT_EQ("/*\n" + " * 456789012345678\n" + " * /x\n" + " */", + format("/*\n" + " *\t456789012345678 /x\n" + " */", + Style)); + verifyFormat("int a; // the\n" " // comment", Style); EXPECT_EQ("int a; /* first line\n"