@@ -230,7 +230,8 @@ $(H2 $(LNAME2 type-conversions, Type Conversions))
230230
231231$(H3 $(LEGACY_LNAME2 Pointer Conversions, pointer-conversions, Pointer Conversions))
232232
233- $(P $(RELATIVE_LINK2 pointers, Pointers) implicitly convert to `void*`.)
233+ $(P Any $(RELATIVE_LINK2 pointers, pointer) implicitly converts to a `void` pointer -
234+ see below.)
234235
235236 $(P Casting between pointers and non-pointers is allowed. Some pointer casts
236237 are disallowed in $(DDLINK spec/memory-safe-d, Memory-Safe-D-Spec, `@safe` code).)
@@ -245,17 +246,43 @@ $(H3 $(LEGACY_LNAME2 Implicit Conversions, implicit-conversions, Implicit Conver
245246 types as required. The rules for integers are detailed in the next sections.
246247 )
247248
248- $(P An enum can be $(DDSUBLINK spec/enum, named_enums, implicitly converted) to its base
249- type, but going the other way requires an explicit
250- conversion.)
251-
252249 $(UL
253- $(LI All types implicitly convert to $(RELATIVE_LINK2 noreturn, `noreturn`).)
254- $(LI Static and dynamic arrays implicitly convert to $(DDSUBLINK spec/arrays, void_arrays, `void` arrays).)
250+ $(LI An enum can be $(DDSUBLINK spec/enum, named_enums, implicitly converted) to its base
251+ type (but going the other way requires an explicit conversion).)
252+ $(LI $(RELATIVE_LINK2 noreturn, `noreturn`) implicitly converts to any type.)
253+ $(LI Static and dynamic arrays implicitly convert to $(DDSUBLINK spec/arrays, void_arrays, `void` arrays).
254+ The `void` element type for the array may need a
255+ $(DDLINK spec/const3, Type Qualifiers, type qualifier), depending on the source
256+ element type:
257+ )
258+ * An array with non-mutable elements will implicitly convert to `const(void)[]`, but not `void[]`.
259+ * An array with `shared` elements will implicitly convert to `shared(void)[]`, but not `void[]`.
260+ $(LI Any pointer implicitly converts to a void pointer. As for void arrays, the
261+ `void` element type may need a type qualifier.)
255262 $(LI $(DDSUBLINK spec/function, function-pointers-delegates, Function pointers and delegates)
256263 can convert to covariant types.)
257264 )
258265
266+ $(SPEC_RUNNABLE_EXAMPLE_COMPILE
267+ ---
268+ void main()
269+ {
270+ noreturn n;
271+ int i = n;
272+ void* p = &i;
273+
274+ const int[] a;
275+ const(void)[] cv = a;
276+ //void[] va = a; // error
277+ }
278+
279+ void f(int x) pure;
280+ void function(int) fp = &f; // pure is covariant with non-pure
281+ ---
282+ )
283+ $(P See also $(DDSUBLINK spec/const3, implicit_qualifier_conversions,
284+ Implicit Qualifier Conversions).)
285+
259286$(H4 $(LNAME2 class-conversions, Class Conversions))
260287
261288 $(P A derived class can be implicitly converted to its base class, but going
0 commit comments