Skip to content

Commit 2268f7e

Browse files
committed
fix: handle MSVC warning C4866: compiler may not enforce left-to-right evaluation order
1 parent c630e22 commit 2268f7e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/pybind11/detail/function_record_pyobject.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "common.h"
1414

1515
#include <cstring>
16+
#include <utility>
1617

1718
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1819
PYBIND11_NAMESPACE_BEGIN(detail)
@@ -188,7 +189,7 @@ inline PyObject *reduce_ex_impl(PyObject *self, PyObject *, PyObject *) {
188189
&& PyModule_Check(rec->scope.ptr()) != 0) {
189190
object scope_module = get_scope_module(rec->scope);
190191
if (scope_module) {
191-
return make_tuple(reinterpret_borrow<object>(PyEval_GetBuiltins())["eval"],
192+
return make_tuple((reinterpret_borrow<object>(PyEval_GetBuiltins()))["eval"],
192193
make_tuple(str("__import__('importlib').import_module('")
193194
+ scope_module + str("')")))
194195
.release()

0 commit comments

Comments
 (0)