https://gcc.gnu.org/g:91417c778ae42af342c1f6e924be39616421a860

commit r14-10728-g91417c778ae42af342c1f6e924be39616421a860
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.
    
    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 38f320329829..d4aadc7666b8 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1093,10 +1093,10 @@ c_cpp_builtins (cpp_reader *pfile)
        }
       if (flag_concepts)
         {
-         if (cxx_dialect >= cxx20 || !flag_concepts_ts)
-           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)
        {

Reply via email to