https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116491
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Sergey Markelov from comment #3) > This is not a duplicate. The macro is defined conditionally, this is not a > correct behavior. Yes and that is by design. -std=gnu++17 enables some non-standard macros which are considered legacy macros while -std=c++17 does not enable those. This is all documented too. as mentioned in both PRs there too. The bug is cmake does not have a way to specify that you want to use C++17 with GNU extensions; only that you want to use the C++17 language. That in itself is not a GCC issue but the way cmake is designed.