mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-12 11:27:06 +08:00
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
This commit is contained in:
parent
4fa964a692
commit
c3de5c4c1b
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user