]> git.ipfire.org Git - people/ms/gcc.git/commit
d: Fix ICE on explicit immutable struct import [PR108877]
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 27 Feb 2023 19:46:18 +0000 (20:46 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 3 Mar 2023 02:27:28 +0000 (03:27 +0100)
commit2583365912c8700abe1f4a23ed611acb80fac09d
tree8fadfee230c22c7052888d6d990ec6dcd003704e
parentca8f548dcc72904a3826626a287edda5416c8fa9
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)
gcc/d/imports.cc
gcc/testsuite/gdc.dg/imports/pr108877a.d [new file with mode: 0644]
gcc/testsuite/gdc.dg/pr108877.d [new file with mode: 0644]