================
@@ -1341,6 +1342,13 @@ checkExprLifetimeImpl(Sema &SemaRef, const
InitializedEntity *InitEntity,
}
if (IsGslPtrValueFromGslTempOwner && DiagLoc.isValid()) {
+
+ if (SemaRef.getLangOpts().CPlusPlus23) {
+ if (const VarDecl *VD = cast<VarDecl>(InitEntity->getDecl());
----------------
yronglin wrote:
```suggestion
if (const VarDecl *VD =
dyn_cast_if_present<VarDecl>(InitEntity->getDecl());
```
https://github.com/llvm/llvm-project/pull/145164
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits