From: Eric Botcazou Date: Sat, 22 Jan 2022 09:56:05 +0000 (+0100) Subject: [Ada] Fix oversight for case expression in Eval_Integer_Literal X-Git-Tag: basepoints/gcc-14~6976 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6798cad793d9581936f2de76c85a22a5449d7358;p=thirdparty%2Fgcc.git [Ada] Fix oversight for case expression in Eval_Integer_Literal The intent of the entry test is to treat conditional expressions, that is to say if-expression and case-expression, alike and to require that a second condition be true for them. But an N_Case_Expression_Alternative is not an N_Subexpr so this second condition was short-circuited for this node. gcc/ada/ * sem_eval.adb (Eval_Integer_Literal): Fix oversight in entry test. --- diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 2881a148c31..af24de3a869 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -2797,7 +2797,7 @@ package body Sem_Eval is -- Check_Non_Static_Context on an expanded literal may lead to spurious -- and misleading warnings. - if (PK not in N_Subexpr + if (PK not in N_Case_Expression_Alternative | N_Subexpr or else (PK in N_Case_Expression_Alternative | N_If_Expression and then Comes_From_Source (N)))