From patchwork Fri Dec 21 22:27:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix PR ada/53737 Date: Fri, 21 Dec 2012 12:27:45 -0000 From: Eric Botcazou X-Patchwork-Id: 207894 Message-Id: <1457843.4KpGgzOI15@polaris> To: gcc-patches@gcc.gnu.org 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 package. 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)) = N_Access_To_Object_Definition + and then Present (Match) then declare Formal_Ent : constant Entity_Id :=