diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 98dc90c0..03ebc322 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -228,7 +228,7 @@ inline iterator handle::end() const { return iterator(nullptr); } Name(const handle &h, bool borrowed) : Parent(h, borrowed) { CvtStmt; } \ Name(const object& o): Parent(o) { CvtStmt; } \ Name(object&& o): Parent(std::move(o)) { CvtStmt; } \ - Name& operator=(object&& o) { return static_cast(object::operator=(std::move(o))); CvtStmt; } \ + Name& operator=(object&& o) { (void) static_cast(object::operator=(std::move(o))); CvtStmt; return *this; } \ Name& operator=(object& o) { return static_cast(object::operator=(o)); CvtStmt; } \ bool check() const { return m_ptr != nullptr && (bool) CheckFun(m_ptr); }