pt.c (instantiate_decl): Do save and restore file position.

* pt.c (instantiate_decl): Do save and restore file position.
	* method.c (build_decl_overload_real): Clear
	numeric_output_need_bar after __.
	* call.c (build_new_method_call): Issue 'incomplete type' error,
	if class is not defined.

From-SVN: r22856
This commit is contained in:
Jason Merrill 1998-10-05 18:10:23 -04:00
parent cac8ce95a1
commit c27be9b9fc
4 changed files with 32 additions and 4 deletions

View File

@ -1,4 +1,18 @@
Tue Oct 6 00:07:14 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_decl): Do save and restore file position.
1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
* method.c (build_decl_overload_real): Clear
numeric_output_need_bar after __.
1998-10-05 Nathan Sidwell <nathan@acm.org>
* call.c (build_new_method_call): Issue 'incomplete type' error,
if class is not defined.
1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* call.c (build_object_call): Move declaration of variable
`fn' into the scope where it is used. Don't access variable

View File

@ -3689,8 +3689,12 @@ build_new_method_call (instance, name, args, basetype_path, flags)
/* XXX will LOOKUP_SPECULATIVELY be needed when this is done? */
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
cp_error ("no matching function for call to `%T::%D (%A)%V'", basetype,
pretty_name, user_args, TREE_TYPE (TREE_TYPE (instance_ptr)));
if (TYPE_SIZE (basetype) == 0)
incomplete_type_error (instance_ptr, basetype);
else
cp_error ("no matching function for call to `%T::%D (%A)%V'",
basetype, pretty_name, user_args,
TREE_TYPE (TREE_TYPE (instance_ptr)));
print_z_candidates (candidates);
return error_mark_node;
}

View File

@ -1527,6 +1527,7 @@ build_decl_overload_real (dname, parms, ret_type, tparms, targs,
and figure out its name without any extra encoding. */
OB_PUTC2 ('_', '_');
numeric_output_need_bar = 0;
if (tparms)
{

View File

@ -8005,6 +8005,8 @@ instantiate_decl (d)
tree gen_tmpl;
int nested = in_function_p ();
int pattern_defined;
int line = lineno;
char *file = input_filename;
/* This function should only be used to instantiate templates for
functions and static member variables. */
@ -8140,7 +8142,11 @@ instantiate_decl (d)
&& ! at_eof))
{
/* Defer all templates except inline functions used in another
function. */
function. We restore the source position here because it's used
by add_pending_template. */
lineno = line;
input_filename = file;
if (at_eof && !pattern_defined
&& DECL_EXPLICIT_INSTANTIATION (d))
/* [temp.explicit]
@ -8213,6 +8219,9 @@ instantiate_decl (d)
}
out:
lineno = line;
input_filename = file;
pop_from_top_level ();
pop_tinst_level ();