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.129.124]) by sourceware.org (Postfix) with ESMTPS id 4A8653858C2D for ; Tue, 27 Sep 2022 13:19:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A8653858C2D 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=1664284753; 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=GditOOM2dNGWV+b9JLRe7wdtwz9ndXh+slGtqHS9wDc=; b=OXfLHQ8kP+1udKKG33ol6UvDwrKdmVQxN0hSIji/33IV2FbXxNbTlvW/knaV2Olb/yqm62 ypxwJOhEysFQEYsmBE21UYUHt9+740x2A09v0lwpgl5eC11dk2aqcyEfIqa4XBovbAxwGR Xda6C5l2p+RfOQbmmSxKftJ5wnkwBf0= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-625-TtPD3QYSOLqgPTWPZutL6g-1; Tue, 27 Sep 2022 09:19:12 -0400 X-MC-Unique: TtPD3QYSOLqgPTWPZutL6g-1 Received: by mail-qt1-f200.google.com with SMTP id g6-20020ac84b66000000b0035cf832dec9so6705549qts.6 for ; Tue, 27 Sep 2022 06:19:12 -0700 (PDT) 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; bh=GditOOM2dNGWV+b9JLRe7wdtwz9ndXh+slGtqHS9wDc=; b=Vfj9yywTOVM6DzXcbAiwj3XiM08wxEpWcbSShmSzCZ+7NLCNmD2IE949rKU4YxLtwC /LG+k6eq4alJ0Q6H8fexDttpX7EqiOpF5mguU5w2usW9NGRTfzuWKr/Lz5eWJwikd1AO nzphiajia37wmjYzoHSeYxZ3qjB7feLjP5dHAEpYqwpT+bai66GcTdj0Ll1YDieehagI kTypuANMKsgs60ktxNhYgXxINOPC5QOyou6iypgsjrHXyljvtV3alParryZOi0jlnhpv hFZ+EpOeoPWR5l5s6hgkbyjp2wVIn1Wdfed1BWOYkIJ81SlXcmdX4SXYk1+m4Mn62Q5M SQ4Q== X-Gm-Message-State: ACrzQf3njmo62RjkB4Ow8XfgDgL1T8no7/OMKa/03W1+PJVIFm+/eazT adm4MaeKy+ysXWK6pbieD4VT+pfx4gqXmeXuRpusoqyYxz93mT/tpIQb52Lt9en2PjUZYGcgd26 O21JiWI8tnb0qajKhVA== X-Received: by 2002:a05:622a:138b:b0:35b:b619:b87d with SMTP id o11-20020a05622a138b00b0035bb619b87dmr22400880qtk.146.1664284752397; Tue, 27 Sep 2022 06:19:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4VvNO3ZrWkKcdnrmbpuIRHgxIJQvtSWWUP5wao+YJFgI2jLleTvPpv2a3mOxSfEju0UbF6Ag== X-Received: by 2002:a05:622a:138b:b0:35b:b619:b87d with SMTP id o11-20020a05622a138b00b0035bb619b87dmr22400856qtk.146.1664284752062; Tue, 27 Sep 2022 06:19:12 -0700 (PDT) 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 d22-20020a05620a205600b006b9c6d590fasm895652qka.61.2022.09.27.06.19.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Sep 2022 06:19:11 -0700 (PDT) Message-ID: <4dd7ed71-d49a-2c9e-5cc4-8b3409af3cba@redhat.com> Date: Tue, 27 Sep 2022 09:19:10 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v2] c++: Don't quote nothrow in diagnostic To: Richard Biener , Marek Polacek Cc: GCC Patches References: <20220923184026.379494-1-polacek@redhat.com> <5b9a9ee4-f6ed-14d3-b069-e3222739f8d2@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=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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 9/27/22 04:41, Richard Biener wrote: > On Mon, Sep 26, 2022 at 9:54 PM Marek Polacek wrote: >> >> On Mon, Sep 26, 2022 at 12:34:04PM -0400, Jason Merrill wrote: >>> On 9/26/22 03:50, Richard Biener wrote: >>>> On Fri, Sep 23, 2022 at 8:41 PM Marek Polacek via Gcc-patches >>>> wrote: >>>>> >>>>> In >>>>> Jason noticed that we quote "nothrow" in diagnostics even though it's >>>>> not a keyword in C++. Just removing the quotes didn't work because >>>>> then -Wformat-diag complains, so this patch replaces it with "no-throw". >>>>> >>>>> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >>>> >>>> That doesn't look like an improvement to me. Can we quote 'nothrow()' instead? >> >> Understood. >> >>> nothrow() is a syntax error; the C++11 keyword is 'noexcept'. std::nothrow >>> is a dummy placement argument used to indicate that a new-expression should >>> return null rather than throw on failure. >>> >>> But bizarrely, the library traits use the word "nothrow". Marek's patch >>> clarifies that we are not trying to refer to anything in the language. >>> >>>> I'd rather leave it alone than changing it to no-throw. Why does -Wformat-diag >>>> complain? If we shouldn't quote nothrow that should be adjusted? >>> >>> I think -Wformat-diag complains because "nothrow" is an attribute; it also >>> includes some other attribute names in the list of "keywords". >>> >>> I would also be fine with just removing the quotes and removing nothrow from >>> c_keywords. >> >> Like below? Bootstrapped/regtested on x86_64-pc-linux-gnu. > > Yes. I assume that terms like "nothrow constructible" are used in the > C++ standard? Not in the language, only in library names like std::is_nothrow_constructible. Jason