diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2023-11-20 08:58:52 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-11-30 11:12:49 +0100 |
commit | 8f9956fc5cdc1eef1260468ee503b5aa8fddd40c (patch) | |
tree | 0c94d1961e4a7ed96312c4fdbbca96c7eae0b479 /gcc/ada/sem_res.adb | |
parent | 262229e1e61c5130c7d5f1b4fa4e77ff60c9bc86 (diff) | |
download | gcc-8f9956fc5cdc1eef1260468ee503b5aa8fddd40c.zip gcc-8f9956fc5cdc1eef1260468ee503b5aa8fddd40c.tar.gz gcc-8f9956fc5cdc1eef1260468ee503b5aa8fddd40c.tar.bz2 |
ada: Rework fix for wrong finalization of qualified aggregate in allocator
The problem is that there is no easy method to insert an action after an
arbitrary node in the tree, so the original fix does not correctly work
when the allocator is nested in another expression.
Therefore this moves the burden of the insertion from Apply_Predicate_Check
to Expand_Allocator_Expression and restricts the new processing to the case
where it is really required.
gcc/ada/
* checks.ads (Apply_Predicate_Check): Add Deref boolean parameter.
* checks.adb (Apply_Predicate_Check): Revert latest change. Use
Loc local variable to hold the source location. Use a common code
path for the generic processing and make a dereference if Deref is
True.
* exp_ch4.adb (Expand_Allocator_Expression): Compute Aggr_In_Place
earlier. If it is true, do not call Apply_Predicate_Check on the
expression on entry but on the temporary on exit with a
dereference.
* sem_res.adb (Resolve_Actuals): Add explicit parameter
association in call to Apply_Predicate_Check.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 8e5d351..c684075 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -4735,7 +4735,7 @@ package body Sem_Res is -- leads to an infinite recursion. if Predicate_Tests_On_Arguments (Nam) then - Apply_Predicate_Check (A, F_Typ, Nam); + Apply_Predicate_Check (A, F_Typ, Fun => Nam); end if; -- Apply required constraint checks |