https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116491
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Or rather see https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html#prop_tgt:CXX_EXTENSIONS . That is -std=c++17 vs -std=gnu++17. GCC defaults to gnu++17 in newer versions of GCC. So the bug is not in cmake but your misunderstanding on the defaults and what is documented (even in cmake documentation :) ).