From aebeaab9baeac19644cf55ac6ae5a10b320e7605 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 9 Aug 2026 18:55:06 +0200 Subject: [PATCH] [diff.expr] Strike line in example that is UB in C23 In C23, "p + 0" is undefined behavior if p is a nullptr, regardless of whether the result is dereferenced. --- source/compatibility.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 95ce283019..44935ddf39 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -3161,7 +3161,6 @@ void f() { char *p = nullptr; char *p2 = &*p; // well-defined in C, undefined behavior in \Cpp{} - char *p3 = &p[0]; // well-defined in C, undefined behavior in \Cpp{} int a[5]; int *q = &a[5]; // well-defined in C, undefined behavior in \Cpp{} }