Bug 10211 – CTFE: Support casts from S** to D**, if S* -> D* is supported.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-30T00:10:00Z
Last change time
2015-06-09T05:12:02Z
Assigned to
nobody
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2013-05-30T00:10:09Z
int bug10211() { int m = 7; int *x = &m; int **y = &x; assert(**y == 7); uint *p = cast(uint *)x; // OK uint **q = cast(uint **)y; // Rejected return 1; } static assert(bug10211()); -- bug.d(8): Error: reinterpreting cast from int** to uint** is not supported in CTFE bug.d(12): called from here: bug10211() bug.d(12): while evaluating: static assert(bug10211())
Comment #1 by github-bugzilla — 2013-05-31T23:49:25Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2bd6ba3a62072c3c72e5565b80a51d0ed4bc221f Fix bug 10211: CTFE: Allow cast S**->D**, if S*->D* is OK https://github.com/D-Programming-Language/dmd/commit/320e4bd639c11e1d09965bc09f5a9849de9f25f4 Merge pull request #2099 from donc/ctfe10211pointercasts Fix bug 10211: CTFE: Allow cast S**->D**, if S*->D* is OK
Comment #2 by github-bugzilla — 2013-09-13T10:45:57Z