Fix a logic error in StringKeyedTest
authorPhil Willoughby <philwill@fb.com>
Fri, 7 Apr 2017 14:11:55 +0000 (07:11 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 7 Apr 2017 14:20:04 +0000 (07:20 -0700)
Summary: Make sure that the last use of `s6` is sequenced before it is moved-from.

Reviewed By: nbronson

Differential Revision: D4850480

fbshipit-source-id: 5272c14475ae2c62bc613cfd54f5df482b19d3dc

folly/experimental/test/StringKeyedTest.cpp

index 34ae949c29de8a1302b2143d6beb0f7e5e8c62bc..3fbcc021f9a907458bd5065f7af7211b4a5b7a4d 100644 (file)
@@ -355,7 +355,8 @@ TEST(StringKeyedUnorderedSetTest, constructors) {
   EXPECT_TRUE(s3.empty());
   EXPECT_TRUE(s6 == s5);
 
-  LeakCheckedUnorderedSet s7(std::move(s6), s6.get_allocator());
+  auto s6_allocator = s6.get_allocator();
+  LeakCheckedUnorderedSet s7(std::move(s6), s6_allocator);
   EXPECT_TRUE(s6.empty());
   EXPECT_TRUE(s7 == s5);