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 3053638560B7 for ; Mon, 26 Sep 2022 16:34:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3053638560B7 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=1664210047; 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=7FC8WrWDccsyJTujcwl4dQSuI85jPiYZOpL7jOl/cVQ=; b=dS9Y49jHoZnEL/zJBT4xXVadVGEzv/2+G+TE+/GsQ3Xwnoawl3knQdsfxcO15mJwtULaxR XZMUZcwSyLUCY7KpseE6Z2dohIqEIMycKu6LWP1ZSCa45n4uCVU4z0GbTH5zuwRmsogO6x xcvTfrgd72jkDXnEHEpenkugJD0IZwQ= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-267-D22PFwuuOkegO2B_yOBnaA-1; Mon, 26 Sep 2022 12:34:06 -0400 X-MC-Unique: D22PFwuuOkegO2B_yOBnaA-1 Received: by mail-qk1-f200.google.com with SMTP id bs33-20020a05620a472100b006cef8cfabe2so5343999qkb.12 for ; Mon, 26 Sep 2022 09:34:06 -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=7FC8WrWDccsyJTujcwl4dQSuI85jPiYZOpL7jOl/cVQ=; b=PRQy3FIDQIpd1MFUSJ8mD9Dck5Rh1f7JQUMC4ViMRSZT5iaNG+Pos3sMQhxd8++ZQo UseBcSUC5j6YXOounYIwo5uoeAuu7xTSxRMQvUk3BjMcnDPk9TEVaV5NFT1IywGhkEwP SWBlOy1klgFF/zxrwqFICUOIgV+20yXxnTBi2WDz/XpL5ihP5At8HaYHOKy1dVcm98AH d1XVeI1IOe3zrhnxbhqlz00yeZbvzOaRtXyxd6cVKZ7S5ADOZa4NwmHc476h6zs7Y+9K DtI3WRqYxII+/whueOdJvDxXuAgnv9Z3IrzHpRDGMGYXfVzJFTkduFAuPIxG+rglHeNM ptOw== X-Gm-Message-State: ACrzQf3gSJ+TZh6pJbqVuMEb3JWG7ZDpp2T79KWA3puKKRqRTevdf9nu CTIIVjb9USDN4Y1KXibl3Lcfrl4O1HxQo4rYqMhYrYcneiM8C/wt/d8SpWi6Apaej2IEB6viC6T xDspWmdPe++Rvu1p3kQ== X-Received: by 2002:a05:620a:7f2:b0:6ce:b70b:7d63 with SMTP id k18-20020a05620a07f200b006ceb70b7d63mr14534221qkk.770.1664210046194; Mon, 26 Sep 2022 09:34:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77xs9QVb1e1nyEKuUTU0ecIeSjAiojXgjqeWJlroadtpi91938Jb3CJYedthV0hEAfDhWEpw== X-Received: by 2002:a05:620a:7f2:b0:6ce:b70b:7d63 with SMTP id k18-20020a05620a07f200b006ceb70b7d63mr14534197qkk.770.1664210045928; Mon, 26 Sep 2022 09:34:05 -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 l3-20020a05620a28c300b006b872b606b1sm12257082qkp.128.2022.09.26.09.34.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 09:34:05 -0700 (PDT) Message-ID: <5b9a9ee4-f6ed-14d3-b069-e3222739f8d2@redhat.com> Date: Mon, 26 Sep 2022 12:34:04 -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] c++: Don't quote nothrow in diagnostic To: Richard Biener , Marek Polacek Cc: GCC Patches References: <20220923184026.379494-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=-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/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? 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. Jason