← Back to index
|
Original Bugzilla link
Bug 10568 – CTFE rejects function pointer safety casts
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-08T03:39:00Z
Last change time
2013-07-24T04:57:46Z
Assigned to
nobody
Creator
clugdbug
Comments
Comment #0
by clugdbug — 2013-07-08T03:39:29Z
@safe void safetyDance() {} int isItSafeToDance() { void function() @trusted yourfriends = &safetyDance; void function() @safe nofriendsOfMine = yourfriends; return 1; } static assert(isItSafeToDance()); --- bug.d(6): Error: reinterpreting cast from @trusted void()* to @safe void()* is not supported in CTFE bug.d(10): called from here: isItSafeToDance() bug.d(10): while evaluating: static assert(isItSafeToDance())
Comment #1
by github-bugzilla — 2013-07-08T04:49:34Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/b60c0d71a7cff7c0a0bd33df13fd591caceda911
Fix issue 10568 CTFE rejects function pointer safety casts We need to check for function pointer covariance
https://github.com/D-Programming-Language/dmd/commit/7258322abba09d2347401be15c0b6a8c75fed34f
Merge pull request #2319 from donc/ctfeCastSafety Fix issue 10568 CTFE rejects function pointer safety casts