Commit dc06abec by Robert Dewar Committed by Arnaud Charlet

sem_ch11.adb: Improved warnings for unused variables

2007-08-14  Robert Dewar  <dewar@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* sem_ch11.adb: Improved warnings for unused variables

	* sem_ch3.ads, sem_ch3.adb (Build_Derived_Record_Type): If the ancestor
	is a synchronized interface, the derived type is limited.
	(Analyze_Object_Declaration): Mark the potential coextensions in the
	definition and expression of an object declaration node.
	(Build_Derived_Type): For the completion of a private type declaration
	with a derived type declaration, chain the parent type's representation
	items to the last representation item of the derived type (not the
	first one) if they are not present already.
	(Analyze_Object_Declaration, Constant_Redeclaration): Allow incomplete
	object declaration of forward references to tags.
	(Access_Subprogram_Declaration): In Ada2005, anonymous access to
	subprogram types can appear as access discriminants of synchronized
	types.
	(OK_For_Limited_Init_In_05): The initialization is legal is it is a call
	given in prefixed form as a selected component.
	(Process_Discriminants): If not all discriminants have defaults, place
	error message on a default that is present.
	(Analyze_Private_Extension_Declaration): Diagnose properly an attempt to
	extend a synchronized tagged type.
	Improved warnings for unused variables
	(Is_Visible_Component): Fix a visibility hole on a component inherited
	by a private extension when parent is itself declared as a private
	extension, and the derivation is in a child unit.
	(Find_Hidden_Interface): Move spec from the package body.

From-SVN: r127426
parent 442ade9d
......@@ -225,9 +225,11 @@ package body Sem_Ch11 is
Generate_Definition (Choice);
-- Set source assigned flag, since in effect this field is
-- always assigned an initial value by the exception.
-- Indicate that choice has an initial value, since in effect
-- this field is assigned an initial value by the exception.
-- We also consider that it is modified in the source.
Set_Has_Initial_Value (Choice, True);
Set_Never_Set_In_Source (Choice, False);
end if;
......@@ -269,7 +271,7 @@ package body Sem_Ch11 is
if Warn_On_Obsolescent_Feature then
Error_Msg_N
("Numeric_Error is an " &
"obsolescent feature ('R'M 'J.6(1))?", Id);
"obsolescent feature (RM J.6(1))?", Id);
Error_Msg_N
("\use Constraint_Error instead?", Id);
end if;
......@@ -306,7 +308,7 @@ package body Sem_Ch11 is
"generic formal package", Id, Ent);
Error_Msg_N
("\and therefore cannot appear in " &
"handler ('R'M 11.2(8))", Id);
"handler (RM 11.2(8))", Id);
exit;
-- If the exception is declared in an inner
......@@ -462,7 +464,7 @@ package body Sem_Ch11 is
P);
Error_Msg_N
("\?RAISE statement may result in abnormal return" &
" ('R'M 6.4.1(17))", P);
" (RM 6.4.1(17))", P);
end if;
end if;
end;
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2007, 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- --
......@@ -137,6 +137,13 @@ package Sem_Ch3 is
-- Note: one might expect this to be private to the package body, but
-- there is one rather unusual usage in package Exp_Dist.
function Find_Hidden_Interface
(Src : Elist_Id;
Dest : Elist_Id) return Entity_Id;
-- Ada 2005: Determine whether the interfaces in list Src are all present
-- in the list Dest. Return the first differing interface, or Empty
-- otherwise.
function Find_Type_Of_Subtype_Indic (S : Node_Id) return Entity_Id;
-- Given a subtype indication S (which is really an N_Subtype_Indication
-- node or a plain N_Identifier), find the type of the subtype mark.
......
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