Issue 63451
Summary [clang-format] AlignConsecutiveDeclarations restarts on function pointers
Labels new issue
Assignees
Reporter gedare
    The `AlignConsecutiveDeclarations` does not handle function pointer declarations properly. The alignment stops when a function pointer is reached, and starts over with a new alignment.

Example:
```
void foo(
  unsigned long a,
 void         *b,
  size_t        c,
  long long int d,
  void (*bar)( void ),
  bool          e,
  void         *f
)
{
 return;
}
```

Output with `clang-format -style="{BasedOnStyle: llvm, BinPackParameters: false, AlignConsecutiveDeclarations: {Enabled: true}}"`:
```
void foo(unsigned long a,
         void *b,
         size_t        c,
         long long int d,
 void (*bar)(void),
         bool  e,
         void *f) {
 return;
}
```

Expected output:
```
void foo(unsigned long a,
         void         *b,
         size_t        c,
         long long int d,
         void          (*bar)(void),
         bool e,
         void         *f) {
  return;
}
```


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to