https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91133
Bug ID: 91133
Summary: Wrong "partial specialization is not more specialized
than" error
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: WisdomOfDarkness at gmail dot com
Target Milestone: ---
The code under fails to compile with GCC 7, 8 and 9, and produces the following
error:
partial specialization 'struct A<T, int, X>' is not more specialized than
[-fpermissive] ...
template<typename T> struct Id
{
using type = T;
};
template<typename T, typename U, U X>
struct A
{
};
//template<int X>
template<typename T, typename Id<T>::type X>
struct A<T, int, X>
{
};
This is clearly wrong because the specialization is clearly specialized in its
second parameter.
godbolt: https://godbolt.org/z/wDp3B7
Works in GCC 6 and under. Also works in clang and MSVC.