This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Fix assignment to null array doesn't raise CE despite warning
- From: Geert Bosch <bosch at darwin dot gnat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 5 Dec 2001 14:35:11 -0500 (EST)
- Subject: [Ada] Fix assignment to null array doesn't raise CE despite warning
2001-12-05 Ed Schonberg <schonber@gnat.com>
* sem_ch3.adb (Analyze_Object_Declaration): If expression is an
aggregate with static wrong size, attach generated Raise node to
declaration.
*** sem_ch3.adb 2001/09/18 20:03:02 1.1354
--- sem_ch3.adb 2001/09/30 17:52:45 1.1355
***************
*** 1593,1598 ****
--- 1593,1603 ----
if not Is_Constrained (T) then
null;
+ elsif Nkind (E) = N_Raise_Constraint_Error then
+ -- Aggregate is statically illegal. Place back in declaration.
+ Set_Expression (N, E);
+ Set_No_Initialization (N, False);
+
elsif T = Etype (E) then
null;