From patchwork Tue Oct 9 23:39:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 190513 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 80ACD2C009A for ; Wed, 10 Oct 2012 10:39:18 +1100 (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=1350430758; h=Comment: DomainKey-Signature:Received:Received: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=1ohAaPlubyFhAw+/iMsFjqwJpAA=; b=tQkn5PuI5fa86LC i25Vc97o7d4e/NiOG5CttRRHr/apxG7ZMwYERdy2y/d0YtnoPCWbc6rMtbpw31eB /12iLRqL4Apxqx9p8gyLwS7TTgZ5ZEAU5S1Flx5MVXZGWi9XhQvWofbheExJxHzj eTMqs0OyD6bW8Ux0f20JpUgkVRp4= 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:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=HaBFx7z/2QNLUtueLV/9B2E1tL4AnnLPhvWP2p9CLPcBxNT04nziDMqRk/ArHV 2sgvRFNo7UWZSONNyORnlvC46Z9mxOoJRpjVFlRlBeK4O7qGCLwdOmculG+hf/g+ suF3NYj3Mkg3Ta/0/9U43WcmMxVGuolL6UEviD05b2Osk=; Received: (qmail 23932 invoked by alias); 9 Oct 2012 23:39:14 -0000 Received: (qmail 23923 invoked by uid 22791); 9 Oct 2012 23:39:13 -0000 X-SWARE-Spam-Status: No, hits=-7.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Oct 2012 23:39:09 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q99Nd7O0022062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Oct 2012 23:39:08 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q99Nd6iC026938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Oct 2012 23:39:07 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q99Nd6Ac032116 for ; Tue, 9 Oct 2012 18:39:06 -0500 Received: from [192.168.1.4] (/79.53.234.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 09 Oct 2012 16:39:06 -0700 Message-ID: <5074B598.3090801@oracle.com> Date: Wed, 10 Oct 2012 01:39:04 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [C++ testcase] PR 53307 X-IsSubscribed: yes 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 Hi, I'm adding the testcase and closing the PR as fixed. Tested x86_64-linux. Thanks, Paolo. ////////////////////// 2012-10-10 Paolo Carlini PR c++/53307 * g++.dg/cpp0x/decltype44.C: New. Index: g++.dg/cpp0x/decltype44.C =================================================================== --- g++.dg/cpp0x/decltype44.C (revision 0) +++ g++.dg/cpp0x/decltype44.C (working copy) @@ -0,0 +1,44 @@ +// PR c++/53307 +// { dg-do compile { target c++11 } } + +template struct tuple{}; + +struct funct +{ + template + T operator()(T arg1, argTs...) + { + return arg1; + } +}; + +template class test; + +template < template class tp, + class...arg1Ts, + class...arg2Ts> +class test, tp> +{ + public: + template + auto test_pass(func fun, arg2Ts...arg2s) + -> decltype(fun(arg2s...)) + { + return fun(arg2s...); + } + + template + auto testbug(func fun, arg2Ts...arg2s, arg3Ts...arg3s) + -> decltype(fun(arg2s..., arg3s...)) + { + return fun(arg2s..., arg3s...); + } +}; + +int main() +{ + test, tuple> t; + t.test_pass (funct(), 'a', 2); + t.testbug (funct(), 'a', 2, "fine"); + t.testbug (funct(), 'a', 2); +}