https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116212

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2025-04-01
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This fixes it:

---
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc
+++
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constrained.cc
@@ -50,7 +50,7 @@ test01(std::vector<T> ix)
     {
       ix = saved_ix;

-      int size = ix.size();
+      unsigned size = ix.size();
       auto buffer = std::unique_ptr<char[]>(new char[sizeof(T)*size]);
       std::span<T> rx((T *)buffer.get(), size);


The compiler thinks it's possible that the vector size overflows int and gives
us a negative number, which then gives a large positive number when converted
back to size_t.

Reply via email to