Commit b8dc622e by Javier Miranda Committed by Arnaud Charlet

sem_attr.adb (Analyze_Attribute): In case of 'Class applied to an abstract interface type call...

2006-02-13  Javier Miranda  <miranda@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb (Analyze_Attribute): In case of 'Class applied to an
	abstract interface type call analyze_and_resolve to expand the type
	conversion into the corresponding displacement of the
	reference to the base of the object.
	(Eval_Attribute, case Width): For systems where IEEE extended precision
	is supported, the maximum exponent occupies 4 decimal digits.
	(Accessibility_Message): Add '\' in 2-line warning message.
	(Resolve_Attribute): Likewise.
	(case Attribute_Access): Significantly revise checks
	for illegal access-to-subprogram Access attributes to properly enforce
	the rules of 3.10.2(32/2).
	Diagnose use of current instance with an illegal attribute.

        * sem_util.ads, sem_util.adb (Enclosing_Generic_Body): Change formal
        to a Node_Id.
        (Enclosing_Generic_Unit): New function to return a node's innermost
        enclosing generic declaration node.
        (Compile_Time_Constraint_Error): Remove '!' in warning messages.
        (Type_Access_Level): The accessibility level of anonymous acccess types
        associated with discriminants is that of the current instance of the
        type, and that's deeper than the type itself (AARM 3.10.2 (12.3.21)).
        (Compile_Time_Constraint_Error): Handle case of conditional expression.
        (Kill_Current_Values_For_Entity): New function
        (Enter_Name): Change formal type to Entity_Id

From-SVN: r111089
parent 9b96e234
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, 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- --
...@@ -136,11 +136,12 @@ package Sem_Util is ...@@ -136,11 +136,12 @@ package Sem_Util is
Ent : Entity_Id := Empty; Ent : Entity_Id := Empty;
Loc : Source_Ptr := No_Location; Loc : Source_Ptr := No_Location;
Warn : Boolean := False) return Node_Id; Warn : Boolean := False) return Node_Id;
-- Subsidiary to Apply_Compile_Time_Constraint_Error and Checks routines. -- This is similar to Apply_Compile_Time_Constraint_Error in that it
-- Does not modify any nodes, but generates a warning (or error) message. -- generates a warning (or error) message in the same manner, but it does
-- For convenience, the function always returns its first argument. The -- not replace any nodes. For convenience, the function always returns its
-- message is a warning if the message ends with ?, or we are operating -- first argument. The message is a warning if the message ends with ?, or
-- in Ada 83 mode, or if the Warn parameter is set to True. -- we are operating in Ada 83 mode, or if the Warn parameter is set to
-- True.
procedure Conditional_Delay (New_Ent, Old_Ent : Entity_Id); procedure Conditional_Delay (New_Ent, Old_Ent : Entity_Id);
-- Sets the Has_Delayed_Freeze flag of New if the Delayed_Freeze flag -- Sets the Has_Delayed_Freeze flag of New if the Delayed_Freeze flag
...@@ -194,10 +195,15 @@ package Sem_Util is ...@@ -194,10 +195,15 @@ package Sem_Util is
-- an expanded name, a defining program unit name or an identifier -- an expanded name, a defining program unit name or an identifier
function Enclosing_Generic_Body function Enclosing_Generic_Body
(E : Entity_Id) return Node_Id; (N : Node_Id) return Node_Id;
-- Returns the Node_Id associated with the innermost enclosing -- Returns the Node_Id associated with the innermost enclosing
-- generic body, if any. If none, then returns Empty. -- generic body, if any. If none, then returns Empty.
function Enclosing_Generic_Unit
(N : Node_Id) return Node_Id;
-- Returns the Node_Id associated with the innermost enclosing
-- generic unit, if any. If none, then returns Empty.
function Enclosing_Lib_Unit_Entity return Entity_Id; function Enclosing_Lib_Unit_Entity return Entity_Id;
-- Returns the entity of enclosing N_Compilation_Unit Node which is the -- Returns the entity of enclosing N_Compilation_Unit Node which is the
-- root of the current scope (which must not be Standard_Standard, and -- root of the current scope (which must not be Standard_Standard, and
...@@ -216,7 +222,7 @@ package Sem_Util is ...@@ -216,7 +222,7 @@ package Sem_Util is
-- build and initialize a new freeze node and set Has_Delayed_Freeze -- build and initialize a new freeze node and set Has_Delayed_Freeze
-- true for entity E. -- true for entity E.
procedure Enter_Name (Def_Id : Node_Id); procedure Enter_Name (Def_Id : Entity_Id);
-- Insert new name in symbol table of current scope with check for -- Insert new name in symbol table of current scope with check for
-- duplications (error message is issued if a conflict is found) -- duplications (error message is issued if a conflict is found)
-- Note: Enter_Name is not used for overloadable entities, instead -- Note: Enter_Name is not used for overloadable entities, instead
...@@ -627,6 +633,11 @@ package Sem_Util is ...@@ -627,6 +633,11 @@ package Sem_Util is
-- Is_Known_Non_Null flags in variables, constants or parameters -- Is_Known_Non_Null flags in variables, constants or parameters
-- since these are also not known to be valid. -- since these are also not known to be valid.
procedure Kill_Current_Values (Ent : Entity_Id);
-- This performs the same processing as described above for the form with
-- no argument, but for the specific entity given. The call has no effect
-- if the entity Ent is not for an object.
procedure Kill_Size_Check_Code (E : Entity_Id); procedure Kill_Size_Check_Code (E : Entity_Id);
-- Called when an address clause or pragma Import is applied to an -- Called when an address clause or pragma Import is applied to an
-- entity. If the entity is a variable or a constant, and size check -- entity. If the entity is a variable or a constant, and size check
......
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