From patchwork Wed Sep 9 21:11:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 516022 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0EF29140281 for ; Thu, 10 Sep 2015 07:12:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=IKc5f0ef; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=jji9FVqo/OI8LEtY8 lWtgVGz0SIRUSPF5QcBDxJnP7ABiWMvmQLeYrTnW42m2k7O3iPoN2j/KHbNCzCoh 5XGUBU7Ra8cckkBLWKfPY03+lepCYFvwMh5byZ8Tomrmtt52EMCb5NYlDUSNxVjt DufPTpB7XTBihrb8sHsHQ28T1Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=RYREmWJTCDYBzPQsHKnfJTB g1sw=; b=IKc5f0ef3TfPydVHCAuYtshG/vmEr+S0kb/IKL4hOOMkHfU3gYp9oi/ zTnQSbPWD7WeIhN371DVo0jbc2Lxhfy27rpT0JvnGBnkwtgOeAm6HeSEWS8VtwNK rdYfVOU9BTFwDgpGxmIrphnus0QNK0/fnl60WPvrpsAjKbwt1uB4= Received: (qmail 126001 invoked by alias); 9 Sep 2015 21:12:02 -0000 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 Received: (qmail 125992 invoked by uid 89); 9 Sep 2015 21:12:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 09 Sep 2015 21:12:00 +0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t89LBw4L018945 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Sep 2015 21:11:59 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t89LBwVr009640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 9 Sep 2015 21:11:58 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t89LBw7Q000468; Wed, 9 Sep 2015 21:11:58 GMT Received: from [192.168.1.4] (/87.10.208.171) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 Sep 2015 14:11:58 -0700 Subject: Re: [C++ Patch] PR 67318 ("[6 regression] Parsing error when using abbreviated integral type names in template parameter pack declaration") To: Jason Merrill , "gcc-patches@gcc.gnu.org" References: <55F060D3.4070208@oracle.com> <55F07DA4.4030808@redhat.com> <55F08345.2010408@oracle.com> From: Paolo Carlini Message-ID: <55F0A094.4040609@oracle.com> Date: Wed, 9 Sep 2015 23:11:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55F08345.2010408@oracle.com> X-IsSubscribed: yes ... what about something this simple? Passes testing... Thanks, Paolo. /////////////////////////// Index: cp/parser.c =================================================================== --- cp/parser.c (revision 227600) +++ cp/parser.c (working copy) @@ -19626,11 +19626,12 @@ cp_parser_parameter_declaration (cp_parser *parser if (type && DECL_P (type)) type = TREE_TYPE (type); - if (type - && TREE_CODE (type) != TYPE_PACK_EXPANSION - && declarator_can_be_parameter_pack (declarator) - && (template_parm_p || uses_parameter_packs (type))) - { + if (((type + && TREE_CODE (type) != TYPE_PACK_EXPANSION + && (template_parm_p || uses_parameter_packs (type))) + || (!type && template_parm_p)) + && declarator_can_be_parameter_pack (declarator)) + { /* Consume the `...'. */ cp_lexer_consume_token (parser->lexer); maybe_warn_variadic_templates (); Index: testsuite/g++.dg/cpp0x/variadic166.C =================================================================== --- testsuite/g++.dg/cpp0x/variadic166.C (revision 0) +++ testsuite/g++.dg/cpp0x/variadic166.C (working copy) @@ -0,0 +1,14 @@ +// PR c++/67318 +// { dg-do compile { target c++11 } } + +template +struct MyStruct1; + +template +struct MyStruct2; + +template +struct MyStruct3; + +template +struct MyStruct4;