Skip to content

clang-format mis-annotates pointer/reference in range-based for loops #109358

@owenca

Description

@owenca

This is split from #60146 and reported by @jeremyong.

I'm seeing this also with an even simpler repro:

for (int i = 0; Foo& foo : foos)

turns into

for (int i = 0; Foo & foo : foos)

even with PointerAlignment: Left. I am assuming that in the presence of scoped declaration statements, subsequent & operators are parsed as bitwise-and operators.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions