From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30047 invoked by alias); 17 Jul 2007 04:30:18 -0000 Received: (qmail 30038 invoked by uid 22791); 17 Jul 2007 04:30:17 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Jul 2007 04:30:16 +0000 Received: (qmail 10191 invoked from network); 17 Jul 2007 04:30:14 -0000 Received: from unknown (HELO ?192.168.0.3?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Jul 2007 04:30:14 -0000 Message-ID: <469C45D2.8060508@codesourcery.com> Date: Tue, 17 Jul 2007 04:39:00 -0000 From: Mark Mitchell User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Paolo Carlini CC: gcc-patches@gcc.gnu.org Subject: Re: [C++ Patch] PR 32108 References: <46960B4C.6070407@suse.de> In-Reply-To: <46960B4C.6070407@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg01486.txt.bz2 Paolo Carlini wrote: > the issue here seems indeed rather simple. I'm only slightly nervous > about the semantics of 'at_function_scope_p' exactly matching the > documentation, which talks about "GCC allows you to declare local labels > in any nested block scope". Otherwise, with the minimal patch the > testcase is rejected consistently with the C front-end and issuing a > consistent error message. What does it say, exactly? I think it would be better to call cp_parser_label_declaration (just as we do now), but have finish_label_decl issue an error message. Then, you can say "__label__ declarations are only allowed in function scopes". The tricky case here will be my least-favorite GNU extension: statement expressions. Consider: void f(int i = ({ __label__ f; ... })) This should probably be allowed. But, I bet that in_function_scope_p will return false when parsing the statement expression. You will have to try it and see... Thanks, -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713