diff --git a/mlir/lib/Bindings/Python/IRInterfaces.cpp b/mlir/lib/Bindings/Python/IRInterfaces.cpp --- a/mlir/lib/Bindings/Python/IRInterfaces.cpp +++ b/mlir/lib/Bindings/Python/IRInterfaces.cpp @@ -63,13 +63,13 @@ : obj(std::move(object)) { try { operation = &py::cast(obj); - } catch (py::cast_error &err) { + } catch (py::cast_error&) { // Do nothing. } try { operation = &py::cast(obj).getOperation(); - } catch (py::cast_error &err) { + } catch (py::cast_error&) { // Do nothing. } @@ -86,7 +86,7 @@ } else { try { opName = obj.attr("OPERATION_NAME").template cast(); - } catch (py::cast_error &err) { + } catch (py::cast_error&) { throw py::type_error( "Op interface does not refer to an operation or OpView class"); }