Skip to content

clang-format 15 has no effect for simple functions with --lines (works with clang-format 14) #59178

@sean-mcmanus

Description

@sean-mcmanus

Do formatting on the 2nd function only:

int a()
{
return 0;
}

int b()
{
return 0;
}

with a command line like "clang-format test.cpp --style="Mozilla" --lines=5:10" and it works with clang 14. The bug repros with other styles too.

A similar (or the same issue) was reported at #58464 with slightly different repro code, but the root cause could be the same.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Needs Review

Relationships

None yet

Development

No branches or pull requests

Issue actions