[Development] Error "invokes deleted constructor" while building Qt5 with clang and libc++

Francisco Lopes francisco.mailing.lists at oblita.com
Mon Dec 3 23:53:12 CET 2012

2012/12/3 Francisco Lopes <francisco.mailing.lists at oblita.com>

> 2012/12/3 Thiago Macieira <thiago.macieira at intel.com>
>> Looks like a defect in the standard then. It requires initialisation with
>> =.
> Yes, indeed it looks like.
  #define ATOMIC_VAR_INIT(value) see below

The macro expands to a token sequence suitable for constant initialization
of an atomic variable of static storage duration of a type that is
initialization-compatible with value. [Note: This operation may need to
initialize locks. — end note ] Concurrent access to the variable being
initialized, even via an atomic operation, constitutes a data race. [ Example:

   atomic<int> v = ATOMIC_VAR_INIT(5);

Qt's QBasicAtomicInteger has a constexpr constructor, dispite this, the
standard puts a lot of constraints for the macro (suitable for
initialization of a static variables). I've looked up the "constant
initialization" section to see whether there could be a loophole to use =
without the requirement of a copy constructor, but I'm about to give up on
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121203/25178482/attachment.html>

More information about the Development mailing list