From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E11533856967; Mon, 30 Oct 2023 13:51:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E11533856967 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698673889; bh=Lqrq37x80eq31bWruSpJYBqGHItlhwL1KjlaoHDgvEc=; h=From:To:Subject:Date:From; b=jE267l49L3zt/0BIyvbpeZMoaRZWBQjApI/8TqZgMCRW54Sah8IUBBcArd/8Q5SuC ROemDnDoSSe1zY8DgWgZ+B5z9E6vFkeoLJD802ooEVASJBu+5ppCWQWhoYMwObL/v0 zOFJlbXo2FZNcsGygciW+UQ0+P+rvGWC4LDRA3GQ= From: "arkamar at atlas dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112293] New: Enhance error reporting with fix-it for missing in gcc 14 Date: Mon, 30 Oct 2023 13:51:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arkamar at atlas dot cz X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcchost cf_gccbuild Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112293 Bug ID: 112293 Summary: Enhance error reporting with fix-it for missing 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 e= rror message [1]. However, the same package compiles successfully with gcc-13. The issue appears to arise from internal changes in libstdc++ that now requ= ire the explicit inclusion of the 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 needs to be explicitly included for clarity? Here is the minimized snippet to reproduce the issue: #include #include struct test; std::vector v; auto f(test *t) { auto it =3D 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::iterator_ to _con= st char*_ 6 | auto it =3D std::remove(begin(v), end(v), t); | ~~~~~^~~ | | | std::vector::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:415= 8, 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=