<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58987>58987</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang format is confused by function-try-block + complex initializers
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dvirtz
</td>
</tr>
</table>
<pre>
Input:
```cpp
namespace good {
struct S {
S() : i{[]() { return 42; }()}
{}
int i;
};
}
namespace bad {
struct S {
S() try
: i{[]() { return 42; }()}
{}
catch(...) {throw;}
int i;
};
}
```
output:
```cpp
namespace good {
struct S {
S() : i{[]() { return 42; }()} {}
int i;
};
} // namespace good
namespace bad {
struct S {
S() try : i{[](){return 42;}
()
} {
}
catch (...) {
throw;
}
int i;
}; // namespace bad
}
```
End of namespace comment is being put at the wrong place and initializer formatting is strange.
https://godbolt.org/z/91hYr5aoj
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytUslu2zAQ_RrpQligFms58BAjLdBzTj1SFCUxpUmBHMW1v75D2Y7lNCjSpgYNzT5v5k1ruyP7ZqYZovwhoo8RfYhKen5ims4Ww_fST1xIMljbkajane0e3CyAPN0sBH9PUVZHWUOwIFHBs8X3eDVWO-IkzM6QIovyHRouLhTIrUjIQ8-rrgxgsfzSJrjW8ll4g7XlH4YK7rjqvfT_PPiVQXAQI0YmSXKpA6OzhzDD3w55JWc9s53h_xH4GfruSPvjNCTKvuIj98j-kcg7Gt-Bjeoa9N3OLxE3XNXblS_kkTv2rumvLN5nvDf57wPjWB8h94vpiO1XecLu9zJ08KSVygwEuSccEIwkB2eDQYc4jonKKFBcq5N0pLduzwFCBqbiHrkZZLJuNQJMPpzRAnWwXWs1JNYNqJ3w36Tjd7fl9jmWLC3LuijyuqBxx_KuyRsegwItmdBY-NItdBLW9LOXHWmPpJ-NAGXNBqnatNqKH7iXXRhp0vLnGq6PZ6fZG0QKxrlNMBoVrV-un83k7LMUgKryfpYehW3d1FU8sp6WOc2rthJtVvYVpZ0symIrBe35Ni2LWPNWas_CvWSZkQeylEAZzydWLKNZlqZpkZZ5ldGE162s6qZo0jwvUI4KKvdc6STgCKuKHVsgtfPg0amVB39zcu_VYKRk5_OM-Qyjdax7UQ5O8dKZLch_ATN0hRM">