llvm / llvm/llvm-project

[clang-format] [reflection] Missing space between `typename` and splicer

Open
#192,040 10 comments 0 reactions 0 assignees View on GitHub
clang-format reflection
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Currently formatted code (clang-format 21.1.8):
```
int main() {
typename[:^^int:] i = 42;
typename int i = 42;
}
```

Expected:
```
int main() {
typename [:^^int:] i = 42;
typename int i = 42;
}
```

Splicer `[:` `:]` is not recognized and no space is added after `typename`.
It seems reasonable to have the same formatting whether the type is spellt out explicitly or it comes from a splicer.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.