Bug 24113 – Eager failure of TypeInfo in _d_newclassT even if not used in -betterC

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2023-08-27T07:25:14Z
Last change time
2024-12-13T19:30:38Z
Keywords
betterC
Assigned to
No Owner
Creator
Richard (Rikki) Andrew Cattermole
Moved to GitHub: dmd#20326 →

Comments

Comment #0 by alphaglosined — 2023-08-27T07:25:14Z
Linux Mint 21.2, dmd 2.105. This works on dmd with dmd 2.105-beta1 ``` /usr/include/dmd/druntime/import/core/lifetime.d(2761,42): Error: `TypeInfo` cannot be used with -betterC ``` This corresponds to the function ``_d_newclassT``. It seems ``_d_newclassT`` is imported by object.d via ```d public import core.lifetime : _d_newitemT; ``` Versioning out the import from object.d stops this error. This is rather curious as classes should generate a different error if it were used and that hook function is templated. Replacing it with a deprecated function, results in no deprecations.
Comment #1 by razvan.nitu1305 — 2023-09-06T13:46:19Z
Could you provide a test case? I don't know how to reproduce this.
Comment #2 by alphaglosined — 2023-09-06T13:58:11Z
I could not come up with a symbol that triggered it. Without the import, the error went away, that is as close as I could get. This is the project code: https://github.com/Project-Sidero/basic_memory/commit/9acbcc1a91a5927aaa9a164ff65118be719f24b5 git clone & dub build It'll exhibit it at that patch (I just verified it, by removing my version'd out import patch from object.d). ```d version(D_BetterC) { } else { public import core.lifetime : _d_delstructImpl; public import core.lifetime : _d_newThrowable; public import core.lifetime : _d_newclassT; public import core.lifetime : _d_newclassTTrace; public import core.lifetime : _d_newitemT; } ```
Comment #3 by robert.schadek — 2024-12-13T19:30:38Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20326 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB