[clang-format] Formatting breaks attributes with arguments
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
This behaviour exists up to including 21.1.6.
Formatting this piece with style llvm
``` c++
class CStruct {
public:
alignas(32) std::array, eP / Impl::eP> m_Buffs;
};
```
Results in
``` c++
class CStruct {
public:
alignas(
32) std::array, eP / Impl::eP> m_Buffs;
};
```
clang-format should try hard to not break up the attribute
Contributor guide
Research direction
Start by reproducing the formatting change with clang-format 21.1.6, using the provided C++ snippet and LLVM style. Trace the clang-format formatting path for alignas attributes with arguments; done means formatting no longer breaks the attribute across lines in this case, with a regression test covering the example.
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
- Clearly specified
- Newbie friendliness
- 45/100