Skip to content

clang-format: extra space not deleted in > >, depending on content in other lines #159111

@bersbersbers

Description

@bersbersbers
clang-format version 21.1.1

x.h:

template<typename T>
concept X = requires(T & v, std::format_context ctx) { std::formatter<std::remove_cvref_t<T> >().format(v, ctx); };

y.h:

template<typename T>
concept X = requires(T & v, std::format_context ctx) { std::formatter<std::remove_cvref_t<T> >().format(v, ctx); };

struct X<Y<Z1, Z2>> {};

clang-format x.h --style="{BasedOnStyle: Google, ColumnLimit: 120}":

template <typename T>
concept X = requires(T& v, std::format_context ctx) { std::formatter<std::remove_cvref_t<T> >().format(v, ctx); };

clang-format y.h --style="{BasedOnStyle: Google, ColumnLimit: 120}":

template <typename T>
concept X = requires(T& v, std::format_context ctx) { std::formatter<std::remove_cvref_t<T>>().format(v, ctx); };

struct X<Y<Z1, Z2>> {};

Note how the extra space between > > is deleted only in y.h (which is as I would expect it) but not in x.h (where I would have expected the space to be removed).

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