Merge from vendor branch TNFTP:
[dragonfly.git] / gnu / usr.bin / cc34 / cc_prep / patches / c-decl.c.patch
1 $DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/c-decl.c.patch,v 1.1 2004/12/21 13:10:48 joerg Exp $
2
3 ===================================================================
4 RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/gcc-3.4/gcc/c-decl.c,v
5 retrieving revision 1.2
6 diff -u -r1.2 c-decl.c
7 --- c-decl.c    20 Dec 2004 19:23:23 -0000      1.2
8 +++ c-decl.c    20 Dec 2004 20:51:28 -0000
9 @@ -1164,9 +1164,8 @@
10      }
11  
12    /* warnings */
13 -  /* All decls must agree on a non-default visibility.  */
14 -  if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT
15 -      && DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT
16 +  /* All decls must agree on a visibility.  */
17 +  if (DECL_VISIBILITYSPECIFIED (newdecl) && DECL_VISIBILITYSPECIFIED (olddecl)
18        && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
19      {
20        warning ("%Jredeclaration of '%D' with different visibility "
21 @@ -1366,9 +1365,12 @@
22       Currently, it can only be defined in the prototype.  */
23    COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
24  
25 -  /* If either declaration has a nondefault visibility, use it.  */
26 -  if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT)
27 -    DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
28 +  /* Use visibility of whichever declaration had it specified */
29 +  if (DECL_VISIBILITYSPECIFIED (olddecl))
30 +    {
31 +      DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
32 +      DECL_VISIBILITYSPECIFIED (newdecl) = 1;
33 +    }
34  
35    if (TREE_CODE (newdecl) == FUNCTION_DECL)
36      {