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 BF0B13949083 for ; Wed, 16 Nov 2022 00:35:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF0B13949083 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=1668558952; 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: in-reply-to:in-reply-to:references:references; bh=AlUhVKl/8UTbuRuhroUH714R1mZJZw4JkObCcvp12pU=; b=fUIBN4qdBOyJYKUyEjZI1M6IBMnJLtRCbKCTxrg4OzxjYrGK0QB3XKcIZ6+gj5pcJOgO+T G61EAivgW2LE4Uc2nlhAeGf3eSTZM7ls71ZtaHrHOYXgTuB3dwbXquf5AdgkZ3iEN6UaXA QeduwPmt0ea/ANbROYDCCw3EHlVrl44= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-104-ZCHOVu8ZPc-w7zWt4HaWNQ-1; Tue, 15 Nov 2022 19:35:51 -0500 X-MC-Unique: ZCHOVu8ZPc-w7zWt4HaWNQ-1 Received: by mail-qv1-f70.google.com with SMTP id e13-20020ad450cd000000b004bb49d98da4so11920798qvq.9 for ; Tue, 15 Nov 2022 16:35:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AlUhVKl/8UTbuRuhroUH714R1mZJZw4JkObCcvp12pU=; b=DYsJiGnIf6lbcZVtvrkSXzZtWWnvmxZ8097amtSAXdbuI92Bm8gaN50/bo+m1zcBQX nBT8pJ8j8CQSyiX2hBzXcX9Hy2Ssb8ZYsczKZbpZ/5mp9QTRV4Uj7rXkwXu0h+nJlfKB DJ7Z/vE7v+iXkscPbX7REtSkR5Kd6tFDKpkqE/LSNWuXymfQDeXg+VDp+Czv6tNUslNY r1LiCb9b4xPvt/NwuwEw9J4oPpm1xe2aQKA5cJfQN33CsM7zQSjuxb5KkzMLo8VXPOf1 Y0gieF7xpIrQ8zpgCJ7BIWwjG8G+OFxgFYPlWP/ZHGQk7VxV+vuppeOw8mkQA8LuEu2C ybbw== X-Gm-Message-State: ANoB5pkqqKjvOZfRHUlVthTWVURVogr6+l33pszq7DuuW3yohD2YmoCQ 4tESnOtamFoq5Kcm0vQcB4Vre2x0b0G6DFI5j2dYH500FCLYIAH9qCh0rBxtzviYM2WxUEXzM19 7O35Z8Sizl7TBEimGmw== X-Received: by 2002:a05:622a:1a1f:b0:3a5:42f9:de64 with SMTP id f31-20020a05622a1a1f00b003a542f9de64mr18926602qtb.685.1668558950705; Tue, 15 Nov 2022 16:35:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7KwBJUMInPTeedkqSXVlPwbGFUfx5AaF9DCYZxM6qCdcqV0XL3XJaoF7hHyBjalcfC+O6WIg== X-Received: by 2002:a05:622a:1a1f:b0:3a5:42f9:de64 with SMTP id f31-20020a05622a1a1f00b003a542f9de64mr18926590qtb.685.1668558950529; Tue, 15 Nov 2022 16:35:50 -0800 (PST) Received: from redhat.com (2603-7000-9500-2e39-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:2e39::1db4]) by smtp.gmail.com with ESMTPSA id s1-20020a05620a29c100b006faeecef56fsm9158190qkp.68.2022.11.15.16.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 16:35:49 -0800 (PST) Date: Tue, 15 Nov 2022 19:35:48 -0500 From: Marek Polacek To: Jason Merrill Cc: GCC Patches Subject: Re: [PATCH] c++: Reject UDLs in certain contexts [PR105300] Message-ID: References: <20221112165331.349041-1-polacek@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.7 (2022-08-07) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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 :/. Marek