Skip to content

Commit 1b1cfe4

Browse files
hcindylMahesh Ravishankar
authored and
Mahesh Ravishankar
committed
[mlir] Set intial value for integer FieldParser function
GCC complains FieldParser returns the value that does not have an obvious initial value. Set an initial return value for the FieldParser function. The change is a no-op functionality-wise. The return value should be updated within the function. This should fix #64312 Differential Revision: https://reviews.llvm.org/D156848
1 parent ecbe78c commit 1b1cfe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: mlir/include/mlir/IR/DialectImplementation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ template <typename IntT>
8787
struct FieldParser<IntT,
8888
std::enable_if_t<std::is_integral<IntT>::value, IntT>> {
8989
static FailureOr<IntT> parse(AsmParser &parser) {
90-
IntT value;
90+
IntT value = 0;
9191
if (parser.parseInteger(value))
9292
return failure();
9393
return value;

0 commit comments

Comments
 (0)