From 5edc02ac2219491b8db8b460ae5e0afdb7ff2c3b Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sat, 16 Nov 2013 09:54:23 +0000 Subject: [PATCH] re PR c++/29143 (address-of overloaded function does not work in function call) /cp 2013-11-16 Paolo Carlini 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 PR c++/29143 * g++.dg/overload/addr2.C: New. * g++.old-deja/g++.other/overload11.C: Adjust. From-SVN: r204898 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/overload/addr2.C | 13 +++++++++++++ gcc/testsuite/g++.old-deja/g++.other/overload11.C | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/overload/addr2.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2adcce4f13e..3f7e1beb71c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-11-16 Paolo Carlini + + PR c++/29143 + * g++.dg/overload/addr2.C: New. + * g++.old-deja/g++.other/overload11.C: Adjust. + 2013-11-15 Mike Stump * lib/gcc.exp (gcc_target_compile): Add support for random runtime diff --git a/gcc/testsuite/g++.dg/overload/addr2.C b/gcc/testsuite/g++.dg/overload/addr2.C new file mode 100644 index 00000000000..1d0c66bffd6 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/addr2.C @@ -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); +} diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload11.C b/gcc/testsuite/g++.old-deja/g++.other/overload11.C index b994b80701a..0b910e48a04 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/overload11.C +++ b/gcc/testsuite/g++.old-deja/g++.other/overload11.C @@ -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