User defined types have the TYPE_CXX_ODR_P flag set, but closure frames
did not. This mismatch led to an ICE in the conflict detection for ODR
and interoperable non-ODR types. As a given closure frame is tied
explicitly to a function, it already conforms to ODR.
PR d/102094
gcc/d/ChangeLog:
* d-codegen.cc (build_frame_type): Set TYPE_CXX_ODR_P.
gcc/testsuite/ChangeLog:
* gdc.dg/lto/pr102094_0.d: New test.
TYPE_FIELDS (frame_rec_type) = fields;
TYPE_READONLY (frame_rec_type) = 1;
+ TYPE_CXX_ODR_P (frame_rec_type) = 1;
layout_type (frame_rec_type);
d_keep (frame_rec_type);
--- /dev/null
+// { dg-lto-do link }
+module pr102094_0;
+
+extern(C) int printf(char* s, ...);
+
+struct S102094
+{
+ int a;
+}
+
+void main()
+{
+ S102094 x;
+ void nested()
+ {
+ printf(cast(char*)0, x);
+ }
+}