From: Piotr Trojanek <troja...@adacore.com> Code cleanup; semantics is unaffected.
gcc/ada/ChangeLog: * exp_ch4.adb: (Expand_N_Not_In): Preserve Alternatives in expanded membership operator just like preserving Right_Opnd (though only one of these fields is present at a time). * par-ch4.adb (P_Membership_Test): Remove redundant setting of fields to their default values. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 9 +++------ gcc/ada/par-ch4.adb | 4 +--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index a7f759fc8a5..82978c775cf 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -7727,12 +7727,9 @@ package body Exp_Ch4 is Make_Op_Not (Loc, Right_Opnd => Make_In (Loc, - Left_Opnd => Left_Opnd (N), - Right_Opnd => Right_Opnd (N)))); - - -- If this is a set membership, preserve list of alternatives - - Set_Alternatives (Right_Opnd (N), Alternatives (Original_Node (N))); + Left_Opnd => Left_Opnd (N), + Right_Opnd => Right_Opnd (N), + Alternatives => Alternatives (N)))); -- We want this to appear as coming from source if original does (see -- transformations in Expand_N_In). diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 3f8d1f1d2e3..648a4cf6464 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -3926,7 +3926,6 @@ package body Ch4 is if Token = Tok_Vertical_Bar then Error_Msg_Ada_2012_Feature ("set notation", Token_Ptr); Set_Alternatives (N, New_List (Alt)); - Set_Right_Opnd (N, Empty); -- Loop to accumulate alternatives @@ -3940,8 +3939,7 @@ package body Ch4 is -- Not set case else - Set_Right_Opnd (N, Alt); - Set_Alternatives (N, No_List); + Set_Right_Opnd (N, Alt); end if; end P_Membership_Test; -- 2.43.0