https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108877
Bug ID: 108877
Summary: Explicit immutable struct import internal compiler
error
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: d
Assignee: ibuclaw at gdcproject dot org
Reporter: belka at caraus dot de
Target Milestone: ---
We have 2 files. util/Version.d:
```
module util.Version;
immutable struct Ver
{
}
```
and the main file:
```
import util.Version : Ver;
```
Compiling with „gdc-12 -c util/Version.d version_test.d“ results in the error:
> version_test.d:1:8: internal compiler error: in make_import, at
> d/imports.cc:48
> 1 | import util.Version : Ver;
> | ^
> 0x1bc1e87 internal_error(char const*, ...)
> ???:0
> 0x7d27f3 fancy_abort(char const*, int, char const*)
> ???:0
> 0x9d4214 ImportVisitor::visit(AggregateDeclaration*)
> ???:0
> 0x9d3cfe build_import_decl(Dsymbol*)
> ???:0
> 0x9ca0ff DeclVisitor::visit(Import*)
> ???:0
> 0x9c70a6 build_decl_tree(Dsymbol*)
> ???:0
> 0x9d6fc0 build_module_tree(Module*)
> ???:0
> 0x9c9f4b DeclVisitor::visit(Module*)
> ???:0
> 0x9c70a6 build_decl_tree(Dsymbol*)
> ???:0
> Please submit a full bug report, with preprocessed source (by using
> -freport-bug).
> Please include the complete backtrace with any bug report.
> See <https://gcc.gnu.org/bugs/> for instructions.
This is reproducable with gdc-12.2.0 and gdc 11.2.0. GDC 12.2.0 info:
> gdc-12 -v
> Using built-in specs.
> COLLECT_GCC=gdc-12
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/12/lto-wrapper
> Target: x86_64-slackware-linux
> Configured with: ../gcc-12.2.0/configure --prefix=/usr --libdir=/usr/lib64
> --mandir=/usr/man --infodir=/usr/info --enable-shared --disable-bootstrap
> --enable-languages=c,c++,d --enable-threads=posix --enable-checking=release
> --with-system-zlib --disable-libquadmath-support
> --with-default-libstdcxx-abi=new --disable-libstdcxx-pch
> --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp
> --enable-gnu-unique-object --enable-plugin --enable-lto
> --disable-install-libiberty --disable-werror --with-gcc-major-version-only
> --with-isl --program-suffix=-12 --with-arch-directory=amd64 --disable-gtktest
> --enable-clocale=gnu --disable-multilib --target=x86_64-slackware-linux
> --build=x86_64-slackware-linux --host=x86_64-slackware-linux
> Thread model: posix
> Supported LTO compression algorithms: zlib zstd
> gcc version 12.2.0 (GCC)