This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH c++/57709] Wshadow is too strict / has false positives


On 21 August 2014 23:35, Jason Merrill <jason@redhat.com> wrote:
> On 08/21/2014 04:22 PM, Manuel LÃpez-IbÃÅez wrote:
>>
>> +                       && TREE_CODE (x) != FUNCTION_DECL
>> +                       && !FUNCTION_POINTER_TYPE_P (TREE_TYPE (x))))
>
>
> How about pointer to member function?

Maybe like this? BTW, I did not actually want to include the
gcc_assert(), it was just a sanity check, thus I deleted it from this
patch.

Bootstrapping and regression testing in progress. But the testcase
works as expected.

OK if it passes?


gcc/cp/ChangeLog:

2014-08-21  Manuel LÃpez-IbÃÃez  <manu@gcc.gnu.org>

    PR c++/57709
    * name-lookup.c (pushdecl_maybe_friend_1): Do not warn if a
    declaration shadows a function declaration, unless the former
    declares a function, pointer to function or pointer to member
    function, because this is a common and valid case in real-world
    code.


gcc/testsuite/ChangeLog:

2014-08-21  Manuel LÃpez-IbÃÃez  <manu@gcc.gnu.org>

    PR c++/57709
    * g++.dg/Wshadow.C: New test.

Attachment: pr57709.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]