diff --git a/include/sqlpp11/for_update.h b/include/sqlpp11/for_update.h index e4734797..f2832a48 100644 --- a/include/sqlpp11/for_update.h +++ b/include/sqlpp11/for_update.h @@ -162,9 +162,8 @@ namespace sqlpp return context; } - template - auto for_update(T&& t) -> decltype(statement_t().for_update(std::forward(t))) + inline auto for_update() -> decltype(statement_t().for_update()) { - return statement_t().for_update(std::forward(t)); + return statement_t().for_update(); } } // namespace sqlpp diff --git a/tests/core/serialize/ForUpdate.cpp b/tests/core/serialize/ForUpdate.cpp index 02bb5c9e..4d0e161c 100644 --- a/tests/core/serialize/ForUpdate.cpp +++ b/tests/core/serialize/ForUpdate.cpp @@ -51,6 +51,9 @@ int ForUpdate(int, char* []) const auto foo = test::TabFoo{}; // const auto bar = test::TabBar{}; + compare(__LINE__, sqlpp::for_update(), + " FOR UPDATE "); + // Unconditionally compare(__LINE__, select(foo.omega).from(foo).unconditionally().for_update(), "SELECT tab_foo.omega FROM tab_foo FOR UPDATE ");