Issue 174053
Summary [Clang-Format][Feature Request] Add/Remove parentheses of lambda _expression_/requires _expression_ if there is no function paremeter.
Labels clang-format
Assignees
Reporter zwuis
    ```cpp
// after adding parenthses
[]() { /* body */ };
requires () { /* body */ };

// after removing parentheses
[] { /* body */ };
requires { /* body */ };

[] () [[attr]] { /* body */ }; // should not be affected
// ^ they are not equivalent v
[] [[attr]] { /* body */ };
// ^ they are equivalent v
[] [[attr]] () { /* body */ };

// can remove parentheses only in C++23 (or later) mode
[] /* contains something other than `()` and template parameter list */ { /* body */ };
```

See https://en.cppreference.com/w/cpp/language/lambda.html for detailed syntax.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to