<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92925>92925</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
False positive of google-readability-casting for out-of-line declaration of static constexpr member of template when building C++14
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
igkper
</td>
</tr>
</table>
<pre>
Given an out-of-line declaration of static constexpr member of template taking an enum template parameter when building C++14, clang-tidy produces a google-readability-casting in the absence of any C-style cast.
```cpp
enum class Enum
{
e,
};
template <Enum e>
struct S final
{
static constexpr int k{};
};
template <Enum e>
constexpr int S<e>::k; // suggests using static_cast<>( ) here
template struct S<Enum::e>;
```
In action: https://godbolt.org/z/bEq855dnr
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU01v2zAM_TXyhXDgUHZSH3xI0nrYuT9gkGXG0SJLnkS3y379ICddu-4DGAYYtkHy8T0-kCpGMziiRlR7Ud1nauaTD40ZzhOFrPP9pflgnsiBcuBnzv0xt8YR9KStCoqNd-CPEFmx0aC9i0xfpwAjjR2FlGIaJ6uYgNXZuCE1IjePr_FJBTUSU4DnEznoZmP7VHgQuBe4X5cCD6CtckPOpr_AFHw_a4qgYPB-sJQHUr3qjDV8ybWKnNDGAZ8IVBfJaUpClLvAIY98sQSpaiWKe1Hsbu9NcX30NF0ji0htVYzw4ObxVrbdX3-ABB5eYvdC7t82-zGakIeEBRLy4ZqKHGbN8AhH45R93xTgVyeNYzinkrc0_0L5c6tHIQ9LTu6E3J2F3IPAVmALcR4GihxhjsnAq5BPySkhDwmBdyCwhhMF-i31y2w3CVeGK9f-nctv8R8dKJ0WScgdnJinmJCLpsH3nbe88mEQ2H4T2HYPX-6qqnch6xvZ17JWGTXr7Xoji7JGmZ0avcZqs1U1YqWLErHXW9xqlL3e9tWmVJlpsMCyqHC9rhALucLtpia5ORZlVa-JSJQFjcrYlbVPY-LOTIwzNTXWWGVWdWTjci-Ijp5hSQrEdD6hSZi8m4coysKayPG1Cxu21LTKRoLJR8PmaVnMv2zx0Yf_Pbs_HFU2B9u8c9vwae5W2o8C26T69smn4D-TZoHtMmsU2C5efA8AAP__vEtVSQ">