The following program should not raise Program_Error, but does.
procedure p is
procedure xxxx (txt: WIDE_STRING) is
pragma Assert(txt'length > 0, "string is empty");
result: WIDE_STRING(txt'first .. txt'first + 3);
begin
result(txt'first .. txt'first + 3) := "xxxx";
if result(txt'first .. txt'first + 3) /= "xxxx" then
raise program_error;
end if;
end xxxx;
begin
xxxx("_");
end p;
URL: svn://gcc.gnu.org/svn/gcc/tags/gcc_4_1_0_release
Revision: 113107
Linux sonnenregen 2.6.12-10-686-smp #1 SMP Sat Mar 11 16:41:12 UTC 2006 i686
GNU/Linux
--
Summary: Wide_String slice assignment in nested procedure does
not work properly
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bauhaus at futureapps dot de
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27225