diff options
author | Nathan Sidwell <nathan@acm.org> | 2021-03-09 05:08:09 -0800 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2021-03-09 05:11:47 -0800 |
commit | 4b3d86a7768a7562798f17f074f540fbc288ec3b (patch) | |
tree | fca2bc0667cbe6190324bb19ca5f614157e7b40f /gcc | |
parent | 08ce558985828b0f5bbcceed64a29a7f7bb21384 (diff) | |
download | gcc-4b3d86a7768a7562798f17f074f540fbc288ec3b.zip gcc-4b3d86a7768a7562798f17f074f540fbc288ec3b.tar.gz gcc-4b3d86a7768a7562798f17f074f540fbc288ec3b.tar.bz2 |
c++: Clarify note about -fmodules-ts [PR 99472]
This clarifies that c++2[03] intentionally does not enable
c++20 modules.
PR c++/99472
gcc/cp/
* parser.c (cp_parser_diagnose_invalid_type_name): Clarify
that C++20 does not yet imply modules.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/parser.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f636bb7..0a7d18a 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -3469,11 +3469,15 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id, else if (TREE_CODE (id) == IDENTIFIER_NODE && (id_equal (id, "module") || id_equal (id, "import"))) { - if (!modules_p ()) - inform (location, "%qE only available with %<-fmodules-ts%>", id); - else - inform (location, "%qE was not recognized as a module control-line", + if (modules_p ()) + inform (location, "%qE is not recognized as a module control-line", + id); + else if (cxx_dialect < cxx20) + inform (location, "C++20 %qE only available with %<-fmodules-ts%>", id); + else + inform (location, "C++20 %qE only available with %<-fmodules-ts%>" + ", which is not yet enabled with %<-std=c++20%>", id); } else if (cxx_dialect < cxx11 && TREE_CODE (id) == IDENTIFIER_NODE |