From: Phil Willoughby Date: Fri, 7 Apr 2017 14:11:55 +0000 (-0700) Subject: Fix a logic error in StringKeyedTest X-Git-Tag: v2017.04.10.00~8 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=905ba447c9990aef5087c8ec885cac4db9435310;p=folly.git Fix a logic error in StringKeyedTest 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 --- diff --git a/folly/experimental/test/StringKeyedTest.cpp b/folly/experimental/test/StringKeyedTest.cpp index 34ae949c..3fbcc021 100644 --- a/folly/experimental/test/StringKeyedTest.cpp +++ b/folly/experimental/test/StringKeyedTest.cpp @@ -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);