[Ada] Bad handling of 'Valid_Scalars and arrays
authorArnaud Charlet <charlet@adacore.com>
Wed, 2 Dec 2020 09:15:36 +0000 (04:15 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 28 Apr 2021 09:37:54 +0000 (05:37 -0400)
commitce32ccfc25a1b12ff9f42b1d9b6150ea128a26ec
treee4f517ec1acc382b979227ce2e6056a5dae1a4a9
parent4c118453c7c6db1e24145401abf70d286133de3f
[Ada] Bad handling of 'Valid_Scalars and arrays

gcc/ada/

* exp_attr.adb (Build_Array_VS_Func, Build_Record_VS_Func,
Expand_N_Attribute_Reference): Use Get_Fullest_View instead of
Validated_View.
(Build_Record_VS_Func): Adjust to keep using Validated_View.
(Expand_N_Attribute_Reference) [Valid]: Use
Small_Integer_Type_For to allow for more compile time
evaluations.
* sem_util.adb (Cannot_Raise_Constraint_Error): Add more precise
support for N_Indexed_Component and fix support for
N_Selected_Component which wasn't completely safe.
(List_Cannot_Raise_CE): New.
* libgnat/i-cobol.adb (Valid_Packed): Simplify test to address
new GNAT warning.
gcc/ada/exp_attr.adb
gcc/ada/libgnat/i-cobol.adb
gcc/ada/sem_util.adb