[clang] [clang-format] Add SpaceInParensOption for __attribute__ keyword (PR #77522)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 10 11:45:30 PST 2024
================
@@ -16815,6 +16817,18 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) {
verifyFormat("void __attribute__((naked)) foo(int bar)", Spaces);
verifyFormat("void f( ) __attribute__((asdf));", Spaces);
+ Spaces.SpacesInParensOptions.InAttributeSpecifiers =
+ FormatStyle::SIPCS_Always;
+ verifyFormat("SomeType *__attribute__( ( attr ) ) *a = NULL;", Spaces);
+ verifyFormat("void __attribute__( ( naked ) ) foo(int bar)", Spaces);
+ verifyFormat("void f( ) __attribute__( ( asdf ) );", Spaces);
+ Spaces.SpacesInParensOptions.InAttributeSpecifiers =
----------------
HazardyKnusperkeks wrote:
```suggestion
verifyFormat("void f( ) __attribute__( ( asdf ) );", Spaces);
Spaces.SpacesInParensOptions.InAttributeSpecifiers =
```
For a better readability.
https://github.com/llvm/llvm-project/pull/77522
More information about the cfe-commits
mailing list