diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h --- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -126,7 +126,7 @@ : Expression(Expr), ValueLocEntries(Locs.begin(), Locs.end()), IsVariadic(IsVariadic) { #ifndef NDEBUG - assert(cast(Expr)->isValid() || + assert(Expr->isValid() || !any_of(Locs, [](auto LE) { return LE.isLocation(); })); if (!IsVariadic) { assert(ValueLocEntries.size() == 1);