diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-03-11 16:57:20 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-03-11 17:52:57 +0000 |
commit | 5643f6f396ef7f60d317aef07dd98978cec6afd0 (patch) | |
tree | 3b85a3697a4d0b407b218d134b7f79dceafc38ac /gcc/ada/gcc-interface/utils.c | |
parent | 9dacc828bf8b087ddfaf797ed7238da45609082c (diff) | |
download | gcc-5643f6f396ef7f60d317aef07dd98978cec6afd0.zip gcc-5643f6f396ef7f60d317aef07dd98978cec6afd0.tar.gz gcc-5643f6f396ef7f60d317aef07dd98978cec6afd0.tar.bz2 |
libstdc++: Make barrier::arrival_token a move-only class type
The standard only specifies that barrier::arrival_token is a move
constructible and move assignable type. We originally used a scoped enum
type, but that means we do not diagnose non-portable code that makes
copies of arrival tokens (or compares them for equality, or uses them as
keys in map!) This wraps the enum in a move-only class type, so that
users are forced to pass it correctly.
The move constructor and move assignment operator of the new class do
not zero out the moved-from token, as that would add additional
instructions. That means that passing a moved-from token will work with
our implementation, despite being a bug in the user code. We could
consider doing that zeroing out in debug mode.
libstdc++-v3/ChangeLog:
* include/std/barrier (barrier::arrival_token): New move-only
class that encapsulates the underlying token value.
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
0 files changed, 0 insertions, 0 deletions