Skip to content

[format] Complex requires clauses get formatted wildly #63251

@danakj

Description

@danakj

Clang-format produces this:

#include <concepts>

template <class T, class E>
void Result()
    requires(!((std::is_void_v<T> ||
                std::is_trivially_destructible_v<
                    T>)&&std::is_trivially_destructible_v<E>) &&
             !std::is_void_v<T>)
{}

Instead of something like this:

#include <concepts>

template <class T, class E>
void Result()
    requires(!((std::is_void_v<T> || std::is_trivially_destructible_v<T>) &&
               std::is_trivially_destructible_v<E>) &&
             !std::is_void_v<T>)
{}
  • It wraps at the template parameter of is_trivially_destructible_v.
  • It puts no spaces around the && after it.

See it in action: https://godbolt.org/z/br3hddTbf

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions