This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/69301] std::atomic<T>::load() won't compile if T doesn't have a default constructor
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Feb 2017 21:18:01 +0000
- Subject: [Bug libstdc++/69301] std::atomic<T>::load() won't compile if T doesn't have a default constructor
- Auto-submitted: auto-generated
- References: <bug-69301-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69301
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Feb 14 21:17:29 2017
New Revision: 245457
URL: https://gcc.gnu.org/viewcvs?rev=245457&root=gcc&view=rev
Log:
PR69301 don't assume atomic<T> can default construct T
Backport from mainline
2017-01-18 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/69301
* include/std/atomic (atomic<T>::load, atomic<T>::exchange): Use
aligned buffer instead of default-initialized variable.
* testsuite/29_atomics/atomic/69301.cc: New test.
* include/ext/pointer.h (_Pointer_adapter::operator++(int))
(_Pointer_adapter::operator--(int)): Likewise.
Added:
branches/gcc-5-branch/libstdc++-v3/testsuite/29_atomics/atomic/69301.cc
Modified:
branches/gcc-5-branch/libstdc++-v3/ChangeLog
branches/gcc-5-branch/libstdc++-v3/include/ext/pointer.h
branches/gcc-5-branch/libstdc++-v3/include/std/atomic