This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/5645] gcc warns that pure virtual class not explicitly initialized
- From: "jwakely dot gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Nov 2007 13:38:32 -0000
- Subject: [Bug c++/5645] gcc warns that pure virtual class not explicitly initialized
- References: <bug-5645-2936@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from jwakely dot gcc at gmail dot com 2007-11-14 13:38 -------
Isn't this warning simply bogus? In other contexts if a default constructor is
available it will be used without warning, whether explicitly used or not.
e.g.
non-virtual bases in constructor initializer lists
data members in constructor initializer lists
"new T" vs "new T()"
"T t;" vs "T t = T();"
This warning seems to be an attempt to enforce someone's personal preference,
rather than any concerns about correctness. As shown by comment 9 on bug
11159, in some cases it's not even possible to do what the warning says you
"should" do.
--
jwakely dot gcc at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jwakely dot gcc at gmail dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5645