d: fix ICE at convert_expr(tree_node*, Type*, Type*) (PR101490)
Both the front-end and code generator had a modulo by zero bug when testing if
a conversion from a static array to dynamic array was valid.
PR d/101490
gcc/d/ChangeLog:
* d-codegen.cc (build_array_index): Handle void arrays same as byte.
* d-convert.cc (convert_expr): Handle converting to zero-sized arrays.
* dmd/dcast.c (castTo): Handle casting to zero-sized arrays.
gcc/testsuite/ChangeLog:
* gdc.dg/pr101490.d: New test.
* gdc.test/fail_compilation/fail22144.d: New test.
(cherry picked from commit
c936c39f86c74b3bfc6831f694b3165296c99dc0)