Commit 872dae48 by Arnaud Charlet

[multiple changes]

2015-10-16  Bob Duff  <duff@adacore.com>

	* debug.adb: Document -gnatdQ switch.

2015-10-16  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Analyze_Formal_Subprogram): Implement rule that
	a formal abstract subprogram cannot have a null default: RM 12.6
	(4 1.2).

From-SVN: r228869
parent 1bc619ef
2015-10-16 Bob Duff <duff@adacore.com> 2015-10-16 Bob Duff <duff@adacore.com>
* debug.adb: Document -gnatdQ switch.
2015-10-16 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Analyze_Formal_Subprogram): Implement rule that
a formal abstract subprogram cannot have a null default: RM 12.6
(4 1.2).
2015-10-16 Bob Duff <duff@adacore.com>
* sem_util.ads, sinput.ads, bcheck.adb: Minor comment fixes. * sem_util.ads, sinput.ads, bcheck.adb: Minor comment fixes.
2015-10-16 Javier Miranda <miranda@adacore.com> 2015-10-16 Javier Miranda <miranda@adacore.com>
......
...@@ -80,7 +80,7 @@ package body Debug is ...@@ -80,7 +80,7 @@ package body Debug is
-- dN No file name information in exception messages -- dN No file name information in exception messages
-- dO Output immediate error messages -- dO Output immediate error messages
-- dP Do not check for controlled objects in preelaborable packages -- dP Do not check for controlled objects in preelaborable packages
-- dQ -- dQ Use old secondary stack method
-- dR Bypass check for correct version of s-rpc -- dR Bypass check for correct version of s-rpc
-- dS Never convert numbers to machine numbers in Sem_Eval -- dS Never convert numbers to machine numbers in Sem_Eval
-- dT Convert to machine numbers only for constant declarations -- dT Convert to machine numbers only for constant declarations
...@@ -430,6 +430,11 @@ package body Debug is ...@@ -430,6 +430,11 @@ package body Debug is
-- in preelaborable packages, but this restriction is a huge pain, -- in preelaborable packages, but this restriction is a huge pain,
-- especially in the predefined library units. -- especially in the predefined library units.
-- dQ Use old method for determining what goes on the secondary stack.
-- This disables some newer optimizations. The intent is to use this
-- temporarily to measure before/after efficiency. ???Remove this
-- when we are done (see Sem_Util.Requires_Transient_Scope).
-- dR Bypass the check for a proper version of s-rpc being present -- dR Bypass the check for a proper version of s-rpc being present
-- to use the -gnatz? switch. This allows debugging of the use -- to use the -gnatz? switch. This allows debugging of the use
-- of stubs generation without needing to have GLADE (or some -- of stubs generation without needing to have GLADE (or some
......
...@@ -1075,7 +1075,7 @@ package body Sem_Ch12 is ...@@ -1075,7 +1075,7 @@ package body Sem_Ch12 is
-- package. As usual an other association must be last in the list. -- package. As usual an other association must be last in the list.
procedure Check_Overloaded_Formal_Subprogram (Formal : Entity_Id); procedure Check_Overloaded_Formal_Subprogram (Formal : Entity_Id);
-- Apply RM 12.3 (9): if a formal subprogram is overloaded, the instance -- Apply RM 12.3(9): if a formal subprogram is overloaded, the instance
-- cannot have a named association for it. AI05-0025 extends this rule -- cannot have a named association for it. AI05-0025 extends this rule
-- to formals of formal packages by AI05-0025, and it also applies to -- to formals of formal packages by AI05-0025, and it also applies to
-- box-initialized formals. -- box-initialized formals.
...@@ -2820,8 +2820,19 @@ package body Sem_Ch12 is ...@@ -2820,8 +2820,19 @@ package body Sem_Ch12 is
if Nkind (N) = N_Formal_Abstract_Subprogram_Declaration then if Nkind (N) = N_Formal_Abstract_Subprogram_Declaration then
Set_Is_Abstract_Subprogram (Nam); Set_Is_Abstract_Subprogram (Nam);
Set_Is_Dispatching_Operation (Nam); Set_Is_Dispatching_Operation (Nam);
-- A formal abstract procedure cannot have a null default
-- (RM 12.6(4 1.2)).
if Nkind (Spec) = N_Procedure_Specification
and then Null_Present (Spec)
then
Error_Msg_N
("a formal abstract subprogram cannot default to null", Spec);
end if;
declare declare
Ctrl_Type : constant Entity_Id := Find_Dispatching_Type (Nam); Ctrl_Type : constant Entity_Id := Find_Dispatching_Type (Nam);
begin begin
...@@ -10737,7 +10748,7 @@ package body Sem_Ch12 is ...@@ -10737,7 +10748,7 @@ package body Sem_Ch12 is
-- Re-establish the state of information on which checks are suppressed. -- Re-establish the state of information on which checks are suppressed.
-- This information was set in Body_Info at the point of instantiation, -- This information was set in Body_Info at the point of instantiation,
-- and now we restore it so that the instance is compiled using the -- and now we restore it so that the instance is compiled using the
-- check status at the instantiation (RM 11.5 (7.2/2), AI95-00224-01). -- check status at the instantiation (RM 11.5(7.2/2), AI95-00224-01).
Local_Suppress_Stack_Top := Body_Info.Local_Suppress_Stack_Top; Local_Suppress_Stack_Top := Body_Info.Local_Suppress_Stack_Top;
Scope_Suppress := Body_Info.Scope_Suppress; Scope_Suppress := Body_Info.Scope_Suppress;
...@@ -11052,7 +11063,7 @@ package body Sem_Ch12 is ...@@ -11052,7 +11063,7 @@ package body Sem_Ch12 is
-- Re-establish the state of information on which checks are suppressed. -- Re-establish the state of information on which checks are suppressed.
-- This information was set in Body_Info at the point of instantiation, -- This information was set in Body_Info at the point of instantiation,
-- and now we restore it so that the instance is compiled using the -- and now we restore it so that the instance is compiled using the
-- check status at the instantiation (RM 11.5 (7.2/2), AI95-00224-01). -- check status at the instantiation (RM 11.5(7.2/2), AI95-00224-01).
Local_Suppress_Stack_Top := Body_Info.Local_Suppress_Stack_Top; Local_Suppress_Stack_Top := Body_Info.Local_Suppress_Stack_Top;
Scope_Suppress := Body_Info.Scope_Suppress; Scope_Suppress := Body_Info.Scope_Suppress;
...@@ -11970,7 +11981,7 @@ package body Sem_Ch12 is ...@@ -11970,7 +11981,7 @@ package body Sem_Ch12 is
-- If the formal and actual types are abstract, check that there -- If the formal and actual types are abstract, check that there
-- are no abstract primitives of the actual type that correspond to -- are no abstract primitives of the actual type that correspond to
-- nonabstract primitives of the formal type (second sentence of -- nonabstract primitives of the formal type (second sentence of
-- RM95-3.9.3(9)). -- RM95 3.9.3(9)).
if Is_Abstract_Type (A_Gen_T) and then Is_Abstract_Type (Act_T) then if Is_Abstract_Type (A_Gen_T) and then Is_Abstract_Type (Act_T) then
Check_Abstract_Primitives : declare Check_Abstract_Primitives : declare
......
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