Bug 24153 – Inliner breaks -betterC by requiring TypeInfo
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2023-09-23T14:48:20Z
Last change time
2024-11-03T07:35:41Z
Keywords
betterC, pull
Assigned to
No Owner
Creator
ryuukk_
Comments
Comment #0 by ryuukk.dev — 2023-09-23T14:48:20Z
The following code:
https://gist.github.com/ryuukk/4f526503cd24f4f5e4b16ef823b523d1
(i tried to strip as much code as possible)
Fail to compile:
```
_.d(1): Error: `TypeInfo` cannot be used with -betterC
struct InvBoneBindInfo
^
```
dmd: `dmd -betterC -inline -verrors=context -run _.d`
version: 2.105.2
Found the cause:
Here reduced test:
```D
struct InvBoneBindInfo
{
}
struct Test(Value)
{
void test()
{
auto t = Value.init;
}
}
extern(C) void main()
{
Test!(InvBoneBindInfo[32]) test;
test.test();
}
```
The problem is ``Value.init``, because value is a static array
Comment #3 by razvan.nitu1305 — 2023-11-23T11:44:06Z
The issue still happen with the latest master, i probably forgot the ``-inline`` when i said that i couldn't reproduce it
Reduced test above still trigger the issue
Comment #5 by dlang-bot — 2024-11-02T18:41:57Z
@bangbangsheshotmedown created dlang/dmd pull request #17049 "Fix bugzilla issue 24153 - Inliner breaks -betterC by requiring TypeInfo" fixing this issue:
- Fix bugzilla issue 24153 - Inliner breaks -betterC by requiring TypeInfo
https://github.com/dlang/dmd/pull/17049
Comment #6 by dlang-bot — 2024-11-03T07:35:41Z
dlang/dmd pull request #17049 "Fix bugzilla issue 24153 - Inliner breaks -betterC by requiring TypeInfo" was merged into master:
- 3013c15815a2ba606d511b3678fdd9ea1fdb66b5 by bangbangsheshotmedown:
Fix bugzilla issue 24153 - Inliner breaks -betterC by requiring TypeInfo
https://github.com/dlang/dmd/pull/17049