Implement -Woverloaded-virtual.
commitf159ac01b4b2ba094a5187e4e045a595c2aa5f22
authorArgiris Kirtzidis <akyrtzi@gmail.com>
Thu, 3 Feb 2011 18:01:15 +0000 (3 18:01 +0000)
committerArgiris Kirtzidis <akyrtzi@gmail.com>
Thu, 3 Feb 2011 18:01:15 +0000 (3 18:01 +0000)
treeb348a406a6df440684ad802300a39619c6f75500
parent9705c0e39b6ad36340defb9ada7c0b1784cae546
Implement -Woverloaded-virtual.

The difference with gcc is that it warns if you overload virtual methods only if
the method doesn't also override any method. This is to cut down on the number of warnings
and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423.
If we want to warn that not all overloads are overriden we can have an additional
warning like -Wpartial-override.

-Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124805 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/warn-overloaded-virtual.cpp [new file with mode: 0644]