From 181f50b626580d7d5e2ee82e945024e8145f9761 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 19 Oct 2016 19:18:43 +0100 Subject: [PATCH] Fix incorrect comment about std::auto_ptr * include/backward/auto_ptr.h (dauto_ptr): Correct comment about conversions from auto_ptr rvalues to auto_ptr. * testsuite/20_util/auto_ptr/assign_neg.cc: Remove redundant dg-error directives that only match notes, not errors. From-SVN: r241349 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/backward/auto_ptr.h | 8 ++++++-- libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc | 3 --- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 565b32cbeae..06506308b38 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2016-10-19 Jonathan Wakely + * include/backward/auto_ptr.h (dauto_ptr): Correct comment about + conversions from auto_ptr rvalues to auto_ptr. + * testsuite/20_util/auto_ptr/assign_neg.cc: Remove redundant dg-error + directives that only match notes, not errors. + * testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc: Add tests for valid and invalid conversions. * testsuite/experimental/memory/shared_ptr/cons/weak_ptr_ctor.cc: diff --git a/libstdc++-v3/include/backward/auto_ptr.h b/libstdc++-v3/include/backward/auto_ptr.h index bfd42d837bb..4dfc8cc9134 100644 --- a/libstdc++-v3/include/backward/auto_ptr.h +++ b/libstdc++-v3/include/backward/auto_ptr.h @@ -249,13 +249,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** * @brief Automatic conversions * - * These operations convert an %auto_ptr into and from an auto_ptr_ref - * automatically as needed. This allows constructs such as + * These operations are supposed to convert an %auto_ptr into and from + * an auto_ptr_ref automatically as needed. This would allow + * constructs such as * @code * auto_ptr func_returning_auto_ptr(.....); * ... * auto_ptr ptr = func_returning_auto_ptr(.....); * @endcode + * + * But it doesn't work, and won't be fixed. For further details see + * http://cplusplus.github.io/LWG/lwg-closed.html#463 */ auto_ptr(auto_ptr_ref __ref) throw() : _M_ptr(__ref._M_ptr) { } diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc index 5e52ec453d2..22cc49e76bf 100644 --- a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc +++ b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc @@ -47,6 +47,3 @@ main() test01(); return 0; } -// { dg-error "::auto_ptr|no known conversion" "" { target *-*-* } 136 } -// { dg-error "note" "" { target *-*-* } 154 } -// { dg-error "::auto_ptr|no known conversion" "" { target *-*-* } 264 } -- 2.30.2