From patchwork Fri Sep 20 20:01:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 276707 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CB0712C00C3 for ; Sat, 21 Sep 2013 06:01:35 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=rBhYE4g3j2KvbCA5H9GoE39lCyfC83+6mdMi8TOp9nb dn8nNj4iHJzHy5QamNHrQBlVupgdVcvA6Hi3OJ7nOzq+MLWsNK4znI3uoniBzCAL IVi2qsF+Ok2PRZl9v5N+tt8agBHGQatW0O5WRgtv1AsVOaTpC0KDsrfHjtGj+sPY = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=Qp/vnR5Eg0SzslFqy/TIBFUVh7I=; b=fM4vtd76JOPkYB3sn JKKATC8bBWJXM6G18/7NPoxQ4lEiXemg1nI+iXk/3ycqzuPh1AeQeDLLVLmsXX2t l/ccBEiT3pnZraz+xKQAw9YFLNBrbbrhp/uDV7NzLFC9JTcpkcITZOkmH/xycRbh PmcmKBmuOKbrghjMthqidw9JYk= Received: (qmail 12856 invoked by alias); 20 Sep 2013 20:01:28 -0000 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 Received: (qmail 12841 invoked by uid 89); 20 Sep 2013 20:01:28 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 20 Sep 2013 20:01:28 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, SPF_SOFTFAIL, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: aserp1040.oracle.com Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r8KK1OXT001776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 Sep 2013 20:01:25 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8KK1Mcx014740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Sep 2013 20:01:24 GMT Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8KK1M4Y014733; Fri, 20 Sep 2013 20:01:22 GMT Received: from poldo4.casa (/79.53.235.170) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Sep 2013 13:01:22 -0700 Message-ID: <523CA990.6040702@oracle.com> Date: Fri, 20 Sep 2013 22:01:20 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 58481 X-IsSubscribed: yes Hi, this bug looks superficially similar to the already fixed c++/50089: an ICE on valid in build_base_path for a qualified-id call in a lambda, which can be worked around by qualifying with this->. It seems to me that in this case too a fix may boil down to simply using current_nonlambda_class_type () instead of current_class_type: here too its return value ends up as the third argument of adjust_result_of_qualified_name_lookup. Tested x86_64-linux. Thanks, Paolo. ///////////////////////////// /cp 2013-09-20 PR c++/58481 * pt.c (tsubst_copy): Use current_nonlambda_class_type to call tsubst_baselink. /testsuite 2013-09-20 PR c++/58481 * g++.dg/cpp0x/lambda/lambda-this17.C: New. Index: cp/pt.c =================================================================== --- cp/pt.c (revision 202785) +++ cp/pt.c (working copy) @@ -12434,7 +12438,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t com return t; case BASELINK: - return tsubst_baselink (t, current_class_type, args, complain, in_decl); + return tsubst_baselink (t, current_nonlambda_class_type (), + args, complain, in_decl); case TEMPLATE_DECL: if (DECL_TEMPLATE_TEMPLATE_PARM_P (t)) Index: testsuite/g++.dg/cpp0x/lambda/lambda-this17.C =================================================================== --- testsuite/g++.dg/cpp0x/lambda/lambda-this17.C (revision 0) +++ testsuite/g++.dg/cpp0x/lambda/lambda-this17.C (working copy) @@ -0,0 +1,21 @@ +// PR c++/58481 +// { dg-require-effective-target c++11 } + +struct Test { + template inline void triggerTest (Args&&... fargs) { } +}; + +struct TestPickled : Test { + template void triggerTest (Args&&... fargs) { + [=](Args... as) { + Test::triggerTest (as...); + } (); + } +}; + +int main() +{ + TestPickled test; + test.triggerTest (); + return 0; +}