Skip to content

Commit

Permalink
tests: only run pedantic in C++20 mode
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Aug 21, 2024
1 parent ba93f53 commit 641f9ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tagbased_polymorphic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ TEST_SUBMODULE(tagbased_polymorphic, m) {
.def(py::init<std::string>())
.def("purr", &Panther::purr);
m.def("create_zoo", &create_zoo);
};
}

0 comments on commit 641f9ba

Please sign in to comment.