From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C31FF3858C41; Tue, 31 Oct 2023 10:48:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C31FF3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698749301; bh=fBPyPpHvBe+HqDkeOmjmm6fdsJEg2lX9M9i9qIDVcLA=; h=From:To:Subject:Date:From; b=rOkGRBbq6Ogtuw+8EC9HLfk7E3guyYayhLH03jKS872MJkafjHJeK87ilM17q+t1c gWYguhkGEqMoohcrfjEeiZULdmLxxzXZz/GSXoDxd7RpELVL4EsRmYtWBjPCo1jHy8 0F2QZg2ZQx0lpniiTFxmk1LxLsA1fSzJ92KsFQjc= From: "j.wuttke@fz-juelich.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112309] New: enhancement: extra flags to let -Wshadow skip if..else and lambda blocks Date: Tue, 31 Oct 2023 10:48:21 +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: j.wuttke@fz-juelich.de 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=3D112309 Bug ID: 112309 Summary: enhancement: extra flags to let -Wshadow skip if..else and lambda blocks Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: j.wuttke@fz-juelich.de Target Milestone: --- Suggestion: add a flag -Wnoshadow-ifelse to prevent -Wshadow from reporting shadowing in "else if" constructs like if (auto* p =3D dynamic_cast(x)) ... else if (auto* p =3D dynamic_cast(x)) ... else if (auto* p =3D dynamic_cast(x)) ... A similar approach (-Wnoshadow-lambda) could help to resolve https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D79328.=