[Ada] Protected objects with interrupt handlers are legal in nested scopes
Arnaud Charlet
charlet@adacore.com
Mon Aug 6 08:03:00 GMT 2012
AI95-0303 removes the rule that protected objects with handlers must be
declared at the library level. The AI is a binding interpretation, and thus
applies to earlier versions of the language as well. The new rule is tested
in ACATS test BXC3002.
Tested on x86_64-pc-linux-gnu, committed on trunk
2012-08-06 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): According to
AI95-0303, protected objects with interrupt handlers can be
declared in nested scopes. This is a binding interpretation,
and thus applies to all versions of the compiler.
-------------- next part --------------
Index: sem_ch3.adb
===================================================================
--- sem_ch3.adb (revision 190155)
+++ sem_ch3.adb (working copy)
@@ -3078,8 +3078,11 @@
-- in the RM is removed) because accessibility checks are sufficient
-- to make handlers not at the library level illegal.
+ -- AI05-0303: the AI is in fact a binding interpretation, and thus
+ -- applies to the '95 version of the language as well.
+
if Has_Interrupt_Handler (T)
- and then Ada_Version < Ada_2005
+ and then Ada_Version < Ada_95
then
Error_Msg_N
("interrupt object can only be declared at library level", Id);
More information about the Gcc-patches
mailing list