mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
More systematic gcc & clang coverage (#4083)
* More systematic gcc coverage, based on https://github.com/pybind/pybind11/pull/4074#issuecomment-1188385580 * Fix complete fail. * Resolve GCC 11 & 12 "redundant move in return statement" warnings. * Also add clang 11, 12, 13 (to gather info for warning suppressions). * Add & use `PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING`
This commit is contained in:
committed by
GitHub
parent
cb35a3c143
commit
9a2963734d
@@ -43,7 +43,16 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
|
||||
m.def("kw_func_udl_z", kw_func, "x"_a, "y"_a = 0);
|
||||
|
||||
// test_args_and_kwargs
|
||||
m.def("args_function", [](py::args args) -> py::tuple { return std::move(args); });
|
||||
m.def("args_function", [](py::args args) -> py::tuple {
|
||||
#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wreturn-std-move"
|
||||
#endif
|
||||
return args;
|
||||
#ifdef PYBIND11_DETECTED_CLANG_WITH_MISLEADING_CALL_STD_MOVE_EXPLICITLY_WARNING
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
});
|
||||
m.def("args_kwargs_function", [](const py::args &args, const py::kwargs &kwargs) {
|
||||
return py::make_tuple(args, kwargs);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user