You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[diff.expr] Paragraph added by CWG2875 is not correct for C23 #9248
voidf() {
char*p=nullptr;
char*p2=&*p; // well-defined in C, undefined behavior in C++char*p3=&p[0]; // well-defined in C, undefined behavior in C++inta[5];
int*q=&a[5]; // well-defined in C, undefined behavior in C++
}
In C &p[0] gets translated to p+0 which is undefined in C23, though it is valid in C2Y because of N3322. Should the second comment be updated since C++ currently references C23?
Activity
jensmaurer commentedon Aug 9, 2026
Good catch.