Skip to content

[clang-format] Unnecessary spacing with brace initialization and address of member function #144057

@carlosgalvezp

Description

@carlosgalvezp

Example input:

template <typename T>
struct ArgCount
{
    static constexpr auto f1{&T::operator()};
    static constexpr auto f2{&T::bar()};
};

Output:

template <typename T> struct ArgCount {
  static constexpr auto f1 { &T::operator() };
  static constexpr auto f2{&T::bar()};
};

Godbolt

Note how the problem only happens with operator(), not with bar().

This is happening on trunk.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions