[clang][Sema][NFC] Remove two nonsensical dyn_cast_or_null
authorTimm Bäder <tbaeder@redhat.com>
Mon, 7 Nov 2022 08:46:08 +0000 (09:46 +0100)
committerTimm Bäder <tbaeder@redhat.com>
Tue, 8 Nov 2022 11:47:41 +0000 (12:47 +0100)
The values used here are never null.

clang/lib/Sema/SemaDeclCXX.cpp

index 73603b5..84d7cf1 100644 (file)
@@ -16732,7 +16732,7 @@ static bool UsefulToPrintExpr(const Expr *E) {
     return false;
 
   // -5 is also simple to understand.
-  if (const auto *UnaryOp = dyn_cast_or_null<UnaryOperator>(E))
+  if (const auto *UnaryOp = dyn_cast<UnaryOperator>(E))
     return UsefulToPrintExpr(UnaryOp->getSubExpr());
 
   // Ignore nested binary operators. This could be a FIXME for improvements
@@ -16746,7 +16746,7 @@ static bool UsefulToPrintExpr(const Expr *E) {
 /// Try to print more useful information about a failed static_assert
 /// with expression \E
 void Sema::DiagnoseStaticAssertDetails(const Expr *E) {
-  if (const auto *Op = dyn_cast_or_null<BinaryOperator>(E)) {
+  if (const auto *Op = dyn_cast<BinaryOperator>(E)) {
     const Expr *LHS = Op->getLHS()->IgnoreParenImpCasts();
     const Expr *RHS = Op->getRHS()->IgnoreParenImpCasts();