From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30731 invoked by alias); 16 Jun 2011 21:45:59 -0000 Received: (qmail 30723 invoked by uid 22791); 16 Jun 2011 21:45:58 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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; Thu, 16 Jun 2011 21:45:40 +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 p5GLjeTp019716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Jun 2011 17:45:40 -0400 Received: from [127.0.0.1] (ovpn-113-143.phx2.redhat.com [10.3.113.143]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5GLjd8F024731 for ; Thu, 16 Jun 2011 17:45:40 -0400 Message-ID: <4DFA7983.6090508@redhat.com> Date: Thu, 16 Jun 2011 21:48:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-patches List Subject: C++ PATCH for c++/49420 (ICE printing variadic error context) Content-Type: multipart/mixed; boundary="------------050700030603080602000806" 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: 2011-06/txt/msg01300.txt.bz2 This is a multi-part message in MIME format. --------------050700030603080602000806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 199 With ENABLE_CHECKING we want to make sure that we're tracking the number of non-default template arguments, but that doesn't apply to argument packs. Tested x86_64-pc-linux-gnu, applying to trunk. --------------050700030603080602000806 Content-Type: text/x-patch; name="49420.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="49420.patch" Content-length: 1411 commit 8ed2e06bbc3925a1c8d86641938f83e9bbd15bda Author: Jason Merrill Date: Wed Jun 15 12:24:17 2011 -0400 PR c++/49420 * error.c (dump_template_argument): Don't try to omit default template args from an argument pack. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 22470dc..7c90ec4 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -147,7 +147,9 @@ static void dump_template_argument (tree arg, int flags) { if (ARGUMENT_PACK_P (arg)) - dump_template_argument_list (ARGUMENT_PACK_ARGS (arg), flags); + dump_template_argument_list (ARGUMENT_PACK_ARGS (arg), + /* No default args in argument packs. */ + flags|TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS); else if (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL) dump_type (arg, flags & ~TFF_CLASS_KEY_OR_ENUM); else diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic112.C b/gcc/testsuite/g++.dg/cpp0x/variadic112.C new file mode 100644 index 0000000..1640657 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/variadic112.C @@ -0,0 +1,19 @@ +// PR c++/49420 +// { dg-options -std=c++0x } + +struct A { }; + +template struct B +{ + typedef typename T::type type ; // { dg-error "no type" } +}; + +template +typename B::type +get(const Array& a, Args... args); + +int main() +{ + A a; + int x = get(a, 1, 2, 3); // { dg-error "no match" } +} --------------050700030603080602000806--