]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Accept aggregates with OTHERS clause in unchecked type conversions
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 10 Jan 2023 23:22:03 +0000 (00:22 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 15 May 2023 09:36:42 +0000 (11:36 +0200)
When inlining subprogram calls in GNATprove mode, the actual parameter
is wrapped in an unchecked conversion. If this actual parameter is an
aggregate OTHERS clause, then the type of unchecked conversion allows us
to resolve this clause (just like for aggregates wrapped in a qualified
expression).

Previously such aggregates were rejected, which caused spurious and
cryptic errors; now they are accepted.

gcc/ada/

* sem_aggr.adb (Resolve_Aggregate): Accept aggregates with OTHERS
appearing inside unchecked conversions.

gcc/ada/sem_aggr.adb

index 3ebb30d64ed032249071e7c1e303d7950c3b13c1..2ccfe6dcaef01e0958d525cd505dac3d091dadfa 100644 (file)
@@ -1180,6 +1180,7 @@ package body Sem_Aggr is
                                  | N_Component_Declaration
                                  | N_Parameter_Specification
                                  | N_Qualified_Expression
+                                 | N_Unchecked_Type_Conversion
                                  | N_Reference
                                  | N_Aggregate
                                  | N_Extension_Aggregate