pointer_to.cc: Fix.
authorJonathan Wakely <jwakely.gcc@gmail.com>
Sat, 28 May 2011 19:15:41 +0000 (19:15 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 28 May 2011 19:15:41 +0000 (20:15 +0100)
2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

* testsuite/20_util/pointer_traits/pointer_to.cc: Fix.

From-SVN: r174384

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

index 393b728e470b314b5a8c0f4d6f5ad44262c5bd73..1ddef589fa9fcbbbb15d0e2a3a23bd9a8484bceb 100644 (file)
@@ -1,3 +1,7 @@
+2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       * testsuite/20_util/pointer_traits/pointer_to.cc: Fix.
+
 2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * acinclude.m4: Define GLIBCXX_CHECK_GET_NPROCS and
index 557e3848a175f6b9a0d41cbcbd12acacaaf619ef..f33582e540cc07f3ec8c50d9fe0ce4ec0b6852bc 100644 (file)
 struct Ptr
 {
   typedef bool element_type;
+  bool* value;
 
-  static bool* pointer_to(bool& b) { return 0; }
+  static Ptr pointer_to(bool& b) { return Ptr{&b}; }
 };
 
 void test01()
 {
   bool test = true;
+  Ptr p{&test};
 
-  VERIFY( std::pointer_traits<Ptr>::pointer_to(test) == 0 );
+  VERIFY( std::pointer_traits<Ptr>::pointer_to(test).value == &test );
 }
 
 void test02()