https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70512
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'd note that we likely need to modify them in-place, as PARM_DECLs etc. with those types already will be around. for (t = TYPE_POINTER_TO (to_type); t; t = TYPE_NEXT_PTR_TO (t)) and for (t = TYPE_REFERENCE_TO (to_type); t; t = TYPE_NEXT_REF_TO (t)) walking perhaps should do it.