diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 88ab5a29aa..2a39e88f37 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -480,7 +480,6 @@ PYBIND11_WARNING_POP \endrst */ PYBIND11_WARNING_PUSH -PYBIND11_WARNING_DISABLE_GCC("-Wpedantic") PYBIND11_WARNING_DISABLE_CLANG("-Wgnu-zero-variadic-macro-arguments") #define PYBIND11_MODULE(name, variable, ...) \ static ::pybind11::module_::module_def PYBIND11_CONCAT(pybind11_module_def_, name) \ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bfc2e94df9..cd94ef3e53 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -377,12 +377,14 @@ function(pybind11_enable_warnings target_name) ${target_name} PRIVATE -Wall -Wextra - -Wpedantic -Wconversion -Wcast-qual -Wdeprecated -Wundef -Wnon-virtual-dtor) + if(DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD VERSION_LESS 20) + target_compile_options(${target_name} PRIVATE -Wpedantic) + endif() endif() if(PYBIND11_WERROR) diff --git a/tests/test_tagbased_polymorphic.cpp b/tests/test_tagbased_polymorphic.cpp index 24b49021b4..13e5ed3198 100644 --- a/tests/test_tagbased_polymorphic.cpp +++ b/tests/test_tagbased_polymorphic.cpp @@ -145,4 +145,4 @@ TEST_SUBMODULE(tagbased_polymorphic, m) { .def(py::init()) .def("purr", &Panther::purr); m.def("create_zoo", &create_zoo); -}; +} diff --git a/tests/test_virtual_functions.cpp b/tests/test_virtual_functions.cpp index 93b136ad3c..a6164eb81d 100644 --- a/tests/test_virtual_functions.cpp +++ b/tests/test_virtual_functions.cpp @@ -589,4 +589,4 @@ void initialize_inherited_virtuals(py::module_ &m) { // Fix issue #1454 (crash when acquiring/releasing GIL on another thread in Python 2.7) m.def("test_gil", &test_gil); m.def("test_gil_from_thread", &test_gil_from_thread); -}; +}