diff --git a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp --- a/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp +++ b/mlir/tools/mlir-tblgen/OpInterfacesGen.cpp @@ -325,7 +325,7 @@ os << " " << (method.isStatic() ? "static " : ""); emitCPPType(method.getReturnType(), os); emitMethodNameAndArgs(method, os, valueType, /*addThisArg=*/false, - /*addConst=*/!isOpInterface); + /*addConst=*/!isOpInterface && !method.isStatic()); os << " {\n " << tblgen::tgfmt(defaultImpl->trim(), &traitMethodFmt) << "\n }\n"; }