The original node is not guaranteed to also be an
N_Full_Type_Declaration, so the code needs to look into the node itself.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * exp_ch3.adb (Expand_N_Full_Type_Declaration): Look into N.
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -6102,8 +6102,7 @@ package body Exp_Ch3 is
          Par_Id := Base_Type (Full_View (Par_Id));
       end if;
 
-      if Nkind (Type_Definition (Original_Node (N))) =
-                                                   N_Derived_Type_Definition
+      if Nkind (Type_Definition (N)) = N_Derived_Type_Definition
         and then not Is_Tagged_Type (Def_Id)
         and then Present (Freeze_Node (Par_Id))
         and then Present (TSS_Elist (Freeze_Node (Par_Id)))


Reply via email to