When an entry has preconditions, the entry call is wrapped in a procedure call that incorporates the precondition checks. To prevent a double expansion, with possible duplication of extra formals, that procedure call must only be pre- nalyzed and resolved. Expansion takes place upon return to the caller Resolve_Call.
No short example available. Tested on x86_64-pc-linux-gnu, committed on trunk 2014-08-01 Ed Schonberg <schonb...@adacore.com> * sem_res.adb (Resolve_Entry_Call): When an entry has preconditions, the entry call is wrapped in a procedure call that incorporates the precondition checks. To prevent a double expansion, with possible duplication of extra formals, that procedure call must only be pre-analyzed and resolved. Expansion takes place upon return to the caller Resolve_Call.
Index: sem_res.adb =================================================================== --- sem_res.adb (revision 213460) +++ sem_res.adb (working copy) @@ -7176,7 +7176,11 @@ New_Occurrence_Of (PPC_Wrapper (Nam), Loc), Parameter_Associations => New_Actuals); Rewrite (N, New_Call); - Analyze_And_Resolve (N); + + -- Preanalyze and resolve new call. Current procedure is called + -- from Resolve_Call, after which expansion will take place. + + Preanalyze_And_Resolve (N); return; end; end if;