diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 6bd4c1261a7610b875c1643e232435b1cc1aeab0..f2b12fd63db7f5eca1f9e86a03206de848912eb7 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 2d27376d98827c24acaf557cf392d078ab8c0c42..7f646704d3f455c6e7371661bc6523b652fb0487 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; }