https://issues.dlang.org/show_bug.cgi?id=16081
Issue ID: 16081 Summary: CTFE mistakes &arr for arr in cast Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: ag0ae...@gmail.com Encountered by Era Scarecrow in D.learn: http://forum.dlang.org/post/mzzpcdzuovajqygue...@forum.dlang.org ---- size_t f() { size_t[] arr = [13]; return *(cast(size_t*) &arr); } void main() { import std.stdio; enum ct = f(); auto rt = f(); writeln(ct, " ", rt); } ---- Prints: "13 1". The expected value is 1 for both. A "not supported" error during CTFE would also be acceptable, as happens when &arr is assigned to a variable first. Looks like CTFE mistakes &arr for arr here. --