aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2001-10-12 00:32:42 +0000
committerGeert Bosch <bosch@gcc.gnu.org>2001-10-12 02:32:42 +0200
commitc3de5c4c1b485db9b8ac9573aa6c812de396749d (patch)
tree9d947b9dfef4c685e8914d1058c3c40d9c717f0d
parent4fa964a6922315292c8228bd810fbb5d3c9485ba (diff)
downloadgcc-c3de5c4c1b485db9b8ac9573aa6c812de396749d.zip
gcc-c3de5c4c1b485db9b8ac9573aa6c812de396749d.tar.gz
gcc-c3de5c4c1b485db9b8ac9573aa6c812de396749d.tar.bz2
sem_eval.adb (Compare_Fixup): get the bounds of a String_Literal properly.
* sem_eval.adb (Compare_Fixup): get the bounds of a String_Literal properly. Fixes regression on ACATS C34005G. From-SVN: r46216
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_eval.adb13
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 942f418..2ab878c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-11 Ed Schonberg <schonber@gnat.com>
+
+ * sem_eval.adb (Compare_Fixup): get the bounds of a String_Literal
+ properly. Fixes regression on ACATS C34005G.
+
2001-10-11 Robert Dewar <dewar@gnat.com>
* sem_ch5.adb (Analyze_Iteration_Scheme): Suppress warning on null
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index dde46a4..4a26a7e 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.291 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
@@ -450,6 +450,17 @@ package body Sem_Eval is
return N;
end if;
+ if Ekind (Xtyp) = E_String_Literal_Subtype then
+ if Attribute_Name (N) = Name_First then
+ return String_Literal_Low_Bound (Xtyp);
+
+ else -- Attribute_Name (N) = Name_Last
+ return Make_Integer_Literal (Sloc (N),
+ Intval => Intval (String_Literal_Low_Bound (Xtyp))
+ + String_Literal_Length (Xtyp));
+ end if;
+ end if;
+
-- Find correct index type
Indx := First_Index (Xtyp);