llvm / llvm/llvm-project

clang-format: operators break `SortIncludes`

Open
#159,254 1 comment 0 reactions 0 assignees View on GitHub
clang-format
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```
clang-format version 21.1.1
```

`x.h`:
```cpp
using std::a;
using MyLib::operator+;
using std::c;
using std::b;
```

`y.h`:
```cpp
using std::a;
using MyLib::xxx;
using std::c;
using std::b;
```

`clang-format x.h --style=Google`:
```cpp
using std::a;
using MyLib::operator+;
using std::b;
using std::c;
```

`clang-format y.h --style=Google`:
```cpp
using MyLib::xxx;
using std::a;
using std::b;
using std::c;
```

Note how includes are fully sorted only in `y.h` (which is as I would expect it) but not in `x.h` (where I would have expected sorting as well).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.