From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 1FC7F395A062 for ; Wed, 16 Nov 2022 13:22:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FC7F395A062 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668604963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bJq4J/MB3FvJAQIY1kLLekek4esm2/hgGJ6Nj/zpeSw=; b=gj9PKfNX3R7/vOfjAMo3e6vIotwAx5ZVlQQxVQoylnh5Dt0OEGWMtOvjGuHOgGsdHf4fDK lFAJaatfUwPB0anC6SVPEfzzhyltnhnDcDpj4wFBztVcStgyDrasbXPKYl8UeMJry6DBiJ ZTtg0eqnK3C8DMT2j/P6tHOKSdQDS1k= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-158-m7u_DGkNMJeGvyljt8iSDA-1; Wed, 16 Nov 2022 08:22:42 -0500 X-MC-Unique: m7u_DGkNMJeGvyljt8iSDA-1 Received: by mail-qk1-f198.google.com with SMTP id bs7-20020a05620a470700b006fac7447b1cso17251300qkb.17 for ; Wed, 16 Nov 2022 05:22:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bJq4J/MB3FvJAQIY1kLLekek4esm2/hgGJ6Nj/zpeSw=; b=dgN04+Fy7kltC+R6FmhtYY/lfTPGX0OunjaHST6lBqroLGnznPDjZliGYsJDv6B3d4 dwKQjDwRdMx21MTP9NhaySr3PFtKnw0Cn4fEgehhRxGRRPXmrYMeqnW+8HpB1EW7uK8n HN5+6hMsDbbqKzjoeAUSsyvlmmpkRv1s6RB3f5wzru9TpddAOOFhwVY6TthB3R6cQ7hk XmguyVx9dtlS4q0ATn4YMrHRt3Vl33yVm55YlZt701n8nm2pNBXvgO46ULcipocVv3ss wTfU3YTm/KPjXk2DMUeKk1+oWSBSG9AOjLEDg0+iQylyBn58wS0bS3WgZhMsKN48dB8V 2AJA== X-Gm-Message-State: ANoB5pn+GofZhqWZK5ubChgFJpidvGu9CvN05aFlMrHWfjJgMwcHcVn/ J8qsU9IsZc2Ct0yOLBuABJV0xakpZVbMo5zrRtTojVFc1d6KYswXIW4yIOeckXr+OPFaU58Ag2n Ixm9D9q6zHf+OMDlG/Q== X-Received: by 2002:a05:6214:961:b0:4b7:f2d9:a458 with SMTP id do1-20020a056214096100b004b7f2d9a458mr20119922qvb.14.1668604961319; Wed, 16 Nov 2022 05:22:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf6n93ueIseapzvRnG1vpkCFiA58FA62vrXIWAgINIonV/evHZImOZtvoU4pNyXuojBPwYA5wQ== X-Received: by 2002:a05:6214:961:b0:4b7:f2d9:a458 with SMTP id do1-20020a056214096100b004b7f2d9a458mr20119900qvb.14.1668604961007; Wed, 16 Nov 2022 05:22:41 -0800 (PST) Received: from [192.168.1.101] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a29cb00b006ec62032d3dsm10274148qkp.30.2022.11.16.05.22.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 05:22:40 -0800 (PST) Message-ID: <95aefa6c-5460-3e40-1e07-c2ebd39e3559@redhat.com> Date: Wed, 16 Nov 2022 08:22:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] c++: Reject UDLs in certain contexts [PR105300] To: Marek Polacek Cc: GCC Patches References: <20221112165331.349041-1-polacek@redhat.com> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/15/22 19:35, Marek Polacek wrote: > On Tue, Nov 15, 2022 at 06:58:39PM -0500, Jason Merrill wrote: >> On 11/12/22 06:53, Marek Polacek wrote: >>> In this PR, we are crashing because we've encountered a UDL where a >>> string-literal is expected. This patch makes the parser reject string >>> and character UDLs in all places where the grammar requires a >>> string-literal and not a user-defined-string-literal. >>> >>> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >> >> Since the grammar has >> >> user-defined-string-literal : >> string-literal ud-suffix >> >> maybe we want to move the UDL handling out to a cp_parser_udl_string_literal >> that calls cp_parser_string_literal? > > Umm, maybe, but the UDL handling code seems to be too entrenched in > cp_parser_string_literal and I don't think it's going to be easy to extract > it :/. Fair enough; maybe a wrapper, then? Jason