[c++]: Improve module-decl diagnostics [PR 98327]
authorNathan Sidwell <nathan@acm.org>
Tue, 5 Jan 2021 13:18:50 +0000 (05:18 -0800)
committerNathan Sidwell <nathan@acm.org>
Tue, 5 Jan 2021 13:28:23 +0000 (05:28 -0800)
commit6ffaffd5d10e1d7daee5e1b889bfc8de06ef1a4b
tree13bd272371a182698068a8d7d8822fe0c5c2dc05
parentaf60b0ec79e9c5d7116122b185e44927aca5aa07
[c++]: Improve module-decl diagnostics [PR 98327]

The diagnostic for a misplaced module decl was essentially 'computer
says no', which isn't the most helpful.  This adjusts it to indicate
what would be acceptable.

gcc/cp/
* parser.c (cp_parser_module_declaration): Alter diagnostic
text to say where is permissable.
gcc/testsuite/
* g++.dg/modules/mod-decl-1.C: Adjust.
* g++.dg/modules/p0713-2.C: Adjust.
* g++.dg/modules/p0713-3.C: Adjust.
gcc/cp/parser.c
gcc/testsuite/g++.dg/modules/mod-decl-1.C
gcc/testsuite/g++.dg/modules/p0713-2.C
gcc/testsuite/g++.dg/modules/p0713-3.C