aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-13 19:18:35 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-13 19:18:35 +0000
commiteee80116a8d0e277930da56aaf57a3d7e880bc86 (patch)
treee9aad0aad6326cf9be486f34c8cb1608f3166a1f /gcc/cp/semantics.c
parent592285e15fa3b272632dca3dd83a7dfae2c7e8b6 (diff)
Fix type-dependence and the current instantiation.
PR c++/10200 PR c++/69753 * pt.c (tsubst_decl): Use uses_template_parms. (instantiate_template_1): Handle non-dependent calls in templates. (value_dependent_expression_p): Handle BASELINK, FUNCTION_DECL. (type_dependent_expression_p): Only consider innermost template args. (dependent_template_arg_p): Check enclosing class of a template here. (dependent_template_p): Not here. (type_dependent_object_expression_p): New. * typeck.c (finish_class_member_access_expr): Use it. * parser.c (cp_parser_postfix_expression): Use it. (cp_parser_postfix_dot_deref_expression): Use it. Use comptypes to detect the current instantiation. (cp_parser_lookup_name): Really implement DR 141. * search.c (lookup_field_r): Prefer a dependent using-declaration. (any_dependent_bases_p): Split out from... * name-lookup.c (do_class_using_decl): ...here. * call.c (build_new_method_call_1): Use it. * semantics.c (finish_call_expr): 'this' doesn't make a call dependent. * tree.c (non_static_member_function_p): Remove. * typeck2.c (build_x_arrow): Use dependent_scope_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236221 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 817ef995a4c..06dee5a6669 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2300,18 +2300,7 @@ finish_call_expr (tree fn, vec<tree, va_gc> **args, bool disallow_virtual,
with no type; type_dependent_expression_p recognizes
expressions with no type as being dependent. */
if (type_dependent_expression_p (fn)
- || any_type_dependent_arguments_p (*args)
- /* For a non-static member function that doesn't have an
- explicit object argument, we need to specifically
- test the type dependency of the "this" pointer because it
- is not included in *ARGS even though it is considered to
- be part of the list of arguments. Note that this is
- related to CWG issues 515 and 1005. */
- || (TREE_CODE (fn) != COMPONENT_REF
- && non_static_member_function_p (fn)
- && !DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (get_first_fn (fn))
- && current_class_ref
- && type_dependent_expression_p (current_class_ref)))
+ || any_type_dependent_arguments_p (*args))
{
result = build_nt_call_vec (fn, *args);
SET_EXPR_LOCATION (result, EXPR_LOC_OR_LOC (fn, input_location));
@@ -2399,17 +2388,6 @@ finish_call_expr (tree fn, vec<tree, va_gc> **args, bool disallow_virtual,
object = maybe_dummy_object (BINFO_TYPE (BASELINK_ACCESS_BINFO (fn)),
NULL);
- if (processing_template_decl)
- {
- if (type_dependent_expression_p (object))
- {
- tree ret = build_nt_call_vec (orig_fn, orig_args);
- release_tree_vector (orig_args);
- return ret;
- }
- object = build_non_dependent_expr (object);
- }
-
result = build_new_method_call (object, fn, args, NULL_TREE,
(disallow_virtual
? LOOKUP_NORMAL|LOOKUP_NONVIRTUAL