================ @@ -40,8 +40,12 @@ static const Expr *ignoreTransparentExprs(const Expr *E) { switch (E->getStmtClass()) { case Stmt::OpaqueValueExprClass: - E = cast<OpaqueValueExpr>(E)->getSourceExpr(); - break; + if (const clang::Expr *SE = cast<OpaqueValueExpr>(E)->getSourceExpr()) { + E = SE; + break; + } else { + return E; + } ---------------- bolshakov-a wrote:
Thanks! `else` doesn't make sense, indeed. But it should be noted that `SE` refers to the result of `->getSourceExpr()` and not to the result of `cast<OpaqueValueExpr>(E)`, hence its type is not a pointer to `OpaqueValueExpr`. Doesn't LLVM policy insist on the explicit type in such cases? Nevertheless, `clang::` qualification is redundant. https://github.com/llvm/llvm-project/pull/79764 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits