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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:71e6353e1b03021bc8bbcf4bd67a5f14d09b5fb1

commit r12-7113-g71e6353e1b03021bc8bbcf4bd67a5f14d09b5fb1
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Feb 8 20:17:55 2022 +0100

    c++: Don't emit repeated -Wshadow warnings for templates/ctors [PR104379]

    The following patch suppresses extraneous -Wshadow warnings.
    On the testcase without the patch we emit 14 -Wshadow warnings,
    with the patch just 4.  It is enough to warn once e.g. during parsing of
the
    template or the abstract ctor, while previously we'd warn also on the
clones
    of the ctors and on instantiation.
    In GCC 8 and earlier we didn't warn because check_local_shadow did
      /* Inline decls shadow nothing.  */
      if (DECL_FROM_INLINE (decl))
        return;

    2022-02-08  Jakub Jelinek  <ja...@redhat.com>

            PR c++/104379
            * name-lookup.cc (check_local_shadow): When diagnosing shadowing
            of a member or global declaration, add warning suppression for
            the decl and don't warn again on it.

            * g++.dg/warn/Wshadow-18.C: New test.

Reply via email to