[Mlir-commits] [mlir] 932f27d - Disambiguate conversion cast for GCC

Benjamin Kramer llvmlistbot at llvm.org
Fri Apr 8 03:56:33 PDT 2022


Author: Benjamin Kramer
Date: 2022-04-08T12:55:09+02:00
New Revision: 932f27dc1f0334eb60e06d34536d93674c923672

URL: https://github.com/llvm/llvm-project/commit/932f27dc1f0334eb60e06d34536d93674c923672
DIFF: https://github.com/llvm/llvm-project/commit/932f27dc1f0334eb60e06d34536d93674c923672.diff

LOG: Disambiguate conversion cast for GCC

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<OperandRange>(*this)[index];
      |
mlir/include/mlir/IR/OperationSupport.h:789:21: note: candidate: mlir::OperandRange::OperandRange(const llvm::iterator_range<llvm::detail::indexed_accessor_
range_base<mlir::OperandRange, mlir::OpOperand*, mlir::Value, mlir::Value, mlir::Value>::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&&)

Added: 
    

Modified: 
    mlir/include/mlir/IR/OperationSupport.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 22cf6fb2423a7..e67dc63f1db4b 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -909,7 +909,7 @@ class MutableOperandRange {
 
   /// Returns the value at the given index.
   Value operator[](unsigned index) const {
-    return static_cast<OperandRange>(*this)[index];
+    return operator OperandRange()[index];
   }
 
 private:


        


More information about the Mlir-commits mailing list