Fix PR ada/53737

Message ID 1457843.4KpGgzOI15@polaris
State New
Headers show

Commit Message

Eric Botcazou Dec. 21, 2012, 10:27 p.m.
This is a regression present on mainline and 4.7 branch, in the form of an 
assertion failure.  The check that an RACW type is acceptable an actual for a 
formal type to which a pragma Remote_Access applies need not be performed on a 
defaulted formal type appearing in the internal instantiation of a formal 

Tested on x86-64/Linux, applied on the mainline and 4.7 branch.

2012-12-21  Ed Schonberg  <>

	PR ada/53737
	* sem_ch12.adb (Analyze_Associations): Do not check the legality of
	actuals for RACW types if this is an internal instantiation for a formal
	package with defaulted parameters.


Index: sem_ch12.adb
--- sem_ch12.adb	(revision 194669)
+++ sem_ch12.adb	(working copy)
@@ -1448,10 +1448,15 @@  package body Sem_Ch12 is
                   --  defined aspect/pragma Remote_Access_Type. In that case
                   --  the actual must be remote as well.
+                  --  If the current instantiation is the construction of a
+                  --  local copy for a formal package the actuals may be
+                  --  defaulted, and there is no matching actual to check.
                   if Nkind (Analyzed_Formal) = N_Formal_Type_Declaration
                     and then
                       Nkind (Formal_Type_Definition (Analyzed_Formal)) =
+                     and then Present (Match)
                         Formal_Ent : constant Entity_Id :=