[LLVMbugs] [Bug 14774] New: clang-format deletes input file

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 1 16:08:21 PST 2013


             Bug #: 14774
           Summary: clang-format deletes input file
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


1. Have this program:

Nicos-MacBook-Pro:~ thakis$ cat foo.cc 
namespace {

class Foo {


}  // comment
Nicos-MacBook-Pro:~ thakis$ 

(Note the work-in-progress constructor. The trailing comment is necessary for
the repro.)

2. Put the cursor somewhere inside of Foo's class body, for example at the
start of the constructor

3. Hit the vim keyboard shortcut that calls clang-format (currently ctrl-i /

Expected: Not sure, probably nothing should happen if clang-format gets
Actual: The whole buffer disappears. (This happened in a fairly large file to
me, and while hitting 'u' is easy, this made me lose my current buffer position
and confused me quite a bit.)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list