================
@@ -534,11 +534,24 @@ class LifetimeSafetySemaHelperImpl : public
LifetimeSafetySemaHelper {
return "expression";
}
+ bool isInValidExpr(const Expr *E) {
+ if (const auto *DRE = dyn_cast<DeclRefExpr>(E)) {
+ return DRE->getDecl()->isImplicit();
+ }
+
+ if (const auto *CE = dyn_cast<CallExpr>(E)) {
+ if (const auto *FE = CE->getDirectCallee())
+ return FE->isImplicit();
+ }
----------------
suoyuan666 wrote:
Sorry, I may have misunderstood. Are you referring to the test case that I
mentioned earlier?
> ```cpp
> void foo() {
> int *s;
> {
> int *(*func)(int *);
> int tgt = 2;
> int *a = &tgt;
> s = func(a);
> }
>
> (void)*s;
> }
> ```
https://github.com/llvm/llvm-project/pull/204592
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits