From: Jonathan Wakely Date: Wed, 20 Jul 2016 18:21:59 +0000 (+0100) Subject: LWG 2441 Provide exact-width atomic typedefs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e87b7d52c364b6ddb173ba74deb47c89b2968461;p=gcc.git LWG 2441 Provide exact-width atomic typedefs * include/std/atomic (atomic_int8_t, atomic_uint8_t, atomic_int16_t) (atomic_uint16_t, atomic_int32_t, atomic_uint32_t, atomic_int64_t) (atomic_uint64_t): Define (LWG 2441). * testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc: Remove empty lines. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Test for the new types. * doc/xml/manual/intro.xml: Document DR 2441 status. From-SVN: r238534 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ad31fe6fdee..c53240be4d7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,14 @@ 2016-07-20 Jonathan Wakely + * include/std/atomic (atomic_int8_t, atomic_uint8_t, atomic_int16_t) + (atomic_uint16_t, atomic_int32_t, atomic_uint32_t, atomic_int64_t) + (atomic_uint64_t): Define (LWG 2441). + * testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc: Remove empty + lines. + * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Test for + the new types. + * doc/xml/manual/intro.xml: Document DR 2441 status. + * include/std/istream (operator>>(basic_istream&&, _Tp&)): Adjust to use perfect forwarding (LWG 2328). * testsuite/27_io/rvalue_streams.cc: Test perfect forwarding. diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml index 6335614efdb..c6b06561999 100644 --- a/libstdc++-v3/doc/xml/manual/intro.xml +++ b/libstdc++-v3/doc/xml/manual/intro.xml @@ -1011,6 +1011,12 @@ requirements of the license of GCC. Add noexcept. + 2441: + Exact-width atomic typedefs should be provided + + Define the typedefs. + + 2454: Add raw_storage_iterator::base() member diff --git a/libstdc++-v3/include/std/atomic b/libstdc++-v3/include/std/atomic index 8cbc91f9347..f8894bf7486 100644 --- a/libstdc++-v3/include/std/atomic +++ b/libstdc++-v3/include/std/atomic @@ -833,6 +833,34 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef atomic atomic_char32_t; + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 2441. Exact-width atomic typedefs should be provided + + /// atomic_int8_t + typedef atomic atomic_int8_t; + + /// atomic_uint8_t + typedef atomic atomic_uint8_t; + + /// atomic_int16_t + typedef atomic atomic_int16_t; + + /// atomic_uint16_t + typedef atomic atomic_uint16_t; + + /// atomic_int32_t + typedef atomic atomic_int32_t; + + /// atomic_uint32_t + typedef atomic atomic_uint32_t; + + /// atomic_int64_t + typedef atomic atomic_int64_t; + + /// atomic_uint64_t + typedef atomic atomic_uint64_t; + + /// atomic_int_least8_t typedef atomic atomic_int_least8_t; diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc index a13f66ab1e5..1f56f5a5815 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc @@ -21,6 +21,3 @@ #include // { dg-error "ISO C.. 2011" "" { target *-*-* } 32 } - - - diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc index 32fe2a4eb1d..51adbf57835 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc @@ -72,4 +72,14 @@ void test01() using std::atomic_ptrdiff_t; using std::atomic_intmax_t; using std::atomic_uintmax_t; + + // DR 2441 + using std::atomic_int8_t; + using std::atomic_uint8_t; + using std::atomic_int16_t; + using std::atomic_uint16_t; + using std::atomic_int32_t; + using std::atomic_uint32_t; + using std::atomic_int64_t; + using std::atomic_uint64_t; }