Commit 68f7159d by Jason Merrill Committed by Jason Merrill

re PR c++/44967 ([C++0x] decltype of method call dependent on pack expansion crashes)

	PR c++/44967
	* pt.c (tsubst_copy_and_build): Rework last change.

From-SVN: r162345
parent d95016e0
2010-07-20 Jason Merrill <jason@redhat.com> 2010-07-20 Jason Merrill <jason@redhat.com>
PR c++/44967 PR c++/44967
* pt.c (tsubst_copy_and_build): Rework last change.
PR c++/44967
* pt.c (tsubst_copy_and_build): Handle partial substitution of * pt.c (tsubst_copy_and_build): Handle partial substitution of
CALL_EXPR. CALL_EXPR.
......
...@@ -12500,15 +12500,6 @@ tsubst_copy_and_build (tree t, ...@@ -12500,15 +12500,6 @@ tsubst_copy_and_build (tree t,
} }
} }
if (processing_template_decl
&& (type_dependent_expression_p (function)
|| any_type_dependent_arguments_p (call_args)))
{
ret = build_nt_call_vec (function, call_args);
KOENIG_LOOKUP_P (ret) = koenig_p;
goto call_out;
}
/* We do not perform argument-dependent lookup if normal /* We do not perform argument-dependent lookup if normal
lookup finds a non-function, in accordance with the lookup finds a non-function, in accordance with the
expected resolution of DR 218. */ expected resolution of DR 218. */
...@@ -12521,14 +12512,15 @@ tsubst_copy_and_build (tree t, ...@@ -12521,14 +12512,15 @@ tsubst_copy_and_build (tree t,
|| TREE_CODE (function) == IDENTIFIER_NODE) || TREE_CODE (function) == IDENTIFIER_NODE)
/* Only do this when substitution turns a dependent call /* Only do this when substitution turns a dependent call
into a non-dependent call. */ into a non-dependent call. */
&& type_dependent_expression_p_push (t)) && type_dependent_expression_p_push (t)
&& !any_type_dependent_arguments_p (call_args))
function = perform_koenig_lookup (function, call_args); function = perform_koenig_lookup (function, call_args);
if (TREE_CODE (function) == IDENTIFIER_NODE) if (TREE_CODE (function) == IDENTIFIER_NODE)
{ {
unqualified_name_lookup_error (function); unqualified_name_lookup_error (function);
ret = error_mark_node; release_tree_vector (call_args);
goto call_out; return error_mark_node;
} }
/* Remember that there was a reference to this entity. */ /* Remember that there was a reference to this entity. */
...@@ -12539,15 +12531,24 @@ tsubst_copy_and_build (tree t, ...@@ -12539,15 +12531,24 @@ tsubst_copy_and_build (tree t,
ret = build_offset_ref_call_from_tree (function, &call_args); ret = build_offset_ref_call_from_tree (function, &call_args);
else if (TREE_CODE (function) == COMPONENT_REF) else if (TREE_CODE (function) == COMPONENT_REF)
{ {
if (!BASELINK_P (TREE_OPERAND (function, 1))) tree instance = TREE_OPERAND (function, 0);
tree fn = TREE_OPERAND (function, 1);
if (processing_template_decl
&& (type_dependent_expression_p (instance)
|| (!BASELINK_P (fn)
&& TREE_CODE (fn) != FIELD_DECL)
|| type_dependent_expression_p (fn)
|| any_type_dependent_arguments_p (call_args)))
ret = build_nt_call_vec (function, call_args);
else if (!BASELINK_P (fn))
ret = finish_call_expr (function, &call_args, ret = finish_call_expr (function, &call_args,
/*disallow_virtual=*/false, /*disallow_virtual=*/false,
/*koenig_p=*/false, /*koenig_p=*/false,
complain); complain);
else else
ret = (build_new_method_call ret = (build_new_method_call
(TREE_OPERAND (function, 0), (instance, fn,
TREE_OPERAND (function, 1),
&call_args, NULL_TREE, &call_args, NULL_TREE,
qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL, qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL,
/*fn_p=*/NULL, /*fn_p=*/NULL,
...@@ -12559,7 +12560,6 @@ tsubst_copy_and_build (tree t, ...@@ -12559,7 +12560,6 @@ tsubst_copy_and_build (tree t,
koenig_p, koenig_p,
complain); complain);
call_out:
release_tree_vector (call_args); release_tree_vector (call_args);
return ret; return ret;
......
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