aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2a16220..5f52d90 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2013-11-15 Aldy Hernandez <aldyh@redhat.com>
* Make-lang.in (CXX_AND_OBJCXX_OBJS): Depend on cp/cp-cilkplus.o.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 81394fa..f5506d0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2184,6 +2184,11 @@ finish_call_expr (tree fn, vec<tree, va_gc> **args, bool disallow_virtual,
}
}
+ /* Per 13.3.1.1, '(&f)(...)' is the same as '(f)(...)'. */
+ if (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == OVERLOAD)
+ fn = TREE_OPERAND (fn, 0);
+
if (is_overloaded_fn (fn))
fn = baselink_for_fns (fn);