This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch]: Testcase for bug in overload resolution.
- To: Klaus-Georg Adams <Klaus-Georg dot Adams at chemie dot uni-karlsruhe dot de>
- Subject: Re: [patch]: Testcase for bug in overload resolution.
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 23 Jun 1998 20:03:03 -0300
- Cc: robertl at dgii dot com, egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com
- References: <199806180830.KAA21019@achibm5.chemie.uni-karlsruhe.de>
Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de> writes:
> // The call to a::foo() generates an error:
> // eb131.C: In method `a::a()':
> // eb131.C:26: no matching function for call to `a::foo (void (a::*)(double))'
> // eb131.C:15: candidates are: a::foo(void (a::*)(float))
> // According to [over.over] in the CD2, &junk should resolve in this context.
IMO, the error message is misleading, but the testcase is wrong.
`&junk' is ill-formed, even inside the scope of `struct a', because
`junk' is not a static member function. In order to form a pointer to
member, you must always qualify it [expr.unary.op]/3.
> foo( &junk );
The test case compiles correctly if you use `&a::junk'.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil