]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc
libstdc++: Add comparison operators to std::shared_ptr (PR 94562)
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / shared_ptr / comparison / less.cc
index 8b42b3a9c1539ffe48de0cf0db00e98c11c2e47c..9ee65ffdf09726df11b2f11b4447f9241e515f0c 100644 (file)
@@ -46,7 +46,11 @@ test01()
   std::shared_ptr<A> p1;
   std::shared_ptr<A> p2;
   VERIFY( !less(p1, p2) && !less(p2, p1) );
+#ifndef __cpp_lib_three_way_comparison
+// In C++20 std::less<std::shared_ptr<A>> uses the operator< synthesized
+// from operator<=>, which uses std::compare_three_way not std::less<A*>.
   VERIFY( std::less<A*>::count == 2 );
+#endif
   return 0;
 }
 
@@ -86,7 +90,7 @@ test03()
 
   return 0;
 }
-int 
+int
 main()
 {
   test01();