[Bug c++/57709] -Wshadow is too strict / has false positives
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 25 16:51:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #4)
> "The option -Wshadow no longer warns if a declaration shadows a function
> declaration, unless the former declares a function or pointer to function,
> because this is a common and valid case in real-world code."
>
> I think this is a useful heuristic also for member functions, no? I don't
> have time to work on this at the moment, but it would be useful to know
> whether the maintainers agree, so someone (Jan?) may start working on a
> patch.
That would be fine. But it seems less important for member functions, since
there's much less chance of a local variable name conflicting with some random
function declared by an #include file.
More information about the Gcc-bugs
mailing list