diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2009-10-16 07:47:33 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2009-10-16 07:47:33 +0000 |
commit | 3808dfec58ef17c44b36dda7c2bb590580f6d8fc (patch) | |
tree | cdc799eed07c90fa504ba1d50d068b242f48f2e6 /libstdc++-v3/src | |
parent | a3e1ddfc645871eeddc703d8f17f2014197d3f5c (diff) | |
download | gcc-3808dfec58ef17c44b36dda7c2bb590580f6d8fc.zip gcc-3808dfec58ef17c44b36dda7c2bb590580f6d8fc.tar.gz gcc-3808dfec58ef17c44b36dda7c2bb590580f6d8fc.tar.bz2 |
re PR libstdc++/40654 ([C++0x] atomic.cc: 'd' is used uninitialized warning)
2009-10-15 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/40654
PR libstdc++/40826
* src/atomic.cc (atomic_flag_test_and_set_explicit): Add
static_cast from base to derived.
(atomic_flag_clear_explicit): Same.
* include/bits/atomic_2.h (__atomic2::atomic_flag): Public derivation.
Remove value type constructor.
* include/bits/atomic_0.h (__atomic0::atomic_flag): Same.
* include/std/future (_Future_state): Use ATOMIC_FLAG_INIT to
initialized the atomic_flag member.
From-SVN: r152895
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/atomic.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/src/atomic.cc b/libstdc++-v3/src/atomic.cc index 3a2ff3d..775bb76 100644 --- a/libstdc++-v3/src/atomic.cc +++ b/libstdc++-v3/src/atomic.cc @@ -80,16 +80,16 @@ namespace std atomic_flag_test_and_set_explicit(volatile __atomic_flag_base* __a, memory_order __m) throw () { - volatile atomic_flag d(__a->_M_i); - return d.test_and_set(__m); + volatile atomic_flag* d = static_cast<volatile atomic_flag*>(__a); + return d->test_and_set(__m); } void atomic_flag_clear_explicit(volatile __atomic_flag_base* __a, memory_order __m) throw () { - volatile atomic_flag d(__a->_M_i); - return d.clear(__m); + volatile atomic_flag* d = static_cast<volatile atomic_flag*>(__a); + return d->clear(__m); } void |