public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112309] New: enhancement: extra flags to let -Wshadow skip if..else and lambda blocks
@ 2023-10-31 10:48 j.wuttke@fz-juelich.de
  0 siblings, 0 replies; only message in thread
From: j.wuttke@fz-juelich.de @ 2023-10-31 10:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112309

            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 = dynamic_cast<A>(x))
   ...
else if (auto* p = dynamic_cast<B>(x))
   ...
else if (auto* p = dynamic_cast<C>(x))
   ...


A similar approach (-Wnoshadow-lambda) could help to resolve
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79328.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-31 10:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31 10:48 [Bug c++/112309] New: enhancement: extra flags to let -Wshadow skip if..else and lambda blocks j.wuttke@fz-juelich.de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).