* decl.c (lang_print_error_function): New fn.
(init_decl_processing): Set print_error_function to use it.
* errfn.c (cp_thing): Don't call maybe_print_template_context here.
* call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
ICS_BAD_FLAG.
* cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
copy-initialization.
From-SVN: r19966
1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
+ * decl.c (lang_print_error_function): New fn.
+ (init_decl_processing): Set print_error_function to use it.
+ * errfn.c (cp_thing): Don't call maybe_print_template_context here.
+
+ * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
+ ICS_BAD_FLAG.
+
+ * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
+ copy-initialization.
+
* class.c (build_vtable_entry): Use int_fits_type_p.
(build_vtable): Pass a signed offset to build_vtable_entry.
(prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
cv-qualification is subsumed by the initialization itself and
does not constitute a conversion. */
+ tree old_ics = *ics;
+
*reference_type = TREE_TYPE (TREE_TYPE (*ics));
*ics = TREE_OPERAND (*ics, 0);
if (TREE_CODE (*ics) == IDENTITY_CONV
&& is_properly_derived_from (TREE_TYPE (*ics), *reference_type))
*ics = build_conv (BASE_CONV, *reference_type, *ics);
+ ICS_USER_FLAG (*ics) = ICS_USER_FLAG (old_ics);
+ ICS_BAD_FLAG (*ics) = ICS_BAD_FLAG (old_ics);
+
return 1;
}
if ((flags & LOOKUP_ONLYCONVERTING)
&& ! (IS_AGGR_TYPE (dtype) && DERIVED_FROM_P (type, dtype)))
- {
- ctor = build_user_type_conversion (type, ctor, flags);
- flags |= LOOKUP_NO_CONVERSION;
- }
+ /* For copy-initialization, first we create a temp of the proper type
+ with a user-defined conversion sequence, then we direct-initialize
+ the target with the temp (see [dcl.init]). */
+ ctor = build_user_type_conversion (type, ctor, flags);
if (ctor)
ctor = build_method_call (NULL_TREE, ctor_identifier,
build_expr_list (NULL_TREE, ctor),
extern tree current_namespace;
extern tree global_namespace;
+extern void (*print_error_function) PROTO((char *));
+
/* Stack of places to restore the search obstack back to. */
/* Obstack used for remembering local class declarations (like
static int member_function_or_else PROTO((tree, tree, char *));
static void bad_specifiers PROTO((tree, char *, int, int, int, int,
int));
+static void lang_print_error_function PROTO((char *));
#if defined (DEBUG_CP_BINDING_LEVELS)
static void indent PROTO((void));
/* Show we use EH for cleanups. */
using_eh_for_cleanups ();
+
+ print_error_function = lang_print_error_function;
+}
+
+/* Function to print any language-specific context for an error message. */
+
+static void
+lang_print_error_function (file)
+ char *file;
+{
+ default_print_error_function (file);
+ maybe_print_template_context ();
}
/* Make a definition for a builtin function named NAME and whose data type
const char *f;
tree atarg = 0;
- /* We call this here so that the calls to cp_error in
- print_template_context don't bash buf. */
- maybe_print_template_context ();
-
len = strlen (format) + 1;
if (len > buflen)
{