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

--- Comment #6 from Mick P. <mick.pearson at wildblue dot net> ---
Desired scenario: https://godbolt.org/z/zKnh1s

template<class A, char A::*> struct T{};
struct A{};
struct B:A{ int x; };
struct C:A{ T<A,(char A::*)&B::x> y; };

Changing x to char yields the other diagnostic. PtoM types are fungible, I
don't know why casting should restrict them to concrete types this way, even if
the standard says so that's a straight-jacket just for strong type-safeness
sake.

Reply via email to