<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55132>55132</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format removes newline after "private:"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
Consider:
```
$ cat /tmp/a.cc
#include <memory>
class A {
public:
std::unique_ptr<const char* []> b() {
return nullptr;
}
private:
int c_ = 0;
};
$ build.release/bin/clang-format -style="{BasedOnStyle: Chromium, Standard: c++17}" /tmp/a.cc
#include <memory>
class A {
public:
std::unique_ptr<const char* []> b() { return nullptr; }
private : int c_ = 0;
};
```
Note the missing newline after "private:" and extra space before the colon. That seems like a bug.
(Originally from https://bugs.chromium.org/p/chromium/issues/detail?id=1320172)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNkk1zmzAQhn-NuOyEkQUY-8DBH_WxOaT3jBBrUCskqo-07q_vYseuPTnkWkYjhMTuvvu8al13anbOBt2hZ8WG8T3j13nJ38flU5SgZAQmDnGcaJa5UtejQltlUofAit2Io_MnVny5T6aMDAE2wOrtZQOm1BqtbjUBQuzmr2KTrP6Z8HWKpGinSFwENUjPBIVXW1btKTe0TKyYWN8lpMdjTN6CTcaco29HrN7fq4HJ6zcZ8a66tlTllfTvgd8C57Db-kahTdp0uUeDMiCBaLWlmTq0_dPR-ZEgPYV4MpR-z4QghVv6sXu2L5fNDewG70adRiZ28BKl7aSfewfFxJbGop4LC_Efsv6I-APbK1yYO_oc6-Mt--ooMA4Iow5B2x4s_jLaIshjRE9AxJ11RIjYAf6OXkKYpEJokRy4ZFDOOJvDt4H8CIhjAKN_UCLyr88fPV09e91rK405wZGsgSHGKZxLHGaDUx9y9e5Z7nxPe7Mr6mbjgdQmDLToMEptWHHQRHi_KARf1ILgZV1TdOtiLbOoo8Hm4bp4svENwyfNZsmb5lFZr-OQ2ly5WYMxb9fX0-Tdd1TxXllVkZpsaOqyOIqqrVUly3J5xArVYlXUUvCai1W9zIxs0YTm4n-mG8GF4KWoeV2sxCJfHPm65rxcStmtuZCs5DhSz_lceKaT-easYcZGh0aHGP4d0t3UvUW85pcpDs43f0bX4Zid1TZnqX8BRm5b0g">