Skip to content

Commit

Permalink
Questionable tests for pointer to float conversion are compiler-specific
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jan 17, 2016
1 parent 4849908 commit df6ac86
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions test/runnable/casting.d
Expand Up @@ -211,19 +211,22 @@ void test14218()
assert(x == 0); // false, '0x00'
}

// Questionable but currently accepted
foreach (To; Seq!( float, double, real,
ifloat, idouble, ireal))
version (DigitalMars)
{
auto x = cast(To)null;
assert(x == 0); // 0i
}
// Questionable but currently accepted by DMD (but not GDC).
foreach (To; Seq!( float, double, real,
ifloat, idouble, ireal))
{
auto x = cast(To)null;
assert(x == 0); // 0i
}

// Internal error: backend/el.c in el_long()
//foreach (To; Seq!(cfloat, cdouble, creal))
//{
// static assert(!__traits(compiles, { auto x = cast(To)null; }));
//}
// Internal error: backend/el.c in el_long()
//foreach (To; Seq!(cfloat, cdouble, creal))
//{
// static assert(!__traits(compiles, { auto x = cast(To)null; }));
//}
}
}

/***************************************************/
Expand Down

0 comments on commit df6ac86

Please sign in to comment.