c-decl.c (warn_if_shadowing): Don't warn if shadowed identifier is from system header.

* c-decl.c (warn_if_shadowing): Don't warn if shadowed
	identifier is from system header.

From-SVN: r181684
This commit is contained in:
Alan Modra 2011-11-24 13:15:21 +10:30 committed by Alan Modra
parent 58494d501e
commit 1d551e4dc3
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-11-24 Alan Modra <amodra@gmail.com>
* c-decl.c (warn_if_shadowing): Don't warn if shadowed
identifier is from system header.
2011-11-23 Jakub Jelinek <jakub@redhat.com>
PR target/51261
@ -104,7 +109,7 @@
PR c++/51264
* tree.c (iterative_hash_expr): Remove break after return.
2011-11-22 Iain Sandoe <iains@gcc.gnu.org>
* target.def (tm_clone_table_section): New hook.

View file

@ -2534,7 +2534,10 @@ warn_if_shadowing (tree new_decl)
/* Is anything being shadowed? Invisible decls do not count. */
for (b = I_SYMBOL_BINDING (DECL_NAME (new_decl)); b; b = b->shadowed)
if (b->decl && b->decl != new_decl && !b->invisible)
if (b->decl && b->decl != new_decl && !b->invisible
&& (b->decl == error_mark_node
|| diagnostic_report_warnings_p (global_dc,
DECL_SOURCE_LOCATION (b->decl))))
{
tree old_decl = b->decl;