From: Yedidya Feldblum Date: Fri, 13 Feb 2015 22:35:04 +0000 (-0800) Subject: clang:dev rejects vector> in EventBaseTest.cpp. X-Git-Tag: v0.27.0~41 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bb4612a0129615428e65400898cce618cd89eb1a;p=folly.git clang:dev rejects vector> in EventBaseTest.cpp. Summary: [Folly] clang:dev rejects vector> in EventBaseTest.cpp. Test Plan: Build and run `folly/io/async/test/EventBaseTest.cpp` using the current `clang`; try building with `clang:dev` and verifying that at least the related failures are gone. Reviewed By: meyering@fb.com Subscribers: mathieubaudet, folly-diffs@, yfeldblum, dougw, brettp FB internal diff: D1848749 Tasks: 6244720 Signature: t1:1848749:1423866420:7b7354d4568b6a6d6a824236ae8d271f6855d90b --- diff --git a/folly/io/async/test/EventBaseTest.cpp b/folly/io/async/test/EventBaseTest.cpp index 25505499..f94ebfc4 100644 --- a/folly/io/async/test/EventBaseTest.cpp +++ b/folly/io/async/test/EventBaseTest.cpp @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +#include + #include #include #include @@ -32,6 +34,7 @@ using std::atomic; using std::deque; using std::pair; using std::vector; +using std::unique_ptr; using std::thread; using std::make_pair; using std::cerr; @@ -1179,14 +1182,14 @@ TEST(EventBaseTest, RunInThread) { // whether any of the race conditions happened. TEST(EventBaseTest, RunInEventLoopThreadAndWait) { const size_t c = 256; - vector> atoms(c); + vector>> atoms(c); for (size_t i = 0; i < c; ++i) { auto& atom = atoms.at(i); - atom = 0; + atom = make_unique>(0); } vector threads(c); for (size_t i = 0; i < c; ++i) { - auto& atom = atoms.at(i); + auto& atom = *atoms.at(i); auto& th = threads.at(i); th = thread([&atom] { EventBase eb; @@ -1209,7 +1212,7 @@ TEST(EventBaseTest, RunInEventLoopThreadAndWait) { th.join(); } size_t sum = 0; - for (auto& atom : atoms) sum += atom; + for (auto& atom : atoms) sum += *atom; EXPECT_EQ(c, sum); }