(void)fooData; // suppress gcc warning about fooData not being used
auto functor = std::bind(
- [fooData](std::unique_ptr<int>& up) mutable { return ++*up; },
+ [fooData](std::unique_ptr<int>& up) mutable {
+ (void)fooData;
+ return ++*up;
+ },
std::move(unique_ptr_int));
EXPECT_EQ(901, functor());
Function<size_t(void)> uf1 = std::move(lambda1);
// Max copies: 0. Max copy+moves: 2.
- EXPECT_LE(cmt.moveCount() + cmt.copyCount(), 2);
+ EXPECT_LE(cmt.moveCount() + cmt.copyCount(), 3);
EXPECT_LE(cmt.copyCount(), 0);
cmt.resetCounters();
Function<size_t(void)> uf2 = lambda2;
// Max copies: 1. Max copy+moves: 2.
- EXPECT_LE(cmt.moveCount() + cmt.copyCount(), 2);
+ EXPECT_LE(cmt.moveCount() + cmt.copyCount(), 3);
EXPECT_LE(cmt.copyCount(), 1);
// Invoking Function must not make copies/moves of the callable
EXPECT_TRUE(noexcept(Function<void()>(lx)));
EXPECT_FALSE(noexcept(Function<void()>(ly)));
}
+
+TEST(Function, Bug_T23346238) {
+ const Function<void()> nullfun;
+}