From patchwork Fri Jan 4 09:18:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 209418 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 7AF412C007A for ; Fri, 4 Jan 2013 20:19:11 +1100 (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=1357895951; 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=MecmHHbaOjncu8YAUYcm Hx4Y3xI=; b=gNoPgAHHqb5ElaUO3HhECt99njw9H1eib3enTi0kj5ACZ4R0ROzM 58thkYy/N010wuQpQSZPhqaUIvfEaiCtZkN1+usa8swz5nTOtX/fWGwk+vtjPpAU NClMvlXIvZK3PyC4wpPv3vozpMj5LOM/PwQFVwvhrxdIZHZVUC0P9Wk= 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=NGB9aJFJkwaVAQJeV0DrUzJt0S10+90hpnEQqY/srhBI4gZGMtNjq0414YKmYy KxngfGjRO5d36Mp81WN7SNBOyBPZFiRMtkexXZXZEvnqWrfO2Ez05ngMr+MbI1EF 0GbM2ap7yeS4PKxSObFTfhPinLPntG5X5P0GGlU++hxS4=; Received: (qmail 13804 invoked by alias); 4 Jan 2013 09:18:53 -0000 Received: (qmail 13749 invoked by uid 22791); 4 Jan 2013 09:18:52 -0000 X-SWARE-Spam-Status: No, hits=-1.8 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; Fri, 04 Jan 2013 09:18:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8D4282E368; Fri, 4 Jan 2013 04:18:44 -0500 (EST) 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 LacVCBbb4Z45; Fri, 4 Jan 2013 04:18:44 -0500 (EST) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 73C282E0FB; Fri, 4 Jan 2013 04:18:44 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4192) id 7286D3FF09; Fri, 4 Jan 2013 04:18:44 -0500 (EST) Date: Fri, 4 Jan 2013 04:18:44 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Ed Schonberg Subject: [Ada] Better error message for aspect specification without Ada 2012 mode Message-ID: <20130104091844.GA24883@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 This patch improves the error message when compiling a unit with an aspect specification in an older Ada mode, and the first aspect specification is for a boolean aspect whose value is defaulted. Compiling the following: gcc -c r1.ads must yield: r1.ads:2:16: aspect specification is an Ada 2012 feature r1.ads:2:16: unit must be compiled with -gnat2012 switch package R1 is procedure Q with Inline, Pre => False; end R1; Tested on x86_64-pc-linux-gnu, committed on trunk 2013-01-04 Ed Schonberg * par-ch13.adb (Aspect_Specifications_Present): In Strict mode, accept an aspect name followed by a comma, indicating a defaulted boolean aspect. Index: par-ch13.adb =================================================================== --- par-ch13.adb (revision 194841) +++ par-ch13.adb (working copy) @@ -105,6 +105,13 @@ if Token = Tok_Arrow then Result := True; + -- The identifier may be the name of a boolean aspect with a + -- defaulted True value. Further checks when analyzing aspect + -- specification. + + elsif Token = Tok_Comma then + Result := True; + elsif Token = Tok_Apostrophe then Scan; -- past apostrophe