From: Steve Baird Date: Mon, 8 Jul 2024 21:45:55 +0000 (-0700) Subject: ada: Type conversion in instance incorrectly rejected. X-Git-Tag: releases/gcc-14.3.0~1015 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aff061f0f51e2547b04c8d24c3b0dc713a6d62a3;p=thirdparty%2Fgcc.git ada: Type conversion in instance incorrectly rejected. 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. --- diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 075c0d85ccd9..a1d5fe4ff541 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -14621,7 +14621,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