aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-12-07 16:54:06 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-04-28 05:37:58 -0400
commit416d48eba3a3809757ef7c9d35dd0ac0c9795be4 (patch)
tree7717fd26c7ad97cc793445f622cc027452c06f95
parent7458323aa60cc9a42bed8d029059e5ebd33bafb9 (diff)
downloadgcc-416d48eba3a3809757ef7c9d35dd0ac0c9795be4.zip
gcc-416d48eba3a3809757ef7c9d35dd0ac0c9795be4.tar.gz
gcc-416d48eba3a3809757ef7c9d35dd0ac0c9795be4.tar.bz2
[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.
-rw-r--r--gcc/ada/sem_ch5.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 04fc980..0869bea 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;