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

Reply via email to