<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/101004>101004</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
mlir::OperandRange seems to give the wrong template parameters to llvm::detail::indexed_accessor_range_base
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aDifferentJT
</td>
</tr>
</table>
<pre>
https://github.com/llvm/llvm-project/blob/13d39cb6f7b20e596b66f59ebf4dba766451398b/mlir/include/mlir/IR/ValueRange.h#L42
`llvm::detail::indexed_accessor_range_base` takes template parameters `<DerivedT, BaseT, T, PointerT, ReferenceT>`
`mlir::OperandRange` inherits from `llvm::detail::indexed_accessor_range_base<OperandRange, OpOperand *, Value, Value, Value>`
This means that `PointerT` and `ReferenceT` are both `mlir::Value` which causes errors like the following:
```
llvm/include/llvm/ADT/iterator.h:125:42: error: no viable conversion from returned value of type 'const mlir::Value *' to function return type 'mlir::Value'
125 | PointerT operator->() const { return &R; }
| ^~
```
Should `mlir::OperandRange` inherit from `llvm::detail::indexed_accessor_range_base<OperandRange, OpOperand *, Value, Value *, Value &>`?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VE2P2zYQ_TX0ZRCDGupjddBBa8dAiwIptkavC1IcWWxo0iApb3Ppby8oObtxsIemhxgGPR6Yb957Hj0Zozk5oo5Vj6zab-ScJh86uTfjSIFc-vW4UV5_6aaULpGJnuGB4eFk0jSr7eDPDA_WXr9-fLgE_xcNieFBWa8YHgqhRTuoemwUcqraWtX1WLWkxlIr2dR1WRWifcg_PVsTGB6MG-ys6a3xyxPDw5_SzvQk3Ym2E0PxW4mM7xnvb2fNFxaiZ6LXlKSxa22cpr9JP8thoBh9eA4Z4lnJSKzmkORnipDofLEyEVxkkGdKFCKwmjOx21MwV9JHhjt4lJGWYjl-98YlCkv9RItXAx2Z-Jgv3jNbZCxsPl0oSKcXGXm8cRMFkyKMwZ_hf4kQuztQ3MGny60DDPvcWKx7p1i4wrdkj5OJcCbpIqRJpszoVWfNYcGs-TdyczMQKJ8muFO6Tqg5vExmmGCQc6QIFIIPEaz5TJAmgtFb61-MO-VL96bd3svX24K9Lcat0e-PuZ0oyOTDdmKiL7Bioi-RiX6dlgvn4WqksgSDd1cK0Xi3Wh4ozcGRhmvmC36E9OVCwLAZvIsJvhO0OtpA8jDObkgZZ4V4vfe9BdisGgAACqyANbtcvu4P-MtK_0P-P_CBYQvrbNY8fgVnWD8x8Qis2b-h5VdGY9XHf961bT3_mPxsNfyXPfyZa3jXzQJvj444bHQndCtauaGuaBCxqnlZbKauHDUqIUpeEW81tqMaSPEWK6VlM4hhYzrkWPIG2wKxwWJblLp4KIoHxKIsmlKzktNZGrvNArc-nDYmxpm6gheclxsrFdm4RCHiGj6YQzF0S7ap-RRZya2JKb4hJJMsde97C5HoHPO6nMx1XfmX4N3p3cRJHn7Y980c7I9H8yI65nBedV87_DcAAP__b3bhig">