Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: test/unittests/heap/slot-set-unittest.cc

Issue 2646553002: Fix unused lambda captures. (Closed)
Patch Set: Add a workaround for MSVC++. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | test/unittests/value-serializer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/heap/slot-set-unittest.cc
diff --git a/test/unittests/heap/slot-set-unittest.cc b/test/unittests/heap/slot-set-unittest.cc
index ec905ea2a7313bf4245f24ef901b9d23dd2d20e6..f89feffe332cc3c41214211e30208ce87192be5b 100644
--- a/test/unittests/heap/slot-set-unittest.cc
+++ b/test/unittests/heap/slot-set-unittest.cc
@@ -150,8 +150,11 @@ TEST(SlotSet, RemoveRange) {
TEST(TypedSlotSet, Iterate) {
TypedSlotSet set(0);
- const int kDelta = 10000001;
- const int kHostDelta = 50001;
+ // These two constants must be static as a workaround
+ // for a MSVC++ bug about lambda captures, see the discussion at
+ // https://social.msdn.microsoft.com/Forums/SqlServer/4abf18bd-4ae4-4c72-ba3e-3b13e7909d5f
+ static const int kDelta = 10000001;
+ static const int kHostDelta = 50001;
int added = 0;
uint32_t j = 0;
for (uint32_t i = 0; i < TypedSlotSet::kMaxOffset;
@@ -162,8 +165,8 @@ TEST(TypedSlotSet, Iterate) {
}
int iterated = 0;
set.Iterate(
- [&iterated, kDelta, kHostDelta](SlotType type, Address host_addr,
- Address addr) {
+ [&iterated](SlotType type, Address host_addr,
+ Address addr) {
uint32_t i = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr));
uint32_t j =
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(host_addr));
« no previous file with comments | « src/heap/spaces.cc ('k') | test/unittests/value-serializer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698