1946 – Compiler crashes on attempt to implicit cast const typedef to non-const.

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1946 - Compiler crashes on attempt to implicit cast const typedef to non-const.
Summary: Compiler crashes on attempt to implicit cast const typedef to non-const.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 critical
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2008年03月26日 06:33 UTC by Neil Vice
Modified: 2015年06月09日 01:14 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Neil Vice 2008年03月26日 06:33:37 UTC
If an attempt is made to implicitly cast a const instance of a typedef of a class to a non-const instance, DMD 2.012 crashes.
The following code causes the compiler to crash:
 class Foo {}
 typedef Foo Test;
 void f(Test test) {}
 void main()
 {
 const Test test;
 f(test);
 }
If "typedef" is replaced with "alias" this does not occur. If "f(Test test)" is declared as "f(in Test test)" this does not occur. If Test is typedef'd to a value-type this does not occur (including structs).
Comment 1 Don 2009年05月14日 06:59:05 UTC
Fixed DMD2.030


AltStyle によって変換されたページ (->オリジナル) /