<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99307>99307</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] `-Wreserved-identifier` warning should not be raised for user-defined literals
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics,
false-positive
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SunBlack
</td>
</tr>
</table>
<pre>
We have a file with user-defined literals:
```cpp
#pragma once
#include <cstddef>
constexpr unsigned long long operator"" _KiB(unsigned long long value)
{
return value * 1024LL;
}
//...
```
Clang raised here the warning: `identifier '_KiB' is reserved because it starts with '_' followed by a capital letter`. As the documentation of [user-defined literals](https://en.cppreference.com/w/cpp/language/user_literal) itself suggest the underscore, I think we have an exception here, where an underscore is fine.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU83O2zgMfBr6QsSwqThODj7kZwMstrc99FjIEm1rq0iGfpL27Rd2EvRr8QGGDAgjcjgzlDGa0TF30JyguRQyp8mH7t_sTlaq70Xv9c_uK-Mk74wSB2MZHyZNmCOHjebBONZoTeIgbQRxhOoC1fvcVc9PzfPrhsQc5HiT6J3i37AkjFM2a0YQZxWT1jyA-OsjRnkXE_-YA2a30tZovRufh585yOQDEAERfvvHnID2nwDv0mYGOrwqt6d3i0PglIN7AhDoiHVF2y9fQLwh7eVN9gp0Lcvyjzk_kj1b6UYM0kTWOHFgTBPjQwZn3AjiiLCrjGaXzGA4IFD7pNyiiRg4crizxp6VzJHRJIxJhhSf6i_oBTp4a_1jwf1EiUrOJkmLllPiALuqxGNc22qv8o1dksl4h35AaE6fO9hcgPZTSvNq5jonu1LNc-CBAzvFpfI3oOsD6Lr4Stdl0CxHBrouNb-9agEd0KTIdsCYx5FjWqlkpzlE5QMDnfFvTJNx3_HxjphD_qF4Xnkuqi2gxyqfdB_eLiItzMtCd0IfxEEW3NUt1VQ3tRDF1Mmd3In9flv3LLdC1KT3uqqHgbbMVbWlwnRU0bZq67au630jyrYXFfdqV-0PjW77BrYV36SxpbX3W-nDWJgYM3eHg6jawsqebVz3hkgtGoA4aiNH52MyKq45PAPRIG3kzeyjSebOy3VzKUK3FN30eYywrayJKf5qk0yy60auGYLmsmRl8_Udis2v2MCuekcK4-Sz1eh8wp7fwRt8-HxVixxs97vPo0lT7l_2LmRev80c_H-sEtB1FSACXZ8a3Dv6PwAA___Xplwk">