aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-07-20 14:22:34 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-07-20 14:22:34 -0400
commit68f7159da9fe1435fb7ccfcbd7227dcb20f3ac90 (patch)
treea57df5127e64b43678167aa946a56633f06e3c70 /gcc/cp
parentd95016e0e6b8942e14a94ec1674290356d571de1 (diff)
downloadgcc-68f7159da9fe1435fb7ccfcbd7227dcb20f3ac90.zip
gcc-68f7159da9fe1435fb7ccfcbd7227dcb20f3ac90.tar.gz
gcc-68f7159da9fe1435fb7ccfcbd7227dcb20f3ac90.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c32
2 files changed, 19 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b2b0279..748f37d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,9 @@
2010-07-20 Jason Merrill <jason@redhat.com>
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
CALL_EXPR.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a992d6f..b618907 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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
lookup finds a non-function, in accordance with the
expected resolution of DR 218. */
@@ -12521,14 +12512,15 @@ tsubst_copy_and_build (tree t,
|| TREE_CODE (function) == IDENTIFIER_NODE)
/* Only do this when substitution turns a 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);
if (TREE_CODE (function) == IDENTIFIER_NODE)
{
unqualified_name_lookup_error (function);
- ret = error_mark_node;
- goto call_out;
+ release_tree_vector (call_args);
+ return error_mark_node;
}
/* Remember that there was a reference to this entity. */
@@ -12539,15 +12531,24 @@ tsubst_copy_and_build (tree t,
ret = build_offset_ref_call_from_tree (function, &call_args);
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,
/*disallow_virtual=*/false,
/*koenig_p=*/false,
complain);
else
ret = (build_new_method_call
- (TREE_OPERAND (function, 0),
- TREE_OPERAND (function, 1),
+ (instance, fn,
&call_args, NULL_TREE,
qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL,
/*fn_p=*/NULL,
@@ -12559,7 +12560,6 @@ tsubst_copy_and_build (tree t,
koenig_p,
complain);
- call_out:
release_tree_vector (call_args);
return ret;