-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
Description
clang-format oscillates between two different choices for how to format the following minimal example. It will continuously reformat its own output. Here is the relevant .clang-format:
---
Language: Cpp
BasedOnStyle: Google
ReflowComments: falseAnd here is a minimal example in C++ to reproduce this.
void func() {
// clang-format off
#define KV(value) #value, value
// clang-format on
}Running clang-format against this produces the result:
void func() {
// clang-format off
#define KV(value) #value, value
// clang-format on
}But running clang-format again on that output re-formats it back to the original code (i.e. it adds the indentation back before the comment). I have tested this against clang-format 16.0.1 and 12.0.0, and am able to reproduce the bug with both.