This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3662: Incorrect warnings with overridden virtual functions in template class
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, gdr at gcc dot gnu dot org, nobody at gcc dot gnu dot org, stuart at personalrobots dot com
- Subject: Re: c++/3662: Incorrect warnings with overridden virtual functions in template class
- From: gdr at gcc dot gnu dot org
- Date: 12 Aug 2001 15:04:18 -0000
Synopsis: Incorrect warnings with overridden virtual functions in template class
Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Sun Aug 12 08:04:18 2001
Responsible-Changed-Why:
See below.
State-Changed-From-To: open->closed
State-Changed-By: gdr
State-Changed-When: Sun Aug 12 08:04:18 2001
State-Changed-Why:
Well, actually the issue is subtile. In the instantiation
of the base class CList<int>, GCC discovers the declaration of
a virtual function and since every virtual function is used even
if it -appears- unused (a language definition requirement) GCC
proceeds to check semantics restruictions, thus the warning.
Arguably, GCC could use a type-based analysis to discover that
the base class function won't be used and suppress the warning
but I guess that is a feature request.
-- Gaby
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3662&database=gcc