From 790cbee34dfd2a840e3ee363725bc5829331ff0f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 4 Nov 2024 14:37:59 +0100 Subject: [PATCH] [MLIR] Fix a stack-use-after-scope error in OpFormatGen.cpp (#114789) --- mlir/tools/mlir-tblgen/OpFormatGen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp index 3bf6f2f6d38176..7e2b0694a860a3 100644 --- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp +++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp @@ -229,10 +229,9 @@ class OIListElement : public DirectiveElementBase { /// Returns a range to iterate over the LiteralElements. auto getLiteralElements() const { - function_ref - literalElementCastConverter = - [](FormatElement *el) { return cast(el); }; - return llvm::map_range(literalElements, literalElementCastConverter); + return llvm::map_range(literalElements, [](FormatElement *el) { + return cast(el); + }); } /// Returns a range to iterate over the parsing elements corresponding to the