https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106478
Bug ID: 106478
Summary: GCC rejects valid code involving partial
specialization of variable template
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following program is incorrectly rejected by gcc. This can be verified
here: https://godbolt.org/z/f4c3d9voa
```
template<typename TSomeTemplate>
struct A
{
static constexpr std::size_t B = 1;
template<typename T, typename... Ts>
static constexpr std::size_t C = 4;
template<typename T>
static constexpr std::size_t C<T> = B; //rejected by msvc and gcc
};
int main()
{
int i = A<int>::C<int>;
return 0;
}
```
The error for gcc says:
<source>:13:34: error: explicit template argument list not allowed
13 | static constexpr std::size_t C<T> = B; //rejected by msvc and gcc