aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-06-23 13:54:07 -0400
committerJason Merrill <jason@redhat.com>2023-08-14 13:33:58 -0400
commitcc56607f21f77d4e9c8146cd1b0400fddea589c6 (patch)
treed92fbe8dd8c126f0468ed312e19027957f8e8a10 /gcc
parent2d2b05f0691799f03062bf5c436462f14cad3e7c (diff)
downloadgcc-cc56607f21f77d4e9c8146cd1b0400fddea589c6.zip
gcc-cc56607f21f77d4e9c8146cd1b0400fddea589c6.tar.gz
gcc-cc56607f21f77d4e9c8146cd1b0400fddea589c6.tar.bz2
c++: -fconcepts and __cpp_concepts
Since -fconcepts no longer implies -fconcepts-ts, we shouldn't advertise TS support with __cpp_concepts=201507L. Also fix one case where -std=c++14 -fconcepts wasn't working (as found by range-v3 calendar). Fixing other cases is not a priority, probably better to reject that flag combination if there are further issues. gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Adjust __cpp_concepts. gcc/cp/ChangeLog: * parser.cc (cp_parser_simple_type_specifier): Handle -std=c++14 -fconcepts.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/c-cppbuiltin.cc2
-rw-r--r--gcc/cp/parser.cc5
2 files changed, 4 insertions, 3 deletions
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 6bd4c12..f2b12fd 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1089,7 +1089,7 @@ c_cpp_builtins (cpp_reader *pfile)
}
if (flag_concepts)
{
- if (cxx_dialect >= cxx20)
+ if (cxx_dialect >= cxx20 || !flag_concepts_ts)
cpp_define (pfile, "__cpp_concepts=202002L");
else
cpp_define (pfile, "__cpp_concepts=201507L");
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 2d27376..7f64670 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -20017,12 +20017,13 @@ cp_parser_simple_type_specifier (cp_parser* parser,
/* Otherwise, look for a type-name. */
if (!type)
{
- if (cxx_dialect >= cxx17)
+ if (cxx_dialect >= cxx17 || flag_concepts)
cp_parser_parse_tentatively (parser);
type = cp_parser_type_name (parser, (qualified_p && typename_p));
- if (cxx_dialect >= cxx17 && !cp_parser_parse_definitely (parser))
+ if ((cxx_dialect >= cxx17 || flag_concepts)
+ && !cp_parser_parse_definitely (parser))
type = NULL_TREE;
}