File tree Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -911,7 +911,7 @@ jobs:
911
911
- name : Configure C++11
912
912
# LTO leads to many undefined reference like
913
913
# `pybind11::detail::function_call::function_call(pybind11::detail::function_call&&)
914
- run : cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DDOWNLOAD_CATCH=ON -S . -B build
914
+ run : cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=11 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON - DDOWNLOAD_CATCH=ON -S . -B build
915
915
916
916
- name : Build C++11
917
917
run : cmake --build build -j 2
@@ -929,7 +929,7 @@ jobs:
929
929
run : git clean -fdx
930
930
931
931
- name : Configure C++14
932
- run : cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DDOWNLOAD_CATCH=ON -S . -B build2
932
+ run : cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=14 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON - DDOWNLOAD_CATCH=ON -S . -B build2
933
933
934
934
- name : Build C++14
935
935
run : cmake --build build2 -j 2
@@ -947,7 +947,7 @@ jobs:
947
947
run : git clean -fdx
948
948
949
949
- name : Configure C++17
950
- run : cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DDOWNLOAD_CATCH=ON -S . -B build3
950
+ run : cmake -G "MinGW Makefiles" -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYBIND11_WERROR=ON - DDOWNLOAD_CATCH=ON -S . -B build3
951
951
952
952
- name : Build C++17
953
953
run : cmake --build build3 -j 2
Original file line number Diff line number Diff line change 27
27
# pragma warning(disable : 4127) // C4127: conditional expression is constant
28
28
# pragma warning(disable : 5054) // https://github.com/pybind/pybind11/pull/3741
29
29
// C5054: operator '&': deprecated between enumerations of different types
30
+ #elif defined(__MINGW32__)
31
+ # pragma GCC diagnostic push
32
+ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
30
33
#endif
31
34
32
35
#include < Eigen/Core>
33
36
#include < Eigen/SparseCore>
34
37
35
38
#if defined(_MSC_VER)
36
39
# pragma warning(pop)
40
+ #elif defined(__MINGW32__)
41
+ # pragma GCC diagnostic pop
37
42
#endif
38
43
39
44
// Eigen prior to 3.2.7 doesn't have proper move constructors--but worse, some classes get implicit
Original file line number Diff line number Diff line change @@ -266,9 +266,14 @@ TEST_SUBMODULE(builtin_casters, m) {
266
266
});
267
267
m.def (" lvalue_nested" , []() -> const decltype (lvnested) & { return lvnested; });
268
268
269
- static std::pair<int , std::string> int_string_pair{2 , " items" };
270
269
m.def (
271
- " int_string_pair" , []() { return &int_string_pair; }, py::return_value_policy::reference);
270
+ " int_string_pair" ,
271
+ []() {
272
+ // Using no-destructor idiom to side-step warnings from overzealous compilers.
273
+ static auto *int_string_pair = new std::pair<int , std::string>{2 , " items" };
274
+ return int_string_pair;
275
+ },
276
+ py::return_value_policy::reference);
272
277
273
278
// test_builtins_cast_return_none
274
279
m.def (" return_none_string" , []() -> std::string * { return nullptr ; });
Original file line number Diff line number Diff line change @@ -176,9 +176,14 @@ TEST_SUBMODULE(stl, m) {
176
176
m.def (" load_bool_vector" ,
177
177
[](const std::vector<bool > &v) { return v.at (0 ) == true && v.at (1 ) == false ; });
178
178
// Unnumbered regression (caused by #936): pointers to stl containers aren't castable
179
- static std::vector<RValueCaster> lvv{2 };
180
179
m.def (
181
- " cast_ptr_vector" , []() { return &lvv; }, py::return_value_policy::reference);
180
+ " cast_ptr_vector" ,
181
+ []() {
182
+ // Using no-destructor idiom to side-step warnings from overzealous compilers.
183
+ static auto *v = new std::vector<RValueCaster>{2 };
184
+ return v;
185
+ },
186
+ py::return_value_policy::reference);
182
187
183
188
// test_deque
184
189
m.def (" cast_deque" , []() { return std::deque<int >{1 }; });
@@ -237,6 +242,7 @@ TEST_SUBMODULE(stl, m) {
237
242
lvn[" b" ].emplace_back (); // add a list
238
243
lvn[" b" ].back ().emplace_back (); // add an array
239
244
lvn[" b" ].back ().emplace_back (); // add another array
245
+ static std::vector<RValueCaster> lvv{2 };
240
246
m.def (" cast_lv_vector" , []() -> const decltype (lvv) & { return lvv; });
241
247
m.def (" cast_lv_array" , []() -> const decltype (lva) & { return lva; });
242
248
m.def (" cast_lv_map" , []() -> const decltype (lvm) & { return lvm; });
You can’t perform that action at this time.
0 commit comments