Issue 60576
Summary Bug: clang-format breaks function calls on user-defined-literals
Labels new issue
Assignees
Reporter Clueliss
    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.
> ```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to