From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31509 invoked by alias); 1 Oct 2010 15:49:19 -0000 Received: (qmail 31494 invoked by uid 22791); 1 Oct 2010 15:49:19 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Oct 2010 15:49:13 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o91FnBea027725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Oct 2010 11:49:12 -0400 Received: from [127.0.0.1] (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o91Fn9fI005474; Fri, 1 Oct 2010 11:49:10 -0400 Message-ID: <4CA602F3.4020204@redhat.com> Date: Fri, 01 Oct 2010 15:49:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100929 Lightning/1.0b1 Shredder/3.0.9pre MIME-Version: 1.0 To: Rodrigo Rivas CC: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= , Magnus Fromreide , GCC Subject: Re: Range-based for in c++98 References: <1285003705.2291.14.camel@sara> <1285006786.16363.25.camel@abajo> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg00002.txt.bz2 On 09/20/2010 07:06 PM, Rodrigo Rivas wrote: > Are you sure? As I said in other post, I am no longer sure that the > C++0x draft forbids the type definition in this context. > But I'm no expert in standarese, so I'm still undecided. It took me some searching, but yes, it does: "A type-specifier-seq shall not define a class or enumeration unless it appears in the type-id of an alias-declaration (7.1.3)." Normal declarations don't have a type-specifier-seq, they have a decl-specifier-seq. I would change cp_parser_range_for to use cp_parser_decl_specifier_seq instead of cp_parser_type_specifier_seq and then wait to complain about defining a type until after we've seen the ':'. Jason