diff --git a/sol/stack.hpp b/sol/stack.hpp
index 769f38b3..8d07774d 100644
--- a/sol/stack.hpp
+++ b/sol/stack.hpp
@@ -234,7 +234,7 @@ auto rtl_pop(lua_State* L, F&& f, types
, Vs&&... vs) -> decltype(rtl_pop(L
return rtl_pop(L, std::forward(f), types<>(), pop(L), std::forward(vs)...);
}
template
-auto rtl_pop(lua_State* L, F&& f, types, types, Vs&&... vs) -> decltype(f(std::forward(declval())...)) {
+auto rtl_pop(lua_State* L, F&& f, types, types, Vs&&... vs) -> decltype(f(std::forward(std::declval())...)) {
return rtl_pop(L, std::forward(f), types(), pop(L), std::forward(vs)...);
}
} // detail