[Development] Branch for adding Q_DECL_OVERRIDEs

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu Oct 27 18:35:37 CEST 2016


Hi,

please keep the discussion on the mailing list, so others can chime in.

Il 27/10/2016 17:47, Александр Волков ha scritto:
> 27.10.2016 18:19, Giuseppe D'Angelo пишет:
>> Don't worry too much. To minimize merge conflicts I'm quite sure we'll
>> keep using Q_DECL_OVERRIDE as long as 5.6 will be open. So use that :)
>> We'll do a cleanup pass in the future.
> 
> BTW, should 'override' be added in the following case:
> struct A {
>    virtual void f();
> };
> struct B : A {
>    void f() final; // override also?
> };
> ?
> 
> Unfortunately gcc reports a warning for f() 
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010)
> There some such places in Qt, for example in 
> corelib/kernel/qeventdispatcher_glib_p.h,
> where Q_DECL_OVERRIDE should be added to make it compilable with gcc 
> [-Werror, -Wsuggest-override].
> The question is whether to follow a reasonable style
> https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override
> or a style forced by gcc?

To be honest I don't know if we have a consensus on this. (How many
cases of "final" in our classes do we have anyhow?)

Cheers,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4007 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20161027/b770929e/attachment.bin>


More information about the Development mailing list