<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/148741>148741</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clamg-format] Add BreakIfInitializer option
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SunBlack
</td>
</tr>
</table>
<pre>
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())
{
...
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykU02PozgQ_TXFpRQEBYTkwCFsNlJrpb30LzB2EdxtbGSbzmZ__cj56J6Zw0ijkZBAVa_ee8b1RAj6bJk7aHpojplY4-R897ra3gj5ng1OXbtXbSXjX0A9UF-2qCPqgMIYd2GF0aFQCgVqq-MmRBF5ZhvxouOkLQqL0PR6ROms0lE7C80RaDfFuASoDkAnoBPbXC6L55E9W8m5dDPQ6QJ0kssCdDLCnldxZqCTHvMpzgZon0NxgOLwEvHiVqMwTux5dJ5xYLRaMuoRr25FeWtLZ6N3Bi8TJyTGSQf88humG2pgvLvm_6IXaLRldB6tiw-5V3cX-m6gQrekk93OUxw2CNviH-YFtgVCdYTqbzw6C9RGFOptDTExoHSKn-iDuYhrgG1xZ0BMxfuTfsCtokcE2klnQ0SxRpfuAaojzmLJR20V0O6dr0B7qPo0kdpUPhF8A6Qu7R8KbX__QMzz_Fk7_iT_dPgvf7D_lcHfsfcn3j51M9VVal_tRcZd2TbUVNRURTZ1JFiUu1rWtShHqhTtWPEwNNSIulW0zXRHBTVFW9ZEVVMVedGMXG8bOZYtlzQKqAuehTa5MR9z7vw50yGs3JX1rq3LzIiBTbhlhkim3dyMzs8iAlFKke_S3GZYzwHqwugQwxdT1NHc8iaNmD8HmyMelMLes3h_GV-sjloY_T_7x2plqzfdj5k56zitwyMqif7x2izevbGMKSvJdQA6PYx_dPQtAAD__wxwLqo">