Commit d449ed75 by Pierre-Marie de Rodat

[multiple changes]

2017-09-25  Piotr Trojanek  <trojanek@adacore.com>

	* adabkend.adb (Call_Back_End): Fix wording of "front-end" and
	"back-end" in comments.

2017-09-25  Ed Schonberg  <schonberg@adacore.com>

	* exp_ch6.adb (Expand_Call_Helper): The extra accessibility check in a
	call that appears in a classwide precondition and that mentions an
	access formal of the subprogram, must use the accessibility level of
	the actual in the call. This is one case in which a reference to a
	formal parameter appears outside of the body of the subprogram.

From-SVN: r253141
parent f71b4cd4
2017-09-25 Piotr Trojanek <trojanek@adacore.com>
* adabkend.adb (Call_Back_End): Fix wording of "front-end" and
"back-end" in comments.
2017-09-25 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Call_Helper): The extra accessibility check in a
call that appears in a classwide precondition and that mentions an
access formal of the subprogram, must use the accessibility level of
the actual in the call. This is one case in which a reference to a
formal parameter appears outside of the body of the subprogram.
2017-09-25 Hristian Kirtchev <kirtchev@adacore.com> 2017-09-25 Hristian Kirtchev <kirtchev@adacore.com>
* sem_res.adb (Replace_Actual_Discriminants): Replace a discriminant * sem_res.adb (Replace_Actual_Discriminants): Replace a discriminant
......
...@@ -57,10 +57,10 @@ package body Adabkend is ...@@ -57,10 +57,10 @@ package body Adabkend is
Write_Eol; Write_Eol;
end if; end if;
-- Frontend leaves the Current_Error_Node at a location that is -- The front end leaves the Current_Error_Node at a location that is
-- meaningless and confusing when emitting bugboxes from the backed. By -- meaningless and confusing when emitting bug boxes from the back end.
-- resetting it here we default to "No source file position information -- By resetting it here we default to "No source file position
-- available" message on backend crashes. -- information available" message on back end crashes.
Current_Error_Node := Empty; Current_Error_Node := Empty;
...@@ -91,7 +91,7 @@ package body Adabkend is ...@@ -91,7 +91,7 @@ package body Adabkend is
-- --
-- If the switch is not valid, control will not return. The switches -- If the switch is not valid, control will not return. The switches
-- must still be scanned to skip the "-o" arguments, or internal GCC -- must still be scanned to skip the "-o" arguments, or internal GCC
-- switches, which may be safely ignored by other back-ends. -- switches, which may be safely ignored by other back ends.
---------------------------- ----------------------------
-- Scan_Back_End_Switches -- -- Scan_Back_End_Switches --
...@@ -251,7 +251,7 @@ package body Adabkend is ...@@ -251,7 +251,7 @@ package body Adabkend is
else else
Add_Src_Search_Dir (Argv); Add_Src_Search_Dir (Argv);
-- Add directory to lib search so that back-end can take as -- Add directory to lib search so that back end can take as
-- input ALI files if needed. Otherwise this won't have any -- input ALI files if needed. Otherwise this won't have any
-- impact on the compiler. -- impact on the compiler.
......
...@@ -3004,6 +3004,20 @@ package body Exp_Ch6 is ...@@ -3004,6 +3004,20 @@ package body Exp_Ch6 is
then then
Prev_Orig := Prev; Prev_Orig := Prev;
-- A class-wide precondition generates a test in which formals of
-- the subprogram are replaced by actuals that came from source.
-- In that case as well, the accessiblity comes from the actual.
-- This is the one case in which there are references to formals
-- outside of their subprogram.
elsif Prev_Orig /= Prev
and then Is_Entity_Name (Prev_Orig)
and then Present (Entity (Prev_Orig))
and then Is_Formal (Entity (Prev_Orig))
and then not In_Open_Scopes (Scope (Entity (Prev_Orig)))
then
Prev_Orig := Prev;
-- If the actual is a formal of an enclosing subprogram it is -- If the actual is a formal of an enclosing subprogram it is
-- the right entity, even if it is a rewriting. This happens -- the right entity, even if it is a rewriting. This happens
-- when the call is within an inherited condition or predicate. -- when the call is within an inherited condition or predicate.
......
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