public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7575] c++: Clarify note about -fmodules-ts [PR 99472]
@ 2021-03-09 13:11 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2021-03-09 13:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4b3d86a7768a7562798f17f074f540fbc288ec3b

commit r11-7575-g4b3d86a7768a7562798f17f074f540fbc288ec3b
Author: Nathan Sidwell <nathan@acm.org>
Date:   Tue Mar 9 05:08:09 2021 -0800

    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.

Diff:
---
 gcc/cp/parser.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f636bb746d4..0a7d18af98b 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-09 13:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 13:11 [gcc r11-7575] c++: Clarify note about -fmodules-ts [PR 99472] Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).