diff mbox series

[Ada] Fix small glitch in Expand_N_Full_Type_Declaration

Message ID 20220517082747.GA1089938@adacore.com
State New
Headers show
Series [Ada] Fix small glitch in Expand_N_Full_Type_Declaration | expand

Commit Message

Pierre-Marie de Rodat May 17, 2022, 8:27 a.m. UTC
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 mbox series

Patch

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)))