aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog16
-rw-r--r--gcc/cp/call.c8
-rw-r--r--gcc/cp/method.c1
-rw-r--r--gcc/cp/pt.c11
4 files changed, 32 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7891064..7bf7f57 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 31c198a..07ed1ae 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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;
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 2702ac5..819fb51 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -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)
{
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 1545c06..83dfde5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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 ();