https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108877
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:fe6cd1ba23ecbce9c0206c08db182cb5164e3b7d commit r11-10554-gfe6cd1ba23ecbce9c0206c08db182cb5164e3b7d Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Mon Feb 27 20:46:18 2023 +0100 d: Fix ICE on explicit immutable struct import [PR108877] Const and immutable types are built as variants of the type they are derived from, and TYPE_STUB_DECL is not set for these variants. PR d/108877 gcc/d/ChangeLog: * imports.cc (ImportVisitor::visit (EnumDeclaration *)): Call make_import on TYPE_MAIN_VARIANT. (ImportVisitor::visit (AggregateDeclaration *)): Likewise. (ImportVisitor::visit (ClassDeclaration *)): Likewise. gcc/testsuite/ChangeLog: * gdc.dg/imports/pr108877a.d: New test. * gdc.dg/pr108877.d: New test. (cherry picked from commit ce1cea3e22f58bbddde017f8a92e59bae8892339)