[llvm-bugs] [Bug 48535] New: clang-format Incorrectly Removes Space After C Style Cast When Type Is Not a Pointer

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 16 16:06:14 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48535

            Bug ID: 48535
           Summary: clang-format Incorrectly Removes Space After C Style
                    Cast When Type Is Not a Pointer
           Product: new-bugs
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: gavin.d.howard at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24295
  --> https://bugs.llvm.org/attachment.cgi?id=24295&action=edit
Style file

When I set the option "SpaceAfterCStyleCast" to true, clang-format will remove
a space after a C-style cast when the type inside the cast parentheses is not a
pointer time.

You can reproduce this by using the attached style file on
https://git.yzena.com/Yzena/Yc/src/branch/master/tests/fs/fs_read.c, lines 69
and 107.

If I add an asterisk after the size_t inside the parens, the space is left.

I speculate that clang-format incorrectly thinks that both sets of parens are
calls, i.e., that the first set is a call to a function that returns a function
pointer and that the second set is a call to that supposed returned function
pointer.

-- 
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/20201217/fcade783/attachment.html>


More information about the llvm-bugs mailing list