Issue 24599 - [REG2.103] Wrongly elided TypeInfo emission leading to undefined symbols at link-time
Summary: [REG2.103] Wrongly elided TypeInfo emission leading to undefined symbols at l...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2024-06-11 10:07 UTC by kinke
Modified: 2024-11-16 23:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description kinke 2024-06-11 10:07:37 UTC
This dustmited testcase regressed with v2.103, failing to link due to an undefined TypeInfo (`_D24TypeInfo_xS3mod8Variable6__initZ`), introduced by https://github.com/dlang/dmd/pull/14844:

```
module mod;

struct Variable
{
    size_t toHash() const { return 0; }
}

enum hasInoutConstruction(T) = __traits(compiles, { struct S { T a; } });

struct Algebraic(T)
{
    static if (hasInoutConstruction!T)
    {
    }
}

Algebraic!Variable foo();

struct S
{
    Variable[] symbols;
}

void main() {}
```
Comment 1 Dlang Bot 2024-06-11 10:17:06 UTC
@kinke updated dlang/dmd pull request #15868 "Draft: Tentative fix for missing struct TypeInfo symbols" fixing this issue:

- Fix Bugzilla 24599 - Wrongly elided TypeInfo emission
  
  Reverting #14844, which caused such missing TypeInfos, *and* making
  sure the special TypeInfo members are fully analyzed and ready for
  codegen (otherwise hitting an assertion for the real-world project).

https://github.com/dlang/dmd/pull/15868
Comment 2 Dlang Bot 2024-07-02 17:31:42 UTC
dlang/dmd pull request #15868 "[stable] Fix Bugzilla 24599 - Wrongly elided TypeInfo emission" was merged into stable:

- 0a859242d93ffc9fb0a5fdda921e9c393e5d11f9 by Martin Kinkelin:
  Fix Bugzilla 24599 - Wrongly elided TypeInfo emission
  
  Reverting #14844, which caused such missing TypeInfos, *and* making
  sure the special TypeInfo members are fully analyzed and ready for
  codegen (otherwise hitting an assertion for the real-world project).

https://github.com/dlang/dmd/pull/15868
Comment 3 Dlang Bot 2024-10-07 09:00:25 UTC
dlang/dmd pull request #16967 "Rebase stable6" was merged into master:

- 9581a91ad65b85c80e9b33a84be731271cb045c8 by Martin Kinkelin:
  Fix Bugzilla 24599 - Wrongly elided TypeInfo emission (#15868)
  
  Reverting #14844, which caused such missing TypeInfos, *and* making
  sure the special TypeInfo members are fully analyzed and ready for
  codegen (otherwise hitting an assertion for the real-world project).

https://github.com/dlang/dmd/pull/16967
Comment 4 Dlang Bot 2024-11-16 23:27:09 UTC
dlang/dmd pull request #17069 "Merge stable" was merged into master:

- 7ab98b931aa1fe40ae3bae73ab3a64a44bb1c696 by Martin Kinkelin:
  Fix Bugzilla 24599 - Wrongly elided TypeInfo emission (#15868)
  
  Reverting #14844, which caused such missing TypeInfos, *and* making
  sure the special TypeInfo members are fully analyzed and ready for
  codegen (otherwise hitting an assertion for the real-world project).

https://github.com/dlang/dmd/pull/17069