[libcxx-commits] [PATCH] D81559: [libcxx] Fix std::vector construct_iter_iter.pass.cpp test (C++98/03)

Mikhail Maltsev via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 10 05:58:22 PDT 2020


miyuki created this revision.
miyuki added a reviewer: ldionne.
Herald added subscribers: libcxx-commits, dexonsmith.
Herald added a project: libc++.
Herald added a reviewer: libc++.

The test is failing on 32-bit targets in C++03 mode. Clang produces
the following warning: 'integer literal is too large to be represented
in type 'long' and is subject to undefined behavior under C++98,
interpreting as 'unsigned long'; this literal will have type 'long
long' in C++11 onwards [-Wc++11-compat]' which is promoted to an error
and causes the test to fail.

There have been no changes in the test itself since 2019, so it looks
like the diagnostic has been updated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81559

Files:
  libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp


Index: libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
===================================================================
--- libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+++ libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
@@ -180,7 +180,7 @@
     // Though the types are different, initialization can be done with `memcpy`.
     int32_t array[1] = { -1 };
     std::vector<uint32_t> v(array, array + 1);
-    assert(v[0] == 4294967295);
+    assert(v[0] == 4294967295U);
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81559.269809.patch
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200610/c1ad0bc8/attachment-0001.bin>


More information about the libcxx-commits mailing list