Here, when we try to bring "memset" back into the global namespace, we find
the built-in, see that it's the same declaration (because the module brought
it into the other namespace with a using-declaration), and decide that we
don't need to do anything. But we still need a non-hidden overload.
gcc/cp/ChangeLog:
* name-lookup.cc (do_nonmember_using_decl): Handle hidden better.
gcc/testsuite/ChangeLog:
* g++.dg/modules/using-33_a.C: New test.
* g++.dg/modules/using-33_b.C: New test.
namespace. We will still want to insert it if
it is revealing a not-revealed thing. */
found = true;
- if (!revealing_p)
+ if (old.hidden_p ())
+ /* The function was merged with a hidden built-in;
+ insert it again as not hidden. */
+ found = false;
+ else if (!revealing_p)
;
else if (old.using_p ())
{
--- /dev/null
+// { dg-additional-options "-fmodules" }
+module;
+
+#include <string.h>
+
+export module M;
+
+namespace N {
+ export using ::memset;
+}
--- /dev/null
+// { dg-additional-options "-fmodules" }
+import M;
+
+using N::memset;
+
+int main()
+{
+ int i = 1;
+ memset (&i, 42, 1);
+}