Commit d31b8797 by Jonathan Wakely Committed by Jonathan Wakely

re PR libstdc++/60940 (general operations on atomic types do not work with…

re PR libstdc++/60940 (general operations on atomic types do not work with atomic integral typedefs)

	PR libstdc++/60940
	* include/bits/atomic_base.h: Remove atomic integral typedefs as
	synonyms for __atomic_base<int> etc.
	* include/std/atomic: Make atomic_int a synonym for atomic<int> and
	likewise for all atomic integral types.
	* testsuite/29_atomics/atomic_integral/cons/copy_list.cc: New.
	* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.

From-SVN: r219790
parent 340c7904
2015-01-17 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60940
* include/bits/atomic_base.h: Remove atomic integral typedefs as
synonyms for __atomic_base<int> etc.
* include/std/atomic: Make atomic_int a synonym for atomic<int> and
likewise for all atomic integral types.
* testsuite/29_atomics/atomic_integral/cons/copy_list.cc: New.
* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
2015-01-17 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/56785
* include/std/tuple (_Tuple_impl): Remove zero-element specialization
and define one-element specialization.
......
......@@ -119,120 +119,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _IntTp>
struct __atomic_base;
/// atomic_char
typedef __atomic_base<char> atomic_char;
/// atomic_schar
typedef __atomic_base<signed char> atomic_schar;
/// atomic_uchar
typedef __atomic_base<unsigned char> atomic_uchar;
/// atomic_short
typedef __atomic_base<short> atomic_short;
/// atomic_ushort
typedef __atomic_base<unsigned short> atomic_ushort;
/// atomic_int
typedef __atomic_base<int> atomic_int;
/// atomic_uint
typedef __atomic_base<unsigned int> atomic_uint;
/// atomic_long
typedef __atomic_base<long> atomic_long;
/// atomic_ulong
typedef __atomic_base<unsigned long> atomic_ulong;
/// atomic_llong
typedef __atomic_base<long long> atomic_llong;
/// atomic_ullong
typedef __atomic_base<unsigned long long> atomic_ullong;
/// atomic_wchar_t
typedef __atomic_base<wchar_t> atomic_wchar_t;
/// atomic_char16_t
typedef __atomic_base<char16_t> atomic_char16_t;
/// atomic_char32_t
typedef __atomic_base<char32_t> atomic_char32_t;
/// atomic_char32_t
typedef __atomic_base<char32_t> atomic_char32_t;
/// atomic_int_least8_t
typedef __atomic_base<int_least8_t> atomic_int_least8_t;
/// atomic_uint_least8_t
typedef __atomic_base<uint_least8_t> atomic_uint_least8_t;
/// atomic_int_least16_t
typedef __atomic_base<int_least16_t> atomic_int_least16_t;
/// atomic_uint_least16_t
typedef __atomic_base<uint_least16_t> atomic_uint_least16_t;
/// atomic_int_least32_t
typedef __atomic_base<int_least32_t> atomic_int_least32_t;
/// atomic_uint_least32_t
typedef __atomic_base<uint_least32_t> atomic_uint_least32_t;
/// atomic_int_least64_t
typedef __atomic_base<int_least64_t> atomic_int_least64_t;
/// atomic_uint_least64_t
typedef __atomic_base<uint_least64_t> atomic_uint_least64_t;
/// atomic_int_fast8_t
typedef __atomic_base<int_fast8_t> atomic_int_fast8_t;
/// atomic_uint_fast8_t
typedef __atomic_base<uint_fast8_t> atomic_uint_fast8_t;
/// atomic_int_fast16_t
typedef __atomic_base<int_fast16_t> atomic_int_fast16_t;
/// atomic_uint_fast16_t
typedef __atomic_base<uint_fast16_t> atomic_uint_fast16_t;
/// atomic_int_fast32_t
typedef __atomic_base<int_fast32_t> atomic_int_fast32_t;
/// atomic_uint_fast32_t
typedef __atomic_base<uint_fast32_t> atomic_uint_fast32_t;
/// atomic_int_fast64_t
typedef __atomic_base<int_fast64_t> atomic_int_fast64_t;
/// atomic_uint_fast64_t
typedef __atomic_base<uint_fast64_t> atomic_uint_fast64_t;
/// atomic_intptr_t
typedef __atomic_base<intptr_t> atomic_intptr_t;
/// atomic_uintptr_t
typedef __atomic_base<uintptr_t> atomic_uintptr_t;
/// atomic_size_t
typedef __atomic_base<size_t> atomic_size_t;
/// atomic_intmax_t
typedef __atomic_base<intmax_t> atomic_intmax_t;
/// atomic_uintmax_t
typedef __atomic_base<uintmax_t> atomic_uintmax_t;
/// atomic_ptrdiff_t
typedef __atomic_base<ptrdiff_t> atomic_ptrdiff_t;
#define ATOMIC_VAR_INIT(_VI) { _VI }
......
......@@ -27,4 +27,4 @@ struct X {
char stuff[0]; // GNU extension, type has zero size
};
std::atomic<X> a; // { dg-error "not supported" "" { target *-*-* } 169 }
std::atomic<X> a; // { dg-error "not supported" "" { target *-*-* } 173 }
// Copyright (C) 2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++11" }
// { dg-do compile }
#include <atomic>
#include <testsuite_common_types.h>
struct Test
{
template<typename T>
void operator()(T&& t)
{
auto val = atomic_load(&t);
atomic_store(&t, val);
}
} test;
int
main()
{
__gnu_cxx::typelist::apply(test, __gnu_test::atomic_integrals::type());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment