Skip to content

[clang-format] Regression in version 20 with macros #107096

Closed
@prj-

Description

@prj-
$ clang-format dump
#define MACRO() \
  namespace std \
  { \
  template <> \
  struct hash<type> { \
    std::size_t operator()(const type &t) const noexcept \
    { \
      std::size_t ret = 0; \
      hash_combine(ret, __VA_ARGS__); \
      return ret; \
    } \
  }; \
  }
$ clang-format-20 dump
#define MACRO() \
  namespace std \
  { \
  template <> \
  struct hash<type>{std::size_t operator()(const type &t) const noexcept {std::size_t ret = 0; \
  hash_combine(ret, __VA_ARGS__); \
  return ret; \
  } \
  } \
  ; \
  }
$ clang-format-20 --version
Debian clang-format version 20.0.0 (++20240902101259+0ba006daf5d9-1~exp1~20240902221440.2311)

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