[PATCH] D32924: [libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant with another constant".

Stephan T. Lavavej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 15:03:42 PDT 2017


STL_MSFT created this revision.

[libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant with another constant".

The expressions `1 == 1` and `true` have the same type, value category, and value.


https://reviews.llvm.org/D32924

Files:
  test/std/containers/sequences/vector.bool/emplace_back.pass.cpp


Index: test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
===================================================================
--- test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
+++ test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
@@ -48,7 +48,7 @@
         assert(c.front() == false);
         assert(c.back() == true);
 #endif
-        c.emplace_back(1 == 1);
+        c.emplace_back(true);
         assert(c.size() == 3);
         assert(c.front() == false);
         assert(c[1] == true);
@@ -82,7 +82,7 @@
         assert(c.front() == false);
         assert(c.back() == true);
 #endif
-        c.emplace_back(1 == 1);
+        c.emplace_back(true);
         assert(c.size() == 3);
         assert(c.front() == false);
         assert(c[1] == true);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32924.98025.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170505/4c5845a8/attachment.bin>


More information about the cfe-commits mailing list