Skip to content

clang-format: operators break SortIncludes #159254

@bersbersbers

Description

@bersbersbers
clang-format version 21.1.1

x.h:

using std::a;
using MyLib::operator+;
using std::c;
using std::b;

y.h:

using std::a;
using MyLib::xxx;
using std::c;
using std::b;

clang-format x.h --style=Google:

using std::a;
using MyLib::operator+;
using std::b;
using std::c;

clang-format y.h --style=Google:

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions