From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118637 invoked by alias); 1 Nov 2018 18:16:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 118628 invoked by uid 89); 1 Nov 2018 18:16:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy= X-HELO: mail-qk1-f177.google.com Received: from mail-qk1-f177.google.com (HELO mail-qk1-f177.google.com) (209.85.222.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Nov 2018 18:16:36 +0000 Received: by mail-qk1-f177.google.com with SMTP id a132so12883436qkg.1 for ; Thu, 01 Nov 2018 11:16:35 -0700 (PDT) Return-Path: Received: from [192.168.1.132] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id w4-v6sm4072420qkc.18.2018.11.01.11.16.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 11:16:33 -0700 (PDT) Subject: Re: C++ PATCH to add test to cover case RANGE_FOR_STMT To: Marek Polacek , GCC Patches References: <20181012012838.GL19003@redhat.com> <20181101180633.GF9403@redhat.com> From: Jason Merrill Message-ID: <04d80ed0-6f64-e2b1-2263-a2b4d181e13b@redhat.com> Date: Thu, 01 Nov 2018 18:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181101180633.GF9403@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00040.txt.bz2 On 11/1/18 2:06 PM, Marek Polacek wrote: > Ping. > > On Thu, Oct 11, 2018 at 09:28:38PM -0400, Marek Polacek wrote: >> Recently it came up that no test in the testsuite triggers the RANGE_FOR_STMT >> case in potential_constant_expression_1. I came up with this valid test that >> tickles that codepath. >> >> I can't use ({ }) instead of a lambda because the constexpr machinery doesn't >> handle statement expressions; see default: in cxx_eval_constant_expression. >> >> Tested on x86_64-linux, ok for trunk? >> >> 2018-10-11 Marek Polacek >> >> * g++.dg/cpp1z/constexpr-lambda22.C: New test, OK, thanks. Jason