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