From: Piotr Trojanek Date: Thu, 24 Apr 2025 14:56:20 +0000 (+0200) Subject: ada: Ignore unchecked type conversions while getting enclosing object X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3e3ac6fa293c7798a28602da537d9c82468aed5;p=thirdparty%2Fgcc.git ada: Ignore unchecked type conversions while getting enclosing object This patch both makes GNAT emit warnings on unused assignments where previously they were suppressed for obscure reasons and synchronizes routine Get_Enclosing_Object with a similar routine in GNATprove (which differs in handling of explicit dereferences). gcc/ada/ChangeLog: * sem_util.adb (Get_Enclosing_Object): Traverse unchecked type conversions since they from the compiler and should be transparent for semantic reasoning. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 3c2a776ce36..127728ab601 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10314,7 +10314,9 @@ package body Sem_Util is => return Get_Enclosing_Object (Prefix (N)); - when N_Type_Conversion => + when N_Type_Conversion + | N_Unchecked_Type_Conversion + => return Get_Enclosing_Object (Expression (N)); when others =>