[Development] QtCS: Notes from Modern C++ session

Thiago Macieira thiago.macieira at intel.com
Tue Jun 16 22:39:36 CEST 2015


On Tuesday 16 June 2015 10:52:16 Matthew Woehlke wrote:
> On 2015-06-12 17:45, Thiago Macieira wrote:
> > On Friday 12 June 2015 10:49:38 Matthew Woehlke wrote:
> >>> On Friday 12 June 2015 08:08:51 André Somers wrote:
> >>>> Not available for use are:
> >>>> * = default,
> >>>> * = deleted,
> >> 
> >> Where are these not supported? I have code that (AFAIK) has been using
> >> these already, and IIRC our compiler requirements are lower.
> > 
> > GCC requires 4.7 for this. I think we were discussing whether our minimum
> > is 4.6 or 4.7.
> 
> Again... really? I have code using '= default' that sometimes¹ is built
> on GCC *4.4*. '= delete' seems to be accepted also. (Now... it may be
> that '= default' is actually broken, i.e. generates bad code, but based
> on a very simple test I just whipped up, '= delete' at least seems to
> work. This is with gcc44-c++-4.4.7-1.el5.)

Yes, really.

People, please read qcompilerdetection.h and its Git history for the 
rationale.

#    if Q_CC_GNU >= 406
       /* Pre-4.6 compilers implement a non-final snapshot of N2346, hence 
default and delete
        * functions are supported only if they are public. Starting from 4.6, 
GCC handles
        * final version - the access modifier is not relevant. */
#      define Q_COMPILER_DEFAULT_MEMBERS
#      define Q_COMPILER_DELETE_MEMBERS

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list