[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 06:12:02 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:

Changed diagnostics for what? We weren't emitting the diagnostic here before at all so how did it change?

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


More information about the cfe-commits mailing list