<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67907>67907</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format-18 detachment from namespace
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kalman5
</td>
</tr>
</table>
<pre>
The following snippet
```
#include <functional>
namespace Short {
void foo() {}
} // namespace Short
namespace LongNameSpace {
void foo() {}
} // namespace LongNameSpace
struct Test {
Test()
: l([] {
Short::foo();
LongNameSpace::foo();
}) {}
std::function<void()> l;
};
```
formattted with clang-format-17 using the following configuration
```
Language: Cpp
AlignConsecutiveDeclarations: Consecutive
```
is formatted in the following way using clang-format-18
```
#include <functional>
namespace Short {
void foo() {}
} // namespace Short
namespace LongNameSpace {
void foo() {}
} // namespace LongNameSpace
struct Test {
Test()
: l([] {
Short:: foo();
LongNameSpace::foo();
}) {}
std::function<void()> l;
};
```
as you can see the the foo invoked from a shortnamespace is detached from it.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVc1u4ywUfRq8QYkw2HG88CJNmlX1bdoXuIFrm68YLAOp-vYj_yRNouksRprFSIMiYi73Hs6BgwDvdWMRK5I_kfyQQAytG6p3MB3YPDk59Vm9tUhrZ4z70Lah3uq-x0DYgbDd0m_Y8puHXGgrTVRIidjX0cqgnQVDxPNtlYUOfQ8S6WvrhkBJ8TRPnJ1WtHaO8C3h5RQvDktlcaCEHwk_0ofynyO_ONv8Bx2-TqPfXuEO5nYlH4YoA31Df8N_Gs7QS2BqROyoGcPTTt-kX9ssROyI2F3JEXFJuyfxXdbSRj2PypYEH9RSvZwMEftxQy5Iz9Rc4cbi6_fDKU997YYOQgio6IcOLZUGbLOao6u0oNGPngl3DpLO1rqJA0yLf--jF7BNhGbUSvd9Pwd3Rjd276xHGYM-4wGlgRnKT4lfU7-grT1dmKOi2j4Q_IDPhfi9nO0_0_9R019Cf4v5wdNPF6kESz3iZKLZSI5qe3bvqGg9uI4C9aPIr63VnioMINtLhg7rRFVClaKEBKt0U27SrEjLLGkrmdV1miGD9MROIBjkORfZFoTY5KpWKtEVZ1ykjKWsyMs8WwuVZ6dUMbXlZc0LIBnDDrRZG3Pu1m5oEu19xGpTlKxIDJzQ-OkB4PzW8ITz8UkYqrFsdYqNJxkz2gf_BRR0MFg9XJNFXIc2zPKuypM4mKoNoR_v6uy4Roc2ntbSdYQfR9zlb9UP7n-UgfDjxNYTfpwI_wgAAP__Xkfq-A">