[Ada] Warn on Unchecked_Conversion to zero-sized array
The compiler usually warns on Unchecked_Conversion between types with
mismatched sizes. This warning is now extended to the case where the
target type is a zero-sized array.
2019-08-20 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_ch13.adb (Is_Null_Array): New function, used to detect the
null array case; used to warn about uncheckedly converting to a
zero-sized array. It is unfortunate that we can't just check
the size, and warn on all cases of converting from a
nonzero-sized type to a zero-sized one. That's because "0" means
two different things: "size is zero" and "size is unknown".
Until we fix that design flaw, we need this more targeted fix.
gcc/testsuite/
* gnat.dg/unchecked_convert14.adb: New testcase.
From-SVN: r274725