[PATCH] D19565: [libc++] Fix an accidental assignment within assert() that should have been equality.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 15:43:38 PDT 2016


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libc++] Fix an accidental assignment within assert() that should have been equality.

Fixes MSVC "warning C4706: assignment within conditional expression".

http://reviews.llvm.org/D19565

Files:
  test/std/containers/associative/map/compare.pass.cpp

Index: test/std/containers/associative/map/compare.pass.cpp
===================================================================
--- test/std/containers/associative/map/compare.pass.cpp
+++ test/std/containers/associative/map/compare.pass.cpp
@@ -44,7 +44,7 @@
         MapT map;
         IterBool result = map.insert(std::make_pair(Key(0), 42));
         assert(result.second);
-        assert(result.first->second = 42);
+        assert(result.first->second == 42);
         IterBool result2 = map.insert(std::make_pair(Key(0), 43));
         assert(!result2.second);
         assert(map[Key(0)] == 42);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19565.55113.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160426/65e1af20/attachment.bin>


More information about the cfe-commits mailing list