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

Mikhail Maltsev via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 10 06:27:57 PDT 2020


Author: Mikhail Maltsev
Date: 2020-06-10T14:27:33+01:00
New Revision: 4e94bdceb0f94b90369bf30bf8dca033ee23943a

URL: https://github.com/llvm/llvm-project/commit/4e94bdceb0f94b90369bf30bf8dca033ee23943a
DIFF: https://github.com/llvm/llvm-project/commit/4e94bdceb0f94b90369bf30bf8dca033ee23943a.diff

LOG: [libcxx] Fix std::vector construct_iter_iter.pass.cpp test (C++98/03)

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.

Differential Revision: https://reviews.llvm.org/D81559

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
index 2b3b212aecde..3b43a89fa457 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
@@ -180,7 +180,7 @@ void test_ctor_with_
diff erent_value_type() {
     // Though the types are 
diff erent, 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);
   }
 }
 


        


More information about the libcxx-commits mailing list