mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-05 01:34:12 +08:00
unique_ptr.h (default_delete<>::default_delete()): Declare defaulted per DR 1517.
2011-01-18 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/unique_ptr.h (default_delete<>::default_delete()): Declare defaulted per DR 1517. * testsuite/util/testsuite_common_types.h (constexpr_defaulted_default_constructible): Add. * testsuite/20_util/default_delete/cons/constexpr.cc: Use it. From-SVN: r168947
This commit is contained in:
parent
e7ef91dc8e
commit
d326f2eeb7
@ -1,3 +1,11 @@
|
||||
2011-01-18 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/unique_ptr.h (default_delete<>::default_delete()):
|
||||
Declare defaulted per DR 1517.
|
||||
* testsuite/util/testsuite_common_types.h
|
||||
(constexpr_defaulted_default_constructible): Add.
|
||||
* testsuite/20_util/default_delete/cons/constexpr.cc: Use it.
|
||||
|
||||
2011-01-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/stl_queue.h (queue<>::swap, priority_queue<>::swap):
|
||||
|
@ -47,7 +47,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
template<typename _Tp>
|
||||
struct default_delete
|
||||
{
|
||||
constexpr default_delete() { }
|
||||
constexpr default_delete() = default;
|
||||
|
||||
template<typename _Up, typename = typename
|
||||
std::enable_if<std::is_convertible<_Up*, _Tp*>::value>::type>
|
||||
@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
template<typename _Tp>
|
||||
struct default_delete<_Tp[]>
|
||||
{
|
||||
constexpr default_delete() { }
|
||||
constexpr default_delete() = default;
|
||||
|
||||
void
|
||||
operator()(_Tp* __ptr) const
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
__gnu_test::constexpr_default_constructible test;
|
||||
__gnu_test::constexpr_defaulted_default_constructible test;
|
||||
test.operator()<std::default_delete<int>>();
|
||||
return 0;
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ namespace __gnu_test
|
||||
template<typename _Tp, bool _IsLitp = std::is_literal_type<_Tp>::value>
|
||||
struct _Concept;
|
||||
|
||||
// NB: _Tp must be a literal type.
|
||||
// NB: _Tp must be a literal type.
|
||||
// Have to have user-defined default ctor for this to work.
|
||||
template<typename _Tp>
|
||||
struct _Concept<_Tp, true>
|
||||
@ -671,6 +671,24 @@ namespace __gnu_test
|
||||
}
|
||||
};
|
||||
|
||||
// Generator to test defaulted default constructor.
|
||||
struct constexpr_defaulted_default_constructible
|
||||
{
|
||||
template<typename _Tp>
|
||||
void
|
||||
operator()()
|
||||
{
|
||||
struct _Concept
|
||||
{
|
||||
void __constraint()
|
||||
{ constexpr _Tp __v __attribute__((unused)) { }; }
|
||||
};
|
||||
|
||||
void (_Concept::*__x)() __attribute__((unused))
|
||||
= &_Concept::__constraint;
|
||||
}
|
||||
};
|
||||
|
||||
struct constexpr_single_value_constructible
|
||||
{
|
||||
template<typename _Ttesttype, typename _Tvaluetype,
|
||||
|
Loading…
Reference in New Issue
Block a user