]> 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)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 14 Oct 2024 10:20:17 +0000 (12:20 +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/
PR ada/114593
* sem_res.adb (Valid_Conversion): Test In_Instance instead of
In_Instance_Body.

gcc/ada/sem_res.adb

index 09a2d8adb5072e8d49163aa0ab39531174746b75..7dde7538734e7eb77288b05945e611150582c2ba 100644 (file)
@@ -14273,7 +14273,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;
 
       --  If both are tagged types, check legality of view conversions