On 10/6/19 11:39 AM, Tam S. B. wrote:
Hi, sorry for chiming in.
IIUC P0388R4 does not allow implicit conversion from `T(*)[]` to `T(*)[N]`. Per
[conv.qual]/3,
A prvalue of type `T1` can be converted to type `T2` if the cv-combined type of
`T1` and `T2` is `T2`.
When T1 is `T(*)[]` and T2 is `T(*)[N]`, the "cv-combined type" is `T(*)[]`,
which is not the same as T2 = `T(*)[N]`, so conversion should not be permitted.
That is to say, either `comp_ptr_ttypes_real` should not use
`comp_array_types`, or `comp_array_types` should be extended to handle this
case correctly.
Also, does this patch permit conversion from `T(*)[N]` to `const T(*)[]`? I
think [conv.qual] allows this conversion, but IIUC `comp_array_types` will
return false in this case, as it uses `same_type_p`.
Agreed.
Jason