Skip to content

Commit ba93f53

Browse files
committed
tests: try just turning off pedantic for one file
Signed-off-by: Henry Schreiner <[email protected]>
1 parent b0e2ac3 commit ba93f53

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

include/pybind11/cast.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,6 @@ struct always_construct_holder {
868868
static constexpr bool value = Value;
869869
};
870870

871-
PYBIND11_WARNING_PUSH
872-
PYBIND11_WARNING_DISABLE_GCC("-Wpedantic")
873-
PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")
874871
/// Create a specialization for custom holder types (silently ignores std::shared_ptr)
875872
#define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) \
876873
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) \
@@ -883,7 +880,6 @@ PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")
883880
: public type_caster_holder<type, holder_type> {}; \
884881
} \
885882
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
886-
PYBIND11_WARNING_POP
887883

888884
// PYBIND11_DECLARE_HOLDER_TYPE holder types:
889885
template <typename base, typename holder>

tests/test_smart_ptr.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#include "object.h"
1212
#include "pybind11_tests.h"
1313

14+
// This breaks on PYBIND11_DECLARE_HOLDER_TYPE
15+
PYBIND11_WARNING_DISABLE_GCC("-Wpedantic")
16+
1417
namespace {
1518

1619
// This is just a wrapper around unique_ptr, but with extra fields to deliberately bloat up the
@@ -281,15 +284,11 @@ struct holder_helper<ref<T>> {
281284
// Make pybind aware of the ref-counted wrapper type (s):
282285
PYBIND11_DECLARE_HOLDER_TYPE(T, ref<T>, true)
283286
// The following is not required anymore for std::shared_ptr, but it should compile without error:
284-
PYBIND11_WARNING_PUSH
285-
PYBIND11_WARNING_DISABLE_GCC("-Wpedantic")
286-
PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")
287287
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
288288
PYBIND11_DECLARE_HOLDER_TYPE(T, huge_unique_ptr<T>)
289289
PYBIND11_DECLARE_HOLDER_TYPE(T, custom_unique_ptr<T>)
290290
PYBIND11_DECLARE_HOLDER_TYPE(T, shared_ptr_with_addressof_operator<T>)
291291
PYBIND11_DECLARE_HOLDER_TYPE(T, unique_ptr_with_addressof_operator<T>)
292-
PYBIND11_WARNING_POP
293292

294293
TEST_SUBMODULE(smart_ptr, m) {
295294
// Please do not interleave `struct` and `class` definitions with bindings code,

0 commit comments

Comments
 (0)