From 905ba447c9990aef5087c8ec885cac4db9435310 Mon Sep 17 00:00:00 2001 From: Phil Willoughby Date: Fri, 7 Apr 2017 07:11:55 -0700 Subject: [PATCH] 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 --- folly/experimental/test/StringKeyedTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.34.1