This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/53901] [C++11] std::atomic<T> fails for type without no-throw default constructor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53901

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[C++11] std::atomic<T>      |[C++11] std::atomic<T>
                   |fails for type without      |fails for type without
                   |trivial default constructor |no-throw default
                   |and trivial destructor      |constructor

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-09 17:31:25 UTC ---
In my testccase T isn't trivially copyable because of its non-trivial
destructor, so only the constructor is relevant.

The fact G++ accepts it if the constructor is defaulted after its first
declaration is now PR 53903

N.B. it fails even if the default constructor isn't used:

  #include <atomic>

  struct T {
    T() noexcept(false) { }
  };

  std::atomic<T> a{ T{} };


This appears to be a defect in the standard rather than a libstdc++ bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]