diff options
author | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-12 00:32:42 +0000 |
---|---|---|
committer | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-10-12 00:32:42 +0000 |
commit | 3c53c7f38e3d748d42e6964fb58d01c4e02708c2 (patch) | |
tree | 9d947b9dfef4c685e8914d1058c3c40d9c717f0d | |
parent | 09009ce9f66d0c2ebd5216c3b26fa658bf404ec0 (diff) | |
download | gcc-3c53c7f38e3d748d42e6964fb58d01c4e02708c2.tar.gz |
* sem_eval.adb (Compare_Fixup): get the bounds of a String_Literal
properly. Fixes regression on ACATS C34005G.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46216 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_eval.adb | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 942f41849b9..2ab878c5743 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 dde46a4b487..4a26a7ebcbb 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); |