https://gcc.gnu.org/g:8555ca0b832e8136858e27633dad882d8dfd17cb
commit r16-6637-g8555ca0b832e8136858e27633dad882d8dfd17cb Author: Eric Botcazou <[email protected]> Date: Mon Dec 22 10:52:01 2025 +0100 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: --- gcc/ada/exp_ch4.adb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 3c5c92664382..f5f03bac57bd 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;
