From patchwork Fri Jan 18 16:45:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1027613 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-494316-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="auDKCPoG"; 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 43h6KL64zpz9sBn for ; Sat, 19 Jan 2019 03:46:30 +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=lOwI8SfvNOSvMcw4QYq1Cpz7G4bjCjOfnVYgiEEJPWIct4eApb4TI S1IdL9yB6b6nequsHP/nMuxwqbJ6LblL7CBj+wuSmYLK7Kq17GGJk3zJcwVSaCCe 3UzueSeW3wkOAvj//V7EMOrpydUlTmpYUQw1C0MLKZfElesMGCsorU= 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=JJ78oFAWnrcEWWj7259q9+y94lM=; b=auDKCPoGsjjImZKZ4s9u I5tQQ2+p/+MHzvepi2urVzO8AeRBRj6PBRYgS1zvR7lPqlvgce69szAn5y3QBf/A JW4qXKZa1lHZ48N8mmFhPTe/+NBKRhshNj5jum6D+jv90TcW5KrNtVTSYgYWWu8P IEbA1qomlUWDYjvBCfi7zVQ= Received: (qmail 4038 invoked by alias); 18 Jan 2019 16:46:11 -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 3865 invoked by uid 89); 18 Jan 2019 16:45:57 -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= 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; Fri, 18 Jan 2019 16:45:54 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C335C05B1E7 for ; Fri, 18 Jan 2019 16:45:53 +0000 (UTC) Received: from redhat.com (ovpn-121-44.rdu2.redhat.com [10.10.121.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC14D5C57C for ; Fri, 18 Jan 2019 16:45:52 +0000 (UTC) Date: Fri, 18 Jan 2019 11:45:50 -0500 From: Marek Polacek To: GCC Patches Subject: C++ PATCH to add test for c++/86926 Message-ID: <20190118164550.GA26714@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) This test got fixed by r267859, so let's add it. Unfortunately, it still ICEs on the gcc-8 branch. Tested on x86_64-linux, applying to trunk. 2019-01-18 Marek Polacek PR c++/86926 * g++.dg/cpp1z/constexpr-lambda23.C: New test. diff --git gcc/testsuite/g++.dg/cpp1z/constexpr-lambda23.C gcc/testsuite/g++.dg/cpp1z/constexpr-lambda23.C new file mode 100644 index 00000000000..4ff866b5d94 --- /dev/null +++ gcc/testsuite/g++.dg/cpp1z/constexpr-lambda23.C @@ -0,0 +1,16 @@ +// PR c++/86926 +// { dg-do compile { target c++17 } } + +int +main() +{ + constexpr auto f = [](auto self, auto n) { + if(n < 2) + return n; + return self(self, n - 1) + self(self, n - 2); + }; + + constexpr auto fibonacci = [=](auto n) { return f(f, n); }; + + static_assert(fibonacci(7) == 13); +}