Bug 23331 – implicit cast from noreturn crashes compiler in various ways

Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-09-10T20:57:10Z
Last change time
2023-10-14T04:29:52Z
Keywords
backend, pull
Assigned to
No Owner
Creator
Ate Eskola

Comments

Comment #0 by Ajieskola — 2022-09-10T20:57:10Z
Defining any of these three functions in latest master will crash the compiler: -------- auto fun(){return double(new noreturn[](0)[0]);} auto gun(){return double(assert(0));} auto hun(){return int(assert(0));} -------- The underlying reason may or may not be same, since a different assertion trips in the compiler for each, located in different a source file for each of them.
Comment #1 by dlang-bot — 2022-09-30T10:21:24Z
@RazvanN7 updated dlang/dmd pull request #14494 "Fix Issues 23331, 23379 - fix casts involving noreturn" fixing this issue: - Fix Issues 23331, 23379 - fix casts involving noreturn https://github.com/dlang/dmd/pull/14494
Comment #2 by dlang-bot — 2022-12-30T00:29:48Z
@ibuclaw created dlang/dmd pull request #14758 "Revert "Fix Issues 23331, 23379 - fix casts involving noreturn"" mentioning this issue: - Revert "Fix Issues 23331, 23379 - fix casts involving noreturn" This reverts commit eb3eb89664e0bc3b61e59e934b4ba0287024914e. https://github.com/dlang/dmd/pull/14758
Comment #3 by dlang-bot — 2022-12-31T14:27:42Z
dlang/dmd pull request #14758 "Revert "Fix Issues 23331, 23379 - fix casts involving noreturn"" was merged into master: - b8e9e3f29021c6f22233d489e8284165035fa5f5 by Iain Buclaw: Revert "Fix Issues 23331, 23379 - fix casts involving noreturn" This reverts commit eb3eb89664e0bc3b61e59e934b4ba0287024914e. https://github.com/dlang/dmd/pull/14758