<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58035>58035</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang-Format Improperly Formats User-Defined Literal Calls In Expressions (broken by SpaceAfterCStyleCast)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          elvenfighter
      </td>
    </tr>
</table>

<pre>
    Tested on clang-format 13 & 16 (from apt.llvm.org).

Consider the following C++ code:
```
$ cat ops.cpp
unsigned long operator""_a3(unsigned long x) { return operator""_a(x)*3; }
unsigned long operator""_a4(unsigned long x) { return operator""_a(x) * 4; }
unsigned long operator""_a5(unsigned long x) { return operator""_a(x) *5; }
unsigned long operator""_a6(unsigned long x) { return operator""_a(x)* 6; }
```

Running clang-format with `SpaceAfterCStyleCast: false` removes spaces around the `*` operator (after the user-defined literal call and before the other argument). 
```
$ clang-format-16 --style="{SpaceAfterCStyleCast: false}" ops.cpp
unsigned long operator""_a3(unsigned long x) { return operator""_a(x)*3; }
unsigned long operator""_a4(unsigned long x) { return operator""_a(x)*4; }
unsigned long operator""_a5(unsigned long x) { return operator""_a(x)*5; }
unsigned long operator""_a6(unsigned long x) { return operator""_a(x)*6; }
```
Running with `SpaceAfterCStyleCast: false` adds the space after the user-defined literal call but removes before the 2nd argument.
```
$ clang-format-16 --style="{SpaceAfterCStyleCast: true}" ops.cpp
unsigned long operator""_a3(unsigned long x) { return operator""_a(x) *3; }
unsigned long operator""_a4(unsigned long x) { return operator""_a(x) *4; }
unsigned long operator""_a5(unsigned long x) { return operator""_a(x) *5; }
unsigned long operator""_a6(unsigned long x) { return operator""_a(x) *6; }
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdlk1v3CAQhn-NfRntyguL1z74sB-NFKmnpj1X2B573WJjAU6y_74Du0mTtImSptpDJIRtGOYdhgdMqetD8RWtwxr0AJWSQztrtOmlgwWHiKWwSOmRNUb3IEc3V-q6n2vTRiyfR8kuStbHeqsH29VowO0RGq2UvumGFrYR21CBStcY8ZNtlCancvxkS6hIUI92Xo3jsXEid-1AYSlNbvSIRjptIsaofJecQnpscUsBQbTagEE3meGPETTAm0RszSO-Icvda3SW_6pDOVvD8g1K4j1K4g1C6TtSB-kjoafrGOov0zD4lX_E0k3n9kCGV6OscN04NNsrd1C4ldYRFtBIZZH6KYReX6MF6w0tSKOnoQ5MeRnmJe_j81xK7yv0TxbNrMamC_PqqFkqwkopkOShRIoEg6GmypDndupxcJ5jeB7LB5OY0U6YzawPO-I7n5zV5uX5rLzVh8KadM4C9RmZfhHpO5hfza-saxsoCwDDa_AsJ3eP_QNMGVF7B-n8vwPqzHROPuGc5-7HOnbheUZjLBZpuuRCiCyN64LXOc9l7DqnsNgGMi6O5-9lPxrvXx3g2GLhmwdydwLy8wnILQFp4XKAT7ejQWs7-qv7Y7Y0-icOUB7gr0CxPJ6MKvbOjdb_5dkFlZb2zFTOK93Th782nB4zCuUHVjTqorN2QksvIku4iPcFY1UqBcOKZSue56Uom5Wo07JalIuyqtJYyRKVLSJBtwo24A0EFz5lYhd3BUsYS3KWJZnIl2KeZU0uZZPnnPNU8ixaJtjLTt3fYmJThJDKqbXUqTrr7O9OacN6YZAj_3Jye20KVNc4NF27pyTEQb8I8f8C6lXiXQ">