https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109732
--- Comment #3 from Sergei Trofimovich <slyfox at gcc dot gnu.org> --- Both -O1 and -fno-strict-aliasing remove the bug: $ g++-14 unit-t.cpp -O2 -Ijson/include -o a -O1 && ./a SUCCESS! $ g++-14 unit-t.cpp -O2 -Ijson/include -o a -fno-strict-aliasing && ./a SUCCESS!