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]

[PATCH] PR c++/9315


The following patch fixes PR c++/9315.

For certain cases in overload resolution we tried to emit a warning that
states which alternative the compiler chose. Alas, we ended up emitting
an error message which only *looks* like a warning.

Changing "pedwarn" to "warning" fixes this. We already tested "pedantic"
as false before emitting the warnings, so the patch should be save.

Bootstrapped and regtested on i686-pc-linux-gnu.

Can somebody please approve and apply the patch (for 3.2 branch, 3.3 branch
and mainline)?


2003-01-17  Volker Reichelt <reichelt@igpm.rwth-aachen.de>

        PR c++/9315
        * call.c (joust): Use "warning" instead of "pedwarn".
          Adjust Copyright.


===============================================================================
--- gcc-old/gcc/cp/call.c	Fri Jan 17 22:10:17 2003
+++ gcc-new/gcc/cp/call.c	Fri Jan 17 22:22:11 2003
@@ -1,6 +1,6 @@
 /* Functions related to invoking methods and overloaded functions.
    Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) and
    modified by Brendan Kehoe (brendan@cygnus.com).
 
@@ -5756,9 +5756,8 @@ tweak:
         {
 	  if (warn)
 	    {
-	      pedwarn ("choosing `%D' over `%D'", w->fn, l->fn);
-	      pedwarn (
-"  because worst conversion for the former is better than worst conversion for the latter");
+	      warning ("choosing `%D' over `%D'", w->fn, l->fn);
+	      warning ("  because worst conversion for the former is better than worst conversion for the latter");
 	    }
 	  else
 	    add_warning (w, l);
===============================================================================

I'm not sure how to prepare a testcase for this situation.
Maybe we even need two testcases (one for the warning when "-pedantic"
is not specified and one for the error when "-pedantic" is specified.

Any suggestions?

Regards,
Volker



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