diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -353,9 +353,9 @@ static inline CastResultType castFailed() { return CastResultType(nullptr); } static inline CastResultType doCastIfPossible(std::unique_ptr &&f) { - if (!Self::isPossible(f)) + if (!Self::isPossible(f.get())) return castFailed(); - return doCast(f); + return doCast(std::forward &&>(f)); } };