Patchwork shared_ptr comparisons

login
register
mail settings
Submitter Jonathan Wakely
Date Nov. 28, 2010, 1:35 a.m.
Message ID <AANLkTi=3VvrwX9feyncO6isr4NxE6v3LAkcuqtfaDn4w@mail.gmail.com>
Download mbox | patch
Permalink /patch/73318/
State New
Headers show

Comments

Jonathan Wakely - Nov. 28, 2010, 1:35 a.m.
On 27 November 2010 23:30, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Nov 27, 2010 at 10:32 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> On 17 November 2010 00:42, Paolo Carlini wrote:
>>> On 11/17/2010 12:46 AM, Jonathan Wakely wrote:
>>>> Unless I'm mistaken we should only have operators <, == and != for shared_ptr.
>>>>
>>>> Any objections to this change?
>>>>
>>> Not from me. To be honest I have no idea where those operators comes
>>> from, and certainly we don't have anything similar for the actual
>>> std::shared_ptr...
>>
>> 2010-11-27  Jonathan Wakely  <jwakely.gcc@gmail.com>
>>
>>        * include/bits/shared_ptr_base.h (operator>, operator>=, operator<=):
>>        Remove comparisons not specified in the C++0x draft.
>>
>> tested x86_64-linux and committed to trunk
>>
>
> This may have caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46689

Yes, sorry - I had changed the test locally but didn't check it in.

Fixed by...

2010-11-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

        PR libstdc++/46689
        * testsuite/20_util/shared_ptr/comparison/cmp.cc: Remove tests for
        invalid comparisons.

Patch

Index: testsuite/20_util/shared_ptr/comparison/cmp.cc
===================================================================
--- testsuite/20_util/shared_ptr/comparison/cmp.cc	(revision 167216)
+++ testsuite/20_util/shared_ptr/comparison/cmp.cc	(revision 167217)
@@ -79,26 +79,10 @@  test02()
   return 0;
 }
 
-int
-test03()
-{
-  bool test __attribute__((unused)) = true;
-
-  std::shared_ptr<A> p1;
-
-  // check other operators are defined
-  VERIFY( p1 <= p1 );
-  VERIFY( p1 >= p1 );
-  VERIFY( !(p1 > p1) );
-
-  return 0;
-}
-
 int 
 main()
 {
   test01();
   test02();
-  test03();
   return 0;
 }