llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

PointerUnion::dyn_cast has been soft-deprecated in favor of
llvm::dyn_cast and llvm::dyn_cast_if_present.  This patch replaces the
former with llvm::dyn_cast where the operand is guaranteed to be
nonnull.

Note that MaterializeTemporaryExpr::State is always initialized or
updated to a nonnull pointer.  It is only set in:

- MaterializeTemporaryExpr::MaterializeTemporaryExpr
- MaterializeTemporaryExpr::setExtendingDecl
- ASTStmtReader::VisitMaterializeTemporaryExpr

Assisted-by: Antigravity


---
Full diff: https://github.com/llvm/llvm-project/pull/230381.diff


1 Files Affected:

- (modified) clang/include/clang/AST/ExprCXX.h (+2-2) 


``````````diff
diff --git a/clang/include/clang/AST/ExprCXX.h 
b/clang/include/clang/AST/ExprCXX.h
index 512b4c60e52694..5187655386d9b7 100644
--- a/clang/include/clang/AST/ExprCXX.h
+++ b/clang/include/clang/AST/ExprCXX.h
@@ -5012,11 +5012,11 @@ class MaterializeTemporaryExpr : public Expr {
   }
 
   LifetimeExtendedTemporaryDecl *getLifetimeExtendedTemporaryDecl() {
-    return State.dyn_cast<LifetimeExtendedTemporaryDecl *>();
+    return dyn_cast<LifetimeExtendedTemporaryDecl *>(State);
   }
   const LifetimeExtendedTemporaryDecl *
   getLifetimeExtendedTemporaryDecl() const {
-    return State.dyn_cast<LifetimeExtendedTemporaryDecl *>();
+    return dyn_cast<LifetimeExtendedTemporaryDecl *>(State);
   }
 
   /// Get the declaration which triggered the lifetime-extension of this

``````````

</details>


https://github.com/llvm/llvm-project/pull/230381
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to