https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124215
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The reason this fails with gcc is that members_of_representable_p function has
6419 if (CP_DECL_CONTEXT (TYPE_NAME (r)) != c)
6420 return false;
and
6430 if (CP_DECL_CONTEXT (r) != c)
6431 return false;
So, it works only if c is TYPE_MAIN_VARIANT of the type, not e.g. cv qualified
version thereof.
So, I guess the fix could be to change != c in both spots to !=
TYPE_MAIN_VARIANT (c).