[Bug libstdc++/53901] [C++11] std::atomic<T> fails for type without no-throw default constructor
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 9 17:31:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list