aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2024-02-12 16:59:12 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2024-02-12 17:06:41 +0100
commitb0efb1c35724e3332ee5993976efb98200c1a154 (patch)
tree454a957a54c97bfb6317294ed7989fa61c7155bc /gcc/d
parent2dde675ff48600188d3e892d191a2345bad2e6ae (diff)
downloadgcc-b0efb1c35724e3332ee5993976efb98200c1a154.zip
gcc-b0efb1c35724e3332ee5993976efb98200c1a154.tar.gz
gcc-b0efb1c35724e3332ee5993976efb98200c1a154.tar.bz2
d: Fix internal compiler error: in make_import, at d/imports.cc:48 [PR113125]
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.
Diffstat (limited to 'gcc/d')
-rw-r--r--gcc/d/types.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index af9aad8..ed97aa3 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -1230,6 +1230,11 @@ public:
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.