C++26 standard makes empty infinite loops well-defined behavior
The upcoming C++26 standard, via proposal P2809R3, changes the language so that trivial infinite loops like 'while(true);' are no longer undefined behavior. Previously, compilers such as Clang could legally assume such loops terminate and optimize them away entirely, sometimes causing code after the loop to execute unexpectedly. Because the fix was also accepted as a defect report, compiler vendors may backport it to earlier C++ standard modes too.