ada: Missing warning on null-excluding array aggregate component
commit65ab836d402bd2fd5ffa5fbef521c2288d8bbf9b
authorJavier Miranda <miranda@adacore.com>
Tue, 28 Feb 2023 18:20:38 +0000 (28 18:20 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:19 +0000 (25 09:44 +0200)
tree4563682134ac9c7d7b67af44169c7bc64b4b5e5e
parent48d9c15fa8a05a9ac541b1468a8eaa4bf94ff3f6
ada: Missing warning on null-excluding array aggregate component

The compiler does not report warnings on the initialization
of arrays of null-excluding access type components by means
of iterated component association, when the expression
initializing each component is either a conditional
expression or a case expression that may initialize
some component with a null value.

gcc/ada/

* sem_aggr.adb
(Warn_On_Null_Component_Association): New subprogram.
(Empty_Range): Adding missing support for iterated component
association node.
(Resolve_Array_Aggregate): Report warning on iterated component
association that may initialize some component of an array of
null-excluding access type components with a null value.
* exp_ch4.adb
(Expand_N_Expression_With_Actions): Add missing type check since
the subtype of the EWA node and the subtype of the expression
may differ.
gcc/ada/exp_ch4.adb
gcc/ada/sem_aggr.adb