}
if (processing_template_decl)
- {
- orig_args = args == NULL ? NULL : make_tree_vector_copy (*args);
- instance = build_non_dependent_expr (instance);
- if (args != NULL)
- make_args_non_dependent (*args);
- }
+ orig_args = args == NULL ? NULL : make_tree_vector_copy (*args);
/* Process the argument list. */
if (args != NULL && *args != NULL)
to undo it so we can try to treat it as an rvalue below. */
expr = maybe_undo_parenthesized_ref (expr);
- if (processing_template_decl)
- expr = build_non_dependent_expr (expr);
-
if (error_operand_p (expr))
return error_mark_node;
}
extern bool dependent_omp_for_p (tree, tree, tree, tree);
extern tree resolve_typename_type (tree, bool);
extern tree template_for_substitution (tree);
-inline tree build_non_dependent_expr (tree t) { return t; } // XXX remove
-extern void make_args_non_dependent (vec<tree, va_gc> *);
extern bool reregister_specialization (tree, tree, tree);
extern tree instantiate_non_dependent_expr (tree, tsubst_flags_t = tf_error);
extern tree instantiate_non_dependent_expr_internal (tree, tsubst_flags_t);
return build_min_nt_loc (loc, ARRAY_REF, array_expr, index_exp,
NULL_TREE, NULL_TREE);
}
- array_expr = build_non_dependent_expr (array_expr);
- if (index_exp)
- index_exp = build_non_dependent_expr (index_exp);
- else
- {
- orig_index_exp_list = make_tree_vector_copy (*index_exp_list);
- make_args_non_dependent (*index_exp_list);
- }
+ if (!index_exp)
+ orig_index_exp_list = make_tree_vector_copy (*index_exp_list);
}
type = TREE_TYPE (array_expr);
orig_args = make_tree_vector_copy (*args);
/* Transform the arguments and add the implicit "this"
- parameter. That must be done before the FN is transformed
- because we depend on the form of FN. */
- make_args_non_dependent (*args);
- object = build_non_dependent_expr (object);
+ parameter. */
if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
{
if (TREE_CODE (fn) == DOTSTAR_EXPR)
object = cp_build_addr_expr (object, complain);
vec_safe_insert (*args, 0, object);
}
- /* Now that the arguments are done, transform FN. */
- fn = build_non_dependent_expr (fn);
}
/* A qualified name corresponding to a bound pointer-to-member is
(**init)[i] = copy_node (e);
}
}
-
- make_args_non_dependent (*placement);
- if (nelts)
- nelts = build_non_dependent_expr (nelts);
- make_args_non_dependent (*init);
}
if (nelts)
return result;
}
-/* ARGS is a vector of expressions as arguments to a function call.
- Replace the arguments with equivalent non-dependent expressions.
- This modifies ARGS in place. */
-
-void
-make_args_non_dependent (vec<tree, va_gc> *args)
-{
- unsigned int ix;
- tree arg;
-
- FOR_EACH_VEC_SAFE_ELT (args, ix, arg)
- {
- tree newarg = build_non_dependent_expr (arg);
- if (newarg != arg)
- (*args)[ix] = newarg;
- }
-}
-
/* Returns a type which represents 'auto' or 'decltype(auto)'. We use a
TEMPLATE_TYPE_PARM with a level one deeper than the actual template parms,
by default. If set_canonical is true, we set TYPE_CANONICAL on it. */
namespace selftest {
-/* Verify that build_non_dependent_expr () works, for various expressions,
- and that location wrappers don't affect the results. */
-
-static void
-test_build_non_dependent_expr ()
-{
- location_t loc = BUILTINS_LOCATION;
-
- /* Verify constants, without and with location wrappers. */
- tree int_cst = build_int_cst (integer_type_node, 42);
- ASSERT_EQ (int_cst, build_non_dependent_expr (int_cst));
-
- tree wrapped_int_cst = maybe_wrap_with_location (int_cst, loc);
- ASSERT_TRUE (location_wrapper_p (wrapped_int_cst));
- ASSERT_EQ (wrapped_int_cst, build_non_dependent_expr (wrapped_int_cst));
-
- tree string_lit = build_string (4, "foo");
- TREE_TYPE (string_lit) = char_array_type_node;
- string_lit = fix_string_type (string_lit);
- ASSERT_EQ (string_lit, build_non_dependent_expr (string_lit));
-
- tree wrapped_string_lit = maybe_wrap_with_location (string_lit, loc);
- ASSERT_TRUE (location_wrapper_p (wrapped_string_lit));
- ASSERT_EQ (wrapped_string_lit,
- build_non_dependent_expr (wrapped_string_lit));
-}
-
/* Verify that type_dependent_expression_p () works correctly, even
in the presence of location wrapper nodes. */
void
cp_pt_cc_tests ()
{
- test_build_non_dependent_expr ();
test_type_dependent_expression_p ();
}
expr = convert_to_void (expr, ICV_STATEMENT, tf_warning_or_error);
}
else if (!type_dependent_expression_p (expr))
- convert_to_void (build_non_dependent_expr (expr), ICV_STATEMENT,
- tf_warning_or_error);
+ convert_to_void (expr, ICV_STATEMENT, tf_warning_or_error);
if (check_for_bare_parameter_packs (expr))
expr = error_mark_node;
tf_warning_or_error);
}
else if (!type_dependent_expression_p (expr))
- convert_to_void (build_non_dependent_expr (expr), ICV_THIRD_IN_FOR,
- tf_warning_or_error);
+ convert_to_void (expr, ICV_THIRD_IN_FOR, tf_warning_or_error);
expr = maybe_cleanup_point_expr_void (expr);
if (check_for_bare_parameter_packs (expr))
expr = error_mark_node;
return result;
}
orig_args = make_tree_vector_copy (*args);
- if (!BASELINK_P (fn)
- && TREE_CODE (fn) != PSEUDO_DTOR_EXPR
- && TREE_TYPE (fn) != unknown_type_node)
- fn = build_non_dependent_expr (fn);
- make_args_non_dependent (*args);
}
if (TREE_CODE (fn) == COMPONENT_REF)
|| TREE_CODE (OMP_CLAUSE_HINT_EXPR (clauses)) != INTEGER_CST)
dependent_p = true;
}
- if (!dependent_p)
- {
- lhs = build_non_dependent_expr (lhs);
- if (rhs)
- rhs = build_non_dependent_expr (rhs);
- if (v)
- v = build_non_dependent_expr (v);
- if (lhs1)
- lhs1 = build_non_dependent_expr (lhs1);
- if (rhs1)
- rhs1 = build_non_dependent_expr (rhs1);
- if (r && r != void_list_node)
- r = build_non_dependent_expr (r);
- }
}
if (!dependent_p)
{
return build_min_nt_loc (UNKNOWN_LOCATION, COMPONENT_REF,
orig_object, orig_name, NULL_TREE);
}
- object = build_non_dependent_expr (object);
}
else if (c_dialect_objc ()
&& identifier_p (name)
= build_dependent_operator_type (lookups, INDIRECT_REF, false);
return expr;
}
- expr = build_non_dependent_expr (expr);
}
rval = build_new_op (loc, INDIRECT_REF, LOOKUP_NORMAL, expr,
= build_dependent_operator_type (lookups, code, false);
return expr;
}
- arg1 = build_non_dependent_expr (arg1);
- arg2 = build_non_dependent_expr (arg2);
}
if (code == DOTSTAR_EXPR)
|| type_dependent_expression_p (arg2))
return build_min_nt_loc (loc, ARRAY_REF, arg1, arg2,
NULL_TREE, NULL_TREE);
- arg1 = build_non_dependent_expr (arg1);
- arg2 = build_non_dependent_expr (arg2);
}
expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL, arg1, arg2,
|| type_dependent_expression_p (arg1)
|| type_dependent_expression_p (arg2))
return build_min_nt_loc (loc, VEC_PERM_EXPR, arg0, arg1, arg2);
- arg0 = build_non_dependent_expr (arg0);
- if (arg1)
- arg1 = build_non_dependent_expr (arg1);
- arg2 = build_non_dependent_expr (arg2);
}
tree exp = c_build_vec_perm_expr (loc, arg0, arg1, arg2, complain & tf_error);
if (processing_template_decl && exp != error_mark_node)
CALL_EXPR_IFN (exp) = IFN_SHUFFLEVECTOR;
return exp;
}
- arg0 = build_non_dependent_expr (arg0);
- arg1 = build_non_dependent_expr (arg1);
- /* ??? Nothing needed for the index arguments? */
}
auto_vec<tree, 16> mask;
for (unsigned i = 2; i < args->length (); ++i)
TREE_TYPE (e) = build_dependent_operator_type (lookups, code, false);
return e;
}
-
- xarg = build_non_dependent_expr (xarg);
}
exp = NULL_TREE;
{
if (type_dependent_expression_p (arg))
return build_min_nt_loc (loc, ADDRESSOF_EXPR, arg, NULL_TREE);
-
- arg = build_non_dependent_expr (arg);
}
tree exp = cp_build_addr_expr_strict (arg, complain);
|| (op1 && type_dependent_expression_p (op1))
|| type_dependent_expression_p (op2))
return build_min_nt_loc (loc, COND_EXPR, ifexp, op1, op2);
- ifexp = build_non_dependent_expr (ifexp);
- if (op1)
- op1 = build_non_dependent_expr (op1);
- op2 = build_non_dependent_expr (op2);
}
expr = build_conditional_expr (loc, ifexp, op1, op2, complain);
= build_dependent_operator_type (lookups, COMPOUND_EXPR, false);
return result;
}
- op1 = build_non_dependent_expr (op1);
- op2 = build_non_dependent_expr (op2);
}
result = build_new_op (loc, COMPOUND_EXPR, LOOKUP_NORMAL, op1, op2,
protected_set_expr_location (result, loc);
return result;
}
- else if (processing_template_decl)
- expr = build_non_dependent_expr (expr);
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Strip such NOP_EXPRs if VALUE is being used in non-lvalue context. */
= build_dependent_operator_type (lookups, modifycode, true);
return rval;
}
-
- lhs = build_non_dependent_expr (lhs);
- rhs = build_non_dependent_expr (rhs);
}
tree rval;
if (VOID_TYPE_P (functype))
return error_mark_node;
- if (processing_template_decl)
- retval = build_non_dependent_expr (retval);
-
/* Under C++11 [12.8/32 class.copy], a returned lvalue is sometimes
treated as an rvalue for the purposes of overload resolution to
favor move constructors over copy constructors.
TREE_TYPE (expr) = ttype;
return expr;
}
- expr = build_non_dependent_expr (expr);
}
if (MAYBE_CLASS_TYPE_P (type))