Skip to content

clang-format does bad things with requires + decltype(auto) #59578

@danakj

Description

@danakj

.clang-format:

BasedOnStyle: Google
Standard: Latest
AllowShortCaseLabelsOnASingleLine: true

The decltype(auto) is on the same line as the requires clause.

  template <class T>
    requires(std::same_as<int, T>) decltype(auto)
  oops() {}

Inserting //clang-format off makes it worse

  template <class T>
  // clang-format off
    requires(std::same_as<int, T>)
      // clang-format on
      decltype(auto)
    oops() {}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions