I found a few similar issues but none as simple as mine in that I have a template inside a Struct scope that is explicitly being specialised. Under MSVC
this is fine and Clang> 6.0.1
but GCC
reports errors for all versions.
Which compiler is correct as per the standard?
A minimal example of the issue: https://godbolt.org/z/1Mh8P7jh9
error: explicit specialization of 'TFoo' in class scope
struct Bar
{
template<typename T>
class TFoo
{
};
// * GCC (ALL) 6.2 to 11.1 + trunk
// error: explicit specialization in non-namespace scope 'struct Bar
// error: too few template-parameter-lists
// * Clang <= 6.0.1
// error: explicit specialization of 'TFoo' in class scope
template<>
class TFoo<int>
{
int a;
};
};