https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91798

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually maybe GCC is correct here.
Remove the variadic template:
```
//Get type parameter at given index.
template<auto i>
struct param
{
    static_assert(i > 0, "Index into parameter pack cannot be negative!");
    using type = typename param<i - 1>::type;
};

template<>
struct param<0>
{
    using type = int;
};

int main()
{
    typename param<0u>::type x = 'a';
    static_cast<void>(x);
}
```

Every compiler (EDG, GCC, clang and MSVC) I tried rejects this.

Note the original code,  EDG rejects it for the same reason as GCC.

The reason why is 0 is different 0u as they have different types as they should
not match.

Though I think there is a defect report in that area ...

Reply via email to