mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
fix: allow -Wpedantic in C++20 mode (#5322)
* fix: allow -Wpedantic again Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: ignore pedantic warning for PYBIND11_DECLARE_HOLDER_TYPE Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: try just turning off pedantic for one file Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: only run pedantic in C++20 mode Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update tests/local_bindings.h --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -56,13 +56,13 @@ private:
|
||||
std::string message = "";
|
||||
};
|
||||
|
||||
PYBIND11_MAKE_OPAQUE(LocalVec);
|
||||
PYBIND11_MAKE_OPAQUE(LocalVec2);
|
||||
PYBIND11_MAKE_OPAQUE(LocalMap);
|
||||
PYBIND11_MAKE_OPAQUE(NonLocalVec);
|
||||
// PYBIND11_MAKE_OPAQUE(NonLocalVec2); // same type as LocalVec2
|
||||
PYBIND11_MAKE_OPAQUE(NonLocalMap);
|
||||
PYBIND11_MAKE_OPAQUE(NonLocalMap2);
|
||||
PYBIND11_MAKE_OPAQUE(LocalVec)
|
||||
PYBIND11_MAKE_OPAQUE(LocalVec2)
|
||||
PYBIND11_MAKE_OPAQUE(LocalMap)
|
||||
PYBIND11_MAKE_OPAQUE(NonLocalVec)
|
||||
// PYBIND11_MAKE_OPAQUE(NonLocalVec2) // same type as LocalVec2
|
||||
PYBIND11_MAKE_OPAQUE(NonLocalMap)
|
||||
PYBIND11_MAKE_OPAQUE(NonLocalMap2)
|
||||
|
||||
// Simple bindings (used with the above):
|
||||
template <typename T, int Adjust = 0, typename... Args>
|
||||
@@ -70,7 +70,7 @@ py::class_<T> bind_local(Args &&...args) {
|
||||
return py::class_<T>(std::forward<Args>(args)...).def(py::init<int>()).def("get", [](T &i) {
|
||||
return i.i + Adjust;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// Simulate a foreign library base class (to match the example in the docs):
|
||||
namespace pets {
|
||||
|
||||
Reference in New Issue
Block a user