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

--- Comment #2 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
This minimal patch fixes the (reduced) issue:

diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc
index 718601756dd..81429f3a73b 100644
--- a/gcc/cp/class.cc
+++ b/gcc/cp/class.cc
@@ -2312,6 +2312,7 @@ fixup_type_variants (tree type)
       TYPE_PRECISION (variant) = TYPE_PRECISION (type);
       TYPE_MODE_RAW (variant) = TYPE_MODE_RAW (type);
       TYPE_EMPTY_P (variant) = TYPE_EMPTY_P (type);
+      TREE_ADDRESSABLE (variant) = TREE_ADDRESSABLE (type);
     }
 }

But it looks like really we should be delegating to duplicate_decls rather than
trying to reimplement it separately.

Reply via email to