public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "luigighiron at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/115196] Bad error message when using library functions from versions before they were introduced
Date: Wed, 22 May 2024 20:28:15 +0000 [thread overview]
Message-ID: <bug-115196-4-FP7i7DPduX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115196-4@http.gcc.gnu.org/bugzilla/>
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.
prev parent reply other threads:[~2024-05-22 20:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 19:56 [Bug c++/115196] New: " luigighiron at gmail dot com
2024-05-22 20:00 ` [Bug c++/115196] " pinskia at gcc dot gnu.org
2024-05-22 20:01 ` sjames at gcc dot gnu.org
2024-05-22 20:01 ` redi at gcc dot gnu.org
2024-05-22 20:13 ` redi at gcc dot gnu.org
2024-05-22 20:28 ` luigighiron at gmail dot com [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-115196-4-FP7i7DPduX@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).