Skip to content

Commit 6e02b58

Browse files
committed
fix: try disabling inside the namespace
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 1a6fca3 commit 6e02b58

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

include/pybind11/cast.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,12 +868,11 @@ 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) \
874+
PYBIND11_WARNING_DISABLE_GCC("-Wpedantic") \
875+
PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments") \
877876
namespace detail { \
878877
template <typename type> \
879878
struct always_construct_holder<holder_type> : always_construct_holder<void, ##__VA_ARGS__> { \
@@ -883,7 +882,6 @@ PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments")
883882
: public type_caster_holder<type, holder_type> {}; \
884883
} \
885884
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
886-
PYBIND11_WARNING_POP
887885

888886
// PYBIND11_DECLARE_HOLDER_TYPE holder types:
889887
template <typename base, typename holder>

0 commit comments

Comments
 (0)