mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +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:
@@ -11,6 +11,9 @@
|
||||
#include "object.h"
|
||||
#include "pybind11_tests.h"
|
||||
|
||||
// This breaks on PYBIND11_DECLARE_HOLDER_TYPE
|
||||
PYBIND11_WARNING_DISABLE_GCC("-Wpedantic")
|
||||
|
||||
namespace {
|
||||
|
||||
// This is just a wrapper around unique_ptr, but with extra fields to deliberately bloat up the
|
||||
@@ -279,13 +282,13 @@ struct holder_helper<ref<T>> {
|
||||
} // namespace PYBIND11_NAMESPACE
|
||||
|
||||
// Make pybind aware of the ref-counted wrapper type (s):
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, ref<T>, true);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, ref<T>, true)
|
||||
// The following is not required anymore for std::shared_ptr, but it should compile without error:
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, huge_unique_ptr<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, custom_unique_ptr<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, shared_ptr_with_addressof_operator<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, unique_ptr_with_addressof_operator<T>);
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, huge_unique_ptr<T>)
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, custom_unique_ptr<T>)
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, shared_ptr_with_addressof_operator<T>)
|
||||
PYBIND11_DECLARE_HOLDER_TYPE(T, unique_ptr_with_addressof_operator<T>)
|
||||
|
||||
TEST_SUBMODULE(smart_ptr, m) {
|
||||
// Please do not interleave `struct` and `class` definitions with bindings code,
|
||||
|
||||
Reference in New Issue
Block a user