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]

[patch] Alter libstdc++ test to work after c++/67216 fix


With Paolo's fix the use of the safe-bool idiom in this test no longer
compiles in C++11 or C++14. The requirement in TR1 is that it works
"in a boolean context" and p1 == false is not necessarily a boolean
context. Do an explicit conversion to make it valid in all modes.

Tested powerpc64le-linux, committing to trunk.
commit 78c8f95718d21c97653a61ba93ca3c311ca21bc7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Aug 18 13:17:50 2015 +0100

    	PR c++/67216
    	* testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc:
    	Fix use of safe-bool idiom that isn't valid in C++11.

diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc
index 0c93f36..e7cefaf 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/observers/bool_conv.cc
@@ -31,9 +31,9 @@ test01()
   bool test __attribute__((unused)) = true;
 
   const std::tr1::shared_ptr<A> p1;
-  VERIFY( p1 == false );
+  VERIFY( bool(p1) == false );
   const std::tr1::shared_ptr<A> p2(p1);
-  VERIFY( p2 == false );
+  VERIFY( bool(p2) == false );
 
   return 0;
 }

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