https://issues.dlang.org/show_bug.cgi?id=22877
Steven Dwy <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |[email protected] Resolution|FIXED |--- --- Comment #3 from Steven Dwy <[email protected]> --- With this fix sizeof an address of a string literal is also the length of the string: ``` const int s1 = sizeof("aa"); _Static_assert(s1 == 3, ""); const int s2 = sizeof(&"aa"); _Static_assert(s2 == sizeof(void*), ""); // fails ``` Additionally, the following invalid code is now accepted: ``` char(**s1)[3] = &(&"aa"); char(***s2)[3] = &(&(&"aa")); // and so on ``` --
