From 3808dfec58ef17c44b36dda7c2bb590580f6d8fc Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 16 Oct 2009 07:47:33 +0000 Subject: re PR libstdc++/40654 ([C++0x] atomic.cc: 'd' is used uninitialized warning) 2009-10-15 Benjamin Kosnik 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 --- libstdc++-v3/src/atomic.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libstdc++-v3/src') 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(__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(__a); + return d->clear(__m); } void -- cgit v1.1