I wrote the following snippet that compiles with clang but gcc and msvc rejects it Demo
#include <iostream>
#include <iomanip>
//wrapper
template<typename T>
struct Wrapper
{
inline static T value{};
};
template<> int Wrapper<int>::value = 42; //clang:OK, gcc:Nope, MSVC:Nope
template<> double Wrapper<double>::value = 3.14; //clang:OK, gcc:Nope, MSVC:Nope
int main()
{
}
GCC says:
<source>:11:30: error: duplicate initialization of 'Wrapper<int>::value'
11 | template<> int Wrapper<int>::value = 42;
| ^~~~~
<source>:12:36: error: duplicate initialization of 'Wrapper<double>::value'
12 | template<> double Wrapper<double>::value = 3.14;
|