[Bug c++/17920] add __attribute__((reimpl)) as a replacement for the (optional) virtual keyword for reimplementations of virtual functions

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 21 16:02:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17920

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-21 16:00:11 UTC ---
G++ 4.7 supports C++0x explicit override control, so the example can be changed
to:

struct A { virtual void foo() const; };
struct B : public A { void foo() override; };

And you get:

final.cc:2:28: error: 'void B::foo()' marked override, but does not override



More information about the Gcc-bugs mailing list