Bug 11438 – Internal error: ..\ztc\cod4.c 358 from "alias this" and a cast

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-04T09:22:00Z
Last change time
2015-04-04T12:16:53Z
Keywords
ice
Assigned to
nobody
Creator
sturtivant

Attachments

IDFilenameSummaryContent-TypeSize
1286bug.dCode as above, with commentaryapplication/octet-stream554

Comments

Comment #0 by sturtivant — 2013-11-04T09:22:40Z
Created attachment 1286 Code as above, with commentary Here's a minimal example of the problem, extracted and simplified laboriously from real code. I only verified it on Windows and Linux, see below for details. struct blah {} struct blah_ptr { blah* ptr; alias ptr this; } void f() { int irrelevant; blah* bptr = cast(blah_ptr)&irrelevant; } /* DMD32 D Compiler v2.063.2 (Windows) DMD64 D Compiler v2.063.2 (Linux) dmd -c bug.d Internal error: ..\ztc\cod4.c 358 */
Comment #1 by luk.wrzosek — 2015-04-04T12:16:53Z
DMD 2.67 works with the test case: bug.d(10): Error: cannot cast expression & irrelevant of type int* to blah_ptr