From patchwork Mon Aug 6 08:03:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 175292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 548682C00A0 for ; Mon, 6 Aug 2012 18:03:30 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1344845010; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=hdUrLb4tTtEhEaVLJ3yv z1ZOlEc=; b=C+q2//92ZjZGiZpaaA/sVpQh/vsSn6zlDwYhdk3JeVI1Fa/YPUTr wftjZL7MzRo0YIKsYdyDl1psjY28uBnBPbFok+9Eh+oDn24yGB2OY0eBVmhtlrxS /bGGKxJS9uK0CoR0yf0jEy6QGMYhJzM8HhvnMO3En0Xhvhm3uArtwxc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=nZ/PfwhAFxcUl1KGJpwxtTD72lygLiSN+LL8kQCvDE8UNqpYXUmDqLiPsfDHAV gSGz2PHILksWcoW0dpo+EwQU0PW4wMLT5FQFSFOYRa3ZsakBxp+xcuhBq7v1gvPp SbSvsL1TwDWTrgSPQ/iKdNAlmCCdCLqbpfUEiO71Du4sM=; Received: (qmail 17532 invoked by alias); 6 Aug 2012 08:03:26 -0000 Received: (qmail 17522 invoked by uid 22791); 6 Aug 2012 08:03:25 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Aug 2012 08:03:00 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 292071C657D; Mon, 6 Aug 2012 04:03:00 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id otzit1CH+ezM; Mon, 6 Aug 2012 04:03:00 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 09FC81C6482; Mon, 6 Aug 2012 04:03:00 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 0B33192BF6; Mon, 6 Aug 2012 04:03:00 -0400 (EDT) Date: Mon, 6 Aug 2012 04:03:00 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Ed Schonberg Subject: [Ada] Protected objects with interrupt handlers are legal in nested scopes Message-ID: <20120806080259.GA32666@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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. 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);