From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17259 invoked by alias); 16 Aug 2009 14:13:39 -0000 Received: (qmail 17251 invoked by uid 22791); 16 Aug 2009 14:13:38 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_31,J_CHICKENPOX_38,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Aug 2009 14:13:32 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1McgUB-0002xZ-9b for gcc-help@gcc.gnu.org; Sun, 16 Aug 2009 14:13:27 +0000 Received: from r74-192-0-229.bcstcmta01.clsttx.tl.dh.suddenlink.net ([74.192.0.229]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 14:13:27 +0000 Received: from cppljevans by r74-192-0-229.bcstcmta01.clsttx.tl.dh.suddenlink.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2009 14:13:27 +0000 To: gcc-help@gcc.gnu.org From: Larry Evans Subject: Re: Help with Code Validation of Variadic templates Date: Mon, 17 Aug 2009 03:18:00 -0000 Message-ID: <4A88188A.8030604@suddenlink.net> References: <4759B730.2000504@htwm.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.22 (X11/20090608) In-Reply-To: <4759B730.2000504@htwm.de> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00160.txt.bz2 On 12/07/07 15:12, Rene Buergel wrote: > I'm currently playing around using mainline with the variadic template > feature and would like to hear some comments on code gcc is rejecting. > > #1: > ===== > 1 template T max() > 2 { > 3 return a > max() ? a : max(); > 4 }; > 5 > 6 templateT max() > 7 { > 8 return a > b ? a : b; > 9 }; > > int main() > { > unsigned int a = max(); > unsigned int a = max(); > } > > ===== > Using the non-variadic template, everything works fine. With the > variadic templates, gcc issues an error in line 3: > error: parameter packs not expanded with `...': > note: 'Args' [snip] I think this is an instance of bug 40092: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40092 A 1 line patch to gcc/cp/tree.c has been proposed there. You might try the patch an see if it solves your problem. -regards, Larry