Thanks!
On 2 December 2013 04:19, Daniel Jasper <[email protected]> wrote: > Author: djasper > Date: Mon Dec 2 03:19:27 2013 > New Revision: 196080 > > URL: http://llvm.org/viewvc/llvm-project?rev=196080&view=rev > Log: > clang-format: Fix excessive formatting caused by r195954. > > Due to a bug in the patch, clang-format would more or less simply format > all multi-line comments. > > Modified: > cfe/trunk/lib/Format/Format.cpp > cfe/trunk/unittests/Format/FormatTest.cpp > > Modified: cfe/trunk/lib/Format/Format.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=196080&r1=196079&r2=196080&view=diff > ============================================================================== > --- cfe/trunk/lib/Format/Format.cpp (original) > +++ cfe/trunk/lib/Format/Format.cpp Mon Dec 2 03:19:27 2013 > @@ -1457,6 +1457,7 @@ private: > bool IsContinuedComment = Line->First->is(tok::comment) && > Line->First->Next == NULL && > Line->First->NewlinesBefore < 2 && > PreviousLine && > + PreviousLine->Affected && > PreviousLine->Last->is(tok::comment); > > if (SomeTokenAffected || SomeFirstChildAffected || LineMoved || > > Modified: cfe/trunk/unittests/Format/FormatTest.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=196080&r1=196079&r2=196080&view=diff > ============================================================================== > --- cfe/trunk/unittests/Format/FormatTest.cpp (original) > +++ cfe/trunk/unittests/Format/FormatTest.cpp Mon Dec 2 03:19:27 2013 > @@ -859,6 +859,13 @@ TEST_F(FormatTest, CanFormatCommentsLoca > "\n" > " // This is unrelated", > 0, 0, getLLVMStyle())); > + EXPECT_EQ("int a;\n" > + "// This is\n" > + "// not formatted. ", > + format("int a;\n" > + "// This is\n" > + "// not formatted. ", > + 0, 0, getLLVMStyle())); > } > > TEST_F(FormatTest, RemovesTrailingWhitespaceOfComments) { > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
