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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Halalaluyafail3 from comment #0)
> This note doesn't seem to be very helpful, it mentions adding an extra
> '#include<memory>' when one is already present. A better error message here
> would be to omit the note, or to make it mention changing the selected C++
> standard version.

If you'd tried gcc trunk on godbolt you'd have seen that's exactly what
happens:

<source>:3:10: note: 'std::to_address' is only available from C++20 onwards

There was just a typo which made gcc think std::to_address is part of <memory>
in C++11, so if it wasn't declared in your program then it must be because you
didn't include <memory>.

After the fix it correctly suggests using at least C++20.

Reply via email to