rpms/gcc/devel gcc44-pr39763.patch, NONE, 1.1 gcc.spec, 1.40, 1.41 gcc44-power7.patch, 1.3, 1.4

Jakub Jelinek jakub at fedoraproject.org
Tue Apr 14 17:55:05 UTC 2009


Author: jakub

Update of /cvs/pkgs/rpms/gcc/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28897

Modified Files:
	gcc.spec gcc44-power7.patch 
Added Files:
	gcc44-pr39763.patch 
Log Message:
4.4.0-0.34

gcc44-pr39763.patch:

--- NEW FILE gcc44-pr39763.patch ---
2009-04-14  Jason Merrill  <jason at redhat.com>

	PR c++/39763
	* name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
	about shadowing by tentative parms.

	* g++.dg/warn/Wshadow-4.C: Extend.

--- gcc/cp/name-lookup.c	(revision 146053)
+++ gcc/cp/name-lookup.c	(revision 146054)
@@ -1002,13 +1002,18 @@ pushdecl_maybe_friend (tree x, bool is_f
 	      && TREE_PUBLIC (x))
 	    TREE_PUBLIC (name) = 1;
 
+	  /* Don't complain about the parms we push and then pop
+	     while tentatively parsing a function declarator.  */
+	  if (TREE_CODE (x) == PARM_DECL && DECL_CONTEXT (x) == NULL_TREE)
+	    /* Ignore.  */;
+
 	  /* Warn if shadowing an argument at the top level of the body.  */
-	  if (oldlocal != NULL_TREE && !DECL_EXTERNAL (x)
-	      /* Inline decls shadow nothing.  */
-	      && !DECL_FROM_INLINE (x)
-	      && TREE_CODE (oldlocal) == PARM_DECL
-	      /* Don't check the `this' parameter.  */
-	      && !DECL_ARTIFICIAL (oldlocal))
+	  else if (oldlocal != NULL_TREE && !DECL_EXTERNAL (x)
+		   /* Inline decls shadow nothing.  */
+		   && !DECL_FROM_INLINE (x)
+		   && TREE_CODE (oldlocal) == PARM_DECL
+		   /* Don't check the `this' parameter.  */
+		   && !DECL_ARTIFICIAL (oldlocal))
 	    {
 	      bool err = false;
 
@@ -1032,10 +1037,7 @@ pushdecl_maybe_friend (tree x, bool is_f
 		    }
 		}
 
-	      if (warn_shadow && !err
-		  /* Don't complain about the parms we push and then pop
-		     while tentatively parsing a function declarator.  */
-		  && !(TREE_CODE (x) == PARM_DECL && DECL_CONTEXT (x) == NULL_TREE))
+	      if (warn_shadow && !err)
 		{
 		  warning (OPT_Wshadow, "declaration of %q#D shadows a parameter", x);
 		  warning (OPT_Wshadow, "%Jshadowed declaration is here", oldlocal);
--- gcc/testsuite/g++.dg/warn/Wshadow-4.C	(revision 146053)
+++ gcc/testsuite/g++.dg/warn/Wshadow-4.C	(revision 146054)
@@ -18,3 +18,15 @@ int foo(int infoo)		// { dg-warning "sha
   };
   return outfoo;
 }
+
+// PR c++/39763
+int foo2(void)
+{
+    int infoo = 0;		// { dg-warning "shadowed declaration" }
+    int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
+    struct A
+    {
+      void f(int infoo) { }	// { dg-warning "shadows a previous local" }
+    };
+    return outfoo;
+}
 2009-04-13  Jason Merrill  <jason at redhat.com>
 
 	PR c++/39480


Index: gcc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc.spec,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- gcc.spec	14 Apr 2009 15:46:15 -0000	1.40
+++ gcc.spec	14 Apr 2009 17:54:33 -0000	1.41
@@ -150,6 +150,7 @@
 Patch26: gcc44-power7.patch
 Patch28: gcc44-pr38757.patch
 Patch30: gcc44-pr39543.patch
+Patch31: gcc44-pr39763.patch
 
 Patch1000: fastjar-0.97-segfault.patch
 
@@ -438,6 +439,7 @@
 %patch26 -p0 -b .power7~
 %patch28 -p0 -b .pr38757~
 #%patch30 -p0 -b .pr39543~
+%patch31 -p0 -b .pr39763~
 
 # This testcase doesn't compile.
 rm libjava/testsuite/libjava.lang/PR35020*
@@ -1755,6 +1757,7 @@
     lib* files
   - PRs c++/28301, c++/39480, c++/39742, c++/39750, c/39613, c/39614, c/39673,
 	libobjc/36610, target/39740, testsuite/35621, tree-optimization/39713
+- fix another -Wshadow C++ issue (PR c++/39763)
 
 * Thu Apr  9 2009 Jakub Jelinek <jakub at redhat.com> 4.4.0-0.32
 - update from gcc-4_4-branch

gcc44-power7.patch:

Index: gcc44-power7.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc44-power7.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- gcc44-power7.patch	14 Apr 2009 15:46:16 -0000	1.3
+++ gcc44-power7.patch	14 Apr 2009 17:54:33 -0000	1.4
@@ -8447,14 +8447,6 @@
 +  [(set_attr "type" "vecperm")])
 --- gcc/config/rs6000/rs6000.h	(.../trunk)	(revision 145777)
 +++ gcc/config/rs6000/rs6000.h	(.../branches/ibm/power7-meissner)	(revision 146027)
-@@ -1,6 +1,6 @@
- /* Definitions of target machine for GNU compiler, for IBM RS/6000.
-    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
--   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-    Free Software Foundation, Inc.
-    Contributed by Richard Kenner (kenner at vlsi1.ultra.nyu.edu)
- 
 @@ -72,14 +72,16 @@
  #define ASM_CPU_POWER6_SPEC "-mpower4 -maltivec"
  #endif




More information about the fedora-extras-commits mailing list