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.
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>;
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
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.
In action: https://godbolt.org/z/bEq855dnr