* c-decl.c (warn_if_shadowing): Don't warn if shadowed
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Nov 2011 02:45:21 +0000 (02:45 +0000)
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Nov 2011 02:45:21 +0000 (02:45 +0000)
identifier is from system header.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181684 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-decl.c

index e678a7a..6787a7c 100644 (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
 
        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.
index 3cb29c0..44358a8 100644 (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;