On Fri, 2016-10-14 at 16:27 +0100, Pedro Alves wrote:
> On 10/12/2016 03:13 PM, Bernd Schmidt wrote:
> > On 10/12/2016 04:09 PM, Pedro Alves wrote:
> > >
> > > Thanks. Here's a follow up patch that I was just testing.
> > >
> > > Need this if building with "g++ -std=gnu++11", with gcc < 4.7.
> > Lovely. That's ok too if the other one goes in.
> FYI, I pushed these in now. I also bootstrapped with the
> jit included in the selected languages, and hacked the
> jit code a bit to trigger the problems OVERRIDE intends to
> catch, just to make sure it still works.
> Pedro Alves
I propose that we update our coding conventions to mention the OVERRIDE
and FINAL macros in the paragraph that discusses virtual funcs.
The attached patch (to the website) does so.
OK to commit?
RCS file: /cvs/gcc/wwwdocs/htdocs/codingconventions.html,v
retrieving revision 1.77
diff -u -p -r1.77 codingconventions.html
--- htdocs/codingconventions.html 18 Sep 2016 13:55:17 -0000 1.77
+++ htdocs/codingconventions.html 14 Oct 2016 21:22:44 -0000
@@ -902,7 +902,10 @@ Its use with data-carrying classes is mo
Think carefully about the size and performance impact
of virtual functions and virtual bases
-before using them.
+before using them. If you do use virtual functions, use the
+<code>OVERRIDE</code> and <code>FINAL</code> macros from
+<code>include/ansidecl.h</code> to annotate the code for a human reader,
+and to allow sufficiently modern C++ compilers to detect mistakes.