On Fri, 26 Apr 2013, Jonathan Wakely wrote:
> On 26 April 2013 13:09, Jurgis Upenieks wrote:
>> I think that I have found a bug in gcc home page gcc-4.7 changes.
>> In C++ paragraph about explicit override control.
>> In example code, is it really struct, not class?
> Yes, that's valid C++, the example is fine.

I guess the alternative way to write this, using class instead of
struct, is the following (which needs an extra protected).

Should we go with this, Jonathan?  What do you think?

Gerald

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.137
diff -u -3 -p -r1.137 changes.html
--- changes.html        11 Apr 2013 07:45:45 -0000      1.137
+++ changes.html        2 Jun 2013 18:04:16 -0000
@@ -425,19 +425,20 @@ struct B
 
   <li>Thanks to Ville Voutilainen, G++ now implements <a 
href="cxx0x_status.html">C++11</a> explicit override control.
     <blockquote><pre>
-struct B {
+class B {
+protected:
   virtual void f() const final;
   virtual void f(int);
 };
 
-struct D : B {
+class D : B {
   void f() const;            // error: D::f attempts to override final B::f
   void f(long) override;     // error: doesn't override anything
   void f(int) override;      // ok
 };
 
-struct E final { };
-struct F: E { }; // error: deriving from final class</pre></blockquote></li>
+class E final { };
+class F: E { }; // error: deriving from final class</pre></blockquote></li>
 
   <li>G++ now implements <a href="cxx0x_status.html">C++11</a> non-static data 
member initializers.
     <blockquote><pre>

Reply via email to