From: Piotr Trojanek Date: Mon, 7 Dec 2020 15:54:06 +0000 (+0100) Subject: [Ada] Extend compile-time evaluation in case statements to all objects X-Git-Tag: basepoints/gcc-13~8125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=416d48eba3a3809757ef7c9d35dd0ac0c9795be4;p=thirdparty%2Fgcc.git [Ada] Extend compile-time evaluation in case statements to all objects gcc/ada/ * sem_ch5.adb (Analyze_Case_Statement): Extend optimization to all objects; fix typo in comment. --- diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 04fc9806c58a..0869bea23442 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1456,7 +1456,7 @@ package body Sem_Ch5 is if Is_Entity_Name (Exp) then Ent := Entity (Exp); - if Is_Assignable (Ent) then + if Is_Object (Ent) then if List_Length (Choices) = 1 and then Nkind (First (Choices)) in N_Subexpr and then Compile_Time_Known_Value (First (Choices)) @@ -1475,7 +1475,7 @@ package body Sem_Ch5 is end if; end if; - -- Case where expression is not an entity name of a variable + -- Case where expression is not an entity name of an object Analyze_Statements (Statements (Alternative)); end Process_Statements;