Issue 161730
Summary [clang-format] Option to place names of functions, constructors and destructors on a new line
Labels clang-format
Assignees
Reporter chghehe
    I would like to place names of functions, constructors and destructors (declarations and inline definitions) on a new line and leave all possible specifiers (such as `explicit`, `constexpr`, attributes and so on) on a separate line before the function name.

Currently it is possible only for function names using `BreakAfterReturnType: All`, but constructors and destructors have no return type.

Input:
```c++
class SomeClass {
public:
  constexpr SomeClass() noexcept = default;

  constexpr explicit SomeClass(int x);

  [[nodiscard]] std::shared_ptr<void> foo();
};
```

Desired output:
```c++
class SomeClass {
public:
 constexpr 
  SomeClass() noexcept = default;

  constexpr explicit 
 SomeClass(int x);

  [[nodiscard]] std::shared_ptr<void>  //< Formatted by BreakAfterReturnType: All
  foo(); //<
};
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to