From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 008E23858D38; Tue, 8 Nov 2022 22:37:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 008E23858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667947031; bh=FaxLTAqUZOz0pyvE8tTj8Kkt8a1CFvVLDsdcI/pWVuU=; h=From:To:Subject:Date:From; b=i/+BoB3pfTLs0OxnlOKTbYK70/7lGnWQIlcnLBX0eXOLY2QFHkJQ82vNUD73iGm+J nxzMRo/7/fPxJrlYgnBunwTpxXqMUHeGnzrITczLic8mLkGbLd7E82yxXg3fVZh+9H stiOXpF0/r5RknJuhoNp3DDhvdt8/KE9E0NwwE8A= From: "sam at gentoo dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107583] New: Missing fixit for struct members (e.g. time_t, missing include) Date: Tue, 08 Nov 2022 22:37:10 +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: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sam at gentoo dot 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 target_milestone attachments.created 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=3D107583 Bug ID: 107583 Summary: Missing fixit for struct members (e.g. time_t, missing include) Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: sam at gentoo dot org Target Milestone: --- Created attachment 53855 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53855&action=3Dedit a-foo.i ``` $ cat /tmp/foo.c struct foo { time_t mytime; /* missing include should trigger fixit */ } $ gcc /tmp/foo.c foo.c:2:9: error: unknown type name 'time_t' 2 | time_t mytime; /* missing include should trigger f= ixit */ | ^~~~~~ foo.c:3:1: error: expected identifier or '(' at end of input 3 | } | ^ ``` ``` # gcc --version gcc (Gentoo 12.2.1_p20221008 p1) 12.2.1 20221008 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` Expected output is a "fixit" like: ``` test.c:3:13: error: unknown type name 'time_t' 3 | void myfunc(time_t test) { | ^~~~~~ test.c:2:1: note: 'time_t' is defined in header ''; did you forget = to '#include '? 1 | #include +++ |+#include 2 | ```=