On 5/15/26 3:03 AM, Jakub Jelinek wrote:
Hi!
The following patch attempts to clarify the diagnostics, so that one e.g.
doesn't look for import std::whatever; in the headers or something similar.
Tested on x86_64-linux and i686-linux, ok for trunk?
OK.
2026-05-15 Jakub Jelinek <[email protected]>
PR libstdc++/125200
* g++.dg/plugin/std_module_exports_plugin.cc (plugin_dump_decl): Use
%< and %>. Clarify the error message and add a note.
--- gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc.jj 2026-04-29
07:54:50.593757510 +0200
+++ gcc/testsuite/g++.dg/plugin/std_module_exports_plugin.cc 2026-05-14
11:13:56.495169735 +0200
@@ -106,13 +106,19 @@ plugin_dump_decl (tree decl, char *scope
if (((int) whitelist[i].enabled_in & (int) this_std) != 0)
{
inform (DECL_SOURCE_LOCATION (decl),
- "missing using %s%D; whitelisted", scope, name);
+ "missing %<using %s%D;%> whitelisted", scope, name);
return;
}
break;
}
- error_at (DECL_SOURCE_LOCATION (decl), "missing using %s%D;", scope, name);
+ auto_diagnostic_group d;
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "missing %<using %s%D;%> in libstdc++-v3/src/c++23/std*.cc.in",
+ scope, name);
+ inform (DECL_SOURCE_LOCATION (decl),
+ "%<%s%D%> found in std namespace but not exported from std module",
+ scope, name);
}
void
Jakub