Skip to content

[clang-format]: token annotator confuses inline asm colon as ObjCMethodExpr or DictLiteral #92616

@gedare

Description

@gedare

The token annotator labels colons in inline asm incorrectly.

$ echo " asm ( a : );" | clang-format -debug
...
 M=0 C=1 T=ObjCMethodExpr S=0 F=0 B=0 BK=0 P=43 Name=colon L=6 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text=':'
...
$ echo " asm { a : };" | clang-format -debug
...
 M=0 C=0 T=DictLiteral S=1 F=1 B=0 BK=0 P=43 Name=colon L=8 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text=':'

A side-effect is that files with inline assembly using parentheses are identified as ObjC source files.

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