[LLVMbugs] [Bug 19536] New: clang-format SpaceBeforeParens option behaves oddly with C++ delete

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 23 14:18:34 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19536

            Bug ID: 19536
           Summary: clang-format SpaceBeforeParens option behaves oddly
                    with C++ delete
           Product: new-bugs
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sean at rogue-research.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Basically, clang-format (svn trunk r206916, i.e. yesterday) transforms this:

------------
int main(void)
{
  void* ptr1 = 0;
  void* ptr2 = 0;

  free(ptr1);
  delete(ptr2);
}
------------

into this:

------------
int main(void)
{
  void* ptr1 = 0;
  void* ptr2 = 0;

  free(ptr1);
  delete (ptr2);
}
------------

Note the space added after "delete".

It does this if SpaceBeforeParens is set to either 'Never',
'ControlStatements', or 'Always', i.e. with all 3 possibilities.

The spacing after "free" behaves as you would expect from the SpaceBeforeParens
documentation.

I don't see why C++ delete should be special-cased.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140423/0241d8f5/attachment.html>


More information about the llvm-bugs mailing list