From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 829D9385782C; Thu, 7 Mar 2024 09:12:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 829D9385782C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709802724; bh=A3Es1oWN6VEsbUr4SZ/bYePeOHWgFiQ9NYo8BRF4iCo=; h=From:To:Subject:Date:From; b=Vudyyt2P0gbSCIS8XLIhsKG2WoKtCg57gwZWXlCxbteZ8lAtVPaahkyt0xQg8NKqd aTfsaKq4WN1gPwuofypZoV7b0CYpBS4qANF/Yj34PGqlsIauih2enjVStLzXayIyO+ tX3SPzB2yUF9h5bTmTr207rFUUVIzj/bAUZuX1jA= From: "denis.campredon at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114265] New: Unhelpful message when var name is also a struct name Date: Thu, 07 Mar 2024 09:12:04 +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: denis.campredon at gmail dot com 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 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=3D114265 Bug ID: 114265 Summary: Unhelpful message when var name is also a struct name Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: denis.campredon at gmail dot com Target Milestone: --- While working with legacy code, I encountered the following problem. The code: ------------ struct Struct; int fn(Struct *); Struct *Struct; int fn(Struct *) {=20 return 0; } ------------- produces the following error message: ------------- aaaaaa.c:7:8: error: 'int fn' redeclared as different kind of entity 7 | int fn(Struct *) | ^~~~~~ aaaaaa.c:3:5: note: previous declaration 'int fn(Struct*)' 3 | int fn(Struct *); | ^~ aaaaaa.c:7:16: error: expected primary-expression before ')' token 7 | int fn(Struct *) -------------- This message does not really explain what the real problem is. A message saying that `Struct` has been redefined as a variable would help more.=