]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: don't advertise C++20 concepts in C++14
authorJason Merrill <jason@redhat.com>
Tue, 1 Oct 2024 14:58:35 +0000 (10:58 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 1 Oct 2024 21:40:49 +0000 (17:40 -0400)
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.

gcc/c-family/c-cppbuiltin.cc

index 73a07055a86ea3f28663c306d88fa296b3f7461c..b37a4c0979229ec8135cb45dbfe62b2e746560c8 100644 (file)
@@ -1102,7 +1102,7 @@ c_cpp_builtins (cpp_reader *pfile)
          cpp_define (pfile, "__cpp_deleted_function=202403L");
          cpp_define (pfile, "__cpp_variadic_friend=202403L");
        }
-      if (flag_concepts)
+      if (flag_concepts && cxx_dialect > cxx14)
        cpp_define (pfile, "__cpp_concepts=202002L");
       if (flag_contracts)
        {