https://issues.dlang.org/show_bug.cgi?id=17287
ZombineDev <petar.p.ki...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|accepts-invalid |ice-on-valid-code CC| |petar.p.ki...@gmail.com Hardware|x86 |All --- Comment #2 from ZombineDev <petar.p.ki...@gmail.com> --- @Stefan It easily comes up in generic code when length is based on some calculation and/or code generation via string mixins For reference see http://docs.algorithm.dlang.io/latest/mir_ndslice_slice.html#Slice and browse through the source code (https://github.com/libmir/mir-algorithm). T[0] is pretty normal if you think about it as struct S { }. If passing around structs without any members works, why wouldn't zero-sized static arrays be ok? Structs without members are invalid in C, but on the contrary are quite common in C++ and similarly D allows them for a reason. See also http://en.cppreference.com/w/cpp/language/ebo, https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html and http://dlang.org/spec/arrays.html: > A static array with a dimension of 0 is allowed, but no space is allocated > for it. It's useful as the last member of a variable length struct, or as the > degenerate case of a template expansion. --