https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70029
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- The difference seems to be in FUNCTION_RVALUE_QUALIFIED and FUNCTION_REF_QUALIFIED which were set in build_ref_qualified_type (but not for the main type it seems).