re PR c++/29143 (address-of overloaded function does not work in function call)

/cp
2013-11-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/29143
	* semantics.c (finish_call_expr): Ensure that for OVERLOADs too
	'(&f)(...)' is the same as '(f)(...)', per 13.3.1.1.

/testsuite
2013-11-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/29143
	* g++.dg/overload/addr2.C: New.
	* g++.old-deja/g++.other/overload11.C: Adjust.

From-SVN: r204898
This commit is contained in:
Paolo Carlini 2013-11-16 09:54:23 +00:00 committed by Paolo Carlini
parent 3a81b570d2
commit 5edc02ac22
3 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-11-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/29143
* g++.dg/overload/addr2.C: New.
* g++.old-deja/g++.other/overload11.C: Adjust.
2013-11-15 Mike Stump <mikestump@comcast.net>
* lib/gcc.exp (gcc_target_compile): Add support for random runtime

View File

@ -0,0 +1,13 @@
// PR c++/29143
void f(int);
void g(int,int);
void g(int,int,int);
void
h ()
{
(&f)(1);
(&g)(1,2,3);
}

View File

@ -32,7 +32,7 @@ int main (int argc, char **argv)
void (*vptr) ();
(ovl) (1); // ok
(&ovl) (1); // { dg-error "" } not suitable for overload resolution
(&ovl) (1); // ok
(ovl) (); // { dg-error "" } no matching candidates
// { dg-message "candidate" "candidate note" { target *-*-* } 36 }
(&ovl) (); // { dg-error "" } not suitable for overload resolution