This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53206] New: overloaded virtual non const warning
- From: "hub at figuiere dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 May 2012 01:21:34 +0000
- Subject: [Bug c++/53206] New: overloaded virtual non const warning
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53206
Bug #: 53206
Summary: overloaded virtual non const warning
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hub@figuiere.net
Created attachment 27296
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27296
test case
With the attache code sample, clang throw a warning. g++ does not.
clang++ -Wall -Wextra -Wsign-compare -Wpointer-arith -Wchar-subscripts
-Wwrite-strings -Wmissing-noreturn -Wunused -Wpointer-arith -Wshadow -c
const-override.cpp
const-override.cpp:18:14: warning: 'Sub::getValue' hides overloaded virtual
function [-Woverloaded-virtual]
virtual int getValue()
^
const-override.cpp:8:14: note: hidden overloaded virtual function
'Base::getValue' declared here
virtual int getValue() const
^
1 warning generated.