From patchwork Mon Apr 16 03:12:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 152748 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 13637B6FDC for ; Mon, 16 Apr 2012 13:13:13 +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=1335150794; 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=qp0PxIg RNduLFJm81VprCiDOtRI=; b=pokR1boqtxZ3IRgGbwtPYfKHeVD2FGi+wl7858M b24t51nWFe+4AFNvIl6sJXh4QwQcyve9V6TSlHUnKQi5feYu94W3yYRH4f7O0fHY r/fdhxOjacJkez8m+re/O7z0IKja2uC89sy5OQ3+u1AdGCCCSmtAAB/lxtDMODXA FWBQ= 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=aKfHdWRLcgcIlNwLgy3Jmp1J+nAa8xGZ6HVlyz+zlMDL5bHqiasnuYfmNf1iPi hSGbgg5XcFzZKDyeYlst9uHGGj3iqxrjKjKxmBtndhP8ZpH7a8vqLWhPys5+ZwJk 9r9kjFjlFJC3yWigf6rRki8LOXTfOlUqP6zG0ldiobE1c=; Received: (qmail 21689 invoked by alias); 16 Apr 2012 03:13:09 -0000 Received: (qmail 21679 invoked by uid 22791); 16 Apr 2012 03:13:07 -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; Mon, 16 Apr 2012 03:12:51 +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 q3G3Co43028651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 15 Apr 2012 23:12:51 -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 q3G3ComD001787 for ; Sun, 15 Apr 2012 23:12:50 -0400 Message-ID: <4F8B8E31.5030808@redhat.com> Date: Sun, 15 Apr 2012 23:12:49 -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++/52292 (problems with variadic member templates) 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 In coerce_template_parms, inner_args is the set of args we're actually working on, whereas "args" also includes any args of the enclosing scope. Treating the latter as the former leads to problems when there actually are multiple levels. Tested x86_64-pc-linux-gnu, applying to trunk and 4.7. commit 4e0709c10d6b3d9139eba31f6d162ae8b81915e2 Author: Jason Merrill Date: Sun Apr 15 20:28:33 2012 -0400 PR c++/52292 PR c++/52380 * pt.c (coerce_template_parms): Even if we aren't converting we want to expand argument packs. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 07a2cc0..42dc0a7 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6882,7 +6882,7 @@ coerce_template_parms (tree parms, { /* We don't know how many args we have yet, just use the unconverted ones for now. */ - new_inner_args = args; + new_inner_args = inner_args; break; } } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic124.C b/gcc/testsuite/g++.dg/cpp0x/variadic124.C new file mode 100644 index 0000000..8ddc810 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic124.C @@ -0,0 +1,29 @@ +// PR c++/52292 +// { dg-options -std=c++11 } + +template