From 2dd52544942be4bef80811ef18c8fcf1d3c7e246 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Wed, 2 Mar 2022 15:25:43 -0500 Subject: [PATCH] fix: missing move in eval.h (#3775) --- include/pybind11/eval.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/eval.h b/include/pybind11/eval.h index c157a0095..bd5f981f5 100644 --- a/include/pybind11/eval.h +++ b/include/pybind11/eval.h @@ -82,7 +82,7 @@ template object eval(const char (&s)[N], object global = globals(), object local = object()) { /* Support raw string literals by removing common leading whitespace */ auto expr = (s[0] == '\n') ? str(module_::import("textwrap").attr("dedent")(s)) : str(s); - return eval(expr, global, local); + return eval(expr, std::move(global), std::move(local)); } inline void exec(const str &expr, object global = globals(), object local = object()) { @@ -91,7 +91,7 @@ inline void exec(const str &expr, object global = globals(), object local = obje template void exec(const char (&s)[N], object global = globals(), object local = object()) { - eval(s, global, local); + eval(s, std::move(global), std::move(local)); } #if defined(PYPY_VERSION)