Commit 55765de4 by Mark Mitchell Committed by Mark Mitchell

init.c (build_member_call): Use build_new_method_call, not build_method_call.

	* init.c (build_member_call): Use build_new_method_call, not
	build_method_call.
	* g++.dg/inherit/access3.C: New test.

From-SVN: r56000
parent ba462c8e
2002-08-02 Mark Mitchell <mark@codesourcery.com>
* init.c (build_member_call): Use build_new_method_call, not
build_method_call.
2002-08-02 Krister Walfridsson <cato@df.lth.se> 2002-08-02 Krister Walfridsson <cato@df.lth.se>
* Make-lang.in (spew.o, lex.o, pt.o): Add path to parse.h dependencies. * Make-lang.in (spew.o, lex.o, pt.o): Add path to parse.h dependencies.
......
...@@ -1434,6 +1434,7 @@ build_member_call (type, name, parmlist) ...@@ -1434,6 +1434,7 @@ build_member_call (type, name, parmlist)
{ {
tree t; tree t;
tree method_name; tree method_name;
tree fns;
int dtor = 0; int dtor = 0;
tree basetype_path, decl; tree basetype_path, decl;
...@@ -1511,6 +1512,18 @@ build_member_call (type, name, parmlist) ...@@ -1511,6 +1512,18 @@ build_member_call (type, name, parmlist)
decl = maybe_dummy_object (type, &basetype_path); decl = maybe_dummy_object (type, &basetype_path);
fns = lookup_fnfields (basetype_path, method_name, 0);
if (fns)
{
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
BASELINK_FUNCTIONS (fns) = build_nt (TEMPLATE_ID_EXPR,
BASELINK_FUNCTIONS (fns),
TREE_OPERAND (name, 1));
return build_new_method_call (decl, fns, parmlist,
/*conversion_path=*/NULL_TREE,
LOOKUP_NORMAL|LOOKUP_NONVIRTUAL);
}
/* Convert 'this' to the specified type to disambiguate conversion /* Convert 'this' to the specified type to disambiguate conversion
to the function's context. */ to the function's context. */
if (decl == current_class_ref if (decl == current_class_ref
...@@ -1527,12 +1540,6 @@ build_member_call (type, name, parmlist) ...@@ -1527,12 +1540,6 @@ build_member_call (type, name, parmlist)
if (constructor_name_p (method_name, type)) if (constructor_name_p (method_name, type))
return build_functional_cast (type, parmlist); return build_functional_cast (type, parmlist);
if (lookup_fnfields (basetype_path, method_name, 0))
return build_method_call (decl,
TREE_CODE (name) == TEMPLATE_ID_EXPR
? name : method_name,
parmlist, basetype_path,
LOOKUP_NORMAL|LOOKUP_NONVIRTUAL);
if (TREE_CODE (name) == IDENTIFIER_NODE if (TREE_CODE (name) == IDENTIFIER_NODE
&& ((t = lookup_field (TYPE_BINFO (type), name, 1, 0)))) && ((t = lookup_field (TYPE_BINFO (type), name, 1, 0))))
{ {
......
2002-08-02 Mark Mitchell <mark@codesourcery.com>
* g++.dg/inherit/access3.C: New test.
2002-08-01 Jakub Jelinek <jakub@redhat.com> 2002-08-01 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/ia64-visibility-2.c: New test. * gcc.dg/ia64-visibility-2.c: New test.
......
// { dg-do compile }
class __new_alloc {
public:
static void allocate() {}
};
template <class _Alloc>
class __debug_alloc : public _Alloc {
public:
static void allocate();
};
template <class _Alloc>
void __debug_alloc<_Alloc>::allocate() {
_Alloc::allocate();
}
template class __debug_alloc<__new_alloc>;
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