aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2024-06-06 09:40:54 +0200
committerMarc Poulhiès <poulhies@adacore.com>2024-06-21 10:34:22 +0200
commit036a37eae64ba6ff73a913fa2f93fc888e4b28b9 (patch)
treedc019717c5a79ad570d649b795a3d6157b45c0f4 /gcc/ada
parent728c1454c2b405543687d80238d8af4f12bcdca2 (diff)
downloadgcc-036a37eae64ba6ff73a913fa2f93fc888e4b28b9.zip
gcc-036a37eae64ba6ff73a913fa2f93fc888e4b28b9.tar.gz
gcc-036a37eae64ba6ff73a913fa2f93fc888e4b28b9.tar.bz2
ada: Apply fixes to Examine_Array_Bounds
gcc/ada/ * sem_util.adb (Examine_Array_Bounds): Add missing return statements. Fix criterion for a string literal being empty.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_util.adb4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 4cdac94..4dde5f3 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -8157,13 +8157,15 @@ package body Sem_Util is
if not Is_Constrained (Typ) then
All_Static := False;
Has_Empty := False;
+ return;
-- A string literal has static bounds, and is not empty as long as it
-- contains at least one character.
elsif Ekind (Typ) = E_String_Literal_Subtype then
All_Static := True;
- Has_Empty := String_Literal_Length (Typ) > 0;
+ Has_Empty := String_Literal_Length (Typ) = 0;
+ return;
end if;
-- Assume that all bounds are static and not empty