https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106248
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > This is interesting because I get the same behavior in clang with LLVM's > libc++. Are you sure? I do not see any dependency on optimization level when using libc++. > Also with -std=c++20 I get the value 0 for all optimization levels. I *do* see a change in behaviour for C++17 vs C++20 when using libc++, which is expected for the reasons already given.