This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11138] "no match" error when there is a match ...
- From: "zolyfarkas at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jun 2003 20:12:30 -0000
- Subject: [Bug c++/11138] "no match" error when there is a match ...
- References: <20030609201028.11138.zolyfarkas@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11138
------- Additional Comments From zolyfarkas@hotmail.com 2003-06-09 20:12 -------
Subject: Re: New: "no match" error when there is a match ...
>From: "zolyfarkas@hotmail.com" <gcc-bugzilla@gcc.gnu.org>
>Reply-To: gcc-bugzilla@gcc.gnu.org
>To: zolyfarkas@hotmail.com
>Subject: [Bug c++/11138] New: "no match" error when there is a match ...
>Date: 9 Jun 2003 20:10:29 -0000
>
>PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11138
>
> Summary: "no match" error when there is a match ...
> Product: gcc
> Version: 3.2
> Status: UNCONFIRMED
> Severity: major
> Priority: P2
> Component: c++
> AssignedTo: unassigned@gcc.gnu.org
> ReportedBy: zolyfarkas@hotmail.com
> CC: gcc-bugs@gcc.gnu.org
>
>Is this a bug ? Maybe ...
>
>Here is the description ...
>the following code :
>
>class a
>{
>int i;
>public:
>a(){i=0;}
>friend a operator+(a&, a&);
>};
>
>a operator+(a& a1, a& a2)
>{
>return a();
>}
>
>int main(void)
>{
>a res = a() + a();
>return 0;
>}
>gives the following compilation error:
>test.cc: In function `int main()':
>test.cc:18: no match for `a + a' operator
>test.cc:10: candidates are: a operator+(a&, a&)
>test.cc:10: a operator+(a&, a&)
>
>I shouldn't get this error ...
>
>if i change the line with the error to the following : a res = (a&)a() +
>(a&)a
>(); //it compiles
>I should not need to do explicit casts is this case ...
>
>I am working on a Solaris 9 sparc system
>
>thanks
>
>
>
>------- You are receiving this mail because: -------
>You reported the bug, or are watching the reporter.
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail