diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-11-13 16:37:32 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-26 10:49:36 +0100 |
commit | 936f9f1d159bd6ef3b1e25e72a6abd1c0fff10b1 (patch) | |
tree | c088c7cd0ffd3c148050f99e83e50e882c299378 /gcc/ada/sem_res.adb | |
parent | e14ec5681e780626f59ef7b37d0648c2d6992a14 (diff) | |
download | gcc-936f9f1d159bd6ef3b1e25e72a6abd1c0fff10b1.zip gcc-936f9f1d159bd6ef3b1e25e72a6abd1c0fff10b1.tar.gz gcc-936f9f1d159bd6ef3b1e25e72a6abd1c0fff10b1.tar.bz2 |
ada: Clean up previous change
gcc/ada/ChangeLog:
* sem_res.adb (Valid_Conversion): Do not initialize Opnd_Type before
calling Get_Corresponding_Mutably_Tagged_Type_If_Present.
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 9cd1db1..5ca2061 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -13803,7 +13803,7 @@ package body Sem_Res is Report_Errs : Boolean := True) return Boolean is Target_Type : constant Entity_Id := Base_Type (Target); - Opnd_Type : Entity_Id := Etype (Operand); + Opnd_Type : Entity_Id; Inc_Ancestor : Entity_Id; function Conversion_Check @@ -14270,14 +14270,10 @@ package body Sem_Res is begin Check_Parameterless_Call (Operand); - if Is_Overloaded (Operand) then - if Is_Ambiguous_Operand (Operand) then - return False; - end if; - - -- The Etype may have been updated by Is_Ambiguous_Operand - - Opnd_Type := Etype (Operand); + if Is_Overloaded (Operand) + and then Is_Ambiguous_Operand (Operand) + then + return False; end if; -- When we encounter a class-wide equivalent type used to represent @@ -14285,7 +14281,7 @@ package body Sem_Res is -- at the class-wide mutably tagged type instead. Opnd_Type := - Get_Corresponding_Mutably_Tagged_Type_If_Present (Opnd_Type); + Get_Corresponding_Mutably_Tagged_Type_If_Present (Etype (Operand)); -- Deal with conversion of integer type to address if the pragma -- Allow_Integer_Address is in effect. We convert the conversion to |