Skip to content

clang-format doesn't handle template variables and operators correctly #54257

@cjdb

Description

@cjdb

Given

template <class T>
inline constexpr bool signed_integral = std::is_integral_v<T> && std::is_signed_v<T>;

clang-format will stylise as

template <class T>
inline constexpr bool signed_integral =
    std::is_integral_v<T>&& std::is_signed_v<T>;

when it should be stylised as

template <class T>
inline constexpr bool signed_integral =
    std::is_integral_v<T> && std::is_signed_v<T>;
//                       ^

I'm unable to provide system details or clang-format details at present, but my estimate is that this clang-format build is at most a fortnight old.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorclang-formatduplicateResolved as duplicate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions