Commit 51bf1e80 by François Dumont

throw_allocator.h (__throw_value_base): Add move semantic, not throwing.

2012-10-05  François Dumont  <fdumont@gcc.gnu.org>

	* include/ext/throw_allocator.h (__throw_value_base): Add move
	semantic, not throwing.
	(__throw_value_limit): Likewise.
	(__throw_value_random): Likewise.
	* testsuite/util/exception/safety.h: Add validation of C++11
	methods emplace/emplace_front/emplace_back/emplace_hint.
	* testsuite/util/testsuite_container_traits.h: Signal emplace
	support on deque, forward_list, list and vector.
	* testsuite/23_containers/deque/requirements/exception/
	propagation_consistent.cc: Remove dg-do run fail.

From-SVN: r193184
parent b8435aa9
2012-10-05 François Dumont <fdumont@gcc.gnu.org>
* include/ext/throw_allocator.h (__throw_value_base): Add move
semantic, not throwing.
(__throw_value_limit): Likewise.
(__throw_value_random): Likewise.
* testsuite/util/exception/safety.h: Add validation of C++11
methods emplace/emplace_front/emplace_back/emplace_hint.
* testsuite/util/testsuite_container_traits.h: Signal emplace
support on deque, forward_list, list and vector.
* testsuite/23_containers/deque/requirements/exception/
propagation_consistent.cc: Remove dg-do run fail.
2012-11-05 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/55215
......
// -*- C++ -*-
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
// Copyright (C) 2005-2012 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
......@@ -467,6 +466,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
throw_value_base(const throw_value_base& __v) : _M_i(__v._M_i)
{ throw_conditionally(); }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
// Shall not throw.
throw_value_base(throw_value_base&&) = default;
#endif
explicit throw_value_base(const std::size_t __i) : _M_i(__i)
{ throw_conditionally(); }
#endif
......@@ -479,6 +483,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return *this;
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
// Shall not throw.
throw_value_base&
operator=(throw_value_base&&) = default;
#endif
throw_value_base&
operator++()
{
......@@ -568,8 +578,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
throw_value_limit(const throw_value_limit& __other)
: base_type(__other._M_i) { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
throw_value_limit(throw_value_limit&&) = default;
#endif
explicit throw_value_limit(const std::size_t __i) : base_type(__i) { }
#endif
throw_value_limit&
operator=(const throw_value_limit& __other)
{
base_type::operator=(__other);
return *this;
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
throw_value_limit&
operator=(throw_value_limit&&) = default;
#endif
};
/// Type throwing via random condition.
......@@ -583,9 +609,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
throw_value_random(const throw_value_random& __other)
: base_type(__other._M_i) { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
throw_value_random(throw_value_random&&) = default;
#endif
explicit throw_value_random(const std::size_t __i) : base_type(__i) { }
#endif
throw_value_random&
operator=(const throw_value_random& __other)
{
base_type::operator=(__other);
return *this;
}
#ifdef __GXX_EXPERIMENTAL_CXX0X__
throw_value_random&
operator=(throw_value_random&&) = default;
#endif
};
......
// { dg-options "-std=gnu++0x" }
// { dg-require-cstdint "" }
// { dg-do run { xfail *-*-* } }
// 2009-09-09 Benjamin Kosnik <benjamin@redhat.com>
// Copyright (C) 2009 Free Software Foundation, Inc.
// Copyright (C) 2009-2012 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
......
// -*- C++ -*-
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
// Copyright (C) 2009-2012 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
......@@ -73,6 +73,7 @@ namespace __gnu_test
typedef std::true_type has_insert;
typedef std::true_type has_push_pop;
typedef std::true_type has_size_type_constructor;
typedef std::true_type has_emplace;
};
template<typename _Tp1, typename _Tp2>
......@@ -85,6 +86,7 @@ namespace __gnu_test
typedef std::true_type has_insert_after;
typedef std::true_type has_push_pop;
typedef std::true_type has_size_type_constructor;
typedef std::true_type has_emplace;
};
template<typename _Tp1, typename _Tp2>
......@@ -98,6 +100,7 @@ namespace __gnu_test
typedef std::true_type has_insert;
typedef std::true_type has_push_pop;
typedef std::true_type has_size_type_constructor;
typedef std::true_type has_emplace;
};
template<typename _Tp1, typename _Tp2>
......@@ -111,6 +114,7 @@ namespace __gnu_test
typedef std::true_type has_throwing_erase;
typedef std::true_type has_insert;
typedef std::true_type has_size_type_constructor;
typedef std::true_type has_emplace;
};
template<typename _Tp1, typename _Tp2, typename _Tp3>
......@@ -148,9 +152,7 @@ namespace __gnu_test
typedef std::true_type has_erase;
typedef std::true_type has_insert;
#ifdef __GXX_EXPERIMENTAL_CXX0X__
typedef std::true_type has_emplace;
#endif
};
template<typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4>
......@@ -164,9 +166,7 @@ namespace __gnu_test
typedef std::true_type has_erase;
typedef std::true_type has_insert;
#ifdef __GXX_EXPERIMENTAL_CXX0X__
typedef std::true_type has_emplace;
#endif
};
template<typename _Tp1, typename _Tp2, typename _Tp3>
......@@ -179,9 +179,7 @@ namespace __gnu_test
typedef std::true_type has_erase;
typedef std::true_type has_insert;
#ifdef __GXX_EXPERIMENTAL_CXX0X__
typedef std::true_type has_emplace;
#endif
};
template<typename _Tp1, typename _Tp2, typename _Tp3>
......@@ -194,9 +192,7 @@ namespace __gnu_test
typedef std::true_type has_erase;
typedef std::true_type has_insert;
#ifdef __GXX_EXPERIMENTAL_CXX0X__
typedef std::true_type has_emplace;
#endif
};
template<typename _Tp1, typename _Tp2>
......
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