File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,6 @@ install:
186
186
187
187
if [ "$CLANG" = "7" ]; then
188
188
export CXXFLAGS="-stdlib=libc++"
189
- # Suppress this warning b/c it's inherent to how `py::self` is used for overloads
190
- export CXXFLAGS="$CXXFLAGS -Wno-self-assign-overloaded"
191
189
fi
192
190
193
191
export NPY_NUM_BUILD_JOBS=2
Original file line number Diff line number Diff line change @@ -62,6 +62,23 @@ namespace std {
62
62
};
63
63
}
64
64
65
+ #pragma GCC diagnostic push
66
+ // clang 7.0.0 and Apple LLVM 10.0.1 introduce `-Wself-assign-overloaded` to
67
+ // `-Wall`, which is used here for overloading (e.g. `py::self += py::self `).
68
+ // Here, we suppress the warning using `#pragma diagnostic`.
69
+ // Taken from: https://github.com/RobotLocomotion/drake/commit/aaf84b46
70
+ // TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`).
71
+ #if (__clang__) && (__APPLE__)
72
+ #if (__clang_major__ >= 10) && (__clang_minor__ >= 0) && (__clang_patchlevel__ >= 1)
73
+ #pragma GCC diagnostic ignored "-Wself-assign-overloaded"
74
+ #endif
75
+ #elif (__clang__)
76
+ #if (__clang_major__ >= 7)
77
+ #pragma GCC diagnostic ignored "-Wself-assign-overloaded"
78
+ #endif
79
+ #endif
80
+ #endif
81
+
65
82
TEST_SUBMODULE (operators, m) {
66
83
67
84
// test_operator_overloading
@@ -144,3 +161,5 @@ TEST_SUBMODULE(operators, m) {
144
161
.def_readwrite (" b" , &NestC::b);
145
162
m.def (" get_NestC" , [](const NestC &c) { return c.value ; });
146
163
}
164
+
165
+ #pragma GCC diagnostic pop
You can’t perform that action at this time.
0 commit comments