]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Only assign type to op if compatible
authorGhjuvan Lacambre <lacambre@adacore.com>
Fri, 18 Jun 2021 15:18:41 +0000 (17:18 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 20 Sep 2021 12:31:30 +0000 (12:31 +0000)
gcc/ada/

* sem_ch4.adb (Find_Non_Universal_Interpretations): Check if
types are compatible before adding interpretation.

gcc/ada/sem_ch4.adb

index c052022886ad9148c22cc0804df0daadb4eae274..553e194a0b5901a92e52c7e0f104599af6985a05 100644 (file)
@@ -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;