https://bugs.llvm.org/show_bug.cgi?id=48891

            Bug ID: 48891
           Summary: [clang-format] Different formatted output can be
                    produced from varying whitespace
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

As of https://reviews.llvm.org/D93839, clang-format can produce different
formatted files depending on amount of whitespace. For example, given (A):

```
#include <stdint.h>
namespace fuzzing {}
```

`clang-format` with this patch would produced (B):

```
#include <stdint.h>
namespace fuzzing {
}
```

but given (C):

```
#include <stdint.h>
namespace fuzzing {


}
```

would be formatted to (D):

```
#include <stdint.h>
namespace fuzzing {

}
```

The invocation specifically is `clang-format --style=google file`. Prior to
this patch, both inputs (A/C) would give the same output:

```
#include <stdint.h>
namespace fuzzing {}
```

This seems to be unintended behavior that should be fixed. This doesn't seem to
occur if `#include "stdint.h"` is used.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to