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 75E17385AC3B for ; Tue, 25 Oct 2022 15:39:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 75E17385AC3B 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=1666712377; 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=RFU3HhRNXTq2fVDFYtGoysXPX9SXAStdVzX/DmgtOLY=; b=Vbfs5siey8IWjq0XK6/W9wvqh+nT03DeG1nzacfbvbXUdw30lGZ2CjSXuOuozbkabmXsrS oE1qKkD4hxs8KdRweNOaxNlEf0iT2ra4/9keYsQsvBTQ78Ttat4lpEZ5/I9wexHwkhyUH/ z6x2xDwcMLPVpwAgxaQ1uamlZzpPAQs= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-120-fga8A6yOOHmToKj2MPfiiA-1; Tue, 25 Oct 2022 11:39:33 -0400 X-MC-Unique: fga8A6yOOHmToKj2MPfiiA-1 Received: by mail-qk1-f199.google.com with SMTP id u7-20020a05620a0c4700b006ee526183fcso11695293qki.8 for ; Tue, 25 Oct 2022 08:39:33 -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:message-id:reply-to; bh=RFU3HhRNXTq2fVDFYtGoysXPX9SXAStdVzX/DmgtOLY=; b=ZD8jd+FjFW7k9JQE4X65f/VCV8Taddi2L631Hawc73l8mLs3p9lTRWtqHx95ybjWYe nPbaDq2Kg81TifMvJP3Fedki0hnYPgcCYNvbeQ+3TvsUeYrPFXsHPaRDpOO/q2E3moBm 00rNFGrbiVRJbKRRNEpcxC49KSrPtzXUHhCvXx7m580nSkmijGZYOdP1KYd6O72vgeOS 35/EpwlN5Fa8cmNCXAGpi1W/0XyJpPcTzc/93FjRhisDo4e3sC5dd9EF9IxwQa0MkyUv Bkq9O1AFeF74WgyvTIH7WnZljqJaodIrDMkm3o8ON99XuBXqsSX1ASkXnMcLDyn0e7NI 1PUQ== X-Gm-Message-State: ACrzQf3w/lcv2dICpWuXleDjOvt00CNTJuNvoV2k8/pFzSK2Ju0U/Jg6 cpDXSp0e8GvhfQMKyUDuRfAeRBSMgRHBcBaizHPEWAMiIPWYPokd0lmhlKC8CYtB89WkjwhBIQQ D82lD+8C5+FpbNbvkiQ== X-Received: by 2002:a05:620a:2a13:b0:6ee:e709:d425 with SMTP id o19-20020a05620a2a1300b006eee709d425mr27769446qkp.785.1666712372850; Tue, 25 Oct 2022 08:39:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7udrsNf2KyF4ld4KypZq12PoFUInjuN0cjAGwY9byB7haN29FditIhJfLvU4NU2fkJ7RdVUg== X-Received: by 2002:a05:620a:2a13:b0:6ee:e709:d425 with SMTP id o19-20020a05620a2a1300b006eee709d425mr27769426qkp.785.1666712372596; Tue, 25 Oct 2022 08:39:32 -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 bn6-20020a05620a2ac600b006bbc3724affsm2226297qkb.45.2022.10.25.08.39.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Oct 2022 08:39:32 -0700 (PDT) Message-ID: <94b6bf22-bf2c-f6c0-3ac6-ca2c89bfde2e@redhat.com> Date: Tue, 25 Oct 2022 11:39:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] c++: Implement -Wdangling-reference [PR106393] To: Marek Polacek , Jonathan Wakely Cc: GCC Patches References: <20221021232824.1093138-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.7 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 10/25/22 09:14, Marek Polacek wrote: > On Tue, Oct 25, 2022 at 12:34:50PM +0100, Jonathan Wakely wrote: >> 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? > > Right, a #pragma will not help, it would only disable the warning > within the definition of use_facet itself. That's why I mentioned adjusting the compiler, i.e. check warning_enabled_at (DECL_SOURCE_LOCATION (fn) Jason