diff mbox series

c++: Clarify note about -fmodules-ts [PR 99472]

Message ID b80508d7-e0ac-5594-0d15-73d4e424ad8f@acm.org
State New
Headers show
Series c++: Clarify note about -fmodules-ts [PR 99472] | expand

Commit Message

Nathan Sidwell March 9, 2021, 1:10 p.m. UTC
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 mbox series

Patch

diff --git c/gcc/cp/parser.c w/gcc/cp/parser.c
index 378e4572f8b..06bb094a299 100644
--- c/gcc/cp/parser.c
+++ w/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