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 2A2E63857BAB for ; Tue, 25 Oct 2022 11:35:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A2E63857BAB 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=1666697706; 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=6wOusTQ/7sTarP4/i2SbRriA7u938N4xEafe0npbAuw=; b=MsI4q3CI2pbJ4IFsKZvFanL/6wCJ/fH5gbATLyLB/uY92SJfNXzwnBfZKIYC27ZP6qQrcm yLPMTPOnx3Gx1DdIWFuvDCOErPK7lXBgUbczCMboor0NpcnngRY4MNZDZL7B70rtUz/VTr CskYntf+9Ks6LHbbpvTNwwOmOZ/RLNk= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-15-Xk5xeTejN1iexno6lx_sZg-1; Tue, 25 Oct 2022 07:35:02 -0400 X-MC-Unique: Xk5xeTejN1iexno6lx_sZg-1 Received: by mail-ej1-f71.google.com with SMTP id hp41-20020a1709073e2900b0078e07dbf280so2557281ejc.7 for ; Tue, 25 Oct 2022 04:35:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6wOusTQ/7sTarP4/i2SbRriA7u938N4xEafe0npbAuw=; b=t9BVnn48iyd4RRWn+xRYMv5lE3BI4DnbZwvbf5OcZmREOTLAj2AQrvb38y3WV9RVSm 7PqQSbcU4RxK4GyawC8WxgrVDrxypfcJHZDJRRErJlxItftFFTmdzX693mItZJbuObah +ycyHYeFUUSlEQ2r0LFlrHNUS+5WHddGFpnorthF+5PE6Dcid+H+pyM1Qm4D2sbILBQd GxaPUOF+TrfaEyaEjD1A9+DP8t+7K2l9D4R4XmpdWWTiIq4DDmRwOnueWjXlW73sYbZ+ RqAL6hik2xXdcoEggaX5UGdrqHi7Oh8Xrhs1l0TYD2GRjaBOgB5Ai45lu0dESYWxUAlM snPg== X-Gm-Message-State: ACrzQf10gz+Qt89YBesy58AUa1EjNnYgkZp/OUPtZ5VFm9wpyf7PvgOf yOsCPYWYUE75PX+ERdCL+bzOjpIkFhDzd+59cuEei9jYPEqfuiMHXoZO87O0LycLDsH4uZ6syuy khsJysM7a2CB7IinlvRhkoTnGP09UhXiNVQ== X-Received: by 2002:a05:6402:4301:b0:461:96bb:b238 with SMTP id m1-20020a056402430100b0046196bbb238mr13261325edc.328.1666697701709; Tue, 25 Oct 2022 04:35:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TtDcRMCFPSmi3Xy4fCTNxU5ffVouQToOdiLUFLQTOaIhDbOjO/ul/uyZjaa4XBbp8M30V7IJH6bGjLqTC3cc= X-Received: by 2002:a05:6402:4301:b0:461:96bb:b238 with SMTP id m1-20020a056402430100b0046196bbb238mr13261311edc.328.1666697701522; Tue, 25 Oct 2022 04:35:01 -0700 (PDT) MIME-Version: 1.0 References: <20221021232824.1093138-1-polacek@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Tue, 25 Oct 2022 12:34:50 +0100 Message-ID: Subject: Re: [PATCH] c++: Implement -Wdangling-reference [PR106393] To: Jason Merrill Cc: Marek Polacek , GCC Patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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,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 Mon, 24 Oct 2022 at 18:30, Jason Merrill wrote: > > On 10/21/22 19:28, Marek Polacek wrote: > > When testing a previous version of the patch, there were many FAILs in > > libstdc++'s 22_locale/; all of them because the warning triggered on > > > > const test_type& obj = std::use_facet(std::locale()); > > > > but this code looks valid -- std::use_facet doesn't return a reference > > to its parameter. Therefore I added code to suppress the warning when > > the call is std::use_facet. Now 22_locale/* pass even with the warning > > on. We could exclude more std:: functions like this if desirable. > > Instead of adding special cases in the compiler, let's disable the > warning around the definition of use_facet (and adjust the compiler as > needed so that avoids the warning). I assume you mean using #pragma here. If we disable it around the definition of use_facet, will that disable it for callers of use_facet, or only within the definition of use_facet itself?