/* Don't bother with the calculations inside sizeof; they'll ICE if the
source type is incomplete and the pointer value doesn't matter. */
- if (skip_evaluation)
+ if (cp_unevaluated_operand != 0)
{
expr = build_nop (build_pointer_type (target_type), expr);
if (!want_pointer)
if (!vtbl)
vtbl = build_vfield_ref (instance, basetype);
- assemble_external (vtbl);
- aref = build_array_ref (vtbl, idx, input_location);
+ aref = build_array_ref (input_location, vtbl, idx);
TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx);
return aref;
if (complete)
{
DECL_EXTERNAL (decl) = 1;
- finish_decl (decl, NULL_TREE, NULL_TREE);
+ cp_finish_decl (decl, NULL_TREE, false, NULL_TREE, 0);
}
return decl;
DECL_INITIAL (field) = NULL_TREE;
/* Detect invalid bit-field type. */
- if (!INTEGRAL_TYPE_P (type))
+ if (!INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
error ("bit-field %q+#D with non-integral type", field);
w = error_mark_node;
CLASSTYPE_EMPTY_P (t) = 0;
/* Create the FIELD_DECL. */
- decl = build_decl (FIELD_DECL, NULL_TREE, CLASSTYPE_AS_BASE (basetype));
+ decl = build_decl (input_location,
+ FIELD_DECL, NULL_TREE, CLASSTYPE_AS_BASE (basetype));
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
DECL_FIELD_CONTEXT (decl) = t;
stores cannot alias stores to void*! */
tree field;
- field = build_decl (FIELD_DECL, get_vfield_name (t), vtbl_ptr_type_node);
+ field = build_decl (input_location,
+ FIELD_DECL, get_vfield_name (t), vtbl_ptr_type_node);
DECL_VIRTUAL_P (field) = 1;
DECL_ARTIFICIAL (field) = 1;
DECL_FIELD_CONTEXT (field) = t;
if (DECL_C_BIT_FIELD (field)
&& INT_CST_LT (TYPE_SIZE (type), DECL_SIZE (field)))
{
- integer_type_kind itk;
+ unsigned int itk;
tree integer_type;
bool was_unnamed_p = false;
/* We must allocate the bits as if suitably aligned for the
{
tree padding_field;
- padding_field = build_decl (FIELD_DECL,
+ padding_field = build_decl (input_location,
+ FIELD_DECL,
NULL_TREE,
char_type_node);
DECL_BIT_FIELD (padding_field) = 1;
for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL)
{
- *next_field = build_decl (FIELD_DECL,
+ *next_field = build_decl (input_location,
+ FIELD_DECL,
DECL_NAME (field),
TREE_TYPE (field));
DECL_CONTEXT (*next_field) = base_t;
/* Make sure not to create any structures with zero size. */
if (integer_zerop (rli_size_unit_so_far (rli)) && CLASSTYPE_EMPTY_P (t))
place_field (rli,
- build_decl (FIELD_DECL, NULL_TREE, char_type_node));
+ build_decl (input_location,
+ FIELD_DECL, NULL_TREE, char_type_node));
/* Let the back end lay out the type. */
finish_record_layout (rli, /*free_p=*/true);
tree target_arg_types;
tree target_ret_type;
tree fns;
+ tree *args;
+ unsigned int nargs, ia;
+ tree arg;
if (is_ptrmem)
target_fn_type
if (TREE_CODE (target_fn_type) == METHOD_TYPE)
target_arg_types = TREE_CHAIN (target_arg_types);
+ nargs = list_length (target_arg_types);
+ args = XALLOCAVEC (tree, nargs);
+ for (arg = target_arg_types, ia = 0;
+ arg != NULL_TREE && arg != void_list_node;
+ arg = TREE_CHAIN (arg), ++ia)
+ args[ia] = TREE_VALUE (arg);
+ nargs = ia;
+
for (fns = overload; fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
/* Try to do argument deduction. */
targs = make_tree_vec (DECL_NTPARMS (fn));
- if (fn_type_unification (fn, explicit_targs, targs,
- target_arg_types, target_ret_type,
- DEDUCE_EXACT, LOOKUP_NORMAL))
+ if (fn_type_unification (fn, explicit_targs, targs, args, nargs,
+ target_ret_type, DEDUCE_EXACT,
+ LOOKUP_NORMAL))
/* Argument deduction failed. */
continue;
if (flags & tf_error)
{
error ("no matches converting function %qD to type %q#T",
- DECL_NAME (OVL_FUNCTION (overload)),
+ DECL_NAME (OVL_CURRENT (overload)),
target_type);
/* print_candidates expects a chain with the functions in
dependent on overload resolution. */
gcc_assert (TREE_CODE (rhs) == ADDR_EXPR
|| TREE_CODE (rhs) == COMPONENT_REF
- || TREE_CODE (rhs) == COMPOUND_EXPR
- || really_overloaded_fn (rhs));
-
- /* We don't overwrite rhs if it is an overloaded function.
- Copying it would destroy the tree link. */
- if (TREE_CODE (rhs) != OVERLOAD)
- rhs = copy_node (rhs);
+ || really_overloaded_fn (rhs)
+ || (flag_ms_extensions && TREE_CODE (rhs) == FUNCTION_DECL));
/* This should really only be used when attempting to distinguish
what sort of a pointer to function we have. For now, any
/*explicit_targs=*/NULL_TREE,
access_path);
- case COMPOUND_EXPR:
- TREE_OPERAND (rhs, 0)
- = instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags);
- if (TREE_OPERAND (rhs, 0) == error_mark_node)
- return error_mark_node;
- TREE_OPERAND (rhs, 1)
- = instantiate_type (lhstype, TREE_OPERAND (rhs, 1), flags);
- if (TREE_OPERAND (rhs, 1) == error_mark_node)
- return error_mark_node;
-
- TREE_TYPE (rhs) = lhstype;
- return rhs;
-
case ADDR_EXPR:
{
if (PTRMEM_OK_P (rhs))