diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-10-07 21:58:58 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-11-04 14:47:28 +0100 |
commit | 50bd9f4e6fc7ac84b5d0f29b76dff1f82381ee38 (patch) | |
tree | 998d8ae370d27ce4647cdf003100bb08504da5d0 /gcc/ada/sem_ch6.adb | |
parent | 64b10736a16c901701e4c97ce71504791ba9bbea (diff) | |
download | gcc-50bd9f4e6fc7ac84b5d0f29b76dff1f82381ee38.zip gcc-50bd9f4e6fc7ac84b5d0f29b76dff1f82381ee38.tar.gz gcc-50bd9f4e6fc7ac84b5d0f29b76dff1f82381ee38.tar.bz2 |
ada: Simplify detection of controlling formals
When detecting controlling formals we are only interested in formal
parameters and not in other entities.
gcc/ada/
* sem_ch6.adb (Controlling_Formal): Iterate with First/Next_Formal
and not with First/Next_Entity.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 228adcf..d28de10 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -10711,13 +10711,13 @@ package body Sem_Ch6 is E : Entity_Id; begin - E := First_Entity (Prim); + E := First_Formal (Prim); while Present (E) loop - if Is_Formal (E) and then Is_Controlling_Formal (E) then + if Is_Controlling_Formal (E) then return E; end if; - Next_Entity (E); + Next_Formal (E); end loop; return Empty; |