aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-07-30 02:34:58 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-07-30 02:34:58 +0100
commit91d975b88eee06af82847fdb48c58e230506c72c (patch)
tree5b5a77889165a1437cae84a1933af1e14db1f0fd /gcc/c-decl.c
parent94ad79eaf5616f25f3edb2d2212742359603ce67 (diff)
downloadgcc-91d975b88eee06af82847fdb48c58e230506c72c.zip
gcc-91d975b88eee06af82847fdb48c58e230506c72c.tar.gz
gcc-91d975b88eee06af82847fdb48c58e230506c72c.tar.bz2
re PR c/23143 (parameter forward declarations broken)
PR c/23143 * c-parser.c (c_parser_parms_list_declarator): Call mark_forward_parm_decls. * c-decl.c (merge_decls): Only check DECL_IN_SYSTEM_HEADER for decls with visibility structure. testsuite: * gcc.dg/parm-forwdecl-1.c, gcc.dg/parm-forwdecl-2.c, gcc.dg/parm-forwdecl-3.c, gcc.dg/parm-forwdecl-4.c: New tests. From-SVN: r102581
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 09c2755..903b5aa 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1664,18 +1664,18 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
&& !C_DECL_BUILTIN_PROTOTYPE (olddecl)))
DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
- /* Merge the unused-warning information. */
- if (DECL_IN_SYSTEM_HEADER (olddecl))
- DECL_IN_SYSTEM_HEADER (newdecl) = 1;
- else if (DECL_IN_SYSTEM_HEADER (newdecl))
- DECL_IN_SYSTEM_HEADER (olddecl) = 1;
-
/* Merge the initialization information. */
if (DECL_INITIAL (newdecl) == 0)
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
if (CODE_CONTAINS_STRUCT (TREE_CODE (olddecl), TS_DECL_WITH_VIS))
{
+ /* Merge the unused-warning information. */
+ if (DECL_IN_SYSTEM_HEADER (olddecl))
+ DECL_IN_SYSTEM_HEADER (newdecl) = 1;
+ else if (DECL_IN_SYSTEM_HEADER (newdecl))
+ DECL_IN_SYSTEM_HEADER (olddecl) = 1;
+
/* Merge the section attribute.
We want to issue an error if the sections conflict but that must be
done later in decl_attributes since we are called before attributes