This is the mail archive of the 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] Implement Rational profile to support non-standard renaming declarations

We introduce the profile Rational and the corresponding pragma to support
legacy Rational code that accepts subprogram renaming declarations that are
not conformant to the RM.
The following program, compiled with -gnatc, must generate the message: subprogram cannot rename itself

The program must compile quietly if the pragma is uncommented.

--  pragma Rational;
package Ren is
   package P is
      type T is null record;
      function F (Obj : T) return integer;
   end P;

   use P;
   type DT is new T;
   package RR renames Ren;

   function F (New_Parameter : DT) return Integer renames RR.F;

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

2013-02-06  Ed Schonberg  <>

	* Add Name_Rational and pragma Rational.
	* par-prag.adb: Recognize pragma Rational.
	* (Rational_Profile): flag to control compatibility mode
	with Rational compiler.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): When Rational profile
	is enable, accept renaming declarations where the new subprogram
	and the renamed entity have the same name.
	* sem_prag.adb (analyze_pragma): Add pragma Rational, and recognize
	Rational as a profile.

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]