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] Disallow Interrupt_Handler and Attach_Handler in generics


In accordance with AI 0033, this patch prohibits the use of either
of the pragmas Interrupt_Handler or Attach_Handler within a generic,
as shown by the following example compiled with -gnatj60:

Compiling: genericih.adb

     1. package body GenericIH is
     2.    protected type Handler is
     3.       procedure My_Handler;
     4.       pragma Interrupt_Handler (My_Handler);
              |
        >>> pragma "Interrupt_Handler" cannot be used
            inside a generic

     5.    end Handler;
     6.
     7.    protected body Handler is
     8.       procedure My_Handler is begin null; end;
     9.    end Handler;
    10. end GenericIH;

Compiling: genericih.ads

     1. generic
     2. package GenericIH is
     3.    pragma Elaborate_Body;
     4. end;

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

2010-10-08  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb (Check_Interrupt_Or_Attach_Handler): Pragmas
	Interrupt_Handler and Attach_Handler not allowed in generics.

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]