-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
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 compilesquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
Hi
I have the C++ code like below: (Two "//" in the same column)
#include <stdio.h>
int main(void) {
#if TEMP
for (size_t index = 0; index < 10; ++index) {
printf("hello world");
}
#endif // TEMP
//
return 0;
}After running clang-format, it will output the extra "\" char in the end of line of the first "//"
#endif // TEMP \It will cause the compiler error if I build them by the command "gcc -Werror=comment test.cc".
I found the issue occur in llvm 21.1.0 or 17.00.
Do you have some options to avoid it before the fix ?
Regards
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 compilesquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!