https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70029
--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Fri Sep 8 22:39:17 2017 New Revision: 251911 URL: https://gcc.gnu.org/viewcvs?rev=251911&root=gcc&view=rev Log: PR c++/70029 - ICE with ref-qualifier and -flto gcc/ * langhooks.h (struct lang_hooks_for_types): Add copy_lang_qualifiers. * attribs.c (build_type_attribute_qual_variant): Use it. * langhooks-def.h (LANG_HOOKS_COPY_LANG_QUALIFIERS): Default to NULL. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. * tree.c (verify_type): Re-enable TYPE_CANONICAL main variant check. gcc/cp/ * tree.c (cxx_copy_lang_qualifiers): New. * cp-tree.h: Declare it. * cp-objcp-common.h: Define LANG_HOOKS_COPY_LANG_QUALIFIERS. Added: trunk/gcc/testsuite/g++.dg/lto/pr70029_0.C Modified: trunk/gcc/ChangeLog trunk/gcc/attribs.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-objcp-common.h trunk/gcc/cp/cp-tree.h trunk/gcc/cp/tree.c trunk/gcc/langhooks-def.h trunk/gcc/langhooks.h trunk/gcc/tree.c