Commit 4f691cb2 by Bob Duff Committed by Pierre-Marie de Rodat

[Ada] Bad "already use-visible" warning re: use in private part

2019-12-18  Bob Duff  <duff@adacore.com>

gcc/ada/

	* sem_ch8.adb (Note_Redundant_Use): It was already checking for
	a use clause in the visible part of the child. Add an additional
	check for a use clause in the context clause of the child.

From-SVN: r279504
parent 63fdce85
2019-12-18 Bob Duff <duff@adacore.com>
* sem_ch8.adb (Note_Redundant_Use): It was already checking for
a use clause in the visible part of the child. Add an additional
check for a use clause in the context clause of the child.
2019-12-16 Bob Duff <duff@adacore.com>
* errout.adb (Handle_Serious_Error): Disable the above-mentioned
......
......@@ -9607,15 +9607,16 @@ package body Sem_Ch8 is
Par : constant Entity_Id := Defining_Entity (Parent (Decl));
Spec : constant Node_Id :=
Specification (Unit (Cunit (Current_Sem_Unit)));
Cur_List : constant List_Id := List_Containing (Cur_Use);
begin
if Is_Compilation_Unit (Par)
and then Par /= Cunit_Entity (Current_Sem_Unit)
and then Parent (Cur_Use) = Spec
and then List_Containing (Cur_Use) =
Visible_Declarations (Spec)
then
return;
if Cur_List = Context_Items (Cunit (Current_Sem_Unit))
or else Cur_List = Visible_Declarations (Spec)
then
return;
end if;
end if;
end;
end if;
......@@ -9629,7 +9630,6 @@ package body Sem_Ch8 is
then
Redundant := Clause;
Prev_Use := Cur_Use;
end if;
if Present (Redundant) and then Parent (Redundant) /= Prev_Use then
......
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