https://gcc.gnu.org/g:6ae9ef1b6bd77dca063b70a54fae46a397f6230a
commit r13-9070-g6ae9ef1b6bd77dca063b70a54fae46a397f6230a Author: Jason Merrill <ja...@redhat.com> Date: Tue Oct 1 10:58:35 2024 -0400 c++: don't advertise C++20 concepts in C++14 There have been various problems with -std=c++14 -fconcepts; let's stop defining the feature test macro in that case. And don't advertise Concepts TS support when it isn't enabled. gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Don't define __cpp_concepts before C++17. Diff: --- gcc/c-family/c-cppbuiltin.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 5d64625fcd7a..6983e9cebb60 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -1083,10 +1083,10 @@ c_cpp_builtins (cpp_reader *pfile) } if (flag_concepts) { - if (cxx_dialect >= cxx20) - cpp_define (pfile, "__cpp_concepts=202002L"); - else + if (flag_concepts_ts && cxx_dialect < cxx20) cpp_define (pfile, "__cpp_concepts=201507L"); + else if (cxx_dialect > cxx14) + cpp_define (pfile, "__cpp_concepts=202002L"); } if (flag_contracts) {