From: Eric Botcazou Date: Mon, 22 Dec 2025 09:52:01 +0000 (+0100) Subject: ada: Fix small oversight in accessibility change X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8555ca0b832e8136858e27633dad882d8dfd17cb;p=thirdparty%2Fgcc.git ada: Fix small oversight in accessibility change The change incorrectly turned a Comes_From_Source test initially done on the type conversion node, into a test on its parent node, that is used to decide whether to apply an accessibility check to the type conversion. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_N_Type_Conversion): Restore Comes_From_Source test on N itself instead of its parent node. --- diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 3c5c9266438..f5f03bac57b 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -12364,10 +12364,10 @@ package body Exp_Ch4 is or else Attribute_Name (Original_Node (N)) = Name_Access) and then not No_Dynamic_Accessibility_Checks_Enabled (N) then - if Nkind (Parent (N)) in N_Function_Call - | N_Parameter_Association - | N_Procedure_Call_Statement - and then not Comes_From_Source (Parent (N)) + if not Comes_From_Source (N) + and then Nkind (Parent (N)) in N_Function_Call + | N_Parameter_Association + | N_Procedure_Call_Statement and then Is_Tagged_Type (Designated_Type (Target_Type)) then null;