File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1860,7 +1860,12 @@ void semanticRTInfo(AggregateDeclaration ad)
18601860 auto sc = ad.rtInfoScope;
18611861 Scope* sc3 = ti.tempdecl._scope.startCTFE();
18621862 sc3.tinst = sc.tinst;
1863- sc3.minst = sc.minst;
1863+ // Use the root module so nested RTInfoImpl instances get codegen'd.
1864+ // If rtInfoScope comes from a non-root ImportC module whose minst is that
1865+ // module itself (see scopeCreateGlobal), so needsCodegen() would skip
1866+ // RTInfoImpl even though TypeInfo references it at link time.
1867+ // See https://github.com/dlang/dmd/issues/23166.
1868+ sc3.minst = sc._module.importedFrom;
18641869 if (ad.isDeprecated())
18651870 sc3.stc |= STC .deprecated_;
18661871
Original file line number Diff line number Diff line change 1+ // Minified from <aws/s3/s3_client.h>
2+
3+ struct MyFoo {
4+ };
5+
6+ typedef struct MyFoo * (MyFuncPtr )(struct MyFoo * allocator );
7+
8+ struct BrokenStruct {
9+ const struct MyFoo * network_interface_names_array ;
10+ int num_network_interface_names ;
11+ MyFuncPtr * buffer_pool_factory_fn ;
12+ void * buffer_pool_user_data ;
13+ };
Original file line number Diff line number Diff line change 1+ // https://github.com/dlang/dmd/issues/23166
2+
3+ import imports.imp23166;
4+
5+ void main ()
6+ {
7+ auto s = new BrokenStruct();
8+ assert (s ! is null );
9+ }
You can’t perform that action at this time.
0 commit comments