From patchwork Tue Apr 17 02:27:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 153027 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 BDE7AB7058 for ; Tue, 17 Apr 2012 12:52:27 +1000 (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=1335235949; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=1erhOsA qMgmRvx2d33OPRfCieSc=; b=VjtMoCGLWPiFd1xJ7g/NcLURIqe+TQ1UTRSs93j 3cwIAJvSKDBQQ/fSx4/8wXjrIcbA0uOutse2iZG0dEFRIDHk0ccc9m5M8hKX/j5q HysBr5gotPKVCzxwqPhOFnsAcr+BRzWWWjGzdJ9NXm4lIR43WjI/aTGjc4ll+AIt LKGU= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wi14zjsSrTiHXGOq2WsXE2tDDQnqlbbNHM0rDFT0/9JM4djPMWg8/dxGeSg3Di dDAtNGpUZKa4xSMs9MKkq3zk46Z3vEp5STeaok/rL4nPQfaT0BhetcF6wwnvVUDg 6u7bzMl9Ph0zhaoDKFs+GvpivrilmHM0pig9XhXc4JaAI=; Received: (qmail 14488 invoked by alias); 17 Apr 2012 02:52:24 -0000 Received: (qmail 14478 invoked by uid 22791); 17 Apr 2012 02:52:23 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, 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; Tue, 17 Apr 2012 02:52:09 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3H2q99M012161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 Apr 2012 22:52:09 -0400 Received: from [10.3.113.15] ([10.3.113.15]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3H2RwGm020748 for ; Mon, 16 Apr 2012 22:27:58 -0400 Message-ID: <4F8CD52E.5030702@redhat.com> Date: Mon, 16 Apr 2012 22:27:58 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/50303 (failure using template template parameter pack in a pack expansion) 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 When substituting into a template template parameter pack pattern with a set of template arguments, we want to use tsubst_expr so that we get the substituted result; tsubst tries and fails to build up a new template template parameter. Tested x86_64-pc-linux-gnu, applying to trunk. commit d04f9e7b78c9355e7b7835dc00fca3dfa4acc666 Author: Jason Merrill Date: Mon Apr 16 11:31:59 2012 -0400 PR c++/50303 * pt.c (tsubst_pack_expansion): Use tsubst_expr for template template parameters. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 95d0aba..7423781 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9518,7 +9518,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, } /* Substitute into the PATTERN with the altered arguments. */ - if (TREE_CODE (t) == EXPR_PACK_EXPANSION) + if (!TYPE_P (pattern)) TREE_VEC_ELT (result, i) = tsubst_expr (pattern, args, complain, in_decl, /*integral_constant_expression_p=*/false); diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic128.C b/gcc/testsuite/g++.dg/cpp0x/variadic128.C new file mode 100644 index 0000000..8c2d3b2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic128.C @@ -0,0 +1,16 @@ +// PR c++/50303 +// { dg-do compile { target c++11 } } + +template +struct A1 { +}; + +template class... Actions> +void g2() { + g2(); +} + +int main() +{ + g2(); +}