Trip report: June 2026 ISO C++ standards meeting (Brno, Czechia)
tl;dr… A few highlights
- Adopted this week in draft C++29: Complete catalog of all undefined behavior (UB) in C++. Contract pre/post support for virtual functions. Defaulting (=default) for postfix increment/decrement. Designated initializers for base classes. Python-style .lookup(key) for associative containers. And more...
- Other significant progress: Progress on various features targeting C++29, including systematically addressing UB and adding safety profiles for C++.
- Next six months: Telecon line-by-line review of a proposal to systematically address all undefined behavior in C++. Progress adding C++ memory safety subsetting profiles. Both aim for inclusion in C++29.
Overview
A few minutes ago, the ISO C++ committee completed the first meeting of C++29 in beautiful Brno, Czechia (hybrid online via Zoom).
This meeting was hosted by Mendel University in Brno. Thank you to everyone involved, including especially Hana Dusíková who took the lead in making the arrangements! Our hosts arranged for high-quality facilities for our six-day meeting from Monday through Saturday.
We had about 200 attendees, split about 55%/45% on-site/on-line, formally representing 28 nations. At each meeting we regularly have new guest attendees who have never attended before, and this time there were 25 new guest attendees, mostly on-site, in addition to new attendees who are official national body representatives. To all of them, once again welcome!
The committee currently has 22 active subgroups, 11 of which met in 6 parallel tracks throughout the week. Some groups ran all week, and others ran for a few days or a part of a day, depending on their workloads. You can find a brief summary of ISO procedures here.
Adopted for C++29: Core language changes/features
These links are to the most recent public version of each paper. If a paper was tweaked at the meeting before being approved, the link tracks and will automatically find the updated version as soon as it’s uploaded to the public site.
Several of the adopted language and library additions are already supported today in major C++ implementations. "Adopted for C++29" doesn’t mean "have to wait until 2029 or later to start seeing some support in real compilers / standard libraries."
In addition to fixing a list of issues, the core language adopted 19 papers, including the following...
P3596R3 "Undefined Behavior and IFNDR Annexes" by Joshua Berne, Timur Doumler, Jens Maurer, and Shafik Yaghmour. This paper adds to the C++ standard two Annexes that thoroughly catalog and document each case of undefined behavior (UB) in C++, including cases marked as "ill-formed, no diagnostic required" or "IF-NDR." This catalog is intended to aid in mitigating or eliminating cases of UB including by profiles.
This was, pardon my French, a “[metric] ton” of work over the course of several years. Thanks Shafik, Joshua, Timur, Jens, and everyone who helped them compile this detailed catalog so that now we can next systematically do something about these UB cases!
The next step is a case-by-case review starting next month with the aim to systematically address them for C++29, possibly as soon as within the next year (more on this below).
Here in C++, we face reality without fear or favor. In case it needs saying again: “Yes, Virginia, there is a vibrant living modern programming language named C++.” (Except, unlike the original, this version is the truth for adults.)
P3097R3 "Contracts for C++: Virtual functions" by Timur Doumler, Joshua Berne, and Gašper Ažman. Quoting from the paper:
"The assertions of an overriding function are independent of those in the overridden function. In a virtual function call, the precondition and postcondition assertions of both the statically chosen function and the final overrider are evaluated. This approach evolves earlier proposals by supporting a broader range of use cases found in existing code, integrating more naturally with C++26 contract-evaluation semantics and contract-violation handling, and providing a better fit for the C++ language than the more restrictive models in languages like Eiffel and D."
Adding this feature addresses one of the major complaints about contracts in C++26, which was that the initial version of contracts did not include virtual function support. Now, less than three months after C++26 was technically finalized, draft standard C++(29) contracts do support virtual functions. This demonstrates that the committee is serious about building out C++26 contracts in C++29. Thanks, Timur and Joshua and Gašper!
P3668R4 "Defaulting Postfix Increment and Decrement Operations" by Matthew Taylor and Alex. This paper adds =default support for postfix increment and decrement operators to opt into the canonical definition that defers to the prefix versions, without us having to write the boilerplate by hand (and possibly getting it wrong). Thanks, Matthew and Alex! For example, this example from the paper is now legal in draft C++29:
class foo{
int member;
public:
constexpr foo& operator++(){
++member;
return *this;
}
constexpr foo operator++(int) = default;
};
P2287R6 "Designated-initializers for Base Classes" by Barry Revzin. This does just what it says on the tin. Thanks, Barry! An example from the paper:
struct A { int a; };
struct B : A { int b; };
B{{1}, 2} // already valid in C++17
B{1, 2} // already valid in C++17B{.a=1, .b=2} // now legal in C++29
B{{.a=1}, .b=2} // now legal in C++29
B{.a{1}, .b{2}} // now legal in C++29B{.b=2, .a=1} // still ill-formed
We also added a bunch more language extensions and improvements.
Adopted for C++29: Standard library changes/features
In addition to fixing a list of issues, the standard library adopted 18 papers, including the following...
P3091 "Better Lookups for map , unordered_map , and flat_map" by Pablo Halpern. This adds Python-style .lookup(key) support for map, unordered_map, and flat_map to C++29. This function, which returns an optional, enables things we can’t do today with operator[] which always inserts if the element isn’t present and find which only finds elements that are present. Thanks, Pablo! Here’s an example from the paper:
constexpr double inf = std::numeric_limits<double>::infinity();
double largest = -inf;
for (int i = 1; i <= 100; ++i) {
largest = std::max(largest, theMap.lookup(i).value_or(-inf));
}
P3125R6 "constexpr pointer tagging" by Hana Dusíková, aka The Queen of Constexpr. This paper’s pointer_tag_pair<Pointer,Tag> tagged pointer type provides portable support for storing information in the low bits of pointers. This is a lower-level library useful for many things including memory safety and security hardening. Thanks, Hana!
P3248 "Require [u]intptr_t" by Gonzalo Brito Gadeschi. Formally in C and C++, until now intptr_t and uintptr_t were "optional," so a C++ implementation could choose not to support them. Because they are useful for low-level code, and already widely supported, the C++ standard will now require them. Thanks, Gonzalo!
We also added a bunch more library extensions and improvements.
Other progress, especially on memory safety work
We also made other important progress on features not yet ready to merge into the draft standard this week.
The following is not a complete list of progress made, but I want to especially highlight progress on several efforts related to memory safety:
- Systematically addressing UB in C++ for C++29. The language evolution subgroup (EWG) also approved spending serious time this summer and fall on a line-by-line telecon review of P3100 "A framework for systematically addressing undefined behaviour in the C++ Standard" by Timur Doumler and Joshua Berne targeting inclusion in C++29. See the paper’s Abstract for a great summary.
- Profiles specification for C++29. The Safety & Security subgroup (SG23) decided to create a specification for Profiles, which enable static and other analysis rules that subset C++ to enforce that code does not use undesirable (e.g., memory-unsafe) operations and thereby harden C++ code in specific ways. That specification would be merged into C++29 if it arrives in time as expected, and otherwise could be published as a white paper concurrently with C++29.
- Initialization profile. SG23 also reviewed the current draft of P4222 "An initialization profile" by Bjarne Stroustrup and we expect to make further progress on it this year, including with implementation experience in at least one major compiler codebase.
As I covered in my previous trip reports, other profiles papers previously worked on include P3984 "A type-safety profile" by Bjarne Stroustrup, and P3589R2 "C++ Profiles: The Framework" by Gabriel Dos Reis, and several other complementary profiles proposal papers.
It’s an understatement to say that these would be enormously important and historic achievements:
- providing a way to systematically address C++ UB, and
- providing a way to guarantee a C++ program has specific properties, such as being free of memory-safety bugs.
We’re not there yet, but both are now clearly more than wishful thinking; they are serious work items the committee intends to make some significant progress toward in the immediate future. I’ll continue to cover these efforts in future trip reports as the work progresses.
A reminder for those who continue to express skepticism that addressing UB in C++ will ever be feasible: Remember that we’re already doing it. Don’t live in the past… “it’s not 2021 anymore” [BeCPP, YouTube].
- Constexpr C++ code, which now includes nearly all of the C++ language and standard library, is already guaranteed to be UB-free when executed at compile time.
- C++26 additionally eliminated two major sources of UB: using uninitialized stack variables is no longer UB, and the C++ hardened standard library added bounds safety for dozens of the most common bounds operations (already widely deployed to harden Apple and Google platforms; see my previous trip report for more about this).
Wrapping up
Thank you again to the about 200 experts who attended on-site and on-line at this week’s meeting, and the many more who participate in standardization through their national bodies!
But we’re not slowing down... we’ll continue to have subgroup Zoom meetings, and then our next full meeting will be in Búzios, near Rio de Janeiro, Brazil in November where we’ll continue adding features to C++29. I look forward to seeing many of you there.
Thank you to everyone reading this for your interest and support for C++ and its standardization.