]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Implement RM 4.5.7(10/3) name resolution rule
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 20 Oct 2022 18:41:08 +0000 (20:41 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 8 Nov 2022 08:35:01 +0000 (09:35 +0100)
commit59ad8b684dd67e171141761f520c6a2ec70e5d6c
treea2b81e2d26a7b41318cebd02b22b90fe296e96e4
parentf1668c3d35b1031fa3ee266b6c3292e53344d315
ada: Implement RM 4.5.7(10/3) name resolution rule

This rule deals with the specific case of a conditional expression that is
the operand of a type conversion and effectively distributes the conversion
to the dependent expressions with the help of the dynamic semantics.

gcc/ada/

* sem_ch4.adb (Analyze_Case_Expression): Compute the
interpretations of the expression only at the end of the analysis,
but skip doing it if it is the operand of a type conversion.
(Analyze_If_Expression): Likewise.
* sem_res.adb (Resolve): Deal specially with conditional
expression that is the operand of a type conversion.
(Resolve_Dependent_Expression): New procedure.
(Resolve_Case_Expression): Call Resolve_Dependent_Expression.
(Resolve_If_Expression): Likewise.
(Resolve_If_Expression.Apply_Check): Take result type as
parameter.
(Resolve_Type_Conversion): Do not warn about a redundant
conversion when the operand is a conditional expression.
gcc/ada/sem_ch4.adb
gcc/ada/sem_res.adb