Bug: clang-format breaks function calls on user-defined-literals #60576
Description
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
#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
#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.
Metadata
Assignees
Type
Projects
Status
Done
Activity