https://gcc.gnu.org/g:3288028d0db7ef2152dc62056516d35722fb6590

commit r13-9105-g3288028d0db7ef2152dc62056516d35722fb6590
Author: Steve Baird <ba...@adacore.com>
Date:   Mon Jul 8 14:45:55 2024 -0700

    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:
---
 gcc/ada/sem_res.adb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index dce35a71ddaa..01ff1f9a97e1 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -14672,7 +14672,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

Reply via email to