Concepts in C++20 are happening and the overlap with the concepts TS is very significant which opens the possibility to write code in a dialect that is accepted by both `-std=c++17 -fconcepts` and `-std=c++2a`. This is a huge bonus for GCC over other implementations, because many long-term supported operating systems ship GCC7 and won't pick up new compilers with full c++20 support for a long time. The only thing that prevents using the common subset is that concepts are introduced by "concept bool" in the TS, but only by "concept" in the draft standard. Instead of burdening the c++20 implementation with being compatible to the TS, it would be really great if you could change the implementation of the TS on GCC7 and GCC8 to also accept just "concept". Note that I do not suggest backporting any features or other changes, this is just about a small syntactical change that would allow cleanly writing code that targets older and newer GCC versions at the same time. I assume this would be greatly appreciated by quite a few libraries that currently employ different concept-compatibility layers like range-v3, nanorange, cmstl2 and others. I also expect more people will be interested in targeting the common concepts dialect as Clang is picking up Concepts soon (the c++2a-feature branch works quite well already).
I see that this has changed for snapshots of GCC9 now, thanks a lot! Is this something you can backport to to GCC7 and GCC8 that would really help downstream projects to reduce needless use of MACROs! Thanks!
This was changed by Jason in r269692 so let's ask him. Don't require 'bool' in a concept definition. * parser.c (cp_parser_decl_specifier_seq): Support C++20 concept-definition syntax without 'bool'.
Any news on this? (I don't know if GCC7 is scheduled to have a patch release at all anymore, but if yes, it would still be great to have this...)
GCC 7 doesn't support the -std=c++2a option, so it doesn't seem necessary to backport it to GCC 7.
Author: jason Date: Tue Nov 5 11:46:54 2019 New Revision: 277825 URL: https://gcc.gnu.org/viewcvs?rev=277825&root=gcc&view=rev Log: PR c++/88075 - Don't require 'bool' in a concept definition. * parser.c (cp_parser_decl_specifier_seq): Support C++20 concept-definition syntax without 'bool'. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/concepts/no-bool1.C Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/parser.c
(In reply to Jason Merrill from comment #5) > Author: jason > Date: Tue Nov 5 11:46:54 2019 > New Revision: 277825 > > URL: https://gcc.gnu.org/viewcvs?rev=277825&root=gcc&view=rev > Log: > PR c++/88075 - Don't require 'bool' in a concept definition. > > * parser.c (cp_parser_decl_specifier_seq): Support C++20 > concept-definition syntax without 'bool'. > > Added: > branches/gcc-8-branch/gcc/testsuite/g++.dg/concepts/no-bool1.C > Modified: > branches/gcc-8-branch/gcc/cp/ChangeLog > branches/gcc-8-branch/gcc/cp/parser.c Thanks a lot for this change! Does this work with -fconcepts and if yes can we also get it for GCC7? Thanks a lot!
(In reply to Hannes Hauswedell from comment #6) > (In reply to Jason Merrill from comment #5) > > Author: jason > > Date: Tue Nov 5 11:46:54 2019 > > New Revision: 277825 > > > > URL: https://gcc.gnu.org/viewcvs?rev=277825&root=gcc&view=rev > > Log: > > PR c++/88075 - Don't require 'bool' in a concept definition. > > > > * parser.c (cp_parser_decl_specifier_seq): Support C++20 > > concept-definition syntax without 'bool'. > > > > Added: > > branches/gcc-8-branch/gcc/testsuite/g++.dg/concepts/no-bool1.C > > Modified: > > branches/gcc-8-branch/gcc/cp/ChangeLog > > branches/gcc-8-branch/gcc/cp/parser.c > > > Thanks a lot for this change! > > Does this work with -fconcepts and if yes can we also get it for GCC7? > Thanks a lot! Well, the branch for GCC7 just closed, so, looks like not...
Done for 8.4 and 9.1