<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60576>60576</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Bug: clang-format breaks function calls on user-defined-literals
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Clueliss
</td>
</tr>
</table>
<pre>
Currently clang-format removes spaces after user-defined-literals when calling functions on them.
This makes code not compile anymore.
Clang Format version: `clang-format version 15.0.7 (Fedora 15.0.7-1.fc37)`
Example:
Before Formatting:
> $ cat test.cpp
> ```c++
> #include <chrono>
> using namespace std::chrono_literals;
>
> int main() { auto x = 5s .count() == 5; }
> ```
> $ clang++ test.cpp && echo $?
> 0
After Formatting:
> $ clang-format test.cpp > testfmt.cpp
> $ cat testfmt.cpp
> ```c++
> #include <chrono>
> using namespace std::chrono_literals;
>
> int main() { auto x = 5s.count() == 5; }
> ```
> $ clang++ testfmt.cpp
> ```
> testfmt.cpp:4:24: error: invalid suffix 's.count' on integer constant
> int main() { auto x = 5s.count() == 5; }
> ^
> 1 error generated.
> ```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VN2SqygQfpr2piuWAX8vvEgm4xPs_RZiq-xBSAHOmXn7LTWTmKqcrb3YPRaFQDd0f1_DJ7xXgyGqITtDdonEHEbr6jc9k1beR63tvuq32TkyQX-h1MIMh966SQR0NNkP8uivQpJH0QdyOHtyh456Zag7aBXICe3x50gGpdBamQH72cigrPFoDYaRphghuUBy-mNUHifxgzxK2xEaG1Da6ao0oTBfk3UUb55b_7Zkg82WzQc5r6wBfkLIk6dEbyY8ZnESFwisbKizTtwWDse4l7wAVkGe7M_f-vdPMV01Ab_Nz9RbR7ewQZnhbgH-jsBSlCJgIB9ieb3uLHmyNQnsvLTdHq6M1HNHCPxNjs4aC_z94TD7hTcjJlq5Rh-6JSg_bb5_fvMMfH_qfaRMwEkoA6wEViEUZxRzsPiJwC-YeYylnU34NvPLugz8jFBcXgB44ugb80L4BuyOHYHlwHIkOdrFCXjz2PSC6dN6g_6J2H1VH1H4-zrppz3jLyvy7PL7i_Lva_I_lOTX4B9Lez9-SoGflrKdkJyzbhko8yG06tDPfa8-EVhxT7VY3rMygQZyKK3xQZjwXyP-xQfZjtvjli4OZMiJQF38AnPU1byreCUiqo95kRV5zjMWjXVXFmVVpm3aJ1lXMpFWbcfoSGkr8ywtykjVLGE8YUlxTHh1ZHFBkhJGJeNVn2dpDmlCk1A61vpjiq0bIuX9THWeZEUeadGS9qvgMmboJ65GYGzRX1cvew7tPHhIE6188I9Tggqa6vO8PIznt9A6Ej_8XVlXqV3l9aUcR7PT9RjC1S8XljXAmkGFcW5jaSdgzRLw9jtcnf2LZADWrGl6YM0K4-8AAAD__8n6zRU">