From patchwork Tue Aug 10 16:54:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 61399 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5302AB70B4 for ; Wed, 11 Aug 2010 02:55:11 +1000 (EST) Received: (qmail 10076 invoked by alias); 10 Aug 2010 16:55:08 -0000 Received: (qmail 10044 invoked by uid 22791); 10 Aug 2010 16:55:04 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from vsmtp4.tin.it (HELO vsmtp4.tin.it) (212.216.176.224) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Aug 2010 16:54:56 +0000 Received: from [192.168.0.4] (79.52.193.127) by vsmtp4.tin.it (8.5.113) id 4BCE3CBE094F153F; Tue, 10 Aug 2010 18:54:53 +0200 Message-ID: <4C61845D.1000001@oracle.com> Date: Tue, 10 Aug 2010 18:54:53 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 MIME-Version: 1.0 To: Jonathan Wakely CC: "gcc-patches@gcc.gnu.org" , libstdc++ Subject: Re: [v3] Add unique_ptr(auto_ptr<_Up>&&) + contraints References: <4C612647.6040901@oracle.com> <4C617F4F.3040401@oracle.com> In-Reply-To: <4C617F4F.3040401@oracle.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 08/10/2010 06:33 PM, Paolo Carlini wrote: >> Excellent. We might as well remove the concept checks such as >> __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) >> because they'll never fail if SFINAE means the constructor isn't eligible. >> >> > Oh you are completely right, didn't notice that. I'll do it... > As applied. Paolo. ///////////////// 2010-08-10 Paolo Carlini * include/bits/shared_ptr_base.h: Remove a few now redundant __glibcxx_function_requires(_ConvertibleConcept...). * testsuite/20_util/shared_ptr/cons/43820.cc: Adjust dg-error line number. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise. Index: include/bits/shared_ptr_base.h =================================================================== --- include/bits/shared_ptr_base.h (revision 163053) +++ include/bits/shared_ptr_base.h (working copy) @@ -605,7 +605,7 @@ std::enable_if::value>::type> __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r) : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws - { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) } + { } __shared_ptr(__shared_ptr&& __r) : _M_ptr(__r._M_ptr), _M_refcount() // never throws @@ -619,7 +619,6 @@ __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r) : _M_ptr(__r._M_ptr), _M_refcount() // never throws { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) _M_refcount._M_swap(__r._M_refcount); __r._M_ptr = 0; } @@ -971,16 +970,13 @@ std::enable_if::value>::type> __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r) : _M_refcount(__r._M_refcount) // never throws - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - _M_ptr = __r.lock().get(); - } + { _M_ptr = __r.lock().get(); } template::value>::type> __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r) : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws - { __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) } + { } template __weak_ptr& Index: testsuite/20_util/shared_ptr/cons/43820.cc =================================================================== --- testsuite/20_util/shared_ptr/cons/43820.cc (revision 163053) +++ testsuite/20_util/shared_ptr/cons/43820.cc (working copy) @@ -35,6 +35,6 @@ // { dg-error "incomplete" "" { target *-*-* } 566 } std::shared_ptr p9(ap()); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 659 } + // { dg-error "incomplete" "" { target *-*-* } 658 } } Index: testsuite/20_util/weak_ptr/comparison/cmp_neg.cc =================================================================== --- testsuite/20_util/weak_ptr/comparison/cmp_neg.cc (revision 163053) +++ testsuite/20_util/weak_ptr/comparison/cmp_neg.cc (working copy) @@ -43,7 +43,7 @@ // { dg-warning "note" "" { target *-*-* } 327 } // { dg-warning "note" "" { target *-*-* } 446 } -// { dg-warning "note" "" { target *-*-* } 864 } +// { dg-warning "note" "" { target *-*-* } 863 } // { dg-warning "note" "" { target *-*-* } 580 } // { dg-warning "note" "" { target *-*-* } 1027 } // { dg-warning "note" "" { target *-*-* } 340 }