diff --git a/mlir/include/mlir/IR/PatternMatch.h b/mlir/include/mlir/IR/PatternMatch.h --- a/mlir/include/mlir/IR/PatternMatch.h +++ b/mlir/include/mlir/IR/PatternMatch.h @@ -920,7 +920,10 @@ // that a parameter pack can be expanded in c++11. // FIXME: In c++17 this can be simplified by using 'fold expressions'. (void)std::initializer_list{ - 0, (addImpl(/*debugLabels=*/llvm::None, arg, args...), 0)...}; + 0, (addImpl(/*debugLabels=*/llvm::None, + std::forward(arg), + std::forward(args)...), + 0)...}; return *this; } /// An overload of the above `add` method that allows for attaching a set @@ -938,7 +941,9 @@ // that a parameter pack can be expanded in c++11. // FIXME: In c++17 this can be simplified by using 'fold expressions'. (void)std::initializer_list{ - 0, (addImpl(debugLabels, arg, args...), 0)...}; + 0, (addImpl(debugLabels, std::forward(arg), + std::forward(args)...), + 0)...}; return *this; }