diff options
author | Alan Modra <amodra@gmail.com> | 2011-11-24 13:15:21 +1030 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2011-11-24 13:15:21 +1030 |
commit | 1d551e4dc364d85d94ce159805dc637a4a819f7d (patch) | |
tree | ea7ebecd24444c9f07bd7452ae3f97d624d6297f /gcc/c-decl.c | |
parent | 58494d501ee754d286d85ff03d12bf177d757841 (diff) | |
download | gcc-1d551e4dc364d85d94ce159805dc637a4a819f7d.zip gcc-1d551e4dc364d85d94ce159805dc637a4a819f7d.tar.gz gcc-1d551e4dc364d85d94ce159805dc637a4a819f7d.tar.bz2 |
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
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 3cb29c0..44358a8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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; |