diff options
author | Richard Kenner <kenner@adacore.com> | 2021-03-05 17:28:52 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-06-17 10:32:11 -0400 |
commit | 24c554da57b6aa81fb311556ed8ec1c609befd45 (patch) | |
tree | bcbb8afef9267d88100780e3c2f279bfdb8a9c8f | |
parent | 79495262f3da3d4d9fda842eb90af365173bd954 (diff) | |
download | gcc-24c554da57b6aa81fb311556ed8ec1c609befd45.zip gcc-24c554da57b6aa81fb311556ed8ec1c609befd45.tar.gz gcc-24c554da57b6aa81fb311556ed8ec1c609befd45.tar.bz2 |
[Ada] Look at Others_Discrete_Choices for N_Others_Choice
gcc/ada/
* exp_util.adb (Expand_Static_Predicates_In_Choices): Handle
Others_Discrete_Choices in N_Others_Choice.
-rw-r--r-- | gcc/ada/exp_util.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 860525d..c2cdb4c 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -5322,7 +5322,7 @@ package body Exp_Util is procedure Expand_Static_Predicates_In_Choices (N : Node_Id) is pragma Assert (Nkind (N) in N_Case_Statement_Alternative | N_Variant); - Choices : constant List_Id := Discrete_Choices (N); + Choices : List_Id := Discrete_Choices (N); Choice : Node_Id; Next_C : Node_Id; @@ -5330,6 +5330,13 @@ package body Exp_Util is C : Node_Id; begin + -- If this is an "others" alternative, we need to process any static + -- predicates in its Others_Discrete_Choices. + + if Nkind (First (Choices)) = N_Others_Choice then + Choices := Others_Discrete_Choices (First (Choices)); + end if; + Choice := First (Choices); while Present (Choice) loop Next_C := Next (Choice); |