]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Type conversion in instance incorrectly rejected.
authorSteve Baird <baird@adacore.com>
Mon, 8 Jul 2024 21:45:55 +0000 (14:45 -0700)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 2 Aug 2024 07:08:05 +0000 (09:08 +0200)
In some cases, a legal type conversion in a generic package is correctly
accepted but the corresponding type conversion in an instance of the generic
is incorrectly rejected.

gcc/ada/

* sem_res.adb (Valid_Conversion): Test In_Instance instead of
In_Instance_Body.

gcc/ada/sem_res.adb

index 8a18430ff5859b7beaeceb7bd84b2ec33da11cba..9a3b6ddbb53426ee752c52a220a8567bd95b4df4 100644 (file)
@@ -14697,7 +14697,7 @@ package body Sem_Res is
 
       --  If it was legal in the generic, it's legal in the instance
 
-      elsif In_Instance_Body then
+      elsif In_Instance then
          return True;
 
       --  Ignore privacy for streaming or Put_Image routines