Commit ca44152f by Ed Schonberg Committed by Arnaud Charlet

sem_aggr.adb (Analyze_N_Extension_Aggregate): Add legality checks for the…

sem_aggr.adb (Analyze_N_Extension_Aggregate): Add legality checks for the ancestor part of an extension aggregate for a...

2008-04-08  Ed Schonberg  <schonberg@adacore.com>
	    Robert Dewar  <dewar@adacore.com>

	* sem_aggr.adb (Analyze_N_Extension_Aggregate): Add legality checks for
	the ancestor part of an extension aggregate for a limited type.
	(Resolve_Array_Aggregate): Issue warning for sliding of aggregate with
	enumeration index bounds.
	(Resolve_Array_Aggregate): Add circuit for diagnosing missing choices
	when array is too short.
	(Check_Expr_OK_In_Limited_Aggregate): Move function
	Check_Non_Limited_Type from Resolve_Record_Aggregate to top level (and
	change name).
	(Resolve_Array_Aggregate.Resolve_Aggr_Expr):
	Check_Expr_OK_In_Limited_Aggregates called to check for illegal limited
	component associations.
	(Check_Non_Limited_Type): Moved to outer level and renamed.
	(Resolve_Record_Aggregate): In an extension aggregate, an association
	with a box initialization can only designate a component of the
	extension, not a component inherited from the given ancestor

	* sem_case.adb: Use new Is_Standard_Character_Type predicate

From-SVN: r134049
parent f89b7956
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1996-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -268,10 +268,7 @@ package body Sem_Case is ...@@ -268,10 +268,7 @@ package body Sem_Case is
-- For character, or wide [wide] character. If 7-bit ASCII graphic -- For character, or wide [wide] character. If 7-bit ASCII graphic
-- range, then build and return appropriate character literal name -- range, then build and return appropriate character literal name
if Rtp = Standard_Character if Is_Standard_Character_Type (Ctype) then
or else Rtp = Standard_Wide_Character
or else Rtp = Standard_Wide_Wide_Character
then
C := UI_To_Int (Value); C := UI_To_Int (Value);
if C in 16#20# .. 16#7E# then if C in 16#20# .. 16#7E# then
...@@ -425,12 +422,7 @@ package body Sem_Case is ...@@ -425,12 +422,7 @@ package body Sem_Case is
-- of literals to search. Instead, a N_Character_Literal node -- of literals to search. Instead, a N_Character_Literal node
-- is created with the appropriate Char_Code and Chars fields. -- is created with the appropriate Char_Code and Chars fields.
if Root_Type (Choice_Type) = Standard_Character if Is_Standard_Character_Type (Choice_Type) then
or else
Root_Type (Choice_Type) = Standard_Wide_Character
or else
Root_Type (Choice_Type) = Standard_Wide_Wide_Character
then
Set_Character_Literal_Name (Char_Code (UI_To_Int (Value))); Set_Character_Literal_Name (Char_Code (UI_To_Int (Value)));
Lit := New_Node (N_Character_Literal, Loc); Lit := New_Node (N_Character_Literal, Loc);
Set_Chars (Lit, Name_Find); Set_Chars (Lit, Name_Find);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment