public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] doc: Suggest fix for -Woverloaded-virtual warnings
Date: Wed, 15 Feb 2023 11:55:56 -0500	[thread overview]
Message-ID: <dec84c8d-39fa-6da3-370f-957dc01b6049@redhat.com> (raw)
In-Reply-To: <20230215133750.15537-1-jwakely@redhat.com>

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:


      reply	other threads:[~2023-02-15 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 13:37 Jonathan Wakely
2023-02-15 16:55 ` Jason Merrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dec84c8d-39fa-6da3-370f-957dc01b6049@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).