public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] doc: Suggest fix for -Woverloaded-virtual warnings
@ 2023-02-15 13:37 Jonathan Wakely
  2023-02-15 16:55 ` Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2023-02-15 13:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jason Merrill

OK for trunk?

-- >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:
-- 
2.39.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] doc: Suggest fix for -Woverloaded-virtual warnings
  2023-02-15 13:37 [PATCH] doc: Suggest fix for -Woverloaded-virtual warnings Jonathan Wakely
@ 2023-02-15 16:55 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2023-02-15 16:55 UTC (permalink / raw)
  To: Jonathan Wakely, gcc-patches

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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-15 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 13:37 [PATCH] doc: Suggest fix for -Woverloaded-virtual warnings Jonathan Wakely
2023-02-15 16:55 ` Jason Merrill

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).