Skip to content

[clang-format] Excess characters in a line when formatting of BlockIndent. #59567

Open
@red1bluelost

Description

Using the following config on the below code does not properly break the code into BlockIndent as it should. The static_assert line is formatted to exceed 80 character column limit.

From toying around, I noticed that if I changed the angle brackets (<, >) into parenthesis ((, )), the line is formatted correctly.

---
Language:                                  Cpp
AlignAfterOpenBracket:                     BlockIndent
ColumnLimit:                               80
...
#include <iterator>
#include <type_traits>

template <typename Category> struct S {
  static_assert(std::is_base_of_v<std::output_iterator_tag, Category> || std::is_base_of_v<std::input_iterator_tag, Category>);
};

The correct formatting would be:

  static_assert(
    std::is_base_of_v<std::output_iterator_tag, Category> ||
    std::is_base_of_v<std::input_iterator_tag, Category>
  );

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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