[mlir] NFC: work around gcc-aarch64 v8.3 compilation issue in getRegionBranchSuccesso...
authorChristian Sigg <csigg@google.com>
Thu, 29 Dec 2022 11:02:58 +0000 (12:02 +0100)
committerChristian Sigg <csigg@google.com>
Thu, 29 Dec 2022 11:03:32 +0000 (12:03 +0100)
https://reviews.llvm.org/rG25671db3d343 didn't quite do it because the underlying issue was that the specific compiler chokes on the second standard conversion sequence after the user-defined `MutableOperandRange::operator OperandRange() const` conversion (see https://en.cppreference.com/w/cpp/language/implicit_conversion).

mlir/lib/Interfaces/ControlFlowInterfaces.cpp

index 9df5e55..deec605 100644 (file)
@@ -395,6 +395,6 @@ mlir::getRegionBranchSuccessorOperands(Operation *operation,
                                        std::optional<unsigned> regionIndex) {
   auto range = getMutableRegionBranchSuccessorOperands(operation, regionIndex);
   if (range)
-    return static_cast<OperandRange>(*range);
+    return range->operator OperandRange();
   return std::nullopt;
 }