P3596R0 — Undefined Behavior and IFNDR Annexes (18 items) CWG
Joshua Berne, Timur Doumler, Jens Maurer, Shafik Yaghmour
This paper provides wording to add two new informative annexes to the C++ Standard: one cataloging all instances of core undefined behavior (Annex E) and one cataloging all instances of ill-formed, no diagnostic required (IFNDR) behavior (Annex F). Each entry includes a title, a cross-reference to the normative text, a summary, and a code example. The annexes also introduce stable identifiers for each kind of undefined or IFNDR behavior to serve as common vocabulary for future mitigation efforts.

References — Anthropic Citations API

[1]
"We have atempted to follow some basic guidance on what is and is not appropriate to include in this annex: • In general the annex examples must be correct and provide an example of the specific..."
[1]
"We have atempted to follow some basic guidance on what is and is not appropriate to include in this annex: • In general the annex examples must be correct and provide an example of the specific..."
[2]
"JMB: Such comments will appear in the text in a box lke this one, and must be resolved prior to the completion of wording review. "
[3]
"In the final rendered standard these will be annexes E and F. Annexes that come after will then have their values increased, and so the current Annex E (Conformance with UAX #31) will become..."
[4]
"Calls to formalize this data into an annex within the C++ Standard itself was made in [P2234R0]"
[5]
"Most other uses of such a pointer have implemention-defined behavior."
[6]
"X* p = (X*)std::malloc(sizeof(struct X)); p->a = 1; // undefined behavior, no set of objects give us defined behavior return p; } — end example] [Example: #include struct X { int..."
[7]
"module; export moodule M; export int h(); // #1, attached to M"
[8]
"1 Specified in: [expr.basic.lvalue.strict.aliasing.violation] If a program attempts to access([defns.access]) the stored value of an object whose dynamic type is T through a glvalue whose type..."
[9]
"where T and the array element type are not similar([conv.rval]), the behavior is undefined."
[10]
"No diagnostic is requried if a function is declared in one translation unit with the noreturn attribute"
[11]
"// Ill-formed no diagnoatic required"
[12]
"4 [Example: int main() { __uint128_t x2 = -1; float f = x2; // undefined behavior on systems where the range of // representable values of float is [-max,+max] on system where // represetable..."
[13]
"Otherwise, the behavior is undefined([expr.static.cast.does.not.contain.orignal.member]). "
[14]
"Translation unit #1 [[noreturn]] void f() {} Translation unit #2 void f(int i); // ill-formed no diagnostic required, declared without noreturn"
[15]
"2 [Example: #include #include #include #include class resumable { public: struct promise_type; using coro_handle =..."
[16]
"[Example: — end example] JMB: produce an example"
[17]
"[Example: — end example] JMB/TD: This is really a general precondition imposed on the Standard Library, not a piece of core language undefined behavior. It is also currently missing an example."
Summary: P3596R0 proposes two new informative annexes for the C++ standard: one cataloguing every instance of undefined behavior with cross-references and examples, and one doing the same for ill-formed, no diagnostic required (IFNDR) cases. The paper includes proposed normative wording changes to tag each UB and IFNDR site with a stable name, plus draft annex content with explanatory examples.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.