Commit 036e0d4f by Benjamin Kosnik

atomic: Remove atomic_address, uplift to N3225.

2011-02-16  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/atomic: Remove atomic_address, uplift to N3225.
	* include/bits/atomic_0.h: Same.
	* include/bits/atomic_2.h: Same.
	* include/bits/atomic_base.h: Same.
	* testsuite/29_atomics/atomic_address/*: Delete.

From-SVN: r170217
parent 3808007c
2011-02-16 Benjamin Kosnik <bkoz@redhat.com>
* include/std/atomic: Remove atomic_address, uplift to N3225.
* include/bits/atomic_0.h: Same.
* include/bits/atomic_2.h: Same.
* include/bits/atomic_base.h: Same.
* testsuite/29_atomics/atomic_address/*: Delete.
2011-02-14 Jonathan Wakely <jwakely.gcc@gmail.com> 2011-02-14 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/regex.h (sub_match::sub_match): Add. * include/bits/regex.h (sub_match::sub_match): Add.
......
...@@ -68,6 +68,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -68,6 +68,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __mo2; return __mo2;
} }
void
atomic_thread_fence(memory_order);
void
atomic_signal_fence(memory_order);
/// kill_dependency /// kill_dependency
template<typename _Tp> template<typename _Tp>
inline _Tp inline _Tp
...@@ -114,7 +120,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -114,7 +120,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __atomic0 namespace __atomic0
{ {
struct atomic_flag; struct atomic_flag;
struct atomic_address;
template<typename _IntTp> template<typename _IntTp>
struct __atomic_base; struct __atomic_base;
...@@ -123,7 +128,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -123,7 +128,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __atomic2 namespace __atomic2
{ {
struct atomic_flag; struct atomic_flag;
struct atomic_address;
template<typename _IntTp> template<typename _IntTp>
struct __atomic_base; struct __atomic_base;
...@@ -132,7 +136,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -132,7 +136,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __atomic1 namespace __atomic1
{ {
using __atomic2::atomic_flag; using __atomic2::atomic_flag;
using __atomic0::atomic_address;
using __atomic0::__atomic_base; using __atomic0::__atomic_base;
} }
...@@ -157,7 +160,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -157,7 +160,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define ATOMIC_INT_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY #define ATOMIC_INT_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
#define ATOMIC_LONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY #define ATOMIC_LONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
#define ATOMIC_LLONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY #define ATOMIC_LLONG_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
#define ATOMIC_ADDRESS_LOCK_FREE _GLIBCXX_ATOMIC_PROPERTY
inline namespace _GLIBCXX_ATOMIC_NAMESPACE { } inline namespace _GLIBCXX_ATOMIC_NAMESPACE { }
...@@ -277,16 +279,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -277,16 +279,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef __atomic_base<ptrdiff_t> atomic_ptrdiff_t; typedef __atomic_base<ptrdiff_t> atomic_ptrdiff_t;
struct atomic_bool;
#define ATOMIC_VAR_INIT(_VI) { _VI } #define ATOMIC_VAR_INIT(_VI) { _VI }
template<typename _Tp> template<typename _Tp>
struct atomic; struct atomic;
template<typename _Tp>
struct atomic<_Tp*>;
// @} group atomics // @} group atomics
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace std
#endif #endif
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2008, 2009, 2010 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/>.
#include <atomic>
#include <cstddef>
int main()
{
std::atomic_address a __attribute__((unused)) = { { NULL } };
return 0;
}
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2008, 2009 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/>.
#include <atomic>
void test01()
{
// Assign.
typedef std::atomic_address test_type;
test_type t1;
test_type t2;
t1 = t2; // { dg-error "deleted" }
}
// { dg-prune-output "include" }
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2010 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/>.
#include <atomic>
#include <testsuite_common_types.h>
int main()
{
__gnu_test::constexpr_single_value_constructible test;
test.operator()<std::atomic_address, void*>();
return 0;
}
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2008, 2009 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/>.
#include <atomic>
void test01()
{
// Copy.
typedef std::atomic_address test_type;
test_type t1;
test_type t2(t1); // { dg-error "deleted" }
}
// { dg-prune-output "include" }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2008, 2009 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/>.
#include <atomic>
int main()
{
// Default constructor.
std::atomic_address a;
return 0;
}
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2008, 2009, 2010 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/>.
#include <atomic>
int main()
{
// Single value constructor.
void* v = 0;
std::atomic_address a(v);
return 0;
}
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2008, 2009 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/>.
#include <atomic>
#include <testsuite_common_types.h>
void test01()
{
__gnu_test::standard_layout test;
test.operator()<std::atomic_address>();
}
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2009 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/>.
#include <atomic>
#include <testsuite_common_types.h>
void test01()
{
__gnu_test::has_trivial_cons_dtor test;
test.operator()<std::atomic_address>();
}
...@@ -94,14 +94,6 @@ namespace gnu ...@@ -94,14 +94,6 @@ namespace gnu
# endif # endif
#endif #endif
#ifndef ATOMIC_ADDRESS_LOCK_FREE
# error "ATOMIC_ADDRESS_LOCK_FREE must be a macro"
# if ATOMIC_ADDRESS_LOCK_FREE != 0 \
&& ATOMIC_ADDRESS_LOCK_FREE != 1 && ATOMIC_ADDRESS_LOCK_FREE != 2
# error "ATOMIC_ADDRESS_LOCK_FREE must be 0, 1, or 2"
# endif
#endif
#ifndef ATOMIC_FLAG_INIT #ifndef ATOMIC_FLAG_INIT
#error "ATOMIC_FLAG_INIT_must_be_a_macro" #error "ATOMIC_FLAG_INIT_must_be_a_macro"
#endif #endif
......
// { dg-options "-std=gnu++0x" } // { dg-options "-std=gnu++0x" }
// { dg-do compile } // { dg-do compile }
// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -72,6 +72,4 @@ void test01() ...@@ -72,6 +72,4 @@ void test01()
using std::atomic_ptrdiff_t; using std::atomic_ptrdiff_t;
using std::atomic_intmax_t; using std::atomic_intmax_t;
using std::atomic_uintmax_t; using std::atomic_uintmax_t;
using std::atomic_address;
} }
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