This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]