From patchwork Sat Feb 23 14:59:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1047408 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-496943-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="IZSN6SFI"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 446BFs6ZbYz9s9L for ; Sun, 24 Feb 2019 01:59:52 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=fF3qIyCZk6+tz83e+Hlsh5evzG8wmKHsufiwAzleOjYZK6XiYy7e4 mDM8q0cJiL1Z4UxynEUsPOXVwWVFhloBwurh+MHNAwLEGpVtBWVufstiuuMl1kDA xweiDqWLHuY4rwceP9o2hzkNRZxztJ3gBtOe+6LLuYadd2KuR9wwVY= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=kvp9YfB1KL3btcWXffYH12JWwRI=; b=IZSN6SFI14+1n9NTxF8+ F7sJ6yGkF9lSgJorXYfzl0cp0KEX0FQx4i0EC21PjgCzWGAIja9Ll2mbtuP6T6Cb 18VZ0rTbkj11O3bBkFY4BFmR/G+WKNXa5fICUTywZ0IbhK45g5UbqAljjRD7DXmN AaaotL8my0L6a40P/N1MUiU= Received: (qmail 5565 invoked by alias); 23 Feb 2019 14:59:44 -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 5555 invoked by uid 89); 23 Feb 2019 14:59:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=gg, g.g, *e.bar, UD:g.g X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Feb 2019 14:59:43 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9F4AE6A74 for ; Sat, 23 Feb 2019 14:59:41 +0000 (UTC) Received: from redhat.com (ovpn-123-167.rdu2.redhat.com [10.10.123.167]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A0935D9CA for ; Sat, 23 Feb 2019 14:59:41 +0000 (UTC) Date: Sat, 23 Feb 2019 09:59:41 -0500 From: Marek Polacek To: GCC Patches Subject: C++ PATCH to add test for c++/89419 Message-ID: <20190223145941.GL20014@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) This test was fixed by r269094, a fix for PR88394. Tested on x86_64-linux, applying to trunk. 2019-02-23 Marek Polacek PR c++/89419 * g++.dg/cpp1y/lambda-generic-89419.C: New test. diff --git gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C new file mode 100644 index 00000000000..46ce909f3b8 --- /dev/null +++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-89419.C @@ -0,0 +1,24 @@ +// PR c++/89419 +// { dg-do compile { target c++14 } } + +struct A; +struct B { + struct C { C (); C (C &); } b; +}; +struct D { A operator* (); }; +struct A { + template void foo (T x) { x (this); } +}; +struct E { + auto bar () { return e; } + D e; +}; +struct F { B f; int g; }; + +int +main () +{ + E e; + auto f = *e.bar (); + auto i = [&] { F g; g.g = 1; auto h = [&](auto) { g.g = 0; }; f.foo (h); return g; }; +}