<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang-format Incorrectly Removes Space After C Style Cast When Type Is Not a Pointer"
   href="https://bugs.llvm.org/show_bug.cgi?id=48535">48535</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-format Incorrectly Removes Space After C Style Cast When Type Is Not a Pointer
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gavin.d.howard@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24295" name="attach_24295" title="Style file">attachment 24295</a> <a href="attachment.cgi?id=24295&action=edit" title="Style file">[details]</a></span>
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
<a href="https://git.yzena.com/Yzena/Yc/src/branch/master/tests/fs/fs_read.c">https://git.yzena.com/Yzena/Yc/src/branch/master/tests/fs/fs_read.c</a>, 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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>