http://d.puremagic.com/issues/show_bug.cgi?id=3173
Don <clugd...@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch OS/Version|Linux |All --- Comment #2 from Don <clugd...@yahoo.com.au> 2009-08-31 23:56:38 PDT --- Cause: default case for getIntRange() assumes it's an integer, which isn't true if there's casting. Solution: if not an integer, assume it could contain anything. PATCH: cast.c, line 1902 (in Walter's private beta of DMD2.032): IntRange Expression::getIntRange() { IntRange ir; ir.imin = 0; if (type->isintegral()) ir.imax = type->sizemask(); else ir.imax = 0xFFFFFFFFFFFFFFFFULL; // assume the worst return ir; } =========== TEST CASES FOR TEST SUITE =========== struct S3173{ double z; } int bug3173(int x) { return x; } S3173 s3173; double e3173 = 4; const double d3173 = 4; // invalid, but should not ICE static assert(!is(typeof(bug3173(cast(long)e3173)))); static assert(!is(typeof(bug3173(cast(long)s3173)))); static assert(!is(typeof(bug3173(cast(long)3.256679e30)))); // And two valid cases: static assert(is(typeof(bug3173(cast(long)d3173)))); static assert(is(typeof(bug3173(cast(long)3.256679e4)))); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------