Skip to content

clang-format-17 AlignTrailingComments: Kind: Leave moves comments #3 #67116

@MartinsSmirnovs

Description

@MartinsSmirnovs

Given following .clang-format file:

AlignEscapedNewlines: Left
AlignTrailingComments:
    Kind: Leave

And following file.hpp header file:

#define MACRO   \
  /* foo1(); */ \
  foo2();

I expect that clang-format file.hpp will not perform formatting, however, it does:

$ clang-format file.hpp 
#define MACRO   \
      /* foo1(); */ \
  foo2();

clang-format version:

$ clang-format --version
Ubuntu clang-format version 17.0.0 (++20230827093036+e91ad6b97fcb-1~exp1~20230827093150.32)

Perhaps the core issue is the same as #59635.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions