diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-09-12 18:10:59 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-26 11:02:30 +0200 |
commit | 4450567167e126051e3100de682e09f0902a2106 (patch) | |
tree | c3576a27d320410cfff6229e2c21e2fdb1ebc6a6 | |
parent | 2ef56cae72631a7349b4cb2b6bd843f05789e231 (diff) | |
download | gcc-4450567167e126051e3100de682e09f0902a2106.zip gcc-4450567167e126051e3100de682e09f0902a2106.tar.gz gcc-4450567167e126051e3100de682e09f0902a2106.tar.bz2 |
ada: Delay expansion of iterator specification in preanalysis
When preanalysing spec expression (e.g. expression of an expression
function), the name of iterator specification should not be expanded.
This patch simplifies a complicated condition for delaying expansion
within quantified expressions and iterated component associations.
gcc/ada/
* sem_ch5.adb (Analyze_Iterator_Specification): Delay expansion
based on Full_Analysis flag.
-rw-r--r-- | gcc/ada/sem_ch5.adb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 6d07f3d..d0f00b3 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2429,14 +2429,9 @@ package body Sem_Ch5 is if not Is_Entity_Name (Iter_Name) - -- When the context is a quantified expression or iterated component - -- association, the renaming declaration is delayed until the - -- expansion phase if we are doing expansion. - - and then (Nkind (Parent (N)) not in N_Quantified_Expression - | N_Iterated_Component_Association - or else (Operating_Mode = Check_Semantics - and then not GNATprove_Mode)) + -- Do not perform this expansion in preanalysis + + and then Full_Analysis -- Do not perform this expansion when expansion is disabled, where the -- temporary may hide the transformation of a selected component into |