aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 1f032e0..83adadb 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1681,7 +1681,7 @@ build_member_call (type, name, parmlist)
tree type, name, parmlist;
{
tree t;
- tree method_name = name;
+ tree method_name;
int dtor = 0;
int dont_use_this = 0;
tree basetype_path, decl;
@@ -1690,6 +1690,11 @@ build_member_call (type, name, parmlist)
return build_x_function_call (do_scoped_id (name, 0), parmlist,
current_class_ref);
+ if (TREE_CODE (name) != TEMPLATE_ID_EXPR)
+ method_name = name;
+ else
+ method_name = TREE_OPERAND (name, 0);
+
if (TREE_CODE (method_name) == BIT_NOT_EXPR)
{
method_name = TREE_OPERAND (method_name, 0);
@@ -1758,7 +1763,10 @@ build_member_call (type, name, parmlist)
|| method_name == constructor_name_full (type))
return build_functional_cast (type, parmlist);
if (t = lookup_fnfields (basetype_path, method_name, 0))
- return build_method_call (decl, method_name, parmlist, basetype_path,
+ 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
&& ((t = lookup_field (TYPE_BINFO (type), name, 1, 0))))