Commit f62cd409 by Dodji Seketeli Committed by Dodji Seketeli

re PR c++/48656 ([C++0x] cannot call member function without object)

Fix PR c++/48656

gcc/cp/

	* semantics.c (finish_call_expr): Don't forget BASELINK nodes when
	considering call expressions involving a member function.

gcc/testsuite/

	* gcc/testsuite/g++.dg/template/inherit7.C: New test case.

From-SVN: r173123
parent c6fc44f3
2011-04-28 Dodji Seketeli <dodji@redhat.com>
PR c++/48656
* semantics.c (finish_call_expr): Don't forget BASELINK nodes when
considering call expressions involving a member function.
2011-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/48530
......
......@@ -2039,7 +2039,8 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
is not included in *ARGS even though it is considered to
be part of the list of arguments. Note that this is
related to CWG issues 515 and 1005. */
|| ((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
|| (((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
|| BASELINK_P (fn))
&& current_class_ref
&& type_dependent_expression_p (current_class_ref)))
{
......
2011-04-28 Dodji Seketeli <dodji@redhat.com>
PR c++/48656
* g++.dg/template/inherit7.C: New test case.
2011-04-28 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40052
......
// Origin: PR c++/48656
// { dg-options "-std=c++0x" }
// { dg-do compile }
struct A {
int f();
int f(int);
};
template <typename> struct B : A
{
};
template <typename T> struct C : B<T>
{
void
g()
{
A::f();
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment