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 0854D3858031 for ; Wed, 15 Feb 2023 16:56:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0854D3858031 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=1676480160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c/yP73DetwRPnRlZREmCWd3mc3g/2XjLZbDfOqZjSl4=; b=G36rG2cZVEO+8QcA7ltJKr+EC4P5mKOKB0otzh/ZRTTuUGPYc56JYyFahrCQT1ycRfD7Zw /wtw0dfhs0rTYT6d+GiZKu4JPtqnMDinHPVj0KbC2p1X+10iQJH9i8852BnCSxiSvVPZeg heCCDk3jP+w8vjJvFAXrDIqOHKfdDXA= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-443-9P0FP6BUPWiOFK73O2ETWg-1; Wed, 15 Feb 2023 11:55:59 -0500 X-MC-Unique: 9P0FP6BUPWiOFK73O2ETWg-1 Received: by mail-qv1-f69.google.com with SMTP id jy16-20020a0562142b5000b0056eb7af8942so4911525qvb.14 for ; Wed, 15 Feb 2023 08:55:59 -0800 (PST) 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: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=c/yP73DetwRPnRlZREmCWd3mc3g/2XjLZbDfOqZjSl4=; b=UYXsbi/ObmnSjBsj88Lhk6YhIsV57/vg8RAfp59j4MHNcvbV71jGjIIODqujn4inmG PBkzHRlm1D/l2gIxDAV9zwezl10plBedf8Y3JZmhwfj25Xq5j2lanMgO1K3/GrZMiEbV rXdXpH9V6+yyKGPvdgg5fc5D9Lnh4mmYghiOg1GhFfaIfbbZtVRwfbPQAlH2kjSilGaJ CTyMl/3V4MhbhtTuYx6PhxIucpuYzF71EYJakUFkudT+LyCCav9BfSSsIpiaD5LzSyOE FN3hRE/EMa2U5iKN6VT5tEo42uH4wrjIhHvD0aLorzmeLmU7mK6xEnv5i0IEM6Knrscq 5iSQ== X-Gm-Message-State: AO0yUKU+iwMO1itd84Ro8MWAJhwt/uDy2ZNoTLabC7rt7v6+HVwqVxFw ahOpHGs42dzzBtbE0lU+B9z/gOVzW0zhd3XFIYhg0JkTCWnZUAKa04XUPxSBj2Y22l95dq8cIo1 8eqk3PXe5PcOACLBrPA== X-Received: by 2002:ad4:5ca2:0:b0:56e:bb46:fc72 with SMTP id q2-20020ad45ca2000000b0056ebb46fc72mr4901802qvh.45.1676480158740; Wed, 15 Feb 2023 08:55:58 -0800 (PST) X-Google-Smtp-Source: AK7set91ifgrq2mjpQApeas37IvmWrnnfCp/SfDV+MUcyh2EeiPxrAp2ZbOG4XZBSCueEMYhtHApmg== X-Received: by 2002:ad4:5ca2:0:b0:56e:bb46:fc72 with SMTP id q2-20020ad45ca2000000b0056ebb46fc72mr4901771qvh.45.1676480158399; Wed, 15 Feb 2023 08:55:58 -0800 (PST) Received: from [192.168.1.108] (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 y206-20020a3764d7000000b0071c2a68d6f2sm14197140qkb.20.2023.02.15.08.55.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Feb 2023 08:55:58 -0800 (PST) Message-ID: Date: Wed, 15 Feb 2023 11:55:56 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH] doc: Suggest fix for -Woverloaded-virtual warnings To: Jonathan Wakely , gcc-patches@gcc.gnu.org References: <20230215133750.15537-1-jwakely@redhat.com> From: Jason Merrill In-Reply-To: <20230215133750.15537-1-jwakely@redhat.com> 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=-12.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 2/15/23 05:37, Jonathan Wakely wrote: > OK for trunk? OK. > -- >8 -- > > Users are confused about what this warning means, so add a suggested > solution to the documentation. > > gcc/ChangeLog: > > * doc/invoke.texi (C++ Dialect Options): Suggest adding a > using-declaration to unhide functions. > --- > gcc/doc/invoke.texi | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 26de582e41e..6404ed5c4ff 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -4282,6 +4282,10 @@ b->f(); > @noindent > fails to compile. > > +In cases where the different signatures are not an accident, the > +simplest solution is to add a using-declaration to the derived class > +to un-hide the base function, e.g. add @code{using A::f;} to @code{B}. > + > The optional level suffix controls the behavior when all the > declarations in the derived class override virtual functions in the > base class, even if not all of the base functions are overridden: