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 34ae949..3fbcc02 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);