mrcvtl wrote:

> I think we should revert to the previous approach, what do you think?
> 
> ```c++
>       if (IsGslPtrValueFromGslTempOwner && DiagLoc.isValid()) {
>         if (const auto *VD =
>                 dyn_cast_if_present<VarDecl>(ExtendingEntity->getDecl());
>             SemaRef.getLangOpts().CPlusPlus23 && VD &&
>             VD->isCXXForRangeImplicitVar())
>           return true;
>         SemaRef.Diag(DiagLoc, diag::warn_dangling_lifetime_pointer)
>             << DiagRange;
>         return false;
>       }
> ```

Thanks for debugging that!
I agree btw, didn't think about this side effect before.

https://github.com/llvm/llvm-project/pull/145164
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to