From 932f27dc1f0334eb60e06d34536d93674c923672 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 8 Apr 2022 12:36:41 +0200 Subject: [PATCH] Disambiguate conversion cast for GCC MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC 9 has problems with this. mlir/include/mlir/IR/OperationSupport.h: In member function ‘mlir::Value mlir::MutableOperandRange::operator[](unsigned int) const’: mlir/include/mlir/IR/OperationSupport.h:912:43: error: call of overloaded ‘OperandRange(const mlir::MutableOperandRange&)’ is ambiguous 912 | return static_cast(*this)[index]; | mlir/include/mlir/IR/OperationSupport.h:789:21: note: candidate: mlir::OperandRange::OperandRange(const llvm::iterator_range::iterator>&) using RangeBaseT::RangeBaseT; ^~~~~~~~~~ mlir/include/mlir/IR/OperationSupport.h:786:7: note: candidate: constexpr mlir::OperandRange::OperandRange(const mlir::OperandRange&) class OperandRange final : public llvm::detail::indexed_accessor_range_base< ^~~~~~~~~~~~ mlir/include/mlir/IR/OperationSupport.h:786:7: note: candidate: constexpr mlir::OperandRange::OperandRange(mlir::OperandRange&&) --- mlir/include/mlir/IR/OperationSupport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h index 22cf6fb..e67dc63 100644 --- a/mlir/include/mlir/IR/OperationSupport.h +++ b/mlir/include/mlir/IR/OperationSupport.h @@ -909,7 +909,7 @@ public: /// Returns the value at the given index. Value operator[](unsigned index) const { - return static_cast(*this)[index]; + return operator OperandRange()[index]; } private: -- 2.7.4