Commit 41251c60 by Javier Miranda Committed by Arnaud Charlet

sem_ch6.ads, [...] (Check_Conformance): In case of anonymous access types the…

sem_ch6.ads, [...] (Check_Conformance): In case of anonymous access types the null-exclusion and access-to-constant...

2005-09-01  Javier Miranda  <miranda@adacore.com>
	    Gary Dismukes  <dismukes@adacore.com>

	* sem_ch6.ads, sem_ch6.adb (Check_Conformance): In case of anonymous
	access types the null-exclusion and access-to-constant attributes must
	also match.
	(Analyze_Return_Statement): When the result type is an anonymous access
	type, apply a conversion of the return expression to the access type
	to ensure that appropriate accessibility checks are performed.
	(Analyze_Return_Type): For the case of an anonymous access result type,
	generate the Itype and set Is_Local_Anonymous_Access on the type.
	Add ??? placeholder for check to disallow returning a limited object
	in Ada 2005 unless it's an aggregate or a result of a function call.
	Change calls from Subtype_Mark to Result_Definition.
	(Analyze_Subprogram_Body): Change formal Subtype_Mark to
	Result_Definition in call to Make_Function_Specification.
	(Build_Body_To_Inline): Change Set_Subtype_Mark to
	Set_Result_Definition.
	(Make_Inequality_Operator): Change formal Subtype_Mark to
	Result_Definition in call to Make_Function_Specification.
	(Process_Formals): Create the new null-excluding itype if required.
	(New_Overloaded_Entity): For an entity overriding an interface primitive
	check if the entity also covers other abstract subprograms in the same
	scope. This is required to handle the general case, that is, overriding
	other interface primitives and overriding abstract subprograms inherited
	from some abstract ancestor type.
	(New_Overloaded_Entity): For an overriding entity that comes from
	source, note the operation that it overrides.
	(Check_Conformance, Type_Conformant): Addition of one new formal
	to skip controlling formals in the analysis. This is used to
	handle overloading of abstract interfaces.
	(Base_Types_Match): Add missing case for types imported from
	limited-with clauses
	(New_Overloaded_Entity): Add barrier to protect the use of
	the "alias" attribute.

From-SVN: r103883
parent ec6078e3
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- 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- --
......@@ -143,11 +143,10 @@ package Sem_Ch6 is
procedure New_Overloaded_Entity
(S : Entity_Id;
Derived_Type : Entity_Id := Empty);
-- Process new overloaded entity. Overloaded entities are created
-- by enumeration type declarations, subprogram specifications,
-- entry declarations, and (implicitly) by type derivations.
-- If Derived_Type is not Empty, then it indicates that this
-- is subprogram derived for that type.
-- Process new overloaded entity. Overloaded entities are created by
-- enumeration type declarations, subprogram specifications, entry
-- declarations, and (implicitly) by type derivations. Derived_Type non-
-- Empty indicates that this is subprogram derived for that type.
procedure Process_Formals (T : List_Id; Related_Nod : Node_Id);
-- Enter the formals in the scope of the subprogram or entry, and
......@@ -168,11 +167,14 @@ package Sem_Ch6 is
function Subtype_Conformant (New_Id, Old_Id : Entity_Id) return Boolean;
-- Determine whether two callable entities (subprograms, entries,
-- literals) are subtype conformant (RM6.3.1(16))
-- literals) are subtype conformant (RM6.3.1(16)).
function Type_Conformant (New_Id, Old_Id : Entity_Id) return Boolean;
function Type_Conformant
(New_Id : Entity_Id;
Old_Id : Entity_Id;
Skip_Controlling_Formals : Boolean := False) return Boolean;
-- Determine whether two callable entities (subprograms, entries,
-- literals) are type conformant (RM6.3.1(14))
-- literals) are type conformant (RM6.3.1(14)).
procedure Valid_Operator_Definition (Designator : Entity_Id);
-- Verify that an operator definition has the proper number of formals
......
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