This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] testsuite tweak


2011-10-03  Jonathan Wakely  <jwakely.gcc@gmail.com>

        * testsuite/20_util/pointer_traits/pointer_to.cc: Define equality
        operator and use.

Tested x86_64-linux, committed to trunk.
Index: testsuite/20_util/pointer_traits/pointer_to.cc
===================================================================
--- testsuite/20_util/pointer_traits/pointer_to.cc	(revision 179472)
+++ testsuite/20_util/pointer_traits/pointer_to.cc	(working copy)
@@ -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()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]