From patchwork Fri Oct 21 00:38:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ville Voutilainen X-Patchwork-Id: 120917 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 C0E7D1007D1 for ; Fri, 21 Oct 2011 11:39:38 +1100 (EST) Received: (qmail 22916 invoked by alias); 21 Oct 2011 00:39:36 -0000 Received: (qmail 22907 invoked by uid 22791); 21 Oct 2011 00:39:35 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-bw0-f47.google.com (HELO mail-bw0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 00:39:15 +0000 Received: by bkat8 with SMTP id t8so4707199bka.20 for ; Thu, 20 Oct 2011 17:39:14 -0700 (PDT) Received: by 10.223.76.24 with SMTP id a24mr11777714fak.31.1319157553919; Thu, 20 Oct 2011 17:39:13 -0700 (PDT) Received: from ville-laptop.gmail.com (dsl-olubrasgw1-ff2fc100-74.dhcp.inet.fi. [88.193.47.74]) by mx.google.com with ESMTPS id b16sm18783667fao.7.2011.10.20.17.39.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Oct 2011 17:39:13 -0700 (PDT) Date: Fri, 21 Oct 2011 03:38:58 +0300 Message-ID: <878vof89gd.wl%ville@ville-laptop> From: Ville Voutilainen To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com Subject: [C++ Patch] PR 50811 (rejects class-virt-specifier if class-head-name includes nested-name-specifier) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") 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 Tested on X86-32 linux. 2011-10-21 Ville Voutilainen PR c++/50811 * parser.c (cp_parser_class_head): Parse virt-specifiers regardless of whether an id is present diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ea0c4dc..dd2357b 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -17576,8 +17576,8 @@ cp_parser_class_head (cp_parser* parser, { cp_parser_check_for_invalid_template_id (parser, id, type_start_token->location); - virt_specifiers = cp_parser_virt_specifier_seq_opt (parser); } + virt_specifiers = cp_parser_virt_specifier_seq_opt (parser); /* If it's not a `:' or a `{' then we can't really be looking at a class-head, since a class-head only appears as part of a diff --git a/gcc/testsuite/g++.dg/cpp0x/override2.C b/gcc/testsuite/g++.dg/cpp0x/override2.C index 7f17504..0d8871d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/override2.C +++ b/gcc/testsuite/g++.dg/cpp0x/override2.C @@ -28,6 +28,13 @@ struct B6 final final {}; // { dg-error "duplicate virt-specifier" } struct B7 override {}; // { dg-error "cannot specify 'override' for a class" } +namespace N +{ + struct C; +} + +struct N::C final{}; + int main() { D3 d;