This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] Redefinition of default args is illegal


On Sun, Feb 17, 2002 at 10:28:21PM +0000, Jason Merrill wrote:
> No.  I will, however, accept a patch to remove the if (pedantic), so that
> the pedwarn becomes unconditional.

OK.

Is this acceptable?


2002-02-17  Craig Rodrigues  <rodrigc@gcc.gnu.org>

	PR c++/5685
	* decl.c (duplicate_decls): Make warning unconditional
	if duplicate default argument declarations are present.


Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.862
diff -u -r1.862 decl.c
--- decl.c	2002/02/16 12:13:35	1.862
+++ decl.c	2002/02/18 01:25:42
@@ -3389,13 +3389,10 @@
 		if (1 == simple_cst_equal (TREE_PURPOSE (t1),
 					   TREE_PURPOSE (t2)))
 		  {
-		    if (pedantic)
-		      {
-			pedwarn ("default argument given for parameter %d of `%#D'",
-				    i, newdecl);
-			cp_pedwarn_at ("after previous specification in `%#D'",
-				       olddecl);
-		      }
+		    pedwarn ("default argument given for parameter %d of `%#D'",
+			     i, newdecl);
+		    cp_pedwarn_at ("after previous specification in `%#D'",
+			           olddecl);
 		  }
 		else
 		  {
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@attbi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]