[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
================
@@ -3927,6 +3935,9 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj,
// Placement new onto an inactive union member makes it active.
O->setUnion(Field, APValue());
} else {
+ // Pointer to/into inactive union member: Not within lifetime
+ if (handler.AccessKind == AK_IsWithinLifetime)
+ return false;
----------------
hanickadot wrote:
same here
https://github.com/llvm/llvm-project/pull/91895
More information about the cfe-commits
mailing list