forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libstdc++: Use type_identity_t for non-deducible std::atomic_xxx args
This is LWG 3220 which is about to become Tentatively Ready. libstdc++-v3/ChangeLog: * include/std/atomic (__atomic_val_t): Use __type_identity_t instead of atomic<T>::value_type, as per LWG 3220. * testsuite/29_atomics/atomic/lwg3220.cc: New test.
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// { dg-do compile { target c++11 } } | ||
// DR 3220. P0558 broke conforming C++14 uses of atomic shared_ptr | ||
|
||
#include <atomic> | ||
#include <memory> | ||
|
||
struct Abstract { virtual void test() = 0; }; | ||
struct Concrete : Abstract { virtual void test() override {} }; | ||
|
||
int main() { | ||
std::shared_ptr<Abstract> ptr; | ||
std::atomic_store<Abstract>(&ptr, std::make_shared<Concrete>()); | ||
} |