Issue |
148741
|
Summary |
[clamg-format] Add BreakIfInitializer option
|
Labels |
clang-format
|
Assignees |
|
Reporter |
SunBlack
|
Since C++17 it is allowed to add a init-statement within an [if condition](https://en.cppreference.com/w/cpp/language/if.html).
It would therefore be nice if you could control whether this statement should be in an extra line or not.
So there should be 3 options:
- `Keep` => Don't adjust the code
- `Always`:
```cpp
if (const auto it = map.find(key);
it != map.end())
{
...
}
```
- `Never`:
```cpp
if (const auto it = map.find(key); it != map.end())
{
...
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs