[Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug
authorJoel E. Denny <jdenny.ornl@gmail.com>
Thu, 15 Aug 2019 21:17:48 +0000 (21:17 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Thu, 15 Aug 2019 21:17:48 +0000 (21:17 +0000)
commit9be6d7edb20b87dfa35d21e981591a9a81959344
treef204ab31e62a6e7a66e8f2493d1c8b7c3c2bf313
parentbe8a2f75657b27ea113517c3279f0489a7f4018c
[Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug

I'd like to add these comments to warn others of problems I
encountered when trying to use `RemoveLineIfEmpty`.  I originally
tried to fix the problem, but I realized I could implement the
functionality more easily and efficiently in my calling code where I
can make the simplifying assumption that there are no prior edits to
the line from which text is being removed.  While I've lost the
motivation to write a fix, which doesn't look easy, I figure a warning
to others is better than silence.

I've added a unit test to demonstrate the problem.  I don't know how
to mark it as an expected failure, so I just marked it disabled.

Reviewed By: jkorous

Differential Revision: https://reviews.llvm.org/D61466

llvm-svn: 369049
clang/include/clang/Rewrite/Core/Rewriter.h
clang/lib/Rewrite/Rewriter.cpp
clang/unittests/Rewrite/RewriteBufferTest.cpp