February 09, 2012 [Issue 7472] New: __traits compiles/ is(typeof) don't work for invalid type casts. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7472 Summary: __traits compiles/ is(typeof) don't work for invalid type casts. Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: timon.gehr@gmx.ch --- Comment #0 from timon.gehr@gmx.ch 2012-02-09 09:55:47 PST --- DMD 2.057 and 2.058head void main(){ class X{} X x; static assert(!__traits(compiles, cast(int)x));// assertion failure int y = cast(int)x; // compile error } Apparently casts are checked for validity too late. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 10, 2012 [Issue 7472] __traits compiles/ is(typeof) don't work for invalid type casts. | ||||
---|---|---|---|---|
| ||||
Posted in reply to timon.gehr@gmx.ch | http://d.puremagic.com/issues/show_bug.cgi?id=7472 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid CC| |yebblies@gmail.com Version|D2 |D1 & D2 --- Comment #1 from yebblies <yebblies@gmail.com> 2012-02-10 16:58:52 EST --- This happens because only some checking of casts is done in the frontend, the rest is done in the glue layer. (e2ir.c CastExp::toElem) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation