This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc home page
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>, Jurgis Upenieks <afla998 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 2 Jun 2013 20:06:01 +0200 (CEST)
- Subject: Re: gcc home page
- References: <CACnX7OGaYj56YkJ7bbUcc57GU6AHrjw3kcYo9D7xt309k=UM+g at mail dot gmail dot com> <CAH6eHdSouO09SDmEFmgJYtjDT9hQpUqdwk3qmhtoqQMiPPB3mw at mail dot gmail dot com>
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>