diff options
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 71fd08b1d4c..06262036715 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1377,14 +1377,17 @@ build_member_call (type, name, parmlist) return build_x_function_call (lookup_namespace_name (type, name), parmlist, current_class_ref); - if (TREE_CODE (name) != TEMPLATE_ID_EXPR) - method_name = name; - else + if (TREE_CODE (name) == TEMPLATE_ID_EXPR) { method_name = TREE_OPERAND (name, 0); + if (TREE_CODE (method_name) == COMPONENT_REF) + method_name = TREE_OPERAND (method_name, 1); if (is_overloaded_fn (method_name)) method_name = DECL_NAME (OVL_CURRENT (method_name)); + TREE_OPERAND (name, 0) = method_name; } + else + method_name = name; if (TREE_CODE (method_name) == BIT_NOT_EXPR) { |