Skip to content

Commit b0e2ac3

Browse files
committed
tests: ignore pedantic warning for PYBIND11_DECLARE_HOLDER_TYPE
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 1a6fca3 commit b0e2ac3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_smart_ptr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,15 @@ struct holder_helper<ref<T>> {
281281
// Make pybind aware of the ref-counted wrapper type (s):
282282
PYBIND11_DECLARE_HOLDER_TYPE(T, ref<T>, true)
283283
// 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")
284287
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
285288
PYBIND11_DECLARE_HOLDER_TYPE(T, huge_unique_ptr<T>)
286289
PYBIND11_DECLARE_HOLDER_TYPE(T, custom_unique_ptr<T>)
287290
PYBIND11_DECLARE_HOLDER_TYPE(T, shared_ptr_with_addressof_operator<T>)
288291
PYBIND11_DECLARE_HOLDER_TYPE(T, unique_ptr_with_addressof_operator<T>)
292+
PYBIND11_WARNING_POP
289293

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

0 commit comments

Comments
 (0)