This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20423] Warning -Woverloaded-virtual triggers to often
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2005 15:11:59 -0000
- Subject: [Bug c++/20423] Warning -Woverloaded-virtual triggers to often
- References: <20050311103418.20423.micis@gmx.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-11 15:11 -------
Hmm, ICC gives:
t.cc(7): warning #654: overloaded virtual function "Foo::Func" is only partially overridden in class "Baz"
class Baz: public Foo
^
t.cc(14): error #165: too few arguments in function call
b->Func(1);
^
compilation aborted for t.cc (code 2)
The warning is correct because Func(int) is still hidden in the supper class and you cannot use it:
class Foo
{
public: virtual void Func(int);
virtual void Func(int, int);
};
class Baz: public Foo
{
public: virtual void Func(int, int);
};
void g(Baz *b)
{
b->Func(1);
}
Maybe we should do the warning which ICC is giving instead of the one which we give right now.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Keywords| |diagnostic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423