From patchwork Sun Apr 22 13:44:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3] fix libstdc++/53027 Date: Sun, 22 Apr 2012 03:44:58 -0000 From: Jonathan Wakely X-Patchwork-Id: 154269 Message-Id: To: "libstdc++" , gcc-patches * include/bits/ptr_traits.h (pointer_traits::rebind): Make public. * testsuite/20_util/pointer_traits/requirements/typedefs.cc: Check rebind works. Tested x86_64linux, committed to trunk and will commit to 4.7 soon. commit 6141cdceb14025ef258b8809301558f5962bf7ab Author: Jonathan Wakely Date: Fri Apr 20 09:13:44 2012 +0100 * include/bits/ptr_traits.h (pointer_traits::rebind): Make public. * testsuite/20_util/pointer_traits/requirements/typedefs.cc: Check rebind works. diff --git a/libstdc++-v3/include/bits/ptr_traits.h b/libstdc++-v3/include/bits/ptr_traits.h index 7f120b1..bba9b49 100644 --- a/libstdc++-v3/include/bits/ptr_traits.h +++ b/libstdc++-v3/include/bits/ptr_traits.h @@ -140,14 +140,8 @@ _GLIBCXX_HAS_NESTED_TYPE(difference_type) /// Type used to represent the difference between two pointers typedef typename __ptrtr_diff_type<_Ptr>::__type difference_type; - private: template using rebind = typename __ptrtr_rebind<_Ptr, _Up>::__type; - - // allocator_traits needs to use __rebind - template friend struct allocator_traits; - template friend struct pointer_traits; - template friend class __ptrtr_rebind_helper2; }; /** diff --git a/libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc index c682557..47b5212 100644 --- a/libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc @@ -32,6 +32,7 @@ void test01() typedef typename test_type::pointer pointer; typedef typename test_type::element_type element_type; typedef typename test_type::difference_type difference_type; + typedef typename test_type::template rebind rebind_type; } int main()