-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Labels
clang-formatinvalid-code-generationTool (e.g. clang-format) produced invalid code that no longer compilesTool (e.g. clang-format) produced invalid code that no longer compiles
Description
clang-format breaks content of raw string literals containing JSON.
C:\bug>clang-format --version
clang-format version 18.0.0 (https://github.com/llvm/llvm-project.git c8544d280a8ef1e41efc5c036e00dc671edbb93d)
C:\bug>type .clang-format
BasedOnStyle: LLVM
RawStringFormats:
- Language: Json
Delimiters: [json]
C:\bug>type test.cpp
void foo() {
const char *json = R"json({
"str": "test"
})json";
}
C:\bug>clang-format -style=file test.cpp
void foo() {
const char *json = R"json(tr": "test" })json";
}
Sam0523 and j-hapvsevolodshorinatmeta
Metadata
Metadata
Assignees
Labels
clang-formatinvalid-code-generationTool (e.g. clang-format) produced invalid code that no longer compilesTool (e.g. clang-format) produced invalid code that no longer compiles