diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-18 11:12:06 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-18 11:12:06 +0000 |
commit | 543699daa8d6e568ee4f9266020d81ed479c3158 (patch) | |
tree | 1435069bc01bf0d34dc5d14d13756271323ad477 /libstdc++-v3 | |
parent | 38ba30bf497752e981bf9f802df31595c2f02542 (diff) | |
download | gcc-543699daa8d6e568ee4f9266020d81ed479c3158.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168947 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/unique_ptr.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/util/testsuite_common_types.h | 20 |
4 files changed, 30 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 11ae49e5bad..856f10738e4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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): diff --git a/libstdc++-v3/include/bits/unique_ptr.h b/libstdc++-v3/include/bits/unique_ptr.h index 0b00fcb5703..12ced5cb537 100644 --- a/libstdc++-v3/include/bits/unique_ptr.h +++ b/libstdc++-v3/include/bits/unique_ptr.h @@ -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 diff --git a/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc index 091f1b6fc36..01fb284761e 100644 --- a/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc +++ b/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc @@ -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; } diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index 0960b7916c4..f597da2f0d7 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -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, |