http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16602

--- Comment #13 from Sebastian Unger <sebunger44 at gmail dot com> ---
I believe the intent behind that is that the qualification of an array type is
identical to that of its element type.

I.e. the statement here is that an 'array of const ints' is identical to a
'const array of ints' rather than that the latter does not exist.

Thus a 'pointer to array of ints' is perfectly convertible to 'pointer to array
of const ints' which makes perfect sense. Note that this is completely
different from a 'pointer to pointer to int' or any such as has been given in
previous examples.

At the very least GCC should treat it such in Gnu99 mode, as it makes perfect
sense to have the following code compile successfully:


typedef int IntArray[3];

void foo(IntArray const* a);

void bar(IntArray* a)
{
   foo(a);
}

Reply via email to