public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "arkamar at atlas dot cz" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112293] New: Enhance error reporting with fix-it for missing <algorithm> in gcc 14 Date: Mon, 30 Oct 2023 13:51:29 +0000 [thread overview] Message-ID: <bug-112293-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112293 Bug ID: 112293 Summary: Enhance error reporting with fix-it for missing <algorithm> in gcc 14 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: arkamar at atlas dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Build: x86_64-pc-linux-gnu We encountered an issue while attempting to build the rspamd package using gcc-14 on Gentoo Linux. The build process fails with a somewhat ambiguous error message [1]. However, the same package compiles successfully with gcc-13. The issue appears to arise from internal changes in libstdc++ that now require the explicit inclusion of the <algorithm> header (this part is likely a bug within rspamd). Is it possible to enhance the error messaging, perhaps with a fix-it hint, to suggest that <algorithm> needs to be explicitly included for clarity? Here is the minimized snippet to reproduce the issue: #include <functional> #include <stdexcept> struct test; std::vector<test *> v; auto f(test *t) { auto it = std::remove(begin(v), end(v), t); } which currently fails with the following error message: test.cxx: In function _auto f(test*)_: test.cxx:6:30: error: cannot convert _std::vector<test*>::iterator_ to _const char*_ 6 | auto it = std::remove(begin(v), end(v), t); | ~~~~~^~~ | | | std::vector<test*>::iterator In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/cstdio:42, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/ext/string_conversions.h:45, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/basic_string.h:4158, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/string:54, from /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/stdexcept:39, from test.cxx:2: /usr/include/stdio.h:157:32: note: initializing argument 1 of _int remove(const char*)_ 157 | extern int remove (const char *__filename) __THROW; | I tested this with: gcc version 14.0.0 20231022 (experimental) (Gentoo 14.0.0_pre20231022-r1 p7) [1] https://bugs.gentoo.org/916438
next reply other threads:[~2023-10-30 13:51 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-30 13:51 arkamar at atlas dot cz [this message] 2023-10-30 14:09 ` [Bug c++/112293] " redi at gcc dot gnu.org 2023-10-30 14:11 ` redi at gcc dot gnu.org 2023-10-30 14:26 ` redi at gcc dot gnu.org 2023-10-30 14:30 ` redi at gcc dot gnu.org 2023-10-30 14:33 ` arkamar at atlas dot cz 2023-10-30 14:42 ` redi at gcc dot gnu.org 2023-10-30 23:55 ` sjames at gcc dot gnu.org 2024-01-21 20:50 ` redi at gcc dot gnu.org 2024-01-21 21:33 ` fw at gcc dot gnu.org
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-112293-4@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: linkBe 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).