[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)
Hana Dusíková via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 19 11:09:39 PDT 2024
================
@@ -3760,6 +3765,9 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj,
if ((O->isAbsent() && !(handler.AccessKind == AK_Construct && I == N)) ||
(O->isIndeterminate() &&
!isValidIndeterminateAccess(handler.AccessKind))) {
+ // Object has ended lifetime since pointer was formed
+ if (handler.AccessKind == AK_IsWithinLifetime)
+ return false;
----------------
hanickadot wrote:
AFAIK you can't use `bool` here, it will be problem when `findSubobject` will be used with non-compatible return type
https://github.com/llvm/llvm-project/pull/91895
More information about the cfe-commits
mailing list