[Bug c++/101140] [modules] no matching function for call to ‘operator new(sizetype, void*)’

nshead at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Oct 4 04:40:07 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101140

--- Comment #6 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
The testcase in comment #0 still fails after the fixes for ADL in PR117658,
because the 'operator new' declaration in new.hpp has been discarded.  This can
be worked around by adding a 'using ::operator new' in 'foo' to ensure that
it's referenced from within the module purview, by making 'new.hpp' a header
unit, or (for this specific case) using 'import std' to provide the
non-allocating placement function.

>From https://eel.is/c++draft/module.global.frag#3.3 however I think that we
shouldn't have discarded this call; I'm not sure how to approach implementing
this however.


More information about the Gcc-bugs mailing list