From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8C7C3858D20; Tue, 3 Oct 2023 16:18:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8C7C3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696349899; bh=f8jBlmGJm/4xSRulrjIPFo4Ebnqerw8zoD7mXdqlvdw=; h=From:To:Subject:Date:From; b=e+iqD8Fk3zx2pAscGEuyOF24PqRcKG/xIbZm4rhG6EFBWDOxkXPN5v0E/RjIWRvLz tLCB1uptgVeMhpOPUcXFuh0mf1Gx5KhFsUreaJKOXTs7pCDYAOzxpyjNybHsTC9ng8 Ht13Q05337mHO2mD/DKKcRfXtqs/dxhajUfQc7SQ= From: "sjames at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111681] New: Missing fixit for exception name in catch Date: Tue, 03 Oct 2023 16:18:19 +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: sjames at gcc dot gnu.org 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 cc target_milestone 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=3D111681 Bug ID: 111681 Summary: Missing fixit for exception name in catch Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org CC: dmalcolm at gcc dot gnu.org Target Milestone: --- Noticed with a Blender issue w/ GCC 13 (missing transitive include for , https://bugs.gentoo.org/914740). If I just take the example at https://en.cppreference.com/w/cpp/error/system_error and mangle it, I get: ``` #include int main() { try { std::thread().detach(); // attempt to detach a non-thread } catch(const std::system_error& e) { std::cout << "Caught system_error with code " "[" << e.code() << "] meaning " "[" << e.what() << "]\n"; } } ``` with: ``` $ g++-14 /tmp/foo.cxx -o /tmp/foo /tmp/foo.cxx: In function =E2=80=98int main()=E2=80=99: /tmp/foo.cxx:9:34: error: expected unqualified-id before =E2=80=98&=E2=80= =99 token 9 | catch(const std::system_error& e) | ^ /tmp/foo.cxx:9:34: error: expected =E2=80=98)=E2=80=99 before =E2=80=98&=E2= =80=99 token 9 | catch(const std::system_error& e) | ~ ^ | ) /tmp/foo.cxx:9:34: error: expected =E2=80=98{=E2=80=99 before =E2=80=98&=E2= =80=99 token /tmp/foo.cxx:9:36: error: =E2=80=98e=E2=80=99 was not declared in this scope 9 | catch(const std::system_error& e) | ^ ``` The error message here could be better, but even better would be a fixit sa= ying to include .=