From patchwork Wed Jul 17 17:51:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 1133377 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-505213-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="nwRpkmJl"; 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 45plFP2lT0z9sBF for ; Thu, 18 Jul 2019 03:51:35 +1000 (AEST) 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=J85R/Cjlq9Grcw83SCvsya7I2UK/aPNT7DkoIUeNLDERXOwiZxaqW mXreErBPVDc9H3m/zwiMlqTSxfdKuxU+RLtscegxfb4coeaowti0Lt7jXddpJyRZ yWTJKWKlUgacrYkcIReNvQInyXkrdYEXhyNP+VhOUDIaFRz5G8rcuk= 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=mrHklDqiAi1uuM8tpvoQIm2+bUw=; b=nwRpkmJlMy26Rx4NZJMb cXdwzP1qz7FBdbY7PsBpifEblXKpcmx8E2vwEyZPW0T6RG+8lC6ioK8FsDPW+32F 6iNenEnAZO1zXq743IcZWOhaYtp32Cr5t50Bf57W8VeZZmtoUhie0o5PFYhjSYQ3 xtMDavXD3CVqS08xmoT3dME= Received: (qmail 106028 invoked by alias); 17 Jul 2019 17:51: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 105497 invoked by uid 89); 17 Jul 2019 17:51:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.1 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; Wed, 17 Jul 2019 17:51:27 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F4A5309B143 for ; Wed, 17 Jul 2019 17:51:26 +0000 (UTC) Received: from redhat.com (ovpn-122-9.rdu2.redhat.com [10.10.122.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CCEFF600C8; Wed, 17 Jul 2019 17:51:25 +0000 (UTC) Date: Wed, 17 Jul 2019 13:51:23 -0400 From: Marek Polacek To: GCC Patches , Jason Merrill Subject: C++ PATCH to add test for c++/91104 Message-ID: <20190717175123.GF32749@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.0 (2019-05-25) This was a wrong code issue where we printed 2 3 1 1 2 3 instead of 1 2 3 1 2 3 but it was fixed by r271705. I don't know of a good way to check the auto... expansion here so I used dg-output. Tested on x86_64-linux, ok for trunk? 2019-07-17 Marek Polacek PR c++/91104 * g++.dg/cpp1y/lambda-generic-variadic20.C: New test. --- /dev/null +++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic20.C @@ -0,0 +1,20 @@ +// PR c++/91104 +// { dg-do run { target c++14 } } + +#include + +void test(void (*f)(int, int, int)) { + f(1, 2, 3); +} + +int main() { + test([](auto... args) { + printf("%d %d %d\n", args...); + }); + test([](int a, int b, int c) { + printf("%d %d %d\n", a, b, c); + }); +} + +// { dg-output "1 2 3(\n|\r\n|\r)" } +// { dg-output "\[^\n\r]*1 2 3" }