[gcc r12-3692] [Ada] Only assign type to op if compatible

Pierre-Marie de Rodat pmderodat@gcc.gnu.org
Mon Sep 20 13:04:07 GMT 2021


https://gcc.gnu.org/g:0f5356c4bfeb42fcab6e2681709a386abf2c0ba1

commit r12-3692-g0f5356c4bfeb42fcab6e2681709a386abf2c0ba1
Author: Ghjuvan Lacambre <lacambre@adacore.com>
Date:   Fri Jun 18 17:18:41 2021 +0200

    [Ada] Only assign type to op if compatible
    
    gcc/ada/
    
            * sem_ch4.adb (Find_Non_Universal_Interpretations): Check if
            types are compatible before adding interpretation.

Diff:
---
 gcc/ada/sem_ch4.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index c052022886a..553e194a0b5 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -6626,7 +6626,7 @@ package body Sem_Ch4 is
                Get_Next_Interp (Index, It);
             end loop;
          end if;
-      else
+      elsif Has_Compatible_Type (R, T1) then
          Add_One_Interp (N, Op_Id, Standard_Boolean, Base_Type (T1));
       end if;
    end Find_Non_Universal_Interpretations;


More information about the Gcc-cvs mailing list