Skip to content

clang-format-18 Comments alligned across scopes #67906

Closed
@kalman5

Description

@kalman5

The following snippet

void foo() {
#if 1   // reference
#elif 0 // slower
#else   // slowest
#endif  // 0
} // foo

formattted with clang-format-17 using the following configuration

Language: Cpp

is formatted in the following way using clang-format-18

void foo() {
#if 1   // reference
#elif 0 // slower
#else   // slowest
#endif  // 0
}       // foo

as you can see the comment at the end foo is alligned with other comments inside another scope

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions