This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13979] Error message about no matching function for call with derived class arguments could be improved
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Mar 2005 22:17:14 -0000
- Subject: [Bug c++/13979] Error message about no matching function for call with derived class arguments could be improved
- References: <20040202145010.13979.bkramer@ciprico.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2005-03-21 22:17 -------
Here's a small testcase:
----------------
struct B {};
struct D : B {};
struct S {
int foo(B* & taskData);
};
int i = S().foo((D*)0);
-----------------
We get these messages, the one for 2.95 being slightly more helpful:
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc
x.cc:8: error: no matching function for call to ?S::foo(D*)?
x.cc:5: note: candidates are: int S::foo(B*&)
g/x> /home/bangerth/bin/gcc-2.95.3/bin/c++ -c x.cc
x.cc:8: initializing non-const `B *&' with `D *' will use a temporary
x.cc:5: in passing argument 1 of `S::foo(B *&)'
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13979