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] pragma Ignore_Pragma(Interface); is illegal


This patch fixes a bug in which pragma Ignore_Pragma(Interface); is illegal,
except in Ada 83 mode. It should be legal in all modes.

The following test should compile quietly.

--  gnat.adc

pragma Ignore_Pragma(Interface);


--  legal_interface.ads

package Legal_Interface is
   procedure Interface_Or_Not;
   pragma Interface (Esperanto, Interface_Or_Not);
   --  The pragma should be ignored, so the body of Interface_Or_Not is legal,
   --  and the fact that Esperanto is not a supported language is irrelevant.
end Legal_Interface;


--  legal_interface.adb

package body Legal_Interface is
   procedure Interface_Or_Not is
   begin
      null;
   end Interface_Or_Not;
end Legal_Interface;

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

2017-04-25  Bob Duff  <duff@adacore.com>

	* par-ch2.adb, scans.ads, scn.adb: Do not give an error for
	reserved words inside pragmas. This is necessary to allow the
	pragma name Interface to be used in pragma Ignore_Pragma.
	* par.adb: Minor comment fix.

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]