OSDN Git Service

2011-10-03 Jonathan Wakely <jwakely.gcc@gmail.com>
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Oct 2011 19:11:53 +0000 (19:11 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Oct 2011 19:11:53 +0000 (19:11 +0000)
* testsuite/20_util/pointer_traits/pointer_to.cc: Define equality
operator and use.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179473 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/pointer_traits/pointer_to.cc

index 31c6914..6e74692 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-03  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       * testsuite/20_util/pointer_traits/pointer_to.cc: Define equality
+       operator and use.
+
 2011-10-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/hashtable.h (_Hashtable<>::insert(value_type&&),
index 33c96e1..1cfc980 100644 (file)
@@ -29,12 +29,14 @@ struct Ptr
   static Ptr pointer_to(bool& b) { return Ptr{&b}; }
 };
 
+bool operator==(const Ptr& l, const Ptr& r) { return l.value == r.value; }
+
 void test01()
 {
   bool test = true;
-  Ptr p __attribute__((unused)) {&test};
+  Ptr p{ &test };
 
-  VERIFY( std::pointer_traits<Ptr>::pointer_to(test).value == &test );
+  VERIFY( std::pointer_traits<Ptr>::pointer_to(test) == p );
 }
 
 void test02()