llvm / llvm/llvm-project

[clang format] `PointerAlignment` not respected in `requires` clauses

Open
#167,533 1 comment 0 reactions 0 assignees View on GitHub
clang-format
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

With above code, with `PointerAlignment = PAS_Left`
```
template
concept dummy = true;

template
requires(dummy) // KO: extra space before &&
void foo()(Args&&...) { // OK
if (dummy) { // OK
}
}

int main() {}
```

`Args && ...` should be `Args&& ...`

Tested with clang-format 20.1.8

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the example with clang-format 20.1.8 using PointerAlignment = PAS_Left, then trace how requires clauses format Args && .... Done means the output uses Args&& ... in the requires clause while preserving the already-correct formatting elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.