The cause of the ICE was that TYPE_DECLs were only being generated for
structs with members, not opaque structs.
PR d/113125
gcc/d/ChangeLog:
* types.cc (TypeVisitor::visit (TypeStruct *)): Generate TYPE_DECL and
apply UDAs to opaque struct declarations.
gcc/testsuite/ChangeLog:
* gdc.dg/imports/pr113125.d: New test.
* gdc.dg/pr113125.d: New test.
apply_user_attributes (t->sym, t->ctype);
finish_aggregate_type (structsize, alignsize, t->ctype);
}
+ else
+ {
+ build_type_decl (t->ctype, t->sym);
+ apply_user_attributes (t->sym, t->ctype);
+ }
/* For structs with a user defined postblit, copy constructor, or a
destructor, also set TREE_ADDRESSABLE on the type and all variants.
--- /dev/null
+module imports.pr113125;
+struct S113125;
--- /dev/null
+// { dg-do compile }
+// { dg-options "-I $srcdir/gdc.dg" }
+module pr113125;
+import imports.pr113125: S113125;