Skip to content
Snippets Groups Projects
Commit 113844d6 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: Include -Woverloaded-virtual in -Wall [PR87729]

This seems like a good warning to have in -Wall, as requested.  But as
pointed out in PR20423, some users want a warning only when a derived
function doesn't override any base function.  So let's put that lesser
version in -Wall (and -Woverloaded-virtual=1) while leaving the semantics
for the existing option the same.

	PR c++/87729
	PR c++/20423

gcc/c-family/ChangeLog:

	* c.opt (Woverloaded-virtual): Add levels, include in -Wall.

gcc/ChangeLog:

	* doc/invoke.texi: Document changes.

gcc/cp/ChangeLog:

	* class.cc (warn_hidden): Handle -Woverloaded-virtual=1.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Woverloaded-virt1.C: New test.
	* g++.dg/warn/Woverloaded-virt2.C: New test.
parent 75fa80bb
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment