[clang] [clang][bytecode] Diagnose non-block pointers in __builtin_is_within_lifetime (PR #228337)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 3 22:36:01 PDT 2026


================
@@ -2446,6 +2446,14 @@ static bool interp__builtin_is_within_lifetime(InterpState &S, CodePtr OpPC,
       return false;
   }
 
+  if (!Ptr.isBlockPointer()) {
+    S.FFDiag(S.Current->getSource(OpPC),
+             diag::note_constexpr_access_unreadable_object)
+        << AK_Read << Ptr.toDiagnosticString(S.getASTContext());
+    noteValueLocation(S, Ptr);
----------------
tbaederr wrote:

All I can tell you is that this matches the diagnostics of the current interpreter and that there are no changes in diagnostics in the entire clang test suite. I don't do formal verification for diagnostic output.

https://github.com/llvm/llvm-project/pull/228337


More information about the cfe-commits mailing list