Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 14207 - [CTFE] ICE on unsupported reinterpret cast in compi…
…le time The problematic code in isSafePointerCast() was introduced in pull 2612 to fix regression 10687.
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ctfe14207.d(13): Error: cannot convert &immutable(ulong) to ubyte[8]* at compile time | ||
fail_compilation/ctfe14207.d(18): called from here: nativeToBigEndian() | ||
fail_compilation/ctfe14207.d(22): called from here: digest() | ||
--- | ||
*/ | ||
|
||
ubyte[8] nativeToBigEndian() | ||
{ | ||
immutable ulong res = 1; | ||
return *cast(ubyte[8]*) &res; | ||
} | ||
|
||
auto digest() | ||
{ | ||
ubyte[8] bits = nativeToBigEndian(); | ||
return bits; | ||
} | ||
|
||
enum h = digest(); |