# C++26: Trivial infinite loops are no longer undefined behaviour -- Sandor Dargo

Source: [Standard C++](https://isocpp.org//blog/2026/11/cpp26-trivial-infinite-loops-are-no-longer-undefined-behaviour-sandor-dargo) · 2026-11-30 · Languages
Page: https://themorning.dev/story/c-26-trivial-infinite-loops-are-no-longer-undefined-behaviour-sandor-dargo-f08129375998ce52
Kind: release · Impact: medium

## In brief

- C++26 no longer treats trivial infinite loops such as while (true); as undefined behaviour, per P2809R3.
- Previously, compilers could optimize such loops away entirely.
- The article also covers the history of C++'s forward-progress rules.

## Why it matters

Once C++26 is in effect, a trivial infinite loop is no longer undefined behaviour, so compilers should not optimize it away, which affects code that relies on such loops.

## Versions

- C++26

## Coverage

- [C++26: Trivial infinite loops are no longer undefined behaviour -- Sandor Dargo](https://isocpp.org//blog/2026/11/cpp26-trivial-infinite-loops-are-no-longer-undefined-behaviour-sandor-dargo) — Standard C++, 2026-11-30

Tags: c++, c++26, undefined-behavior, compilers, standards

---

Brief generated by AI (claude-haiku-5-5) from the reporting listed under Coverage. Headlines belong to their publishers. The Morning Dev – https://themorning.dev
