* call.c (build_object_call): Don't look at DECL_NAME for a type.
(pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
(typeck.c): Or TYPE_MAIN_VARIANT for a type.
From-SVN: r27068
1999-05-20 Mark Mitchell <mark@codesourcery.com>
+ * call.c (build_object_call): Don't look at DECL_NAME for a type.
+ (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
+ (typeck.c): Or TYPE_MAIN_VARIANT for a type.
+
* pt.c (for_each_template_parm): Rework to match documentation.
Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
return error_mark_node;
}
- if (DECL_NAME (cand->fn) == ansi_opname [CALL_EXPR])
+ /* Since cand->fn will be a type, not a function, for a conversion
+ function, we must be careful not to unconditionally look at
+ DECL_NAME here. */
+ if (TREE_CODE (cand->fn) == FUNCTION_DECL
+ && DECL_NAME (cand->fn) == ansi_opname [CALL_EXPR])
return build_over_call (cand, mem_args, LOOKUP_NORMAL);
obj = convert_like (TREE_VEC_ELT (cand->convs, 0), obj);
}
f = make_typename_type (ctx, f);
+ if (f == error_mark_node)
+ return f;
return cp_build_qualified_type (f,
CP_TYPE_QUALS (f)
| CP_TYPE_QUALS (t));
ifexp = op1 = save_expr (ifexp);
}
+ type1 = TREE_TYPE (op1);
+ code1 = TREE_CODE (type1);
+ type2 = TREE_TYPE (op2);
+ code2 = TREE_CODE (type2);
+ if (op1 == error_mark_node || op2 == error_mark_node
+ || type1 == error_mark_node || type2 == error_mark_node)
+ return error_mark_node;
+
ifexp = cp_convert (boolean_type_node, ifexp);
if (TREE_CODE (ifexp) == ERROR_MARK)
return error_mark_node;
/* C++: REFERENCE_TYPES must be dereferenced. */
- type1 = TREE_TYPE (op1);
- code1 = TREE_CODE (type1);
- type2 = TREE_TYPE (op2);
- code2 = TREE_CODE (type2);
-
if (code1 == REFERENCE_TYPE)
{
op1 = convert_from_reference (op1);