]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Move new functions to separate files [PR119110]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 3 Mar 2025 13:36:54 +0000 (13:36 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 5 Mar 2025 22:10:26 +0000 (22:10 +0000)
The new test functions I added in r15-7765-g3866ca796d5281 are causing
those tests to FAIL on Solaris and arm-thumb due to the linker
complaining about undefined functions.  The new test functions are not
called, so it shouldn't matter that they call undefined member
functions, but it does.

Move those functions to separate { dg-do compile } files so the linker
isn't used and won't complain.

libstdc++-v3/ChangeLog:

PR libstdc++/119110
* testsuite/25_algorithms/move/constrained.cc: Move test06
function to ...
* testsuite/25_algorithms/move/105609.cc: New test.
* testsuite/25_algorithms/move_backward/constrained.cc: Move
test04 function to ...
* testsuite/25_algorithms/move_backward/105609.cc: New test.

libstdc++-v3/testsuite/25_algorithms/move/105609.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/move/constrained.cc
libstdc++-v3/testsuite/25_algorithms/move_backward/105609.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/move_backward/constrained.cc

diff --git a/libstdc++-v3/testsuite/25_algorithms/move/105609.cc b/libstdc++-v3/testsuite/25_algorithms/move/105609.cc
new file mode 100644 (file)
index 0000000..8104519
--- /dev/null
@@ -0,0 +1,33 @@
+// { dg-do compile { target c++20 } }
+
+// PR libstdc++/105609
+// ranges::move should use ranges::iter_move instead of std::move
+
+#include <algorithm>
+
+namespace pr105609
+{
+  struct I {
+    using value_type = int;
+    using difference_type = std::ptrdiff_t;
+    int operator*() const;
+    I& operator++();
+    I operator++(int);
+    I& operator--();
+    I operator--(int);
+    bool operator==(I) const;
+    friend int& iter_move(const I&);
+  };
+}
+
+void
+test(pr105609::I i)
+{
+  struct O {
+    O(int&) { }
+    O(int&&) = delete;
+  };
+
+  O* o = nullptr;
+  std::ranges::move(i, i, o);
+}
index e2b45b070ef2a2fbe0d0371c92db5560656ab755..587b2f3728b1c2821a722e85bc31ad0da6e6d869 100644 (file)
@@ -204,35 +204,6 @@ test05()
   VERIFY( ranges::equal(v, (int[]){1,2,3,0}) );
 }
 
-namespace pr105609
-{
-  struct I {
-    using value_type = int;
-    using difference_type = std::ptrdiff_t;
-    int operator*() const;
-    I& operator++();
-    I operator++(int);
-    I& operator--();
-    I operator--(int);
-    bool operator==(I) const;
-    friend int& iter_move(const I&);
-  };
-}
-
-void
-test06(pr105609::I i)
-{
-  // PR libstdc++/105609
-  // ranges::move should use ranges::iter_move instead of std::move
-  struct O {
-    O(int&) { }
-    O(int&&) = delete;
-  };
-
-  O* o = nullptr;
-  std::ranges::move(i, i, o);
-}
-
 int
 main()
 {
diff --git a/libstdc++-v3/testsuite/25_algorithms/move_backward/105609.cc b/libstdc++-v3/testsuite/25_algorithms/move_backward/105609.cc
new file mode 100644 (file)
index 0000000..a4fb8d8
--- /dev/null
@@ -0,0 +1,33 @@
+// { dg-do compile { target c++20 } }
+
+// PR libstdc++/105609
+// ranges::move should use ranges::iter_move instead of std::move
+
+#include <algorithm>
+
+namespace pr105609
+{
+  struct I {
+    using value_type = int;
+    using difference_type = std::ptrdiff_t;
+    int operator*() const;
+    I& operator++();
+    I operator++(int);
+    I& operator--();
+    I operator--(int);
+    bool operator==(I) const;
+    friend int& iter_move(const I&);
+  };
+}
+
+void
+test(pr105609::I i)
+{
+  struct O {
+    O(int&) { }
+    O(int&&) = delete;
+  };
+
+  O* o = nullptr;
+  std::ranges::move_backward(i, i, o);
+}
index 4d94d386dd0bd036966b16755ba095aeb91dab65..8f6fd455b4b6763b085e7f8fa5f324e2cb3ff20e 100644 (file)
@@ -160,35 +160,6 @@ test03()
   return ok;
 }
 
-namespace pr105609
-{
-  struct I {
-    using value_type = int;
-    using difference_type = std::ptrdiff_t;
-    int operator*() const;
-    I& operator++();
-    I operator++(int);
-    I& operator--();
-    I operator--(int);
-    bool operator==(I) const;
-    friend int& iter_move(const I&);
-  };
-}
-
-void
-test04(pr105609::I i)
-{
-  // PR libstdc++/105609
-  // ranges::move should use ranges::iter_move instead of std::move
-  struct O {
-    O(int&) { }
-    O(int&&) = delete;
-  };
-
-  O* o = nullptr;
-  std::ranges::move_backward(i, i, o);
-}
-
 int
 main()
 {