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

--- Comment #5 from Halalaluyafail3 <luigighiron at gmail dot com> ---
(In reply to Jonathan Wakely from comment #4)
> (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.

My bad, I only tested this on GCC 14.1 and assumed that GCC 14.1 was recent
enough that it wouldn't have been changed.

Reply via email to