This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] overriding indicator in subunit


The parser did not correctly recognize "overriding"
and "not overriding" in a subunit.

The following test should compile silently.

package Subunits is

   type T is null record;

   not overriding
   procedure Not_Overriding (X : T);

end Subunits;

package body Subunits is

   not overriding
   procedure Not_Overriding (X : T) is separate;

end Subunits;

separate (Subunits)
not overriding
procedure Not_Overriding (X : T) is
begin
   null;
end Not_Overriding;

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-06-14  Bob Duff  <duff@adacore.com>

	* par-ch10.adb (P_Subunit): If the next token after "separate(X)" is
	Tok_Not or Tok_Overriding, call P_Subprogram. We had previously given
	the incorrect error "proper body expected".
	* par-ch6.adb (P_Subprogram): Suppress "overriding indicator not
	allowed here" error in case of subunits, which was triggered by the
	above change to P_Subunit.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]