2.cc: Add test for non-transparent comparison function.
authorJonathan Wakely <jwakely@redhat.com>
Mon, 26 Jan 2015 11:18:14 +0000 (11:18 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 26 Jan 2015 11:18:14 +0000 (11:18 +0000)
* testsuite/23_containers/set/operations/2.cc: Add test for
non-transparent comparison function.

From-SVN: r220107

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/23_containers/set/operations/2.cc

index 1620f4e941254617755600ae1f76e70c3a6eb9ca..6b2124a37b8ead92409f2f6caed39758153ab7d9 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-26  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/23_containers/set/operations/2.cc: Add test for
+       non-transparent comparison function.
+
 2015-01-25  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/29366
index 752bc7dd7a62d1967c2b60086d1cdaeaec7280f1..84ddd1f1ddcecb90b73c5d1aa722db20cbda9e4f 100644 (file)
@@ -128,6 +128,22 @@ test05()
   VERIFY( Cmp::count == 0);
 }
 
+void
+test06()
+{
+  // https://gcc.gnu.org/ml/libstdc++/2015-01/msg00176.html
+  // Verify the new function template overloads do not cause problems
+  // when the comparison function is not transparent.
+  struct I
+  {
+    int i;
+    operator int() const { return i; }
+  };
+
+  std::set<int> s;
+  I i = { };
+  s.find(i);
+}
 
 int
 main()
@@ -137,4 +153,5 @@ main()
   test03();
   test04();
   test05();
+  test06();
 }