This is the mail archive of the gcc-bugs@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]

[Bug c++/13979] Error message about no matching function for call with derived class arguments could be improved


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-15 21:59 -------
To the extent this is a regression (which is very mild), the best way to fix
this is, in my opinion, to make some changes tok our overall policies about
overload resolution and conversion.

In particular, we permit (with -fpermissive) certain invalid conversions (the
ones given by ptr_reasonably_similar).  The way our overload machinery works is
that when we see that a conversion is "reasonably similar" we allow the
conversion, but mark it as "bad", so that if we actually try to use it we will
issue a pedwarn.  If the pointer and reference conversions used in this example
were so marked, we would issue helpful error messages as the submitter requests.

However, if we did that, we would also allow these conversions with
-fpermissive, which would make -fpermissive even more permissive than it already is.

I think that we should change -fpermissive so that it is *less* permissive that
it currently is; in particular, we should not allow any bad conversions, even
with -fpermissive.  However, we should treat any pointer->pointer or
reference->reference conversion as "bad", and eliminate ptr_reasonably_similar.

(Actually, I'd be happy to eliminate -fpermissive altogether, but that's another
story.)

Jason, as the key force behind -fpermissive, what say you?

In any case, I'm going to move this test case into the enhancement category.  To
the extent it's a regression that comes from deliberate improvements in our
overloading code, and is not easily fixed without resolving the questions above.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com
           Severity|minor                       |enhancement
            Summary|[3.3/3.4/3.5 Regression] no |Error message about no
                   |matching function for call  |matching function for call
                   |with derived class arguments|with derived class arguments
                   |                            |could be improved
   Target Milestone|3.3.4                       |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13979


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