<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61676>61676</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Format, IntegerLiteralSeparator not correct with literal suffix
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JVApen
</td>
</tr>
</table>
<pre>
`auto NR = 0x4000'0000_u64;` becomes `auto NR = 0x4'0000'000_u64;` for config:
````
IntegerLiteralSeparator:
Binary: 4
Decimal: 0
Hex: 4
````
I would expect the first.
Note that literal is defined in the following way (in another header):
````
constexpr auto operator"" _u64(unsigned long long value) noexcept -> std::uint64_t
{
return static_cast<std::uint64_t>(value);
}
````
It feels like it considers the _ as part of the number. Though this is needed according to https://en.cppreference.com/w/cpp/language/user_literal
> All ud-suffixes introduced by a program must begin with the underscore character _. The standard library ud-suffixes do not begin with underscores.
Bug found on LLVM 16, was not a problem in LLVM 16-rc2
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8lM2u6yYQx58Gb0aJCHaceOFFcnOitjq9i7a62wjD2KbFYMFwk7x9ZcfnS0fnWhZIDPPx_zEgYzSdQ6zZ9si2p0wm6n2o__hxGNFljdf3mpVcJvLw_S9g-Qn4reCcM7HjnPNLKguWH1nJoUHlB4zwefuy9zG982h9AOVdazqWHxg_MX5gJX_755XfHWGH4dkQBmn_xlEGST68esDROBnuLD_A61csJjihMoO07438xfYb3qb14svEcPXJasDbiIqAeoTWhEjrxWEev3tCoF4S2EeBYCJobI1DDcY9vLy1_mpcB1d5Byb2xoF0nnoM0KPUGJiofkEAYKIUCW9jgBmtH_EBQQgmBMxIxT65-Sg1WO-6x_BT2oRMVOA83hSOBCuWP0EkPeXLD8k4KosLLYnY7viaEgACUgoOIkky6qJkJJZ_--ybPzGxf8k0He1LsNNXihbABC2ijWDNfwiGZpVGY4gztgvICKMMBL6dF1waGgxr-Kf3qeuBehMn2g5RowaplA96okweeqIxTmWKMxNndGs1jgFbDOgUrpUfmDhfmTircWTibKXrkuyQiXOKGC7LUS615k9wsBaSXsXUtuaGEYyj4HVSqKG5g4Qx-C7IAYYUCRrsjIOroX6uOrlJkfIBQfUySEUY4DKpwIms0zJosKYJMtw_JNEenP8Q7i1UXMN7ksfUQeuT0-AdPD__-BM2JRPf4CrjHGOusLE4TC252FdBiUzXua7ySmZYb8pdVZa82O6yvub7POfNplF5uyvbIldt1Yhqt2v3uWwV32SmFlzkPBfFRgi-3a2rRou2KcsWVdVUDbKC4yCNXVv7c1j70GUmxoR1uSl3ZWZlgzbOb44QDq8wG6d23p6yUE8-qyZ1kRXcmkjxLQoZsliffRgkTRK_eB5m2cqHMF3dGd7L_XzwzVKw9ccu6Qz1qVmaY8q3TKsx-H9RERPnucrIxHlW8X8AAAD__-jwoIM">