This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22406] New: -Weffc++ warns about missing op= and copy ctor, even when base classes have already disabled these
- From: "mutz at kde dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2005 13:20:12 -0000
- Subject: [Bug c++/22406] New: -Weffc++ warns about missing op= and copy ctor, even when base classes have already disabled these
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This warns with -Weffc++, but shouldn't:
class Foo {
Foo(constFoo&); // disable
Foo&operator=(const Foo&); // disable
public:
Foo() {}
~Foo() {}
};
class Bar : public Foo { void * mPointerMember; };
The compiler knows at this point that any attempt to generate a op= or copy
ctor is doomed, so it should suppress a warning. The warning is easy to get rid
of, but still, explicitly disabling copy ctor and op= in each derived class is
tedious, esp. if you don't control the source code of the hierarchy, and the
author of the hierarchy disabled them only in the base class (which is
completely sufficient).
--
Summary: -Weffc++ warns about missing op= and copy ctor, even
when base classes have already disabled these
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mutz at kde dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22406