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] Renaming of intrinsic generic subprograms


This patch allows the renaming and subsequent instantiation  of generic
subprograms that are marked Intrinsic, such as the predefined units
Unchecked_Conversion and Unchecked_Deallocation.

The following must execute quietly:

   gnatmake -q -gnatws uncrename.adb
   uncrename

---
with Mumble;
with Dumble;
procedure UncRename is

   function Cast is new Mumble (Boolean, Integer);
   X : Boolean := True;
   Y : Integer := Cast (X);

   type A is access all Integer;

   procedure Free is new Dumble (Integer, A);

   Z : A := new Integer;

begin
   Free (Z);
end UncRename;
---
with Ada.Unchecked_Conversion;
generic function Mumble renames Ada.Unchecked_Conversion;
---
with Ada.Unchecked_Deallocation;
generic procedure Dumble renames Ada.Unchecked_Deallocation;

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

2014-07-17  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Analyze_Generic_Renaming): For generic subprograms,
	propagate intrinsic flag to renamed entity, to allow e.g. renaming
	of Unchecked_Conversion.
	* sem_ch3.adb (Analyze_Declarations): Do not analyze contracts
	if the declaration has errors.

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]