diff --git a/orc-rt/include/orc-rt/bind.h b/orc-rt/include/orc-rt/bind.h index ca1f20d1b5b3d..855873e10db02 100644 --- a/orc-rt/include/orc-rt/bind.h +++ b/orc-rt/include/orc-rt/bind.h @@ -25,7 +25,7 @@ template class BoundFn { private: template auto callExpandingBound(std::index_sequence, ArgTs &&...Args) { - return F(std::get(BoundArgs)..., std::move(Args)...); + return F(std::get(BoundArgs)..., std::forward(Args)...); } public: diff --git a/orc-rt/unittests/bind-test.cpp b/orc-rt/unittests/bind-test.cpp index 26b868aaef77b..bfaef4e9c1ebe 100644 --- a/orc-rt/unittests/bind-test.cpp +++ b/orc-rt/unittests/bind-test.cpp @@ -71,6 +71,12 @@ TEST(BindTest, MinimalCopies) { EXPECT_EQ(OpCounter::destructions(), 2U); } +TEST(BindTest, ForwardUnboundArgs) { + auto B = bind_front([](int &) {}); + int N = 7; + B(N); +} + static int increment(int N) { return N + 1; } TEST(BindTest, BindFunction) {