OSDN Git Service

fcf01dd69848772a100dd0ec15fa1a4bfaa6e80b
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 1999-11-02  Mark Mitchell  <mark@codesourcery.com>
2
3         * decl.c (grokfndecl): Remove dead code.
4
5         * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
6
7 1999-11-02  Scott Snyder  <snyder@fnal.gov>
8
9         * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
10         IMAGPART_EXPR.
11         * pt.c (tsubst_copy): Likewise.
12
13 1999-11-01  Jason Merrill  <jason@yorick.cygnus.com>
14
15         * decl2.c (maybe_make_one_only): Always make things comdat on
16         ELF targets, too.
17
18 1999-10-31  Mark Mitchell  <mark@codesourcery.com>
19
20         * decl.c (finish_function): Call free_after_parsing for functions
21         we are not immediately turning into RTL.
22
23 1999-10-31  Brendan Kehoe  <brendan@cygnus.com>
24
25         * cp-tree.h (flag_dump_translation_unit): Add decl.
26
27 Sat Oct 30 22:42:50 1999  Stephen L Moshier <moshier@mediaone.net>
28
29         * lex.c (yylex): Accept 'f' in mantissa of hex float constant.
30
31 1999-10-30  Mark Mitchell  <mark@codesourcery.com>
32
33         * decl.c (pop_cp_function_context): Don't call free on a NULL
34         pointer.
35         * semantics.c: Include ggc.h.
36         (expand_body): Do garbage-collection after processing a template
37         function.  Clear DECL_SAVED_TREE after generating RTL for a
38         function.
39         * Makefile.in (semantics.o): Depend on ggc.h.
40         
41 1999-10-29  Mark Mitchell  <mark@codesourcery.com>
42
43         * cp-tree.h (make_typename_type): Change prototype.
44         * decl.c (make_typename_type): Only complain if so requested.
45         * parse.y (nested_name_specifier): Adjust calls.
46         (typename_sub0): Likewise.
47         (typename_sub1): Likewise.
48         * parse.c: Regenerated.
49         * pt.c (convert_template_argument): Pass complain to
50         make_typename_type.
51         (tsubst): Likewise.
52         
53 1999-10-28  Mark Mitchell  <mark@codesourcery.com>
54
55         * semantics.c (finish_handler): End the scope of the handler
56         before attaching it to the statement-tree.
57
58 1999-10-28  Ian Lance Taylor  <ian@zembu.com>
59
60         * rtti.c (build_dynamic_cast_1): Give a better error message for
61         an attempt to dynamic_cast from a non-polymorphic type.
62
63 1999-10-27  Mark Mitchell  <mark@codesourcery.com>
64
65         * cp-tree.h (make_temp_vec): Remove.
66         (make_scratch_vec): Likewise.
67         * call.c (add_function_candidate): Use make_tree_vec.
68         (add_conv_candidate): Likewise.
69         (build_builtin_candidate): Likewise.
70         (add_template_candidate_real): Likewise.
71         * class.c (resolve_address_of_overloaded_function): Likewise.
72         * decl.c (start_function): Don't fool with the momentary obstack.
73         (finish_function): Likewise.
74         * init.c (expand_direct_vtbls_init): Likewise.
75         (begin_init_stmts): Likewise.
76         (finish_init_stmts): Likewise.
77         * pt.c (add_to_template_args): Use make_tree_vec.
78         (check_explicit_specialization): Likewise.
79         (coerce_template_parms): Likewise.
80         (lookup_template_class): Don't fool with the momentary obstack.
81         (instantiate_class_template): Likewise.
82         (tsubst_template_arg_vector): Use make_tree_vec.
83         (tsubst_aggr_type): Don't fool with the momentary obstack.
84         (tsubst_decl): Likewise.  Use make_tree_vec.
85         (try_one_overload): Likewise.
86         (try_class_unification):  Don't fool with the momentary obstack.
87         (get_bindings_real): Use make_tree_vec.
88         (set_mangled_name_for_template_decl): Likewise.
89         * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
90         * semantics.c (finish_expr_stmt): Likewise.
91         (finish_do_stmt): Likewise.
92         (finish_for_expr): Likewise.
93         (finish_switch_cond): Likewise.
94         (do_pushlevel): Likewise.
95         (do_poplevel): Likewise.
96         * tree.c (make_temp_vec): Remove.
97         
98         * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs.  Dump
99         CLEANUP_P for a TRY_BLOCK.
100         * ir.texi: Document SAVE_EXPR.
101
102 Tue Oct 26 23:29:56 1999  Jeffrey A Law  (law@cygnus.com)
103
104         * call.c (build_over_call):  Check that the built-in function is
105         of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
106         * typeck.c (build_function_call_real): Similarly. 
107
108 1999-10-26  Mark Mitchell  <mark@codesourcery.com>
109
110         * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS.  Don't call
111         remember_end_note.
112
113 1999-10-24  Mark Mitchell  <mark@codesourcery.com>
114
115         * decl.c (push_overloaded_decl_1): Use pushdecl.
116         
117         * decl.c (auto_function): Replace #ifdef'd __inline with just
118         plain inline.
119         * lex.c (my_get_run_time): Likeise.
120         (yyprint): Likewise.
121         (identifier_type): Likewise.
122         * method.c (start_squangling): Likewise.
123         (end_squangling): Likewise.
124         (icat): Likewise.
125         (old_backref_index): Likewise.
126         (flush_repeats): Likewise.
127         (issue_ktype): Likewise.
128         * parse.y (empty_parms): Likewise.
129         * parse.c: Regenerated.
130         
131 1999-10-21  Mark Mitchell  <mark@codesourcery.com>
132
133         * dump.c (dequeue_and_dump): Replace several uses of
134         queue_and_dump_index with dump_child.
135
136 1999-10-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
137
138         * expr.c: Include tm_p.h.
139
140 1999-10-21  Mark Mitchell  <mark@codesourcery.com>
141
142         * cp-tree.h (SCOPE_PARTIAL_P): New macro.
143         (pushlevel_temporary): Remove.
144         (add_scope_stmt): New function.
145         * decl.c (pushlevel_temporary): Remove.
146         (poplevel): Use add_scope_stmt.
147         (start_decl_1): Likewise.
148         * semantics.c (add_scope_stmt): New function.
149         (do_pushlevel): Use it.
150         (do_poplevel): Use it.
151         (expand_stmt): Check SCOPE_PARTIAL_P.
152         
153         * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
154         * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
155         * expr.c (cplus_expand_expr): Expand it.
156         * ir.texi: Document EMPTY_CLASS_EXPR.
157         
158 1999-10-20  Mark Mitchell  <mark@codesourcery.com>
159
160         * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
161         parameters as having namespace scope.
162
163 1999-10-19  Mark Mitchell  <mark@codesourcery.com>
164
165         * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
166         (mangling_flags): New type.
167         (build_overload_int): Change prototype.
168         (build_overload_value): Likewise.
169         (numeric_output_need_bar): Improve comment.
170         (mangle_expression): New function, broken out from ...
171         (build_overload_int): Here.
172         (build_overload_value): Adjust for use of mangling flags.  Don't
173         warn about real-valued template parameters here.  Do handle
174         complex expressions involving real-valued template parameters.
175         (build_template_parm_names): Encase non-type template parameters
176         in underscores, if necessary.
177         (process_overload_item): Remove conditional on
178         PARM_CAN_BE_ARRAY_TYPE.
179
180 1999-10-17  Mark Mitchell  <mark@codesourcery.com>
181
182         * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
183
184         * ir.texi: Clean up documentation of RETURN_INIT.
185         
186 1999-10-15  Greg McGary  <gkm@gnu.org>
187
188         * lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
189         (lang_init): Set default for flag_bounds_check if still "unspecified".
190
191 1999-10-13  Andrew Haley  <aph@cygnus.com>
192
193         * class.c (finish_struct_1): Force alignment of non-bitfields to
194         BITS_PER_UNIT.
195
196 Wed Oct 13 22:01:35 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
197
198         * typeck2.c (process_init_constructor): Handle empty constructors.
199
200 1999-10-13  Jason Merrill  <jason@yorick.cygnus.com>
201
202         * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
203
204         * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
205         array error.
206
207 1999-10-13  Mark Mitchell  <mark@codesourcery.com>
208
209         * decl.c (make_rtl_for_local_static): Don't create register RTL
210         for addressable constants.
211
212 1999-10-13  Nathan Sidwell  <nathan@acm.org>
213
214         * cp-tree.h (build_x_va_arg): Prototype new function.
215         * call.c (build_x_va_arg): Define it.
216         * parse.y (unary_expr): Call build_x_va_arg.
217         
218         * cp-tree.h (convert_type_from_ellipsis): Prototype new function.
219         * call.c (convert_type_from_ellipsis): Define it.
220         * decl.c (init_decl_processing): Set lang_type_promotes_to.
221
222         * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
223
224 1999-10-11  Jason Merrill  <jason@yorick.cygnus.com>
225
226         * class.c (fixed_type_or_null): Always set *nonnull.
227
228 1999-10-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
229
230         * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
231         __GNUC__ and __GNUC_MINOR__.
232
233 1999-10-09  Mark Mitchell  <mark@codesourcery.com>
234
235         * cp-tree.h (make_rtl_for_local_static): New function.  
236         * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
237         local statics ...
238         (make_rtl_for_local_static): Here.
239         * semantics.c (expand_stmt): Use make_rtl_for_local_static.
240         
241 1999-10-08  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
242
243         * method.c: Include tm_p.h.
244
245 1999-10-7   Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
246
247         * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
248         * lex.c (cp_make_lake_type): Likewise.
249         * tree.c (init_tree): Init make_lang_type_fn.
250         
251 1999-10-07  Mark Mitchell  <mark@codesourcery.com>
252
253         * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
254         paramter.
255         
256         * semantics.c (expand_stmt): Don't pretend to have asmspecs for
257         local statics if we don't really have them.
258
259         * ir.texi: Improve documentation for STMT_EXPR.  Describe
260         CLEANUP_POINT_EXPR.
261
262 1999-10-07  Jason Merrill  <jason@yorick.cygnus.com>
263
264         * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
265
266 1999-10-07  Greg McGary  <gkm@gnu.org>
267
268         * class.c (finish_struct_1): Use simpler method of
269         removing elements of a singly-linked list which doesn't
270         lose for classes without data members.
271
272 1999-10-07  Mark Mitchell  <mark@codesourcery.com>
273
274         * friend.c (make_friend_class): Robustify.
275
276         * semantics.c (finish_object_call_expr): Reject calls to template
277         types.
278
279 1999-10-06  Mark Mitchell  <mark@codesourcery.com>
280
281         * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
282
283         * cp-tree.h (CLASSTYPE_VFIELD): Remove.
284         * call.c (build_vfield_ref): Use TYPE_VFIELD, not
285         CLASSTYPE_VFIELD.
286         * class.c (get_vfield_offset): Likewise.
287         (finish_base_struct): Likewise.
288         (modify_one_vtable): Likewise.
289         (fixup_vtable_deltas): Likewise.
290         (finish_struct_1): Likewise.
291         * init.c (expand_virtual_init): Likewise.
292         * search.c (lookup_field_1): Likewise.
293         (expand_upcast_fixups): Likewise.
294         * typeck.c (build_component_ref): Likewise.
295         (build_binary_op_nodefault): Likewise.
296         
297         * dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
298         * ir.texi: Document TYPE_VFIELD.
299
300 1999-10-06  Brendan Kehoe  <brendan@cygnus.com>
301
302         * decl.c (grokdeclarator): Only warn about non-zero arrays if
303         !in_system_header (linux socketbits.h can give this for
304         __cmsg_data, which is using a GNU extension).
305
306 1999-10-05  Mark Mitchell  <mark@codesourcery.com>
307
308         * decl2.c (start_static_storage_duration_function): Push the
309         function declaration so it ends up in namespace scope.
310
311         * dump.c (DUMP_CHILDREN): Remove.
312         (DUMP_BINFO): Adjust.
313         (struct dump_node_info): Remove dump_children_p.
314         (queue_and_dump_type): Remove dump_children_p parameter.
315         (queue): Don't set dump_children_p.
316         (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
317         queue_and_dump_index.
318         (dequeue_and_dump): Unconditionally print children.  Adjust calls
319         to functions mentioned above.
320         (dump_node):  Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
321         
322         * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
323         * dump.c (dequeue_and_dump): Dump them.
324         
325         * method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
326
327         * decl.c (start_function): Set current_in_charge_parm for
328         constructors, too, where appropriate.
329         * search.c (fixup_all_virtual_upcast_offsets): New function.
330         (expand_indirect_vtbls_init): Use it.
331         
332 1999-10-04  Nathan Sidwell  <nathan@acm.org>
333
334         * decl2.c (grok_alignof): Don't decay lvalues.
335         
336         * init.c (build_new): Remove unused variable.
337
338 1999-10-04  Mark Mitchell  <mark@codesourcery.com>
339
340         * cp-tree.h (struct language_function): Remove static_labelno.
341         (static_labelno): Remove macro.
342         * method.c (build_overload_nested_name): Make static_labelno
343         static here.
344         
345         * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
346         to decide whether or not a function is defined.
347
348         * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
349         situations where make_node will do it automatically.
350         * decl.c (grok_reference_init): Likewise.
351         (expand_static_init): Likewise.
352         (do_static_initialization): Likewise.
353         * init.c (perform_member_init): Likewise.
354         (expand_aggr_init_1): Likewise.
355         (build_new_1): Likewise.
356         * method.c (do_build_copy_constructor): Likewise.
357         (do_build_assign_ref): Likewise.
358         * search.c (expand_upcast_fixups): Likewise.
359         * semantics.c (finish_stmt_expr): Likewise.
360         * typeck.c (build_unary_op): Likewise.
361         (check_return_expr): Likewise.
362
363 1999-10-04  Jason Merrill  <jason@yorick.cygnus.com>
364
365         * init.c (build_vec_delete_1): Fold COND_EXPRs.
366
367 1999-10-03  Mark Mitchell  <mark@codesourcery.com>
368
369         * cp-tree.def (VEC_INIT_EXPR): Remove.
370         * cp-tree.h (struct stmt_tree): New type.
371         (struct saved_scope): Remove firstobj.  Add x_saved_tree,
372         x_stmt_tree.
373         (class_cache_firstobj): Remove.
374         (struct language_function): Remove stmts_are_full_exprs_p,
375         x_last_tree, and x_last_expr_type.  Add x_stmt_tree.
376         (current_stmt_tree): New macro.
377         (last_tree): Adjust.
378         (last_expr_type): Likewise.
379         (doing_semantic_analysis_p): Simplify.
380         (stmts_are_full_exprs_p): Adjust.
381         (begin_tree): Remove prototype.
382         (end_tree): Likewise.
383         (begin_stmt_tree): Change prototype.
384         (finish_stmt_tree): Likewise.
385         (building_stmt_tree): Simplify.
386         * decl.c (mark_stmt_tree): New function.
387         (mark_saved_scope): Use it.
388         (start_function): Rearrange slightly to call begin_stmt_tree 
389         earlier.
390         (save_function_data): Tweak.
391         (finish_function): Adjust call to finish_stmt_tree.
392         (mark_lang_function): Use mark_stmt_tree.
393         * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
394         * init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
395         (build_vec_init): Remove creation of stand-in intializer.
396         * pt.c (begin_tree): Remove.
397         (end_tree): Likewise.
398         * semantics.c (SET_LAST_STMT): New macro.  Use it throughout.
399         (begin_compound_stmt): Handle a compound-statement outside of a
400         function.
401         (begin_stmt_expr): Handle a statement-expression outsidef of a
402         function.
403         (finish_stmt_expr): Likewise.
404         (begin_class_definition): Don't call begin_tree.
405         (finish_inline_definitions): Don't call end_tree.
406         (begin_stmt_tree): Take a pointer to tree, not a function as input.
407         (finish_stmt_tree): Likewise.
408         * tree.c (search_tree): Don't handle VEC_INIT_EXPR.
409         (mapcar): Likewise.
410         
411         * parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
412         * parse.c: Regenerated.
413         
414         * dump.c (dqueue_and_dump): Dump bitfieldness.
415         
416         * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
417         bitfields, rather than DECL_BIT_FIELD.
418         * ir.texi: Document how to tell whether or not a field is a
419         bitfield.
420         
421         * lex.c (make_lang_type): Fix typo in comment.
422
423 1999-10-01  Jason Merrill  <jason@yorick.cygnus.com>
424
425         * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
426
427 1999-10-01  Mark Mitchell  <mark@codesourcery.com>
428
429         * pt.c (tsubst_decl): If the type of a template instantiation is
430         bogus, so is the whole instantiation.
431
432 1999-09-30  Mark Mitchell  <mark@codesourcery.com>
433
434         * decl.c (initialize_local_var): Handle static variables here.
435         (cp_finish_decl): Tweak handling of function-scope static
436         variables.
437         * semantics.c (expand_stmt): Handle DECL_STMTs for static
438         variables.
439
440         * method.c (emit_thunk): Don't crash when -fsyntax-only.
441
442         * cp-tree.h (lang_decl_flags): Add global_ctor_p and
443         global_dtor_p.  Add init_priority.
444         (DECL_ACCESS): Adjust accordingly.
445         (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
446         (GLOBAL_INIT_PRIORITY): Likewise.
447         * decl.c (lang_mark_tree): Adjust accordingly.
448         (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P, 
449         and GLOBAL_INIT_PRIORITY.
450         * dump.c (dequeue_and_dump): Print them.
451         * ir.texi: Document them.
452
453         * decl2.c (struct priority_info_s): Remove initialization_sequence
454         and destruction_sequence.
455         (start_static_storage_duration_function): Return the body of the
456         function.  Convert for function-at-a-time mode.
457         (generate_inits_for_priority): Remove.
458         (finish_static_storage_duration_function): Change prototype.
459         Adjust for function-at-a-time mode.
460         (do_static_initialization): Likewise.
461         (do_static_destruction): Likewise.
462         (do_static_initialization_and_destruction): Remove.
463         (start_static_initialization_or_destruction): New function.
464         (finish_static_initialization_or_destruction): Likewise.
465         (get_priority_info): Don't manipulation initialization_sequence or
466         destruction_sequence.
467         (prune_vars_needing_no_initialization): New function.
468         (write_out_vars): Likewise.
469         (finish_file): Use the various new functions instead of the old.
470         
471 Thu Sep 30 00:13:27 1999  Dirk Zoller  <duz@rtsffm.com>
472
473         * cp-tree.h (warn_float_equal): Declare.
474         * decl2.c (warn_float_equal): Define.
475         (lang_decode_option): Recognize -W[no-]float-equal.
476         * typeck.c (build_binary_op_nodefault): Conditionally warn
477         about equality tests of floating point types.
478
479 1999-09-29  Jason Merrill  <jason@yorick.cygnus.com>
480
481         Support normal type_info-based EH mechanisms with -fno-rtti.
482         * except.c (build_eh_type_type): Remove special -fno-rtti handling.
483         (build_eh_type_type_ref): Likewise.
484         (build_eh_type): Remove.
485         (expand_throw): Call build_eh_type_type, not build_eh_type.
486         * decl2.c (import_export_decl): Don't associate the tinfo fn with
487         the vtable if -fno-rtti.
488         * decl.c (init_decl_processing): Always init_rtti_processing.
489
490         * rtti.c (get_typeid): Don't complain about -fno-rtti.
491
492         * class.c (class_cache_obstack, class_obstack): Remove.
493         (init_class_processing): Don't initialize class_obstack.
494         (push_cache_obstack): Remove.
495         (pushclass): Don't call it.
496         * cp-tree.h: Remove prototype for push_cache_obstack.
497         * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
498         (pushlevel_class): Don't push_decl_level.
499         (poplevel_class): Don't pop_stack_level.
500         (push_class_level_binding): Don't push_cache_obstack.
501         (init_decl_processing): Don't intialize decl_obstack.
502         * search.c (push_class_decls): Don't push_cache_obstack.
503         * tree.c (list_hash_add): Put hash node on permanent_obstack.
504         (hash_tree_cons): Don't mess with obstacks.
505         (print_lang_statistics): Don't print stats for class_obstack and
506         decl_obstack.
507
508 1999-09-29  Mark Mitchell  <mark@codesourcery.com>
509
510         * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
511         * ir.texi: Document DECL_EXTERNAL.
512
513         * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
514         * ir.texi: Document THUNK_DECLs.
515
516         * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
517         (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
518         (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
519         * error.c (dump_template_bindings): Remove unused parameter.
520         Handle multiple levels of template parameters.
521         (dump_template_decl): Use `parms', not `args', for template
522         parameters.  Fix thinko.
523         (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION.  Don't pass
524         flags to dump_template_bindings.
525         * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
526         (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
527         (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
528         (tsubst_copy): Clarify variable name.
529         (most_general_template): Robustify.
530         
531 1999-09-29  Nathan Sidwell  <nathan@acm.org>
532
533         * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
534         to change primary template rendering.
535
536 1999-09-29  Mark Mitchell  <mark@codesourcery.com>
537
538         * cp-tree.h (UPT_TEMPLATE): Remove.
539         (UPT_PARMS): Likewise.
540         (DECL_NEEDED_P): New macro.
541         * decl2.c (finish_vtable_vardecl): Use it.
542         (finish_objects): Don't crash with -fsyntax-only.
543         (finish_file): Use DECL_NEEDED_P.  Don't prune vtables when
544         -fsyntax-only.
545         * pt.c (tsubst_friend_function): Remove FIXME that talks about
546         obstacks.
547         (tsubst_expr): Correct handling of function try-blocks.
548         * semantics.c: Include flags.h.
549         (expand_body): Don't do RTL generation if -fsyntax-only.
550         * Makefile.in (semantics.o): Depends on flags.h.
551         
552 1999-09-28  Gabriel Dos Reis  <gdr@codesourcery.com>
553
554         * pt.c (most_general_template): Adjust declaration.
555
556         * cp-tree.h: (most_general_template): Declare.
557
558         * error.c (dump_template_value): Rename to ...
559         (dump_template_argument): This.
560         (dump_template_argument_list): New function.
561         (dump_type): Use it.
562         (dump_template_parameter): New function.
563         (dump_template_decl): Use it.
564         (dump_template_bindings): New function.
565         (dump_function_decl): Use it. Pretty print function template
566         instantiations.
567
568 1999-09-28  Nathan Sidwell  <nathan@acm.org>
569
570         * decl.c (grokdeclarator): Distinguish parameter context for
571         diagnostics. Tidy up missing type diagnostic.
572         Diagnose `explicit' in one place. Diagnose `mutable' in one place.
573
574 1999-09-28  Mark Mitchell  <mark@codesourcery.com>
575
576         * ir.texi: Improve documentation for TARGET_EXPR.
577
578 1999-09-27  Nathan Sidwell  <nathan@acm.org>
579
580         Augment stringification of trees.
581         * cp-tree.h (tree_string_flags): New error stringifying enumeration.
582         (fndecl_as_string, type_as_string_real, args_as_string,
583         code_as_string, language_as_string, parm_as_string,
584         op_as_string, assop_as_string, cv_as_string): Remove.
585         (type_as_string, decl_as_string, expr_as_string): Adjust prototype.
586         (context_as_string): Declare new function.
587         * error.c (cp_printers): Move definition.
588         (OB_UNPUT): Remove.
589         (OB_END_TEMPLATE_ID): Adjust.
590         (interesting_scope_p): Remove.
591         (dump_scope): New static function.
592         (dump_qualifiers): Adjust prototype, reimplement.
593         (dump_template_value): Use tree_string_flags.
594         (dump_type_real): Move back to dump_type.
595         (dump_type): Adjust prototype. Use tree_string_flags.
596         (dump_aggr_type): Likewise. Use dump_template_parms.
597         (dump_type_prefix): Adjust prototype. Use tree_string_flags.
598         Return pad flag.
599         (dump_type_suffix): Adjust prototype. Use tree_string_flags.
600         (dump_simple_decl): Likewise.
601         (dump_decl): Likewise. Use dump_template_decl.
602         (dump_template_decl): New static function broken out of dump_decl.
603         (dump_function_decl): Adjust prototype. Use tree_string_flags.
604         (dump_parameters): Likewise. Prefix space.
605         (dump_exception_spec): Adjust prototype. Use tree_string_flags.
606         (dump_function_name): Likewise. Use dump_template_parms.
607         (dump_template_parms): New static function broken out of
608         dump_function_name.
609         (dump_expr_list): Adjust prototype. Use tree_string_flags.
610         (dump_expr): Likewise.
611         (fndecl_as_string): Removed
612         (type_as_string_real): Removed
613         (dump_binary_op): Adjust prototype. Use tree_string_flags.
614         (dump_unary_op): Likewise.
615         (type_as_string): Likewise.
616         (expr_as_string): Likewise.
617         (decl_as_string): Likewise.
618         (context_as_string): New function.
619         (lang_decl_name): Adjust.
620         (decl_to_string): New static print callback.
621         (expr_to_string): Likewise.
622         (fndecl_to_string): Likewise.
623         (code_as_string): Renamed to ...
624         (code_to_string): ... here. Adjust.
625         (language_as_string): Renamed to ...
626         (language_to_string): ... here. Adjust.
627         (parm_as_string): Renamed to ...
628         (parm_to_string): ... here.
629         (op_as_string): Renamed to ...
630         (op_to_string): ... here.
631         (assop_as_string): Renamed to ...
632         (assop_to_string): ... here.
633         (type_to_string): New static print callback.
634         (args_as_string): Renamed to ...
635         (args_to_string): ... here. Adjust.
636         (cv_as_string): Renamed to ...
637         (cv_to_string): ... here. Adjust.
638         * pt.c (mangle_class_name_for_template): Use tree_string_flags.
639         (print_template_context): Likewise.
640
641 1999-09-26  Mark Mitchell  <mark@codesourcery.com>
642
643         * cp-tree.h (expand_throw): Remove prototype.
644         * except.c (expand_throw): Make it static.  Use tree-generation
645         functions, rather than RTL-generation functions.
646         (build_throw): Use it.
647         * expr.c: Include except.h.
648         (cplus_expand_expr): Don't call expand_throw here.
649         * Makefile.in (expr.o): Depend on except.h.
650         * ir.texi: Update documentation for THROW_EXPR.
651         
652         * decl.c (start_function): Set x_dont_save_pending_sizes rather
653         than calling get_pending_sizes.
654         * init.c (build_new): Don't save and restore
655         immediate_size_expand; instead, assert that it has the expected
656         value already.
657
658 1999-09-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
659
660         * lex.c (compiler_error): Add missing call to va_end().
661
662 1999-09-25  Mark Mitchell  <mark@codesourcery.com>
663
664         * dump.c (dequeue_and_dump): Handle RESULT_DECL.
665         * ir.texi: Document RESULT_DECL and DECL_RESULT.
666
667         * cp-tree.h (check_return_expr): New function.
668         * decl.c (finish_constructor_body): New function.
669         (pushdecl): Put global friend functions in namespace binding
670         level, not the class binding level.
671         (finish_destructor_body): Make sure the dtor_label is always
672         defined.  Fix typo in comment.
673         (finish_function): Move generation of constructor-termination code
674         to semantic-analysis time.  Move generation of implicit `main'
675         return value to semantic-analysis time.
676         * semantics.c (finish_return_stmt): Generate goto's to
677         ctor_label/dtor_label here.  Use check_return_expr to do semantic
678         analysis on the returned expression.
679         * typeck.c (maybe_warn_about_returning_address_of_local): New
680         function split out from c_expand_return.
681         (check_return_expr): Likewise.
682         (c_expand_return): Just generate the RTL for the return.
683         
684 1999-09-24  Mark Mitchell  <mark@codesourcery.com>
685
686         * cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
687         (cleanup_type): Likewise.
688         (search_tree): Change prototype.
689         * decl.c (local_variable_p): Adjust for new interface to
690         search_tree.
691         (check_default_argument): Likewise.
692         * error.c (dump_expr): Handle INIT_EXPR.
693         * except.c (expand_throw): Don't make cleanup_type a local static.
694         * expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
695         * init.c (build_new): Call build_new_1 directly, rather than
696         building a NEW_EXPR.
697         (build_new_1): Tidy.  Don't build a VEC_INIT_EXPR except when
698         processing file-scope initializers.
699         * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
700         * tree.c: Include splay-tree.h
701         (no_linkage_helper): Adjust for new interface to search_tree.
702         (search_tree): Pass around pointers to tree nodes, rather than the
703         nodes themselves.  Handle VEC_INIT_EXPR.
704         (no_linkage_check): Adjust for new interface to search_tree.
705         (mapcar): Handle VEC_INIT_EXPR.
706         (target_remap): New variable.
707         (bot_manip): Use it.
708         (bot_replace): New function.
709         (break_out_target_exprs): Use it to remap all variables used in a
710         default argument expression.
711         * typeck.c (build_modify_expr): Don't crash when outside a
712         function and presented with an INIT_EXPR assignment
713         * Makefile.in (tree.o): Depend on splay-tree.h.
714
715 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
716
717         * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
718         DECL_BUILT_IN.
719         (builtin_function): New arg CLASS.  Arg CODE now of type int.  All
720         callers changed.
721         Set the builtin's DECL_BUILT_IN_CLASS.
722
723 1999-09-24  Mark Mitchell  <mark@codesourcery.com>
724
725         * decl.c (pushdecl): Don't make local declarations of extern
726         variables give the variable a DECL_CONTEXT for the function.
727         (make_rtl_for_nonlocal_decl): Don't fuss with obstacks.  Simplify.
728         Don't accidentally make RTL for local declarations.
729         (emit_local_var): Handle declarations with asm-specifiers here.
730         
731 1999-09-23  Mark Mitchell  <mark@codesourcery.com>
732
733         * ir.texi: Improve documentation for TARGET_EXPRs.  Discuss
734         STMT_IS_FULL_EXPR_P.
735
736         * cp-tree.h (language_function): Add cannot_inline.
737         * decl.c (start_function): Restore current_function_cannot_inline
738         from the saved value.
739         (save_function_data): Save current_function_cannot_inline.
740         * decl2.c (start_objects): Change prototype.  Build the function
741         in function-at-a-time mode.
742         (finish_objects): Likewise.
743         (generate_ctor_or_dtor_function): Adjust accordingly.
744         
745         * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
746         * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
747         Don't call expand_anon_union_decl here
748         * semantics.c (exapnd_stmt): Call it here, instead.
749         * typeck.c (mark_addressable): Addressed variables are implicitly
750         used.
751         
752 1999-09-23  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
753
754         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
755         (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
756         (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
757         * cp-tree.h: Add tree checking macros to various tree access
758         macros. 
759         * ptree.c (print_lang_decl): Test for function or variable
760         before accessing template info.
761
762 1999-09-23  Jason Merrill  <jason@yorick.cygnus.com>
763
764         * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
765         * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
766         * decl2.c (lang_f_options): Add -fshort-wchar.
767         * cp-tree.h: Declare flag_short_wchar.
768         * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned 
769         int' for wchar_t.
770
771 1999-09-23  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
772
773         * ir.texi: Fix formatting errors and typos.
774
775 1999-09-22  Mark Mitchell  <mark@codesourcery.com>
776
777         * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
778
779         * decl.c (pushdecl): Do create a binding for extern "C" functions,
780         but not for their DECL_ASSEMBLER_NAMEs.
781         (lookup_name_current_level): Fix formatting.
782         (xref_tag): Likewise.
783         * decl2.c (start_objects): Mark static constructors and
784         destructors as used.
785
786 1999-09-22  Jason Merrill  <jason@yorick.cygnus.com>
787
788         * decl.c (define_case_label): Don't crash if we're not in a switch.
789
790         * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
791         * lang-options.h: Restore -fthis-is-variable.  Remove help strings
792         for unsupported flags.
793
794 1999-09-21  Jason Merrill  <jason@yorick.cygnus.com>
795
796         * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
797         Accept and warn about -fthis-is-variable.
798
799 1999-09-21  Mark Mitchell  <mark@codesourcery.com>
800
801         * dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
802         CLEANUP_STMT, and SCOPE_STMT.
803
804         * decl2.c (lang_decode_option): Adjust, in the wake of recent
805         changes to option processing.
806
807 1999-09-21  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
808
809         * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
810         function pointer from pmfs with no object given.
811         (convert_for_assignment): Do not return error when converting
812         pmfs.
813
814 1999-09-21  Alex Samuel  <samuel@codesourcery.com>
815
816         * lex.c (internal_filename): New variable.
817         (INTERNAL_FILENAME): New macro.
818         (init_parse): Allocate internal_filename and mark as root.  Use it
819         instead of a string constant.
820
821 1999-09-21  Nathan Sidwell  <nathan@acm.org>
822
823         Reimplement dynamic cast and catch matching.
824         * cp-tree.h (get_dynamic_cast_base_type): Prototype new function
825         * search.c (dynamic_cast_base_recurse): New function.
826         (get_dynamic_cast_base_type): New function for dynamic cast.
827         * rtti.c (build_dynamic_cast_1): Determine source and target
828         class relationship. Call __dynamic_cast_2.
829         * tinfo.h (__user_type_info::upcast): New catch dispatcher.
830         (__user_type_info::dyncast): New dynamic cast dispatcher.
831         (__user_type_info::sub_kind): New nested enumeration.
832         (__user_type_info::contained_p): sub_kind predicate.
833         (__user_type_info::contained_public_p): Likewise.
834         (__user_type_info::contained_nonpublic_p): Likewise.
835         (__user_type_info::contained_nonvirtual_p: Likewise.
836         (__user_type_info::upcast_result): New nested struct.
837         (__user_type_info::dyncast_result): New nested struct.
838         (*::do_upcast): New catch function.
839         (*::do_dyncast): New dynamic cast function.
840         (__user_type_info::find_public_subobj): New dynamic cast
841         helper dispatcher.
842         (*::do_find_public_subobj): New dynamic cast helper function.
843         * tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
844         (__user_type_info::dyncast): Define dynamic cast dispatcher.
845         (*::do_upcast): Define catch function.
846         (*::do_dyncast): Define dynamic cast function.
847         (*::do_find_public_subobj): Define dynamic cast helper function.
848         * tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
849         (__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
850         (__dynamic_cast_2): New dynamic cast runtime.
851
852 1999-09-20  Mark Mitchell  <mark@codesourcery.com>
853
854         * cp-tree.h (finish_stmt_expr): Change prototype.
855         * expr.c (cplus_expand_expr): Adjust call accordingly.
856         * init.c (finish_init_stmts): Likewise.
857         * parse.y (primary): Likewise.
858         * pt.c (tsubst_copy): Likewise.
859         * semantics.c (finish_stmt_expr): Don't take two parameters.
860         Don't remove generated BLOCKs from the block-tree.
861
862         Remove support for assigning to `this'.
863         * NEWS: Note that fact.
864         * class.c (build_vbase_path): Don't check flag_this_is_variable.
865         * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
866         (language_function): Remove assigns_this, just_assigned_this, and
867         x_base_init_expr.  Add x_vcalls_possible_p.  Add vtbls_set_up_p.
868         (base_init_expr): Remove.
869         (current_vcalls_possible_p): New macro.
870         (vtbls_set_up_p): Likewise.
871         (emit_base_init): Change prototype.
872         * decl.c (finish_destructor_body): New function, split out from
873         finish_function.
874         (current_function_assigns_this): Remove.
875         (current_function_just_assigned_this): Likewise.
876         (start_function): Don't set them.
877         (finish_function): Don't check them.  Don't emit
878         base-initialization code here.  Generate code for destructors when
879         doing semantic analysis.
880         (finish_stmt): Don't check current_function_just_assigned_this.
881         * decl2.c (lang_f_options): Remove this-is-variable.
882         (lang_decode_option): Likewise.
883         (grokclassfn): Don't check flag_this_is_variable.
884         * init.c (emit_base_init): Return the expression generated.
885         (construct_virtual_bases): Don't push/pop obstacks.  Fix
886         typo.
887         (build_new_1): Don't check flag_this_is_variable.
888         (get_temp_regvar): Don't set DECL_REGISTER.
889         (build_vec_init): Don't call use_variable.
890         * lang-options.h: Remove "-fthis-is-variable" and
891         "-fno-this-is-variable".
892         * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
893         * search.c (expand_upcast_fixups): Use finish_expr_stmt, not
894         expand_expr_stmt.
895         * semantics.c (finish_expr_stmt_real): Rename to ...
896         (finish_expr_stmt): This.  Remove assigned_this parameter.
897         (begin_if_stmt): Call do_pushlevel before starting the statement.
898         (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
899         blocks.
900         (setup_vtbl_ptr): Emit initialization code for bases and members
901         at semantic-analysis time.  Emit code to initialize vtables in
902         destructors here.
903         (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
904         Don't handle CTOR_INITIALIZER any more.
905         * typeck.c (build_modify_expr): Don't check for assignments to
906         this.
907         (c_expand_return): Don't suggest assigning to `this'.
908         
909         * Makefile.in (decl.o): Depend on RTL_H.
910         (decl2.o): Likewise.
911         (class.o): Likewise.
912         (call.o): Likewise.
913         (method.o): Likewise.
914         (search.o): Likewise.
915         (tree.o): Likewise.
916         (pt.o): Likewise.
917
918         * decl.c (duplicate_decls): When a builtin function is redeclared
919         as static, make sure it is mangled correctly.
920
921         * ir.texi (CTOR_INITIALIZER): Remove mention.  Fix typo.  Add
922         detail about the statement-tree.
923         
924 1999-09-20  Nathan Sidwell  <nathan@acm.org>
925
926         * parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
927
928 1999-09-20  Nick Clifton  <nickc@cygnus.com>
929
930         * decl2.c (lang_decode_option): Extend comment.
931
932 Mon Sep 20 10:49:05 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
933
934         * typeck.c: Include "tm_p.h".
935
936 1999-09-19  Mark Mitchell  <mark@codesourcery.com>
937
938         * ir.texi: New file.
939
940 1999-09-19  Paul Burchard <burchard@pobox.com>
941
942         * semantics.c (expand_stmt): Initialize return value.
943
944 1999-09-18  Paul Burchard <burchard@pobox.com>
945
946         * gxxint.texi: G++ now implements namespaces.
947         
948 1999-09-18  Mark Mitchell  <mark@codesourcery.com>
949
950         * decl.c (pop_label): Don't warn about unused labels more than
951         once.
952         * semantics.c (finish_goto_stmt): Always marked used labels as
953         used.
954
955         * decl.c (layout_var_decl): Change prototype.  Call layout_decl
956         even when the declaration is external.
957         (cp_finish_decl): Adjust call to layout_var_decl.
958         * pt.c (tsubst_expr): Make sure to initialize stmt before using it.
959
960 1999-09-18  Martin von Loewis  <loewis@informatik.hu-berlin.de>
961
962         * typeck.c (get_member_function_from_ptrfunc): Always consider
963         virtuality inside member pointer.
964
965 1999-09-17  Mark Mitchell  <mark@codesourcery.com>
966
967         Turn on function-at-a-time processing.  
968         * cp-tree.h (doing_semantic_analysis_p): New macro.
969         (SF_DEFAULT): Define to zero, not SF_EXPAND.
970         (start_handler_parms): Change prototype.
971         (expand_start_catch_block): Likewise.
972         (expand_end_catch_block): Likewise.
973         (expand_start_eh_spec): Likewise.
974         (expand_end_eh_spec): Declare.
975         (finish_handler_parms): Change prototype.
976         (begin_catch_block): Declare.
977         (finish_handler): Change prototype.
978         (do_pushlevel): Declare.
979         (do_poplevel): Likewise.  
980         * decl.c (pushlevel): Don't create
981         binding levels when not doing semantic analysis.
982         (poplevel): Don't pop them.
983         (pushdecl): Assert that we are never called when not doing
984         semantic analysis.
985         (pushdecl_top_level): Use push_to_top_level.
986         (make_label_decl): Don't fiddle with obstacks.  Make RTL For the
987         label when expanding.
988         (cp_finish_decl): Only inject for-scope variables when doing
989         semantic analysis.  Add comments.
990         (start_handler_parms): Return the handler parm.
991         (start_function): Reorganize.  Don't clear DECL_INITIAL if it is
992         already set.  Reinitialize from saved function data if available.
993         Don't pushlevel when not doing semantic analysis.
994         (store_parm_decls): Only generate RTL when expanding.  Only
995         pushdecl when doing semantic analysis.  Set
996         current_eh_spec_try_block if appropriate.
997         (finish_function): Simplify.  Use do_pushlevel and do_poplevel.
998         Combine common code.  Don't poplevel when not doing semantic
999         analysis.
1000         (push_cp_function_context): Don't expand functions without an
1001         explicit call to expand_body.
1002         (mark_lang_function): Make eh_spec_try_block and
1003         x_scope_stmt_stack.  
1004         * except.c (expand_end_eh_spec): Don't
1005         declare.
1006         (process_start_catch_block): Likewise.
1007         (push_eh_cleanup): Use finish_decl_cleanup.
1008         (initialize_handler_parm): New function.
1009         (expand_start_catch_block): Use it.
1010         (expand_end_catch_block): Use tree-generation functions, not
1011         RTL-generation functions.
1012         (expand_start_eh_spec): Likewise.
1013         (expand_end_eh_spec): Likewise.
1014         (expand_exception_blocks): Simplify.
1015         (start_anon_func): Use do_pushlevel.
1016         (end_anon_func): Use do_poplvel.  Call expand_body for the
1017         function.  
1018         * expr.c (do_case): Don't call define_case_label.  
1019         * init.c (create_temporary_var): Set DECL_CONTEXT for local
1020         variables.  
1021         * method.c (emit_thunk): Call expand_body for the
1022         thunk.
1023         (sythesize_method): Likewise.  
1024         * parse.y (handler_args): Give it ttype.
1025         (eat_saved_input): Call expand_body.
1026         (base_init): Use do_pushlevel.
1027         (pending_inline): Call expand_body.
1028         (handler): Adjust calls to finish_handler_parms and
1029         finish_handler.
1030         (handler_args): Don't call expand_start_catch_block.  Return the
1031         catch parameter.  * pt.c (tsubst_expr): Adjust HANDLER handling.
1032         * parse.c: Regenerated.
1033         * rtti.c (synthesize_tinfo_fn): Call finish_function.  
1034         * semantics.c (do_pushlevel): Give it external linkage.  Build
1035         SCOPE_STMTs.
1036         (do_poplevel): Likewise.
1037         (finish_case_label): Call define_case_label when doing semantic
1038         analysis.
1039         (finish_goto_stmt): Create RTL for labels.
1040         (finish_function_try_block): Set in_function_try_handler
1041         unconditionally.
1042         (finish_function_handler_sequence): Unset it.
1043         (finish_handler_parms): Use expand_start_catch_block even when
1044         building a statement-tree.
1045         (begin_catch_block): New function.
1046         (finish_handler): Move a little RTL-generation logic here.
1047         (finish_decl_cleanup): Allow cleanups for empty declarations.
1048         (finish_named_return_value): Don't pushdecl when not doing
1049         semantic analysis.
1050         (expand_stmt): Don't do semantic analysis for variable
1051         declarations.  Handle START_CATCH_STMT.  Call expand_label
1052         directly for a LABEL_STMT.  Tweak handling of GOTO_STMT.  Adjust
1053         HANDLERs.  Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
1054         (expand_body): Let expand_stmt handle CTOR_INITIALIZER,
1055         RETURN_INIT and function try blocks.
1056         
1057         * cp-tree.h (language_function): Add x_eh_spec_try_block.  Add
1058         x_scope_stmt_stack.  Add x_in_charge_parm.
1059         (current_eh_spec_try_block): New macro.
1060         (current_scope_stmt_stack): Likewise.
1061         (current_in_charge_parm): Likewise.
1062         * decl.c (start_function): Initialize current_in_charge_parm.
1063         (finish_function): Use current_in_charge_parm rather than looking
1064         up __in_chrg.
1065         * search.c (expand_indirect_vtbls_init): Likewise.
1066
1067         * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
1068         (TRY_BLOCK): Likewise.
1069         (HANDLER): Likewise.
1070         (START_CATCH_STMT): New tree node.
1071         (SCOPE_STMT): Likewise.
1072         * cp-tree.h (SCOPE_BEGIN_P): New macro.
1073         (SCOPE_NULLIFIED_P): Likewise.
1074         (struct lang_decl_flags): Add pending_inline_p.  Adjust dummy.
1075         (struct lang_decl): Add saved_language_function.
1076         (DECL_PENDING_INLINE_INFO): Adjust documentation.
1077         (DECL_PENDING_INLINE_P): New macro.
1078         (TYPE_TI_ARGS): Fix typo in comment.
1079         (DECL_SAVED_TREE): Add to documentation.
1080         (DECL_SAVED_FUNCTION_DATA): New macro.
1081         (START_CATCH_TYPE): Likewise.
1082         (SCOPE_END_P): New macro.
1083         (declare_parm_level): Don't declare.
1084         * decl.c (mark_lang_function): New function, split out from
1085         mark_cp_function_context.
1086         (save_function_data): New function.
1087         (declare_parm_level): Remove.
1088         (finish_function): Use save_function_data to squirrel away
1089         important stuff for later use.
1090         (mark_cp_function_context): Use mark_function_data.
1091         (lang_mark_tree): Likewise.
1092         * lex.c (begin_definition_of_inclass_inline): Set
1093         DECL_PENDING_INLINE_P.
1094         (store_pending_inline): Clear it.
1095         * pt.c (tsubst_decl): Likewise.
1096
1097 1999-09-17  Nathan Sidwell  <nathan@acm.org>
1098
1099         * call.c (perform_implicit_conversion): Deal with error_mark_node.
1100
1101 1999-09-17  Mark Mitchell  <mark@codesourcery.com>
1102
1103         * decl.c (warn_extern_redeclared_static): Don't get confused by
1104         static member functions.
1105         (duplicate_decls): Merge DECL_THIS_STATIC.
1106
1107         * decl.c (expand_static_init): Make sure assignments to local
1108         statics actually occur.
1109
1110 1999-09-17  Mark Mitchell  <mark@codesourcery.com>
1111
1112         * cp-tree.h (poplevel_class): Declare.
1113         * class.c (popclass): Use poplevel_class, not poplevel.
1114         * decl.c (poplevel_class): Don't make it static.  Don't return a
1115         value.
1116         (poplevel): Don't call poplevel_class; abort in a class
1117         binding level is seen.
1118         * semantics.c (finish_translation_unit): Use pop_everything.
1119         * parse.y (member_init): Allow errors.
1120         (pending_inline): Call finish_function.
1121         * parse.c: Regenerated.
1122         * Makefile.in (CONFLICTS): Adjust.
1123
1124 1999-09-17  Gabriel Dos Reis  <gdr@codesourcery.com>
1125         
1126         * error.c: Reduce code duplication.
1127         (dump_template_value): New function.
1128         (dump_type_real): Use it.
1129         (dump_decl): Likewise.
1130         (dump_function_name): Likewise.
1131         (dump_function_decl): Don't be too talkative about function return
1132         type variety.
1133
1134 1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1135
1136         * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
1137
1138         * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
1139
1140 1999-09-16  Jason Merrill  <jason@yorick.cygnus.com>
1141
1142         * decl2.c (finish_file): Also call check_global_declarations for
1143         the pending_statics list.
1144
1145 1999-09-15  Jason Merrill  <jason@yorick.cygnus.com>
1146
1147         * lex.c (cp_pragma_implementation): Allow #pragma implementation
1148         in header files.
1149
1150 1999-09-15  Richard Henderson  <rth@cygnus.com>
1151
1152         * lex.c (mark_impl_file_chain): Follow the next chain.
1153
1154 1999-09-15  Mark Mitchell  <mark@codesourcery.com>
1155
1156         * decl.c (warn_extern_redeclared_static): Simplify.  Catch
1157         problems with extern "C" functions redeclared as static.
1158         (duplicate_decls): When a builtin is redeclared static, make the
1159         new function have internal linkage.
1160         
1161 1999-09-15  Mark Mitchell  <mark@codesourcery.com>
1162
1163         * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
1164         * pt.c (tsubst_copy): Likewise.
1165         * tree.c (search_tree): Likewise.
1166         (mapcar): Likewise.
1167
1168 1999-09-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1169
1170         * typeck2.c (ack): Don't declare progname.
1171
1172 1999-09-14  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
1173
1174         * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
1175         filenames with ggc_alloc_string.
1176
1177 1999-09-14  Mark Mitchell  <mark@codesourcery.com>
1178
1179         * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the 
1180         TARGET_EXPR.
1181         * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
1182         the TARGET_EXPR.
1183         * cvt.c (build_up_reference): Likewise.
1184         * tree.c (build_cplus_new): Likewise.
1185         (get_target_expr): Likewise.
1186         
1187 Tue Sep 14 01:45:10 1999  Marc Espie <espie@cvs.openbsd.org>
1188
1189         * Makefile.in:  Prepend $(SHELL) to move-if-change calls.
1190
1191 1999-09-13  Mark Mitchell  <mark@codesourcery.com>
1192
1193         * cp-tree.h (build_target_expr): New function.
1194         * call.c (build_conditional_expr): Use build_target_expr.
1195         (convert_like): Likewise.
1196         (build_over_call): Likewise.
1197         * cvt.c (build_up_reference): Likewise.
1198         * decl.c (build_cleanup_on_safe_obstack): Fold into ...
1199         (destroy_local_var): Here.
1200         (build_target_expr): New function.
1201         * tree.c (build_cplus_new): Use it.
1202         (get_target_expr): Likewise.
1203
1204 1999-09-13  Nathan Sidwell  <nathan@acm.org>
1205
1206         * typeck.c (expr_sizeof): Don't decay arrays and functions.
1207         Remove misleading comment.
1208         (build_compound_expr): Don't decay arrays.
1209
1210 1999-09-13  Jason Merrill  <jason@yorick.cygnus.com>
1211
1212         * call.c (build_conditional_expr): Always use a TARGET_EXPR for
1213         class rvalues again.
1214
1215 Sun Sep 12 23:29:07 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1216
1217         * Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
1218
1219         * g++spec.c: Include gcc.h.
1220         (lang_specific_driver): Constify a char*.  Call xcalloc, not
1221         xmalloc/bzero.  All calls to the function pointer parameter now
1222         explicitly call `fatal'.
1223
1224 1999-09-12  Mark Mitchell  <mark@codesourcery.com>
1225
1226         * call.c (implicit_conversion): Robustify.  Handle OFFSET_REFs.
1227         * cvt.c (ocp_convert): Complete the from and destination types.
1228         Adjust warning about functions always being `true' in conditionals.
1229         * decl.c (duplicate_decls): Don't play funny games with abort.
1230         * error.c (dump_expr): Handle OVERLOADs.
1231         * spew.c (probe_obstack): Remove.
1232         * typeck.c (condition_conversion): Use perform_implicit_conversion.
1233         
1234 1999-09-12  Bernd Schmidt  <bernds@cygnus.co.uk>
1235
1236         * cp-tree.h (auto_function, define_function): Adjust prototypes.
1237         * decl.c (define_function): Lose FUNCTION_CODE arg.  All callers
1238         changed.
1239         (auto_function): Likewise, for CODE arg.
1240         Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
1241         (builtin_function): ... here.
1242
1243 1999-09-11  Mark Mitchell  <mark@codesourcery.com>
1244
1245         * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
1246         (init_decl_processing): Don't set TREE_PERMANENT for the
1247         error_mark_node.
1248         (start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
1249         (grokdeclarator): Likewise.
1250         (grokparms): Don't check TREE_PERMANENT when building up lists.
1251         * decl2.c (grokfield): Don't assert TREE_PERMANENT.
1252         (mark_inline_for_output): Likewise.
1253         * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
1254         * init.c (build_offset_ref): Don't check TREE_PERMANENT.
1255         * lex.c (check_newline): Don't check ggc_p; it is always one.
1256         * pt.c (process_template_parm): Don't check TREE_PERMANENT.
1257         * spew.c (yylex): Don't copy_node or probe_obstacks for
1258         non-permanent CONSTANTs and STRINGs.
1259         * tree.c (build_cplus_array_type_1): Don't fuss with
1260         TREE_PERMANENT on ARRAY_TYPEs.
1261         
1262         * cp-tree.def (CLEANUP_STMT): New node.
1263         * cp-tree.h (language_function): Add name_declared.
1264         (current_function_name_declared): New macro.
1265         (CLEANUP_DECL): New macro.
1266         (CLEANUP_EXPR): Likewise.
1267         (emit_local_var): Likewise.
1268         (finish_decl_cleanup): New function.
1269         * cvt.c (build_up_reference): Simplify.
1270         (ocp_convert): Remove dead code.
1271         * decl.c (start_decl): Remove call to add_decl_stmt.
1272         (grok_reference_init): Adjust, to handle bindings temporaries to
1273         references.  Remove dead code.
1274         (initialize_local_var): Don't generate RTL for
1275         declarations here, or build cleanups here.  Don't fuss with
1276         obstacks.  Replace expand_start_target_temps calls with explicit
1277         setting of stms_are_full_exprs_p.
1278         (destroy_local_var): New function.
1279         (emit_local_var): Likewise.
1280         (cp_finish_decl): Use them, as appropriate.
1281         (start_function): Announce template functions.
1282         (store_parm_decls): Don't call declare_function_name here.
1283         (finish_stmt): Don't start emit base-initialization code when just
1284         building the statement-tree.
1285         * init.c (create_temporary_var): Move add_decl_stmt call ...
1286         (get_temp_regvar): Here.
1287         * pt.c (tsubst_expr): Make DECL_INITIAL look like what
1288         cp_finish_decl would expect.  Don't call add_decl_stmt.
1289         * semantics.c (begin_compound_stmt): Call declare_function_name,
1290         if appropriate.
1291         (finish_decl_cleanup): New function.
1292         (expand_stmt): Use emit_local_var to output variables.          
1293         (expand_body): Set current_funtion_name_declared.
1294         
1295 1999-09-10  Mark Mitchell  <mark@codesourcery.com>
1296
1297         * cp-tree.h (finish_cleanup_try_block): New function.
1298         * semantics.c (finish_cleanup_try_block): Add comment.
1299
1300 Fri Sep 10 10:32:32 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
1301
1302         * cp-tree.h: Delete declarations for all tree nodes now moved to
1303         global_trees.
1304         * decl.c: Delete their definitions.
1305         (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
1306         FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
1307         provide defaults.
1308         (init_decl_processing): Call build_common_tree_nodes and
1309         build_common_tree_nodes_2 instead of building their nodes here.
1310         Don't add gc roots for them.
1311
1312 1999-09-10  Mark Mitchell  <mark@codesourcery.com>
1313
1314         * cp-tree.h (language_function): Rename expanding_p to
1315         x_expanding_p.  Rename named_label_uses to x_named_label_uses.
1316         (expanding_p): Adjust accordingly.
1317         (TREE_VIA_PRIVATE): Fix typo in comment.
1318         (DECL_REFERENCE_SLOT): Remove.
1319         (SET_DECL_REFERENCE_SLOT): Likewise.
1320         * decl.c (named_label_uses): Adjust. Remove chicken comment.
1321         (push_overloaded_decl): Don't truncate the chain of bindings when
1322         adding an overloaded function.
1323         (grok_reference_init): Don't use DECL_REFERENCE_SLOT.
1324         (initialize_local_var): Fix typo in comment.
1325         (store_parm_decls): Don't set DECL_REFERENCE_SLOT.  Tidy up.
1326         * decl2.c (start_objects): Make the fact that we are expanding
1327         the generated function right away explicit.
1328         (start_static_storage_duration_function): Likewise.
1329         (finish_file): Fix typo in comment.
1330         * init.c (build_vec_init): Correct bugs in handling cleanups.
1331         * semantics.c (maybe_convert_cond): New function.
1332         (FINISH_COND): Always store the condition, even if there's
1333         a declaration.
1334         (finish_if_stmt_cond): Use maybe_convert_cond.
1335         (finish_while_stmt_cond): Likewise.
1336         (finish_do_stmt): Likewise.
1337         (finish_for_cond): Likewise.
1338         (expand_cond): Adjust.
1339         
1340         * cp-tree.h (FN_TRY_BLOCK_P): New macro.
1341         * init.c (perform_member_init): Remove obstack machinations.
1342         (expand_cleanup_for_base): Likewise.
1343         (finish_init_stmts): Mark the statement-expression as used.
1344         * method.c (emit_thunk): Use tree-generating functions, not
1345         RTL.
1346         (do_build_copy_constructor): Likewise.
1347         (do_build_assign_ref): Likewise.
1348         (synthesize_method): Likewise.  Keep track of line numbers.
1349         * pt.c (tsubst_expr): Handle various kinds of try blocks.
1350         * semantics.c (expand_stmts): Remove.
1351         (begin_function_try_block): Set FN_TRY_BLOCK_P.
1352         (finish_function_try_block): Be careful rechaining 
1353         function try blocks.
1354         (expand_stmt): Loop through all the statements at a given level.
1355         (exapnd_body): Be careful with line-numbers here too.  Prepare for
1356         being called directly from the parser.
1357
1358         * cp-tree.h (finish_function): Adjust prototype.
1359         * decl.c (finish_function): Return the function compiled.
1360         * pt.c (instantiate_decl): Don't play games with obstacks.
1361         * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
1362         (search_tree): Likewise.
1363         * typeck.c: Fix typo in comment.
1364         * typeck2.c (store_init_value): Add comment.
1365
1366         * cp-tree.h (CPTI_ATEXIT): New macro.
1367         (atexit_node): Likewise.
1368         * decl.c (destroy_local_static): New function, broken out from ...
1369         (expand_static_init): Here.
1370
1371         * rtti.c (get_tinfo_var): These should always be global
1372         (expand_si_desc): Use tree, not RTL, functions to generate code.
1373         (expand_class_desc): Likewise.
1374         (expand_ptr_desc): Likewise.
1375         (expand_attr_desc): Likewise.
1376         (expand_generic_desc): Likewise.
1377         (synthesize_tinfo_fn): Likewise.
1378
1379 1999-09-09  Mark Mitchell  <mark@codesourcery.com>
1380
1381         * semantics.c (RECHAIN_STMTS): Remove `last' parameter.
1382         (RECHAIN_STMTS_FROM_LAST): Remove.  Replace all uses with
1383         RECHAIN_STMTS. 
1384         (RECHAIN_STMST_FROM_CHAIN): Likewise.
1385
1386         * parse.y (simple_stmt): Fix typo in last change.
1387
1388         * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
1389         (STMT_IS_FULL_EXPR_P): Likewise.
1390         (STMT_LINENO_FOR_FN_P): Likewise.
1391         (prep_stmt): New function.
1392         (building_stmt_tree): Tweak for safety.
1393         * pt.c (tsubst_expr): Use prep_stmt throughout.
1394         (add_tree): Move it to semantics.c
1395         * semantics.c (add_tree): Move it here.
1396         (finish_expr_stmt_real): New function.
1397         (finish_expr_stmt): Use it.
1398         (finish_if_stmt_cond): Use FINISH_COND.
1399         (finish_while_stmt_cond): Likewise.
1400         (finish_for_cond): Likewise.
1401         (finish_stmt_tree): Tweak line-number handling.
1402         (prep_stmt): New function.
1403         (expand_stmt): Use it.
1404         
1405         * cp-tree.h (begin_switch_stmt): Adjust prototype.
1406         (finish_switch_cond): Likewise.
1407         * parse.y (simple_stmt): Adjust accordingly.
1408         * parse.c: Regenerated.
1409         * pt.c (tsubst_expr): Adjust accordingly.
1410         * semantics.c (expand_cond): New function.
1411         (FINISH_COND): New macro.
1412         (begin_switch_stmt): Build the SWITCH_STMT here.
1413         (finish_switch_stmt_cond): Not here.
1414         (expand_stmt): Adjust calls to begin_switch_stmt and
1415         finish_switch_cond.  Use expand_cond throughout.
1416
1417         * dump.c (dequeue_and_dump): Dump types for constants.
1418         Describe DECL_ARG_TYPE more intuitively.
1419         Handle ARRAY_REF.
1420
1421         * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
1422         (lang_cleanup_tree): Remove.
1423         * lex.c (make_lang_type): Use ggc_alloc to allocate
1424         TYPE_LANG_SPECIFIC.
1425
1426         Reorganize per-function data.
1427         * cp-tree.h (saved_scope): Add function_decl, bindings.
1428         (language_function): Rename binding_level to bindings.
1429         (cp_function_chain): Use the current_function, not the
1430         outer_function_chain.
1431         (current_class_ptr): Make it work, even when there's no 
1432         current function.
1433         (current_class_ref): Likewise.
1434         (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New 
1435         macros.
1436         (clear_temp_name): Remove.
1437         * decl.c (check_function_type): New function, broken out from
1438         start_function.
1439         (current_binding_level): Adjust definition.
1440         (pushlevel): Simplify.
1441         (poplevel): Don't use named_label_uses when we're outside
1442         a function scope.
1443         (mark_saved_scope): Mark function_decl and bindings.
1444         (maybe_push_to_top_level): Don't unconditionally push a new
1445         function context.  Save bindings and the current_function_decl.
1446         Don't clear named_labels.
1447         (pop_from_top_level): Pop function context if appropriate.
1448         (init_decl_processing): Set init_lang_status and free_lang_status,
1449         rather than save_lang_status and restore_lang_status.
1450         (start_function): Take SF_* flags.  Don't clear per-function data.
1451         Reorder and simplify to use new per-function data code.  Add
1452         asserts.
1453         (store_parm_decls): Don't call init_function_start here.
1454         (finish_function): Adjust for new handling of per-function data.
1455         (push_cp_function_context): Simplify.
1456         (mark_cp_function_context): Change binding_level to bindings.
1457         * decl2.c (clear_temp_name): Remove.
1458         (start_objects): Use SF flags to start_function.
1459         (start_static_storage_duration_function): Likewise.
1460         * except.c (start_anon_func): Remove redundant calls to 
1461         push_function_context_to.  Use SF flags to start function.
1462         (end_anon_func): Remove redundant call to pop_function_context
1463         from.
1464         * lex.c (reinit_parse_for_function): Don't initialize per-function 
1465         data.
1466         * method.c (emit_thunk): Clear current_function after calling
1467         assemble_end_function.  Use SF flags for start_function.
1468         (synthesize_method): Use SF flags for start_function.
1469         * parse.c: Regenerated.
1470         * parse.y (fn.defpen): Likewise.
1471         (pending_inline): Clear current_function, even if something goes
1472         wrong.
1473         * pt.c (instantiate_decl): Use SF flags to start_function.
1474         Don't save and restore expanding_p.
1475         (add_tree): Handle the case where we are outside any function.
1476         (end_tree): Likewise.
1477         * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
1478         * semantics.c (begin_function_definition): Likewise.
1479         (expand_body): Likewise.
1480         
1481 1999-09-09  Nathan Sidwell  <nathan@acm.org>
1482
1483         * cp-tree.h (convert_to_void): Prototype new function.
1484         (require_complete_type_in_void): Remove prototype.
1485         * cvt.c (convert_to_void): New function.
1486         (ocp_convert): Use convert_to_void.
1487         * decl.c (cplus_expand_expr_stmt): Likewise, for complete
1488         expressions.
1489         * typeck.c (require_complete_type_in_void): Remove function.
1490         (build_compound_expr): Use convert_to_void.
1491         (build_static_cast): Likewise.
1492         (build_c_cast): Likewise.
1493         * semantics.c (finish_expr_stmt): Do not decay full expressions.
1494         
1495         * typeck.c (build_x_compound_expr): Add FIXME.
1496
1497 1999-09-08  Mark Mitchell  <mark@codesourcery.com>
1498
1499         * cp-tree.h (scratch_tree_cons): Remove.
1500         * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
1501         and perm_tree_cons with plain tree_cons.
1502         * class.c: Likewise.
1503         * decl.c: Likewise.
1504         * decl2.c: Likewise.
1505         * except.c: Likewise.
1506         * expr.c: Likewise.
1507         * init.c: Likewise.
1508         * lex.c: Likewise.
1509         * method.c: Likewise.
1510         * parse.y: Likewise.
1511         * pt.c: Likewise.
1512         * repo.c: Likewise.
1513         * rtti.c: Likewise.
1514         * search.c: Likewise.
1515         * typeck.c: Likewise.
1516         * parse.c: Regenerated.
1517         * tree.c (build_srcloc): Simplify.
1518         
1519 1999-09-08  Mark Mitchell  <mark@codesourcery.com>
1520
1521         * cp-tree.h (lang_decl_flags): Remove permanent_attr.
1522         Remove next.
1523         (LANG_DECL_PERMANENT): Remove.
1524         * decl.c (duplicate_decls): Don't mess about with obstacks trying
1525         to free memory.
1526         (lang_mark_tree): Mark DECL_LANG_SPECIFIC.
1527         * lex.c (free_lang_decl_chain): Remove.
1528         (build_lang_decl): Don't use obstacks.
1529         (retrofit_lang_decl): Likewise.
1530         (copy_lang_decl): Likewise.
1531
1532         * cp-tree.h (saved_scope): Remove old_binding_level and 
1533         function_decl.  Tidy up.
1534         * decl.c (mark_saved_scope): Don't set them.
1535         (maybe_push_to_top_level): Clear memory.
1536
1537         * decl.c (layout_var_decl): Change prototype.  Don't complete
1538         types for external objects.
1539         (check_initializer): Likewise.  Tidy.
1540         (initialize_local_var): Complete types here.
1541         (cp_finish_decl): Not here.  Reorganize a little.
1542         (grokvardecl): Don't complete types here.
1543
1544         * decl.c (start_function): Clear last_dtor_insn and
1545         last_parm_cleanup_insn. 
1546         (push_cp_function_context): Just copy over a little of
1547         the old context, not all of it.
1548
1549         * cp-tree.h (copy_to_permanent): Remove.
1550         (permanent_p): Likewise.
1551         * decl.c (building_typename_type): Don't use copy_to_permanent.
1552         (start_decl): Likewise.
1553         (grok_reference_init): Likewise.
1554         (cp_finish_decl): Likewise.
1555         * init.c (build_new_1): Don't use mapcar.
1556         (build_vec_delete_1): Don't use copy_to_permanent.
1557         (build_vec_init): Likewise.
1558         * parse.y (primary): Likewise.
1559         * parse.c: Regenerated.
1560         * pt.c (push_template_decl_real): Don't use copy_to_permanent.
1561         (lookup_template_class): Likewise.
1562         (tsubst_friend_function): Likewise.
1563         (instantiate_class_template): Likewise.
1564         (tsubst_decl): Likewise.
1565         (tsubst): Likewise.
1566         (instantiate_template): Likewise.
1567         (unify): Likewise.
1568         * rtti.c (get_tinfo_fn): Likewise.
1569         (build_dynamic_cast): Likewise.
1570         * semantics.c (finish_if_stmt_cond): Likewise.
1571         (finish_while_stmt_cond): Likewise.
1572         (finish_do_stmt): Likewise.
1573         (finish_for_cond): Likewise.
1574         (finish_for_expr): Likewise.
1575         (finish_cleanup): Likewise.
1576         (add_decl_stmt): Likewise.
1577         (finish_named_return_value): Likewise.
1578         (finish_qualified_call_expr): Likewise.
1579         * tree.c (perm_manip): Remove.
1580         (build_exception_variant): Don't use copy_to_permanent.
1581         (permanent_p): Remove.
1582         (copy_to_permament): Remove.
1583         (build_min_nt): Don't use copy_to_permanent.
1584         (build_min): Likewise.
1585         (min_tree_cons): Likewise.
1586         * typeckc.c (build_static_cast): Likewise.
1587         (build_reinterpret_cast): Likewise.
1588         (build_const_cast): Likewise.
1589         
1590 1999-09-07  Mark Mitchell  <mark@codesourcery.com>
1591
1592         * decl.c (ggc_p): Set it to 1.
1593         (mark_saved_scope): Add prototype.
1594
1595 1999-09-07  Richard Henderson  <rth@cygnus.com>
1596
1597         * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
1598         * typeck.c (self_promoting_args_p): Delete.
1599
1600 1999-09-07  Jason Merrill  <jason@yorick.cygnus.com>
1601
1602         * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
1603         (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
1604
1605 1999-09-07  Mark Mitchell  <mark@codesourcery.com>
1606
1607         * Makefile.in (tree.o): Depend on ggc.h.
1608         * class.c (make_method_vec): Remove.
1609         (free_method_vec): Likewise.
1610         (free_method_vecs): Remove.
1611         (add_method): Don't use them.
1612         * cp-tree.def (PTRMEM_CST): Make it longer.
1613         (TEMPLATE_PARM_INDEX): Make it shorter.
1614         * cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
1615         (template_parm_index): Remove RTL field.
1616         (ptrmem_cst): Add RTL field.
1617         (finish_function): Removed parameter.
1618         (process_next_inline): Change prototype.
1619         (init_cplus_unsave): Rename to init_tree.
1620         (binding_init): Remove.
1621         * decl.c (free_binding_nodes): Remove.
1622         (push_binding): Don't use them.  Set BINDING_HAS_LEVEL_P.
1623         (pop_binding): Don't use free_binding_nodes.
1624         (free_binding_vecs): Remove.
1625         (store_bindings): Don't use them.
1626         (pop_from_top_level): Likewise.
1627         (lookup_namespace_name): Simplify.
1628         (build_typename_type): Don't use obstack_free.
1629         (unqualified_namespace_lookup): Simplify.
1630         (lookup_name_real): Simplify.
1631         (start_function): Remove comment about leaks.
1632         (finish_function): Removed nested parameter.  Call
1633         expand_end_bindings even when building_stmt_tree.
1634         Call ggc_push_context and ggc_pop_context around
1635         rest_of_compilation, if necessary.
1636         (mark_cp_function_context): Handle a NULL language-context.
1637         (lang_mark_false_label_stack): Fix typo.
1638         (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
1639         TEMPLATE_PARM_INDEX.  Handle the funny TYPE_LANG_SPECIFIC on
1640         pointer to method types.
1641         (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
1642         * decl2.c (finish_objects): Adjust call to finish_function.
1643         (finish_static_store_duration_function): Likewise.
1644         (do_nonmember_using_decl): Remove call to binding_init.
1645         * except.c (end_anon_func): Adjust call to finish_function.
1646         * lex.c (mark_impl_file_chain): New function.
1647         (init_parse): Call init_tree, not init_cplus_unsave.
1648         Add GC roots.
1649         (cp_pramga_interface): Use xmalloc, not permalloc.
1650         (cp_pragma_implementation): Likewise.
1651         (begin_definition_of_inclass_inline): Simplify.
1652         (process_next_inline): Adjust prototype.
1653         (do_scoped_id): Don't call binding_init.
1654         (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
1655         * method.c (emit_thunk): Adjust call to finish_function.
1656         (synthesize_method): Likewise.
1657         * parse.y (%union): Add a new `pi' variant.
1658         (PRE_PARSED_FUNCTION_DECL): Use it.
1659         (fn.defpen): Likewise.
1660         (fndef): Adjust call to finish_function.
1661         * pt.c (instantiate_decl): Likewise.
1662         * rtti.c (syntheisze_tinfo_fn): Likewise.
1663         * semantics.c (expand_body): Likewise.
1664         * tree.c: Include ggc.h.
1665         (mark_list_hash): New function.
1666         (binding_init): Remove.
1667         (init_cplus_unsave): Rename to ...
1668         (init_tree): This.  Add GC roots.
1669         
1670 1999-09-05  Mark Mitchell  <mark@codesourcery.com>
1671
1672         Get ready for garbage collection.
1673         * Makefile.in (CXX_TREE_H): Add varray.h
1674         (lex.o): Depend on ggc.h.
1675         (decl.o): Likewise.
1676         (decl2.o): Likewise.
1677         (method.o): Likewise.
1678         (search.o): Likewise.
1679         (pt.o): Likewise.
1680         (repo.o): Likewise.
1681         * class.c: Include ggc.h.
1682         (current_class_name): Remove.
1683         (current_class_type): Likewise.
1684         (current_access_specifier): Likewise.
1685         (previous_class_type): Likewise.
1686         (previous_class_values): Likewise.
1687         (class_cache_firstobj): Likewise.
1688         (current_lang_base): Likewise.
1689         (current_lang_stack): Likewise.
1690         (current_lang_stacksize): Likewise.
1691         (lang_name_c): Likewise.
1692         (lang_name_cplusplus): Likewise.
1693         (lang_name_java): Likewise.
1694         (current_lang_name): Likewise.
1695         (base_layout_decl): Likewise.
1696         (access_default_node): Likewise.
1697         (access_public_node): Likewise.
1698         (access_protected_node): Likewise.
1699         (access_private_node): Likewise.
1700         (access_default_virtual_node): Likewise.
1701         (access_public_virtual_node): Likewise.
1702         (access_protected_virtual_node): Likewise.
1703         (access_private_virtual_node): Likewise.
1704         (signed_zero_node): Likewise.
1705         (init_class_processing): Don't build base_layout_decl.
1706         (push_lang_context): Adjust now that current_lang_base is a varray.
1707         (pop_lang_context): Likewise.
1708         * cp-tree.h: Include varray.h.
1709         (cp_global_trees): Add access_default, access_public,
1710         access_protected, access_private, access_default_virtual,
1711         access_public_virtual, access_protected_virtual,
1712         access_private_virtual, ctor_identifier, delta2_identifier, 
1713         delta_identifier, dtor_identifier, in_charge_identifier,
1714         index_identifier, nelts_identifier, this_identifier,
1715         pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
1716         lang_name_c, lang_name_cplusplus, lang_name_java,
1717         empty_except_spec, null, jclass, minus_one, terminate.
1718         (saved_scope): Move here from decl.c.  Define globals in terms of
1719         saved_scope: current_namespace, current_class_name,
1720         current_class_type, current_access_specifier, current_lang_stack,
1721         current_lang_base, current_lang_name, current_function_parms,
1722         current_template_parms, processing_template_decl,
1723         processing_specialization, processing_explicit_instantiation,
1724         previous_class_type, previous_class_values, class_cache_firstobj.
1725         (scope_chain): New variable.
1726         (init_pt): New function.
1727         * decl.c (current_namespace): Remove.
1728         (this_identifier, in_charge_identifier, ctor_identifier): Likewise.
1729         (dtor_identifier, pfn_identifier, index_identifier): Likewise.
1730         (delta_identifier, delta2_identifier): Likewise.
1731         (pfn_or_delta2_identifier, tag_identifier): Likewise
1732         (vt_off_identifier, empty_except_spec, null_node): Likewise.
1733         (current_function_parms, current_lang_base): Remove.
1734         (current_lang_stack, previous_class_values): Remove.
1735         (class_binding_level): Macroize.
1736         (saved_scope): Remove.
1737         (current_saved_scope): Rename to scope_chain.
1738         (mark_saved_scope): Adjust for new scope structure.
1739         (maybe_push_to_top_level): Likewise.
1740         (pop_from_top_level): Likewise.
1741         (duplicate_decls): Adjust now that current_lang_base is a varray.
1742         (build_typename_type): Call ggc_add_tree_hash_table_root.
1743         (init_decl_processing): Call init_pt.  Call push_to_top_level to
1744         set up globals.  Add GC roots.
1745         (xref_basetypes): Adjust now that current_lang_base is a varray.
1746         * decl.h (this_identifier): Remove.
1747         (in_charge_identifier): Likewise.
1748         * decl2.c: Don't include varray.h.
1749         (current_namespace): Remove.
1750         (init_decl2): Add GC roots.
1751         * except.c (Terminate): Remove. 
1752         (init_exception_processing): Use terminate_node instead.
1753         (build_terminate_handler): Likewise.
1754         * init.c (nc_nelts_field_id): Remove.
1755         (minus_one): Likewise.
1756         (init_init_processing): Use minus_one_node and nelts_identifier
1757         instead.  Add GC roots.
1758         (jclass_node): Remove.
1759         (build_new_1): Use nelts_identifier.
1760         (build_vec_init): Likewise.
1761         (build_vec_delete): Likewise.
1762         * lex.c: Include ggc.h.
1763         (defarg_fn): Move declaration early.
1764         (defarg_parms): Likewise.
1765         (init_parse): Add GC roots.
1766         (handle_cp_pragma): Remove redundant declaration of
1767         pending_vtables.
1768         * method.c: Include ggc.h.
1769         (btypelist): Make it a varray.  All uses changed.
1770         (ktypelist): Likewise.
1771         (init_method): Add GC roots.
1772         * pt.c: Don't include varray.h.  Include ggc.h.
1773         (current_template_parms): Remove.
1774         (processing_template_decl): Likewise.
1775         (processing_specialization): Likewise.
1776         (processing_explicit_instantiation): Likewise.
1777         (init_pt): New function.
1778         * repo.c: Include ggc.h.
1779         (init_repo): Add GC roots.
1780         * search.c: Don't include varray.h.
1781         (_vptr_name): Remove.
1782         (lookup_field_1): Use vtpr_identifier instead.
1783         (expand_indirect_vtbls_init): Remove redundant declaration of
1784         in_charge_identifier.
1785         (init_search_processing): Use vptr_identifier.
1786         
1787 1999-09-05  Richard Henderson  <rth@cygnus.com>
1788             Bernd Schmidt <bernds@cygnus.co.uk>
1789             Mark Mitchell  <mark@codesourcery.com>
1790
1791         * Makefile.in (parse.o): Depend on ggc.h.
1792         (decl2.o): Depend on ggc.h.
1793         (init.o): Depend on ggc.h.
1794         * cp-tree.h (init_decl2): Declare.
1795         (cp_parse_init): Likewise.
1796         * decl.c (ggc_p): Define to zero.
1797         (mark_saved_scope): New function.
1798         (init_decl_processing): Call cp_parse_init, and cp_decl2.
1799         Register GC roots.
1800         (expand_static_init): Add GC roots.
1801         * decl2.c: Include ggc.h.
1802         (init_decl2): New function.
1803         * init.c: Include ggc.h.
1804         (init_init_processing): Add GC roots.
1805         * parse.y: Include ggc.h.
1806         (cp_parse_init): New function.
1807         
1808 1999-09-04  Mark Mitchell  <mark@codesourcery.com>
1809
1810         * decl.c (init_decl_processing): Set mark_lang_status.
1811         (lang_mark_false_label_stack): Adjust prototype.
1812         * decl2.c (grok_function_init): Remove extraneous declaration of
1813         abort_fndecl.
1814
1815         * Make-lang.in (cc1plus): Remove dependency on GGC.
1816         * Makefile.in (OBJS): Don't mention ggc-simple.o.
1817         (OBJDEPS): Don't mention ggc-simple.o.
1818
1819         * Make-lang.in (cc1plus): Depend on $(GGC).
1820         * Makefile.in (OBJS): Add ggc-simple.o.
1821         (OBJDEPS): Likewise.
1822         * cp-tree.h (language_function): Rename members to `x_' versions;
1823         we now have x_named_labels, x_ctor_label, x_dtor_label,
1824         x_base_init_list, x_member_init_list, x_base_init_expr,
1825         x_current_class_ptr, x_current_class_ref, x_last_tree,
1826         x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
1827         x_result_rtx. 
1828         (dtor_label, ctor_label, current_base_init_list,
1829         current_member_init_list, base_init_expr, current_class_ptr,
1830         current_class_ref, last_tree, last_expr_type): Adjust accordingly.
1831         * decl.c: Include ggc.h.
1832         (last_dtor_insn): Adjust to use x_ names.
1833         (last_parm_cleanup_insn): Likewise.
1834         (original_result_rtx): Likewise.
1835         (named_labels): Likewise.
1836         (mark_binding_level): New function.
1837         (mark_cp_function_context): Likewise.
1838         (mark_false_label_stack): Likewise.
1839         (lang_mark_tree): Likewise.
1840         (lang_cleanup_tree): Likewise.
1841         
1842 1999-09-03  Mark Mitchell  <mark@codesourcery.com>
1843
1844         * Makefile.in (CXX_TREE_H): Include function.h.
1845         (decl.o): Don't depend on function.h.
1846         (decl2.o): Likewise.
1847         (typeck.o): Likewise.
1848         (init.o): Likewise.
1849         (method.o): Likewise.
1850         * cp-tree.h: Include function.h.
1851         (cp_function): Rename to language_function.  Remove next.
1852         (cp_function_chain): Make it a macro, not a variable.
1853         (push_cp_function_context): Don't declare.
1854         (pop_cp_function_context): Likewise.
1855         * decl.c: Don't include function.h.
1856         (push_cp_function_context): Make it static.  Make it suitable for
1857         a save_lang_status callback.
1858         (pop_cp_function_context): Likewise.
1859         (maybe_push_to_top_level): Call push_function_context_to, not
1860         push_cp_function_context.
1861         (pop_from_top_level): Call pop_function_context_from, not
1862         pop_cp_function_context.
1863         (init_decl_processing):  Set save_lang_status and
1864         restore_lang_status.  Call push_function_context_to, not
1865         push_cp_function_context.
1866         (cp_function_chain): Remove.
1867         * decl2.c: Don't include function.h.
1868         * except.c: Don't include function.h.
1869         (start_anon_func): Call push_function_context_to, not
1870         push_cp_function_context.
1871         (end_anon_func):  Call pop_function_context_from, not
1872         pop_cp_function_context.
1873         * init.c: Don't include function.h.
1874         * lex.c (begin_definition_of_inclass_inline): Call
1875         push_function_context_to, not push_cp_function_context. 
1876         (process_next_inline):  Call pop_function_context_from, not
1877         pop_cp_function_context.
1878         * method.c: Don't include function.h.
1879         (synthesize_method): Call push_function_context_to, not
1880         push_cp_function_context.  Call pop_function_context_from, not
1881         pop_cp_function_context.
1882         * typeck.c: Don't include function.h.
1883         
1884         * decl.c (expand_static_init): Tweak handling of static
1885         initializations for objects without constructors.
1886
1887 1999-09-03  Nathan Sidwell  <nathan@acm.org>
1888
1889         * typeck.c (build_indirect_ref): Reject dereference of pointer to
1890         void.
1891
1892 1999-09-02  Mark Mitchell  <mark@codesourcery.com>
1893
1894         * cp-tree.h (cp_function): Move here, from decl.c.
1895         (cp_function_chain): Declare.
1896         (dtor_label): New macro, instead of variable.
1897         (ctor_label): Likewise.
1898         (current_base_init_list): Likewise.
1899         (current_member_init_list): Likewise.
1900         (base_init_expr): Likewise.
1901         (current_class_ptr): Likewise.
1902         (current_class_ref): Likewise.
1903         (last_tree): Likewise.
1904         (last_expr_type): Likewise.
1905         (current_function_returns_value): Likewise.
1906         (current_function_returns_null): Likewise.
1907         (current_function_just_assigned_this): Likewise.
1908         (current_function_parms_stored): Likewise.
1909         (temp_name_counter): Likewise.
1910         (static_labelno): Likewise.
1911         (expanding_p): Likewise.
1912         (stmts_are_full_exprs_p): Likewise.
1913         (in_function_try_handler): Likewise.
1914         (lang_type): Remove nested type_flags.  All uses changed.
1915         * call.c (ctor_label): Remove.
1916         (dtor_label): Likewise.
1917         * class.c (current_class_ptr): Remove.
1918         (current_class_ref): Likewise.
1919         * decl.c (static_labelno): Remove.
1920         (dtor_label): Likewise.
1921         (last_dtor_insn): New macro, instead of variable.
1922         (last_parm_cleanup_insn): Likewise.
1923         (original_result_rtx): Likewise.
1924         (in_function_try_handler): Remove.
1925         (named_label_uses): New macro, instead of variable.
1926         (named_labels): Likewise.
1927         (current_function_returns_value): Remove.
1928         (current_function_returns_null): Likewise.
1929         (current_function_assigns_this): New macro, instead of variable.
1930         (current_function_just_assigned_this): Likewise.
1931         (current_binding_level): Likewise.
1932         (init_decl_processing): Call push_cp_function_context.
1933         (cp_function): Move to cp-tree.h
1934         (cp_function_chain): Make it global.
1935         (temp_name_counter): Remove.
1936         (push_cp_function_context): Simplify.
1937         (pop_cp_function_context): Likewise.
1938         * decl2.c (temp_name_counter): Remove.
1939         * init_c (current_base_init_list): Likewise.
1940         (current_member_init_list): Likewise.
1941         (base_init_expr): Likewise.
1942         * method.c (static_labelno): Likewise.
1943         * pt.c (last_tree): Likewise.
1944         * semantics.c (expanding_p): Likewise.
1945         (stmts_are_full_exprs_p): Likewise.
1946         (last_expr_type): Likewise.
1947         * typeck.c (dtor_label): Likewise.
1948         (ctor_label): Likewise.
1949         
1950 1999-09-01  Alex Samuel  <samuel@codesourcery.com>
1951
1952         * decl2.c (arg_assoc_template_arg): New prototype.  New function.
1953         (arg_assoc_class): Use arg_assoc_template_arg for template
1954         arguments. 
1955         (arg_assoc): Likewise.
1956         * pt.c (mangle_class_name_for_template): Allow member template
1957         template arguments.
1958
1959 1999-09-02  Nathan Sidwell  <nathan@acm.org>
1960
1961         * call.c (build_conditional_expr): Warn on enum mismatches.
1962         (convert_arg_to_ellipsis): Move non-pod check to after
1963         conversion.
1964
1965 1999-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1966
1967         * gxx.gperf (hash, is_reserved_word): Add prototypes.
1968
1969         * init.c (build_vec_init): Initialize variable `try_block'.
1970
1971         * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
1972         Likewise for bzero/memset.
1973         (token_getch, token_put_back): Add static prototypes.  Remove
1974         `inline' from the definitions.
1975         (retrofit_lang_decl): Call memset, not bzero, to avoid casts.
1976
1977 1999-09-01  Mark Mitchell  <mark@codesourcery.com>
1978
1979         * cp-tree.h (lang_type): Move align into type_flags.
1980         (CLASSTYPE_ALIGN): Adjust accordingly.
1981         * call.c (direct_reference_binding): Remove misleading comment.
1982
1983 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1984
1985         * parse.y (language_string): Constify.
1986
1987 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1988
1989         * repo.c (getpwd): Don't prototype.
1990         * xref.c (getpwd): Likewise
1991
1992 1999-08-30  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1993
1994         * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
1995         Remove hacks for stuff which now comes from libiberty.
1996
1997 1999-08-30  Jason Merrill  <jason@yorick.cygnus.com>
1998
1999         * cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
2000
2001 1999-08-30  Mark Mitchell  <mark@codesourcery.com>
2002
2003         * cp-tree.h (begin_init_stmts): Declare.
2004         (finish_init_stmts): Likewise.
2005         * cvt.c (build_up_reference): Wrap the declaration of a temporary
2006         in a statement-expression so that we will see it when expanding
2007         tree structure later.
2008         * init.c (begin_init_stmts): Don't make it static.
2009         (finish_init_stmts): Likewise.
2010
2011         * cp-tree.h (start_handler_parms): New function.
2012         (expand_start_catch_block): Take only one parameter.
2013         (start_handler_parms): New function.
2014         * decl.c (start_handler_parms): Define it.
2015         * except.c (process_start_catch_block): Take only one parameter.
2016         Don't call grokdeclarator here.
2017         (expand_start_catch_block): Don't call grokdeclarator here,
2018         either.
2019         * parse.y (handler_args): Adjust call to
2020         expand_start_catch_block.  Use start_handler_parms.
2021         * pt.c (push_template_decl_real): Make permanent lists have
2022         permanent elements.
2023         (tsubst_expr): Adjust calls to expand_start_catch_block
2024         appropriately.
2025         * semantics.c (expand_stmt): Likewise.
2026         
2027 1999-08-29  Alex Samuel  <samuel@codesourcery.com>
2028
2029         * pt.c (push_template_decl_real): Use template declaration from
2030         class type if it exists.
2031
2032 1999-08-29  Mark Mitchell  <mark@codesourcery.com>
2033
2034         * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
2035         (maybe_inject_for_scope_var): Declare it.
2036         (initialize_local_var): Likewise.
2037         * decl.c (maybe_inject_for_scope_var): Make it global.
2038         (initialize_local_var): Likewise.  Move cleanup handling here,
2039         from cp_finish_decl.
2040         (make_rtl_for_nonlocal_decl): Use
2041         push_obstacks_nochange/pop_obstacks, rather than
2042         end_temporary_allocation/resume_temporary_allocation.
2043         (cp_finish_decl): Try to complete the type of a variable when it
2044         is declared.  Move cleanup-handling to initialize_local_var.
2045         (expand_static_init): Use tree-building code, rather than
2046         RTL-building code.
2047         * decl2.c (get_temp_name): Assert non-initializedness of
2048         temporaries.
2049         * init.c (create_temporary_var): Move RTL-assigning code to ...
2050         (get_temp_regvar): Here.
2051         * pt.c (tsbust_expr): Fix indentation.  Call cp_finish_decl here.
2052         * semantics.c (expand_stmt): Don't call cp_finish_decl here.  Just
2053         call initialize_local_var to generate initialization code.
2054         
2055 1999-08-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2056
2057         * cp-tree.h (fndecl_as_string, type_as_string,
2058         type_as_string_real, args_as_string, decl_as_string,
2059         expr_as_string, code_as_string, language_as_string,
2060         parm_as_string, op_as_string, assop_as_string, cv_as_string,
2061         lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
2062
2063         * errfn.c (cp_printer): Likewise.
2064
2065         * error.c (cp_printer, fndecl_as_string, type_as_string_real,
2066         type_as_string, expr_as_string, decl_as_string, lang_decl_name,
2067         cp_file_of, code_as_string, language_as_string, parm_as_string,
2068         op_as_string, assop_as_string, args_as_string, cv_as_string):
2069         Likewise.
2070
2071         * tree.c (lang_printable_name): Likewise.
2072
2073 1999-08-28  Richard Henderson  <rth@cygnus.com>
2074
2075         * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
2076
2077 1999-08-28  Mark Mitchell  <mark@codesourcery.com>
2078
2079         * cp-tree.h (strip_array_types): New function.
2080         * decl.c (maybe_deduce_size_from_array_init): New function, split
2081         out from cp_finish_decl.
2082         (layout_var_decl): Likewise.
2083         (maybe_commonize_var): Likewise.
2084         (maybe_inject_for_scope_var): Likewise.
2085         (initialize_local_var): Likewise.
2086         (build_cleanup_on_safe_obstack): Likewise.
2087         (check_initializer): Likewise.
2088         (make_rtl_for_nonlocal_decl): Likewise.
2089         (cp_finish_decl): Use them.
2090         * typeck.c (strip_array_types): New function.
2091         
2092         * cp-tree.def (LABEL_STMT): New tree node.
2093         * cp-tree.h (LABEL_STMT_LABEL): New macro.
2094         (shadow_label): Remove.
2095         (declare_local_label): New function.
2096         (finish_label_decl): Likewise.
2097         * decl.c (make_label_decl): New function, split out from
2098         lookup_label.
2099         (shadowed_labels): Remove.
2100         (binding_level): Add shadowed_labels.
2101         (clear_binding_level): Remove.
2102         (push_binding_level): Just bzero the new binding level.
2103         (pushlevel): Fix indentation.
2104         (pop_label): New function.
2105         (pop_labels): Likewise, split out from poplevel.
2106         (poplevel): Pop local labels.  Use pop_labels.
2107         (maybe_push_to_top_level): Don't clear shadowed_labels.
2108         (lookup_label): Use make_label_decl.
2109         (shadow_label): Remove.
2110         (declare_local_label): New function.
2111         (define_label): Simplify.
2112         (start_function): Don't clear shadowed_labels.
2113         (cp_function): Remove shadowed_labels.
2114         (push_cp_function_context): Don't save shadowed_labels.
2115         (pop_cp_function_context): Don't restore it.
2116         * dump.c (dequeue_and_dump): Handle LABEL_STMT.
2117         * parse.y (label_decl): Use finish_label_decl.
2118         * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
2119         declarations.
2120         * semantics.c (finish_label_stmt): Add a LABEL_STMT when
2121         building_stmt_tree.
2122         (finish_label_decl): New function.
2123         (expand_stmt): Handle LABEL_STMTs and local label declarations.
2124         
2125 1999-08-26  Mark Mitchell  <mark@codesourcery.com>
2126
2127         * decl.c (lookup_label): Build labels on the permanent obstack
2128         when building statement trees.  Don't build RTL for labels when
2129         building statement trees.
2130         * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
2131         building statement trees.
2132         (finish_label_stmt): Likewise.
2133         (expand_stmt): Adjust accordingly.
2134         * pt.c (tsubst_expr); Likewise.
2135         (do_decl_instantiation): Robustify.
2136         
2137         * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
2138         * tree.c (build_cplus_new): Set it.
2139         * expr.c (cplus_expand_expr): Use it.
2140         * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
2141         
2142         * decl.c (store_parm_decls): Reset immediate_size_expand.
2143         (finish_function): Likewise.
2144         
2145         * tree.c (cplus_unsave_expr_now): Don't return a value.
2146
2147         * semantics.c (do_poplevel): Always initialize the return value.
2148
2149 1999-08-26  Gavin Romig-Koch  <gavin@cygnus.com>
2150
2151         * cp-tree.h (cplus_unsave_expr_now) : Correct return type.
2152         * tree.h (cplus_unsave_expr_now) : Same.
2153
2154 1999-08-25  Mark Mitchell  <mark@codesourcery.com>
2155
2156         * decl.c (grokdeclarator): Amend comment.
2157         * except.c (expand_start_catch_block): Call push_template_decl for
2158         catch-block parameters.
2159         * method.c (synthesize_method): Build an empty compound statement
2160         for the body of a constructor.
2161
2162 1999-08-25  Jason Merrill  <jason@yorick.cygnus.com>
2163
2164         * tree.c (cp_build_qualified_type_real): If we're asking for the
2165         same quals we already have, just return.
2166
2167 1999-08-25  Mark Mitchell  <mark@codesourcery.com>
2168
2169         * cp-tree.def (SUBOBJECT): New tree node.
2170         * cp-tree.h (CLEANUP_P): New macro.
2171         (SUBOBJECT_CLEANUP): Likewise.
2172         (keep_next_level): Add parameter.
2173         (get_temp_regvar): Don't declare.
2174         (emit_base_init): Remove parameter.
2175         (expand_aggr_init): Rename to build_aggr_init.
2176         (expand_vec_init): Rename to build_vec_init.
2177         (do_pushlevel): Remove.
2178         (do_poplevel): Likewise.
2179         (finish_cleanup): New function.
2180         (finish_subobject): Likewise.
2181         (stmts_are_full_exprs_p): New variable.
2182         * decl.c (keep_next_level): Add parameter.
2183         (cp_finish_decl): Use build_aggr_init, not
2184         expand_aggr_init.  Use finish_expr_stmt to expand the code.
2185         (expand_static_init): Use tree-generating, not RTL-generating,
2186         functions to handle the initialization.
2187         (start_function): Remove dead code.  Always have a momentary
2188         obstack inside the function, even before hitting the first curly
2189         brace.
2190         (cplus_expand_expr_stmt): Move calls to
2191         expand_{start,end}_target_temps into semantics.c.
2192         (cp_function): Add stmts_are_full_exprs_p.
2193         (push_cp_function_context): Save it.
2194         (pop_cp_function_context): Restore it.
2195         * decl2.c (get_temp_regvar): Move to init.c.
2196         (do_static_initialization): Use build_{aggr,vec}_init.
2197         (do_static_destruction): Fix typo in comment.
2198         * dump.c (dequeue_and_dump): Handle INIT_EXPR.
2199         * except.c (expand_throw): Use create_temporary_var.
2200         * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
2201         * init.c (expand_vec_init_try_block): Remove.
2202         (expand_vec_init_catch_clause): Likewise.
2203         (get_temp_regvar): New function.
2204         (begin_init_stmts): Likewise.
2205         (finish_init_stmts): Likewise.
2206         (perform_member_init): Use build_{aggr,vec}_init.  Build up tree
2207         structure here.
2208         (emit_base_init): Likewise.  Remove unused parameter.
2209         (expand_virtual_init): Likewise.
2210         (expand_cleanup_for_base): Use finish_subobject.
2211         (expand_aggr_vbase_init_1): Simplify.
2212         (construct_virtual_bases): Use tree-generating functions to build
2213         up initialization.
2214         (expand_aggr_init): Likewise.  Rename to build_aggr_init.
2215         (expand_default_init): Likewise.
2216         (expand_aggr_init_1): Likewise.
2217         (expand_vec_init): Rename to build_vec_init.
2218         * method.c (do_build_copy_constructor): Use tree-generating
2219         functions.  Don't call clear_last_expr.
2220         (do_build_assign_ref): Likewise.
2221         (synthesize_method): Call clear_last_expr here.
2222         * parse.y (base_init): Don't call clear_last_expr here.
2223         (nodecls): Likewise.
2224         * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
2225         * semantics.c (do_pushlevel): Move to here.
2226         (do_poplevel): Likewise.
2227         (stmts_are_full_exprs_p): New variable.
2228         (finish_expr_stmt): Handle logic for temoprary cleanup here.
2229         (finish_for_stmt): Use finish_expr_stmt.
2230         (finish_cleanup): New function.
2231         (finish_function_try_block): Fix indentation.
2232         (finish_subobject): New function.
2233         (setup_vtbl_ptr): Call keep_next_level here.
2234         (finish_stmt_expr): Handle a block with no scope inside the
2235         statement-expression.
2236         (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set.  Handle
2237         SUBOBJECT.
2238         * tree.c (search_tree): Handle INIT_EXPR.
2239         (mapcar): Likewise.
2240         * typeck.c (build_modify_expr): Don't build an RTL_EXPR.
2241         * typeck2.c (store_init_value): Change expand_aggr_init to
2242         build_aggr_init in comment.
2243         
2244 1999-08-25  Mark Mitchell  <mark@codesourcery.com>
2245
2246         * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
2247
2248 1999-08-25  Nathan Sidwell  <nathan@acm.org>
2249
2250         * decl2.c (handle_class_head): Be graceful about additional
2251         scope qualifiers. Adjust comments to reflect reality.
2252
2253 1999-08-24  Jason Merrill  <jason@yorick.cygnus.com>
2254
2255         * call.c (build_conditional_expr): Fix typo.
2256         * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
2257         lvalue before trying to mess with the sides.
2258
2259         * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
2260
2261 Mon Aug 23 22:17:20 1999  Mumit Khan  <khan@xraylith.wisc.edu>
2262
2263         * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
2264
2265 1999-08-23  Jason Merrill  <jason@yorick.cygnus.com>
2266
2267         * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
2268         Return arbitrary pointer or NULL.
2269         (check_eh_spec): Call __throw_type_match_rtti_2.
2270         * tinfo.h (*::dcast): Return int.  Add valp parm.
2271         * tinfo.cc (*::dcast): Likewise.  Adjust to allow for null pointers.
2272         * tinfo2.cc (__throw_type_match_rtti_2): Likewise.
2273         (__throw_type_match_rtti): Now just a wrapper.
2274
2275         * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
2276         (init_exception_processing): Don't initialize them.
2277
2278 1999-08-23  Paul Burchard <burchard@pobox.com>
2279
2280         * decl.c (check_default_argument): Fix typo.
2281
2282 1999-08-22  Mark Mitchell  <mark@codesourcery.com>
2283
2284         * cp-tree.def (STMT_EXPR): Fix typo in node name.
2285
2286         * dump.c (dump_next_stmt): New function.
2287         (dequeue_and_dump): Use it.
2288         
2289         * pt.c (tsubst_copy): Make sure to initialize return value for a
2290         STMT_EXPR, even when processing_template_decl.
2291         * semantics.c (finish_stmt_expr): A statement-expression whose
2292         last statement is not an expression-statement has type `void'.  
2293         
2294 1999-08-20  Mark Mitchell  <mark@codesourcery.com>
2295
2296         * semantics.c (finish_stmt_expr): Fix typo in comment.
2297         * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
2298         (mapcar): Likewise.
2299         * init.c (build_vec_delete_1): Make the children of a permanent
2300         BIND_EXPR permanent.
2301         * pt.c (register_specialization): Don't register a specialization
2302         more than once.
2303         
2304 1999-08-18  Andrew Haley  <aph@cygnus.com>
2305
2306         * method.c (process_overload_item): Call build_mangled_C9x_name ()
2307         for all integer parameter types larger than long long.
2308
2309 1999-08-19  Mark Mitchell  <mark@codesourcery.com>
2310
2311         * pt.c (redeclare_class_template): Merge default template
2312         arguments in both directions.
2313
2314         * typeck.c (common_type): Undo 1999-08-18 change.  Remove
2315         compiler_error message.
2316
2317 1999-08-19  Jason Merrill  <jason@yorick.cygnus.com>
2318
2319         * cp-tree.h: Declare flag_use_repository.
2320         * pt.c (do_decl_instantiation): Don't complain about duplicate
2321         instantiation with -frepo.
2322         (do_type_instantiation): Likewise.
2323
2324         * pt.c (push_template_decl_real): Complain about everything
2325         that isn't a valid template.
2326
2327         * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
2328         affect inlines.
2329
2330 1999-08-19  Mark Mitchell  <mark@codesourcery.com>
2331
2332         * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
2333         * decl2.c (build_expr_from_tree): Handle it.
2334         * error.c (dump_expr): Likewise.
2335         * pt.c (for_each_template_parm): Likewise.
2336         (tsubst_copy): Likewise.
2337         * tree.c (search_tree): Likewise.
2338         * semantics.c (finish_pseudo_destructor_call): Create it.
2339         
2340 1999-08-18  Mark Mitchell  <mark@codesourcery.com>
2341
2342         * search.c (setup_class_bindings): Robustify.
2343         * typeck.c (common_type): Use same_type_p, not pointer equality,
2344         to compare types.
2345
2346         * cp-tree.h (build_lang_field_decl): Remove.
2347         * class.c (build_vtable): Replace calls to build_lang_field_decl
2348         with build_lang_decl.
2349         (prepare_fresh_vtable): Likewise.
2350         (finish_struct_1): Likewise.
2351         (init_class_processing): Likewise.
2352         * decl.c (push_using_decl): Likewise.
2353         (init_decl_processsing): Likewise.
2354         (grokvardecl): Likewise.
2355         (build_ptrmemfunc_type): Likewise.
2356         (grokdeclarator): Likewise.
2357         (build_enumerator): Likewise.
2358         * decl2.c (grok_x_components): Likewise.
2359         (do_class_using_decl): Likewise.
2360         * except.c (call_eh_info): Likewise.
2361         * init.c (init_init_processing): Likewise.
2362         * rtti.c (expand_class_decl): Likewise.
2363         * tree.c (build_base_fields): Likewise.
2364         (build_vbase_pointer_fields): Likewise.
2365         * lex.c (build_lang_decl): Build declarations on the permanent
2366         obstack if we're building statmeent trees.
2367         (retrofit_lang_decl): Handle both the full lang_decl and also the
2368         smaller lang_decl_flags here.
2369         (build_lang_field_decl): Remove.
2370         * pt.c (push_template_decl_real): Issue errors for variable
2371         declarations that are not static members.
2372
2373 1999-08-18  Richard Henderson  <rth@cygnus.com>
2374
2375         * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
2376         (mapcar): Likewise.
2377
2378 1999-08-17  Mark Mitchell  <mark@codesourcery.com>
2379
2380         * cp-tree.h (back_end_hook): New variable.
2381         * decl2.c (back_end_hook): Define it.
2382         (finish_file): If it's non-NULL, call it.
2383
2384         * decl.c (add_decl_to_level): New function.
2385         (push_local_binding): Use it.
2386         (find_binding): Fix typo in comment.
2387         (pushdecl): Use add_decl_to_level.  Put templates on the
2388         corresponding namespace-scope binding levels.
2389         * dump.c (dequeue_and_dump): Print the specializations of a
2390         template.
2391         * pt.c (push_template_decl_real): Don't push a template multiple
2392         times.
2393
2394 1999-08-17  Mark Mitchell  <mark@codesourcery.com>
2395
2396         * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
2397         (CALL_DECLARATOR_QUALS): Likewise.
2398         (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
2399         * decl.c (grokdeclarator): Adjust to use them.
2400         * decl2.c (grokfield): Likewise.
2401         (reparse_absdcl_as_casts): Likewise.
2402         * lex.c (make_call_declarator): Likewise.
2403         (set_quals_and_spec): Likewise.
2404         * pt.c (tsubst): Likewise.
2405         * tree.c (mapcar): Remove special hack to handle third operand of
2406         a CALL_EXPR.
2407
2408 1999-08-16  Mark Mitchell  <mark@codesourcery.com>
2409
2410         * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
2411         * class.c (build_vtable): Use build_lang_field_decl to build the
2412         VAR_DECLs for vtables.
2413         (prepare_fresh_vtable): Likewise.
2414         * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
2415         CAN_HAVE_FULL_LANG_DECL_P.
2416         (push_using_decl): Use build_lang_decl to build USING_DECLs.
2417         (grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
2418         * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
2419         (build_lang_field_decl): Likewise.
2420         (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
2421         to copy.
2422         
2423         * cp-tree.def (STMT_EXPR): New tree node.
2424         * cp-tree.h (STMT_EXPR_STMT): New macro.
2425         (store_return_init): Change prototype.
2426         (finish_named_return_value): New function.
2427         (expand_stmt): Likewise.
2428         (expand_body): Likewise.
2429         (begin_stmt_tree): Likewise.
2430         (finish_stmt_tree): Likewise.
2431         (expanding_p): New variable.
2432         (last_expr_type): Likewise.
2433         (building_stmt_tree): New macro.
2434         * decl.c (start_function): Use building_stmt_tree, not
2435         processing_template_decl, where appropriate.
2436         (store_parm_decls): Likewise.
2437         (store_return_init): Move most of the body to semantics.c.
2438         (finish_function): Use building_stmt_tree.
2439         (finish_stmt): Clear last_expr_type here.
2440         (cp_function): Add expanding_p, last_tree, last_expr_type.
2441         (push_cp_function_context): Save them.
2442         (pop_cp_function_context): Restore them.
2443         * decl2.c (setup_vtbl_ptr): Move to semantics.c.
2444         * error.c (dump_expr): Handle STMT_EXPR.
2445         * except.c (expand_start_catch_block): Use building_stmt_tree.
2446         Use add_decl_stmt.
2447         * expr.c (cplus_expand_expr): Handle STMT_EXPR.
2448         (do_case): Move add_tree call to semantics.c.
2449         * parse.y (return_init): Use finish_named_return_value.
2450         (for.init.statement): Use finish_expr_stmt.
2451         * parse.c: Regenerated.
2452         * pt.c (do_pushlevel): Move to semantics.c.
2453         (do_poplevel): Likewise.
2454         (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
2455         (tsubst_expr): Don't expand all the way to RTL here.  Handle
2456         RETURN_INIT and CTOR_INITIALIZER.
2457         (instantiate_decl): Call expand_body after tsubst'ing into
2458         DECL_SAVED_TREE.
2459         * semantics.c (expand_stmts): New function.
2460         (expanding_p): New variable.
2461         (last_expr_type): Likewise.
2462         (finish_expr_stmt): Use building_stmt_tree.
2463         (begin_if_stmt): Likewise.
2464         (finish_if_stmt_cond): Likewise.
2465         (finish_then_clause): Likewise.
2466         (begin_else_clause): Likewise.
2467         (finish_else_clause): Likewise.
2468         (begin_while_stmt): Likewise.
2469         (finish_while_stmt_cond): Likewise.
2470         (finish_while_stmt): Likewise.
2471         (finish_do_body): Likewise.
2472         (finish_do_stmt): Likewise.
2473         (finish_return_stmt): Likewise.
2474         (begin_for_stmt): Likewise.
2475         (fnish_for_init_stmt): Likewise.
2476         (finish_for_cond): Likewise.
2477         (finish_for_expr): Likewise.
2478         (finish_for_stmt): Likewise.
2479         (finish_break_stmt): Likewise.
2480         (finish_continue_stmt): Likewise.
2481         (finish_switch_cond): Likewise.
2482         (finish_switch_stmt): Likewise.
2483         (finish_case_label): Call add_tree here if necessary.
2484         (finish_goto_statement): Use building_stmt_tree.
2485         (begin_try_block): Likewise.
2486         (begin_function_try_block): Likewise.
2487         (finish_try_block): Likewise.
2488         (finish_function_try_block): Likewise.
2489         (finish_handler_sequence): Likewise.
2490         (finish_function_handler_sequence): Likewise.
2491         (begin_handler): Likewise.
2492         (finish_handler_parms): Likewise.
2493         (finish_handler): Likewise.
2494         (begin_compound_stmt): Likewise.
2495         (finish_compound_stmt): Likewise.
2496         (finish_asm_stmt): Likewise.
2497         (finish_label_stmt): Likewise.
2498         (finish_named_return_value): New function.
2499         (setup_vtbl_ptr): Moved here from decl2.c.
2500         (do_pushlevel): Moved here from pt.c.
2501         (do_poplevel): Likewise.
2502         (begin_stmt_expr): Use building_stmt_tree.
2503         (finish_stmt_expr): Likewise.  Build a STMT_EXPR, not a BIND_EXPR,
2504         when building_stmt_tree.
2505         (begin_stmt_tree): New function.
2506         (finish_stmt_tree): Likewise.
2507         (expand_stmt): Likewise.
2508         (expand_body): Likewise.
2509         * tree.c (build_cplus_method_type): Make sure the argument types
2510         end up on the same obstack as the METHOD_TYPE.
2511         (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
2512         THROW_EXPR, STMT_EXPR.
2513         (mapcar): Break out common cases.  Handle COMPOUND_EXPR,
2514         MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR.  Abort, rather than
2515         sorry, if an unsupported node is encountered.
2516         * typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
2517         (c_expand_return): Don't call add_tree here.
2518         
2519 1999-08-15  Mark Mitchell  <mark@codesourcery.com>
2520
2521         * pt.c (check_default_tmpl_args): Don't check in local scopes.
2522         (tsubst_decl): Make sure the declaration is on a saveable
2523         obstack.  Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
2524         variable.
2525         (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
2526         
2527 1999-08-14  Jason Merrill  <jason@yorick.cygnus.com>
2528
2529         Speed up Koenig lookup.
2530         * decl.c (unqualified_namespace_lookup): Nonstatic.  Add spacep parm
2531         to return namespaces we've looked at.
2532         * decl2.c (lookup_using_namespace): Likewise.
2533         (add_function): Don't call ovl_member.
2534         (lookup_arg_dependent): Initialize k.namespaces to the list of 
2535         namespaces seen in unqualified lookup.
2536         * call.c (equal_functions): Move here from tree.c.
2537         (joust): Use it to handle duplicate candidates.
2538         * tree.c (ovl_member): Use ==.
2539
2540 1999-08-13  Mark Mitchell  <mark@codesourcery.com>
2541
2542         * cp-tree.def (DECL_STMT): Make it smaller.
2543         * cp-tree.h (lang_decl_flags): Move saved_tree to ...
2544         (lang_decl): ... here.  Add next.
2545         (DECL_SAVED_TREE): Adjust accordingly.
2546         (DECL_IMPLICIT_TYPEDEF_P): New macro.
2547         (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
2548         (DECL_STMT_DECL): Likewise.
2549         (create_implicit_typedef): New function.
2550         (maybe_push_decl): Likewise.
2551         (tsubst_default_argument): New function.
2552         (at_function_scope_p): Likewise.
2553         (add_decl_stmt): Likewise.
2554         (push_permanent_obstack): Likewise.
2555         * call.c (convert_default_arg): Use tsubst_default_argument.
2556         * class.c (add_method): Use push_permanent_obstack.
2557         (build_self_reference): Create a TEMPLATE_DECL for the
2558         self-reference, if necessary.
2559         * decl.c (pseudo_global_level_p): Only look at the current binding
2560         level.
2561         (push_binding): Use push_permanent_obstack.
2562         (create_implicit_typedef): New function.
2563         (pushtag): Use it.
2564         (duplicate_decls): Use push_permanent_obstack.
2565         (maybe_push_decl): New function.
2566         (start_decl): Use it.  Remove dead code.  Use add_decl_stmt.
2567         (start_decl_1): Remove dead code.
2568         (cp_finish_decl): Remove DECL_STMT handling here.  Don't use
2569         pseudo_global_level_p.
2570         (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
2571         template.
2572         (grokdeclarator): Likewise, for TYPE_DECLs.  Don't use
2573         pseudo_global_level_p.
2574         * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
2575         a template.
2576         (get_sentry): Use push_permanent_obstack.
2577         * dump.c (dequeue_and_dump): Enable DECL_STMT.
2578         * except.c (call_eh_info): Use push_permanent_obstack.
2579         (build_eh_type_ref): Likewise.
2580         (do_pop_exception): Likewise.
2581         (expand_eh_spec): Likewise.
2582         (alloc_eh_object): Likewise.
2583         (expand_throw): Likewise.
2584         * init.c (build_java_class_ref): Likewise.
2585         * lex.c (get_time_identifier): Likewise.
2586         (free_lang_decl_chain): Correct type.
2587         (retrofit_lang_decl): Adjust accordingly.
2588         (build_lang_field_decl): Likewise.
2589         * lex.h (free_lang_decl_chain): Likewise.
2590         * parse.y (lang_extdef): Don't use pseudo_global_level_p.
2591         * parse.c: Regenerated.
2592         * pt.c (tsubst_default_arguments): New function.
2593         (retrieve_local_specialization): Likewise.
2594         (register_local_specialization): Likewise.
2595         (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P.  Just use
2596         pseudo_global_level_p to determine whether or not a template is
2597         primary.
2598         (lookup_template_class): Likewise.  Use create_implicit_typedef.
2599         (instantiate_class_template): Call tsubst_default_arguments for
2600         member functions, if appropriate.
2601         (tsubst_default_argument): New function.
2602         (tsubst_decl): Use it.  Change TYPE_DECL handling to match VAR_DECLs.
2603         * search.c (at_function_scope_p): New function.
2604         * semantics.c (finish_asm_stmt): Use push_permanent_obstack.
2605         (finish_label_stmt): Likewise.
2606         (add_decl_stmt): New function.
2607         (begin_class_definition): Likewise.
2608         (finish_typeof): Likewise.
2609         * tree.c (copy_template_template_parm): Likewise.
2610         (copy_to_permanent): Likewise.
2611         (push_permanent_obstack): Define.
2612         (mark_addressable): Use it.
2613         * typeck.c (mark_addressable): Likewise.
2614         
2615 1999-08-13  Gavin Romig-Koch  <gavin@cygnus.com>
2616
2617         * cp-tree.h (init_cplus_unsave): New.
2618         (cplus_unsave_expr_now): New.
2619         * lex.c (init_parse): Call init_cplus_unsave.
2620         * tree.c (init_cplus_unsave): New.
2621         (cplus_unsave_expr_now): New.
2622
2623 1999-08-13  Mark Mitchell  <mark@codesourcery.com>
2624
2625         * pt.c (tsubst): Back out 1999-08-06 patch.  Use fold and
2626         decl_constant_value to simplify array bounds.
2627
2628 1999-08-11  Jason Merrill  <jason@yorick.cygnus.com>
2629
2630         * lang-options.h: Add -fms-extensions.
2631         * cp-tree.h: Declare flag_ms_extensions.
2632         * decl2.c: Define it.
2633         * class.c (instantiate_type): Don't complain about taking the address
2634         of a bound member function if -fms-extensions.
2635         * typeck.c (build_unary_op): Likewise.
2636         * decl.c (grokdeclarator): Or about implicit int.
2637         * init.c (resolve_offset_ref): Or about implicit '&'.
2638
2639 1999-08-11  Mark Mitchell  <mark@codesourcery.com>
2640
2641         * cp-tree.h (minimal_parse_mode): Remove.
2642         (finish_label_stmt): New function.
2643         * decl.c (saved_scope): Remove minimal parse mode.
2644         (maybe_push_to_top_level): Don't save it.
2645         (pop_from_top_level): Don't restore it.
2646         (define_label): Split out template-handling code to semantics.c.
2647         (start_decl): Don't use minimal_parse_mode.
2648         (cp_finish_decl): Likewise.
2649         (start_function): Don't increment it.
2650         (store_return_init): Don't use it.
2651         (finish_function): Don't decrement it.
2652         * parse.y (label_colon): Use finish_label_stmt throughout.
2653         * parse.c: Regenerated.
2654         * pt.c (minimal_parse_mode): Don't define it.
2655         (tsubst_expr): Use finish_label_stmt.
2656         * semantics.c (finish_label_stmt): New function.
2657
2658         * dump.c (queue): Be careful when computing bitmasks.
2659         (dequeue_and_dump): Describe binfos as binfos, not as
2660         vectors.
2661         
2662         * parse.y (pedantic): Give it itype.  Adjust usage accordingly
2663         throughout.     
2664         * parse.c: Regenerated.
2665         
2666         * Make-lang.in (CXX_SRCS): Remove sig.c.
2667         * Makefile.in (CXX_OBJS): Remove sig.o.
2668         (sig.o): Remove.
2669         * cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
2670         (CPTI_SIGNATURE_TYPE): Likewise.
2671         (CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
2672         (opaque_type_node): Likewise.
2673         (signature_type_node): Likewise.
2674         (sigtable_entry_type): Likewise.
2675         (flag_handle_signatures): Likewise.
2676         (lang_type): Remove is_signature, is_signature_pointer,
2677         is_signature_reference, has_opaque_typedecls,
2678         sigtables_has_been_generated.  Adjust dummy.  Remove signature,
2679         signature_pointer_to, signature_reference_to.
2680         (IS_SIGNATURE): Remove.
2681         (SET_SIGNATURE): Remove.
2682         (CLEAR_SIGNATURE): Remove.
2683         (IS_SIGNATURE_POINTER): Remove.
2684         (IS_SIGNATURE_REFERENCE): Remove.
2685         (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
2686         (SIGTABLE_HAS_BEEN_GENERATED): Remove.
2687         (CLASSTYPE_SIGNATURE): Remove.
2688         (SIGNATURE_TYPE): Remove.
2689         (SIGNATURE_METHOD_VEC): Remove.
2690         (SIGNATURE_POINTER_TO): Remove.
2691         (SIGNATURE_REFERENCE_TO): Remove.
2692         (lang_decl_flags): Remove is_default_implementation.  Rename
2693         memfunc_pointer_to to saved_tree.
2694         (IS_DEFAULT_IMPLEMENTATION): Remove.
2695         (DECL_MEMFUNC_POINTER_TO): Remove.
2696         (DECL_MEMFUNC_POINTING_TO): Remove.
2697         (DECL_SAVED_TREE): Adjust definition.
2698         (tag_types): Remove signature_type_node.
2699         (SIGNATURE_FIELD_NAME): Remove.
2700         (SIGNATURE_FIELD_NAME_FORMAT): Likewise.
2701         (SIGNATURE_OPTR_NAME): Likewise.
2702         (SIGNATURE_SPTR_NAME): Likewise.
2703         (SIGNATURE_POINTER_NAME): Likewise.
2704         (SIGNATURE_POINTER_NAME_FORMAT): Likewise.
2705         (SIGNATURE_REFERENCE_NAME): Likewise.
2706         (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
2707         (SIGTABLE_PTR_TYPE): Likewise.
2708         (SIGTABLE_NAME_FORMAT): Likewise.
2709         (SIGTABLE_NAME_FORMAT_LONG): Likewise.
2710         (SIGTABLE_TAG_NAME): Likewise.
2711         (SIGTABLE_VB_OFF_NAME): Likewise.
2712         (SIGTABLE_VT_OFF_NAME): Likewise.
2713         (finish_base_specifiers): Change prototype.
2714         (build_signature_pointer_type): Remove.
2715         (build_signature_reference_type): Remove.
2716         (build_signature_pointer_constructor): Remove.
2717         (build_signature_method_call): Remove.
2718         (build_optr_ref): Likewise.
2719         (append_signature_fields): Likewise.
2720         (signature_error): Likewise.
2721         * call.c (build_this): Remove signature support.
2722         (build_over_call): Likewise.
2723         (build_new_method_call): Likewise.
2724         * class.c (add_implicitly_declared_members): Likewise.
2725         (finish_struct_1): Likewise.
2726         (finish_struct): Likewise.
2727         * cvt.c (cp_convert_to_pointer): Likewise.
2728         (convert_to_pointer_force): Likewise.
2729         (ocp_convert): Likewise.
2730         * decl.c (sigtable_decl_p): Remove.
2731         (init_decl_processing): Remove support for signatures.
2732         (cp_finish_decl): Likewise.
2733         (grokdeclarator): Likewise.
2734         (grokparms): Likewise.
2735         (xref_tag): Likewise.
2736         (start_function): Likewise.
2737         (start_method): Likewise.
2738         * decl2.c (finish_sigtable_vardecl): Remove.
2739         (flag_handle_signatures): Remove.
2740         (lang_f_options): Remove handle-signatures.
2741         (grokfield): Remove support for signatures.
2742         (grokbitfield): Likewise.
2743         (finish_file): Likewise.
2744         (reparse_absdcl_as_casts): Likewise.
2745         * error.c (dump_type_real): Likewise.
2746         (dump_function_decl): Likewise.
2747         * friend.c (make_friend_class): Likewise.
2748         * gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
2749         * hash.h: Regenerated.
2750         * init.c (build_new_1): Remove support for signatures.
2751         * lang-options.h: Remove -fhandle-signatures,
2752         -fno-handle-signatures. 
2753         * lex.c (init_parse): Remove support for signatures.
2754         (yyprint): Likewise.
2755         * lex.h (rid): Remove RID_SIGNATURE.
2756         * method.c (build_decl_overload_real): Remove support for
2757         signatures. 
2758         (hack_identifier): Likewise.
2759         * parse.y (base_class): Likewise.
2760         (base_class.1): Likewise.
2761         (access_specifier): Likewise.
2762         * search.c (lookup_member): Likewise.
2763         * semantics.c (finish_qualified_object_call_expr): Likewise.
2764         (finish_template_type_parm): Likewise.
2765         (begin_class_definition): Likewise.
2766         (finish_base_specifier): Likewise.
2767         * sig.c: Remove.
2768         * tree.c (build_cplus_method_type): Remove support for signatures.
2769         * typeck.c (require_complete_type): Likewise.
2770         (c_sizeof): Likewise.
2771         (c_alignof): Likewise.
2772         (build_object_ref): Likewise.
2773         (build_component_ref): Likewise.
2774         (build_indirect_ref): Likewise.
2775         (build_c_cast): Likewise.
2776         (build_modify_expr): Likewise.
2777         (convert_for_initialization): Likewise.
2778         * typeck2.c (signature_error): Remove.
2779         (store_init_value): Remove support for signatures.
2780         (digest_init): Likewise.
2781         (build_x_arrow): Likewise.
2782         (build_functional_cast): Likewise.
2783         * xref.c (GNU_xref_decl): Likewise.
2784         
2785 1999-08-10  Martin v. Loewis  <martin@mira.isdn.cs.tu-berlin.de>
2786
2787         * lex.c (do_identifier): Remove unnecessary lookup of class field.
2788
2789 1999-08-09  Martin v. Loewis  <martin@mira.isdn.cs.tu-berlin.de>
2790
2791         * decl2.c (set_decl_namespace): Do not complain about non-matching
2792         decls if processing a template.
2793
2794 1999-08-09  Mark Mitchell  <mark@codesourcery.com>
2795
2796         * decl.c (build_ptrmemfunc_type): Handle qualified
2797         pointer-to-member types here.
2798         * tree.c (cp_build_qualified_type_real): Simplify handling here.
2799
2800 1999-08-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2801
2802         * lex.c (lang_identify): Likewise.
2803
2804 1999-08-09  Bernd Schmidt  <bernds@cygnus.co.uk>
2805
2806         * Makefile.in: Update dependencies.
2807         * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
2808         NULL_RTX.
2809         * decl.c: Include "function.h"
2810         (cleanup_label, return_label): Delete declarations.
2811         (store_parm_decls):  Don't initialize DECL_SAVED_INSNS with NULL_RTX.
2812         (finish_function): Rename last_parm_insn variable to
2813         fn_last_parm_insn.  Don't compare DECL_SAVED_INSNS to NULL_RTX.
2814         * decl2.c: Include "function.h".
2815         (rtl_expr_chain): Delete declaration.
2816         * method.c: Include "function.h"
2817         * tree.c (build_vbase_pointer_fields): Don't initialize
2818         DECL_SAVED_INSNS with NULL_RTX.
2819         * typeck.c: Include "function.h"
2820
2821 1999-08-09  Jason Merrill  <jason@yorick.cygnus.com>
2822
2823         * semantics.c (begin_function_try_block, finish_function_try_block,
2824         finish_function_handler_sequence): New fns.
2825         * parse.y (function_try_block): Use them.
2826         * pt.c (instantiate_decl): Likewise.
2827
2828         * cp-tree.h: Declare in_function_try_handler.
2829         * decl.c: Define it.
2830         (start_function): Clear it.
2831         (struct cp_function, push_cp_function_context): Save it.
2832         (pop_cp_function_context): Restore it.
2833         * parse.y (function_try_block): Set and clear it.
2834         * except.c (expand_end_catch_block): Rethrow if we reach the end
2835         of a function-try-block handler in a ctor or dtor.
2836         * typeck.c (c_expand_return): Complain about returning from a
2837         function-try-block handler of a ctor.
2838
2839         * parse.y (function_try_block): Call end_protect_partials
2840         before expand_start_all_catch.
2841
2842 1999-08-08  Jason Merrill  <jason@yorick.cygnus.com>
2843
2844         * decl.c (struct binding_level): Add eh_region field.
2845         (push_binding_level): Set it.
2846         (define_label): Complain about jumping into an EH block.
2847
2848         * ptree.c (print_lang_type): Print the real type of a PMF.
2849         Print what exceptions a fn type throws.
2850
2851 1999-08-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2852
2853         * class.c (count_fields, add_fields_to_vec): Add static prototype.
2854
2855         * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
2856         get_id_2, composite_pointer_type, dump_node_to_file): Constify a
2857         char*.
2858
2859         * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
2860         Constify a char*.
2861
2862         * decl2.c (finish_static_data_member_decl, grokfield): Constify a
2863         char*.
2864
2865         * dump.c (queue_and_dump_index, dump_int, dump_string,
2866         dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
2867         a char*.
2868         (dump_stmt): Add static prototype.
2869
2870         * errfn.c (cp_thing): Constify a char*.
2871
2872         * error.c (dump_unary_op, dump_binary_op, aggr_variety,
2873         dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
2874         dump_expr): Constify a char*.
2875
2876         * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
2877         read_line_number): Add static prototype.
2878         (opname_tab, assignop_tab, operator_name_string): Constify a char*.
2879         (real_yylex): Move label `letter' into the scope where it is used.
2880
2881         * method.c (build_mangled_template_parm_index, build_overload_int,
2882         build_decl_overload_real, get_id_2): Constify a char*.
2883
2884         * search.c (check_final_overrider): Make static.
2885
2886         * typeck.c (composite_pointer_type): Constify a char*.
2887
2888 1999-08-06  Jason Merrill  <jason@yorick.cygnus.com>
2889
2890         * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
2891         we're looking at a class.
2892
2893         * decl.c (lookup_name_real): Set the complain flag if we're
2894         looking for a namespace member.
2895
2896         * lex.c (real_yylex): We can have a number with no digits.
2897
2898         * cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
2899
2900         * search.c (binfo_from_vbase): New fn.
2901         * cp-tree.h: Declare it.
2902         * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
2903         from pointer to member of virtual base.  
2904         * typeck.c (get_delta_difference): Likewise.
2905
2906 1999-08-06  Alexandre Oliva  <oliva@dcc.unicamp.br>
2907
2908         * pt.c (tsubst): Use build_index_type to build in-template array
2909         index type.  Fixes g++.oliva/dwarf1.C.
2910         * decl.c (grokdeclarator): Likewise, just for consistency, as it
2911         doesn't seem to trigger the bug without it.
2912
2913 1999-08-06  Jason Merrill  <jason@yorick.cygnus.com>
2914
2915         * typeck2.c (add_exception_specifier): Use complete_type.
2916
2917 1999-08-06  Mark Mitchell  <mark@codesourcery.com>
2918
2919         * error.c (dump_expr): Handle EXACT_DIV_EXPR.
2920         (dump_binary_op): Bulletproof.
2921         * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
2922         * tree.c (search_tree): Don't enumerate all the nodes of classes
2923         `1', `2', and `<'; handle them generically.  Don't be sorry about
2924         "unrecognized tree codes"; just abort.
2925         (no_linkage_check): Don't do linkage checks for templates.
2926         
2927         * tree.c (cp_build_qualified_type_real): Handle
2928         pointer-to-member-function types correctly.
2929
2930 1999-08-05  Jason Merrill  <jason@yorick.cygnus.com>
2931
2932         * decl.c (pushdecl): Only give an error for shadowing a parm 
2933         from *this* function.
2934
2935 Thu Aug  5 02:40:42 1999  Jeffrey A Law  (law@cygnus.com)
2936
2937         * typeck2.c: Update URLs and mail addresses.
2938
2939 1999-08-04  Nathan Sidwell  <nathan@acm.org>
2940
2941         * cp-tree.h (empty_except_spec): New global var.
2942         (compexcepttypes): Remove prototype.
2943         (comp_except_specs): Prototype new global function.
2944         (add_exception_specifier): Prototype new global function.
2945         * decl.c (empty_except_spec): Define new global var.
2946         (duplicate_decls): Use comp_except_specs, reword error message.
2947         (init_decl_processing): Initialize empty_except_spec.
2948         Adjust build_exception_variant calls.
2949         * parse.y (exception_specification_opt): Use empty_except_spec.
2950         (ansi_raise_identifier): Call check_for_new_type.
2951         (ansi_raise_identifiers): Use add_exception_specifier.
2952         * pt.c (tsubst): Use add_exception_specifier to build exception
2953         specifier.
2954         * search.c (check_final_overrider): New static function, broken
2955         out of get_matching_virtual. Check throw specifiers, reword
2956         diagnostics.
2957         (get_matching_virtual): Use check_final_overrider.
2958         * tree.c (build_exception_variant): Use comp_except_specs.
2959         * typeck.c (compexcepttypes): Remove.
2960         (comp_except_types): New static function, helper for
2961         comp_except_specs. Compare two types as exception specifiers.
2962         (comp_except_specs): New global function, compare two exception
2963         specifiers.
2964         (comptypes): Adjust for comp_except_specs.
2965         * typeck2.c (add_exception_specifier): New global function.
2966         
2967         * class.c (check_for_override): Reword error message.
2968
2969 1999-08-03  Nathan Sidwell  <nathan@acm.org>
2970
2971         * call.c (convert_arg_to_ellipsis): Use pod_type_p.
2972         * cp-tree.h (struct lang_type): Added non_pod_class flag.
2973         (CLASSTYPE_NON_POD_P): New macro to access it.
2974         * class.c (finish_struct_1): Determine non-PODness.
2975         Check for arrays of pointers (-Weffc++).
2976         Remove array inspection duplicated code.
2977         * tree.c (pod_type_p): Detect non-pod non-aggregate types.
2978         Use CLASSTYPE_NON_POD_P.
2979
2980 1999-08-03  Nathan Sidwell  <nathan@acm.org>
2981
2982         * class.c (duplicate_tag_error): Preserve template information.
2983
2984 1999-08-03  Nathan Sidwell  <nathan@acm.org>
2985
2986         * decl.c (start_enum): Show location of previous definition.
2987         * parse.y (enumlist_opt): New reduction.
2988         (structsp): Simplify enum rules to use enumlist_opt.
2989
2990 1999-08-03  Jason Merrill  <jason@yorick.cygnus.com>
2991
2992         * lex.c (yyprint): Handle PFUNCNAME.
2993
2994         * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
2995         build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
2996
2997 1999-08-03  Mumit Khan  <khan@xraylith.wisc.edu>
2998
2999         * decl.c (start_decl): Set attributes before duplicate_decls call.
3000
3001 1999-08-02  Mark Mitchell  <mark@codesourcery.com>
3002
3003         * Make-lang.in (CXX_SRCS): Add dump.c.
3004         * Makefile.in (CXX_OBJS): Add dump.o.
3005         (dump.o): New target.
3006         * cp-tree.h (DECL_CONV_FN_P): Document.
3007         (DECL_OVERLOADED_OPERATOR_P): New function.
3008         (TYPE_PTRMEM_CLASS_TYPE): New macro.
3009         (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
3010         (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
3011         (ASM_VOLATILE_P): New macro.
3012         (STMT_LINENO): Likewise.
3013         (cp_namespace_decls): New function.
3014         (dump_node_to_file): New function.
3015         * decl.c (cp_namespace_decls): New function.
3016         (walk_namespaces_r): Use it.
3017         (wrapup_globals_for_namespace): Likewise.
3018         * decl2.c (flag_dump_translation_unit): New variable.
3019         (lang_decode_option): Handle -fdump-translation-unit.
3020         (finish_file): If flag_dump_translation_unit is set, dump the
3021         translation unit.
3022         * dump.c: New file.
3023         * lang-options.h: Add -fdump-translation-unit.
3024         * pt.c (tsubst_template_parms): Robustify.
3025         (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
3026         (tsubst_expr): Use STMT_LINENO.
3027         * semantics.c (finish_asm_stmt): Eliminate duplicate code.  Check
3028         for invalid cv-qualifiers even while building templates.
3029         
3030 1999-08-02  Richard Henderson  <rth@cygnus.com>
3031
3032         * call.c: Include defaults.h instead of expr.h.
3033         * decl.c: Likewise.
3034         * pt.c: Likewise.
3035         * typeck.c: Include defaults.h.
3036
3037 1999-08-02  Mark Mitchell  <mark@codesourcery.com>
3038
3039         * lex.c (errorcount, sorrycount): Don't declare.
3040         * repo.c (errorcount, sorrycount): Likewise.
3041         * typeck2.c (errorcount, sorrycount): Likewise.
3042
3043 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
3044
3045         * call.c (convert_default_arg, build_over_call): Change all uses of
3046         PROMOTE_PROTOTYPES, so that it tests it as a C expression.
3047         Ensure expr.h is included.
3048         * decl.c (grokparams): Ditto.
3049         * pt.c (tsubst_decl): Ditto.
3050         * typeck.c (convert_arguments): Ditto.
3051
3052 1999-08-02  Jason Merrill  <jason@yorick.cygnus.com>
3053
3054         * class.c (mark_overriders): Fix order of args to overrides.
3055         (warn_hidden): Likewise.  Fix for having virtual and non-virtual
3056         functions with the same name.
3057
3058 1999-08-02  Richard Henderson  <rth@cygnus.com>
3059
3060         * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
3061
3062 1999-08-01  Mark Mitchell  <mark@codesourcery.com>
3063
3064         * call.c (build_conditional_expr): Fix typo in comment.
3065
3066 1999-08-01  Bernd Schmidt  <bernds@cygnus.co.uk>
3067
3068         * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
3069         case_stack; use in_control_zone_p.
3070         * typeck.c (c_expand_return): Likewise.
3071
3072 1999-07-31  Bernd Schmidt  <bernds@cygnus.co.uk>
3073
3074         * except.c (catch_clauses): Delete declaration.
3075
3076 1999-07-30  Mark Mitchell  <mark@codesourcery.com>
3077
3078         * call.c (build_conditional_expr): Call convert_from_reference to
3079         avoid reference/non-reference type confusion.  Fix typo.
3080
3081 1999-07-30  Richard Henderson  <rth@cygnus.com>
3082
3083         * typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
3084         * cp-tree.h (initializer_constant_valid_p): Remove.
3085
3086 1999-07-28  Mark Mitchell  <mark@codesourcery.com>
3087
3088         * call.c (conditional_conversion): Don't build BASE_CONVs for
3089         conversions between things that have the same type.
3090         (build_conditional_expr): Tweak.
3091         (convert_like): Some BASE_CONVs really do require the generation
3092         of code.
3093         
3094         * init.c (perform_member_init): Don't go through build_modify_expr
3095         for simple initializations.
3096
3097 1999-07-27  Jason Merrill  <jason@yorick.cygnus.com>
3098
3099         * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
3100         * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
3101         virtual functions and MI.  Simplify.
3102
3103         * method.c: Remove prototype for largest_union_member.
3104         * pt.c (determine_specialization): Fix uninitialized warning.
3105         * lex.c (real_yylex): Likewise.
3106
3107 1999-07-27  Mark Mitchell  <mark@codesourcery.com>
3108
3109         * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
3110         here too.
3111
3112         * cp-tree.h (BINFO_VIRTUALS): Document new format.
3113         * class.c (modify_one_vtable): Change prototype accordingly.
3114         (modify_all_vtables): Likewise.
3115         (modify_all_direct_vtables): Likewise.
3116         (modify_all_indirect_vtables): Likewise.
3117         (build_vtable_entry_for_fn): New function.
3118         (set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
3119         (modify_vtable_entry): Likewise.
3120         (add_virtual_function): Likewise.
3121         (build_vtbl_initializer): New function.
3122         (finish_vtbls): Simplify for new BINFO_VIRTUALS format.
3123         (fixup_vtable_deltas1): Likewise.
3124         (fixup_vtable_deltas): Likewise.
3125         (override_one_vtable): Likewise.
3126         (finish_struct_1): Likewise.
3127
3128         * error.c (dump_expr): Likewise.
3129         * search.c (get_abstract_virtuals_1): Likewise.
3130         (get_abstract_virtuals): Likewise.
3131         (expand_upcast_fixups): Likewise.
3132         * tree.c (debug_binfo): Likewise.
3133         * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
3134         __pure_virtual here.
3135         
3136 1999-07-26  Mark Mitchell  <mark@codesourcery.com>
3137
3138         * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
3139         as per 1999-07-26 change.
3140
3141         * typeck.c (c_sizeof): Don't allow non-static data members.
3142         (expr_sizeof): Likewise.
3143
3144 1999-07-26  Jason Merrill  <jason@yorick.cygnus.com>
3145
3146         * input.c (feed_input): Only touch lineno and input_filename
3147         if !USE_CPPLIB.  Save the old values before setting the new ones.
3148
3149         * input.c (feed_input): Add file, line parms.
3150         * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
3151         (real_yylex): Check linemode before input_redirected().
3152
3153         * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
3154         from op new to warning.
3155
3156 1999-07-26  Mark Mitchell  <mark@codesourcery.com>
3157
3158         * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
3159         * call.c: All uses changed.
3160         * typeck.c: Likewise.
3161
3162 1999-07-26  Nathan Sidwell  <nathan@acm.org>
3163
3164         * exception.cc (__cplus_type_matcher): Match __eh_matcher
3165         prototype.
3166
3167 1999-07-26  Mark Mitchell  <mark@codesourcery.com>
3168
3169         * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
3170         (ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
3171         (strip_top_quals): Declare.
3172         (ncp_convert): Likewise.
3173         (type_after_usual_arithmetic_converions): Likewise.
3174         (composite_pointer_type): Likewise.
3175         * call.c (strip_top_quals): Don't make it static.
3176         (promoted_arithmetic_type_p): New function.
3177         (conditional_conversion): Likewise.
3178         (null_ptr_cst_p): Allow `false' as a NULL pointer constant.
3179         (standard_conversion): Use same_type_p.  Don't build BASE_CONVs
3180         for converting a type to itself.
3181         (reference_binding): Honor LOOKUP_NO_TEMP_BIND.
3182         (implicit_conversion): Make sure the from and to types are
3183         complete.
3184         (add_builtin_candidate): Correct handling of ?: operator.
3185         (add_builtin_candidates): Improve documentation.
3186         (build_conditional_expr): New function.
3187         (can_convert): Implement in terms of can_convert_arg.
3188         (ncp_convert): New function.
3189         * typeck.c (type_after_usual_arithmetic_conversions): New
3190         function, split out from common_type.
3191         (composite_pointer_type): New function, split out from
3192         build_conditional_expr.
3193         (common_type): Use type_after_usual_arithmetic_conversions.
3194         Remove redundant attribute merging.
3195         (comptypes): Tidy.  Handle COMPLEX_TYPE.
3196         (build_binary_op_nodefault): Use null_ptr_cst_p.
3197         (build_conditional_expr): Remove.
3198         (convert_for_assignment): Use new conversion functions.
3199         
3200         * cp-tree.h (abstract_virtuals_error): Change declaration.
3201         * typeck2.c (abstract_virtuals_error): Check to see if an error
3202         ocurred, and return a boolean value accordingly.
3203         (build_functional_cast): Adjust accordingly.
3204         * class.c (finish_struct_1): Likewise.
3205         * cvt.c (ocp_convert): Likewise.
3206         * decl.c (cp_finish_decl): Likewise.
3207         (grokparams): Likewise.
3208         (grok_op_properties): Likewise.
3209         (start_function): Likewise.
3210         * init.c (build_new_1): Likewise.
3211
3212         * pt.c (unify): Don't get confused by pointers-to-member functions.
3213
3214         * search.c (build_cplus_new): Robustify.
3215         
3216 1999-07-24  Richard Henderson  <rth@cygnus.com>
3217
3218         * gxx.gperf (__builtin_va_arg): New.
3219         * parse.y (VA_ARG): New token.
3220         (unary_expr): Recognize it.
3221
3222 Sun Jul 25 15:24:21 1999  Jeffrey A Law  (law@cygnus.com)
3223
3224         * g++FAQ.texi: Deleted per Joe Buck's request.
3225         * Makefile.in: Corresponding changes.
3226
3227 1999-07-23  Jason Merrill  <jason@yorick.cygnus.com>
3228
3229         * lex.c: Sync with C frontend.
3230         (whitespace_cr): New fn.
3231         (skip_white_space): Use it.
3232         (init_parse): Reorder.
3233         (yyprint): Support CONSTANT.
3234         (pragma_getc, pragma_ungetc): Bring back.
3235         (read_line_number): Change in_system_header directly.
3236         (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
3237         (parse_float): Update to C version.
3238         (yylex): Handle '$' under the letter case.
3239         Remove looking_for_typename handling.
3240         Support hex floating point constants.
3241         Follow C's lead for choosing type of integer constants.
3242         Rearrange stuff to match C frontend.
3243         (yyungetc, reinit_parse_for_block, yylex): Support indent_level.
3244         * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
3245
3246 1999-07-23  Mark Mitchell  <mark@codesourcery.com>
3247
3248         * call.c (reference_binding): Tweak.
3249         (mayble_handle_implicit_object): Use direct_reference_binding to
3250         create the right implicit conversion sequence.
3251
3252 1999-07-22  Mark Mitchell  <mark@codesourcery.com>
3253
3254         * pt.c (convert_nontype_argument): Don't call decl_constant_value
3255         if we're converting to a reference type.
3256
3257         * call.c (NEED_TEMPORARY_P): New macro.
3258         (standard_conversion): Set it, for derived-to-base conversions.
3259         (reference_related_p): New function.
3260         (reference_compatible_p): Likewise.
3261         (convert_class_to_reference): Likewise.
3262         (direct_reference_binding): Likewise.
3263         (reference_binding): Rework for standards-compliance.
3264         (convert_like): Adjust accordingly.
3265         (maybe_handle_ref_bind): Simplify; the right conversion sequences
3266         are now built up in reference_binding.
3267         (initialize_reference): New function.
3268         * cp-tree.h (ICS_USER_FLAG): Document.
3269         (ICS_THIS_FLAG): Likewise.
3270         (ICS_BAD_FLAG): Likewise.
3271         (NEED_TEMPORARY_P): Likewise.
3272         (cp_lvalue_kind): New type.
3273         (real_lvalue_p): Return it.
3274         * error.c (dump_expr): Provide more accurate representation for
3275         AGGR_INIT_EXPRs.
3276         * init.c (expand_default_init): Do not try to perform implicit
3277         conversions for a brace-enclosed initializer.
3278         * search.c (lookup_conversions): Document.
3279         * tree.c (lvalue_p_1): Return a cp_lvalue_kind.  Calculate
3280         appropriately.
3281         (real_lvalue_p): Adjust accordingly.
3282         (lvalue_p): Likewise.
3283         (build_cplus_new): Don't allow the creation of an abstract class.
3284         * typeck.c (convert_for_initialization): Use initialize_reference.
3285         
3286 1999-07-21  Gavin Romig-Koch  <gavin@cygnus.com>
3287
3288         * lex.c (real_yylex) : Correct the test for overflow when lexing
3289         integer literals.
3290
3291 1999-07-20  Jason Merrill  <jason@yorick.cygnus.com>
3292
3293         * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL,
3294         not DECL_BUILT_IN, to determine if a function is internally declared.
3295         (duplicate_decls): Likewise.  Improve handling of builtins.
3296         (push_overloaded_decl): Remove special handling of builtins.
3297
3298         * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P.
3299
3300         * decl.c (grokdeclarator): Pull out decl_constant_value in
3301         templates, too.
3302
3303         * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm.
3304         * cp-tree.h, pt.c, semantics.c: Adjust.
3305         * method.c (largest_union_member): Remove.
3306
3307         * lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
3308
3309         * lex.c (token_getch, token_put_back): New fns.
3310         (real_yylex): Use them.
3311
3312         * lex.c (lang_init): Generalize.
3313         (lang_init_options): Tell cpplib this is C++.
3314         (nextchar): Remove.  Replace uses with put_back.
3315         (skip_white_space): Handle linemode here.  Optimize for cpplib.
3316         (extend_token_buffer_to): New fn.
3317         (extend_token_buffer): Use it.
3318         (read_line_number, check_newline): Just deal with tokens.
3319         (real_yylex): More cpplib optimizations.  Simplify.  Don't produce
3320         EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here.
3321         * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING.
3322         * parse.y (PAREN_STAR_PAREN): Remove.
3323         * input.c: Don't use the putback machinery with cpplib.
3324         (sub_getch): Fold back into getch.
3325         (getch): Don't handle linemode here.
3326         (feed_input): Unget any text in the token buffer.
3327
3328         * lex.c (set_typedecl_interface_info, set_vardecl_interface_info,
3329         nextyychar, nextyylval): Remove.
3330
3331 1999-07-20  Michael Tiemann  <tiemann@holodeck.cygnus.com>
3332             Jason Merrill  <jason@yorick.cygnus.com>
3333
3334         * lex.c (indent_level): New variable.
3335         (init_parse): Set cpp_token to CPP_DIRECTIVE.
3336         (consume_string): Make this smart about USE_CPPLIB.
3337         (yyungetc): Use put_back function.
3338         (pragma_getc, pragma_ungetc): Functions deleted.
3339         (check_newline): Rewrite to be intelligent about USE_CPPLIB.
3340         Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and
3341         pragma_ungetc.
3342         (real_yylex): Rewrite to be intelligent about USE_CPPLIB.
3343         Also, clean up cases where we redundantly set token_buffer[0].
3344         (read_line_number): New fn.
3345         * input.c (feed_input): Use integrated cpplib if USE_CPPLIB.
3346         (end_input): Call cpp_pop_buffer if USE_CPPLIB.
3347         (sub_getch): Conditionalize out code that's not appropriate if
3348         USE_CPPLIB.
3349         (put_back): Rewrite in case USE_CPPLIB is defined.
3350         (input_redirected): Ditto.
3351
3352 Tue Jul 20 11:24:19 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
3353
3354         * cp-tree.h: Delete lots of declarations of tree nodes; replaced by
3355         c_global_trees and accessor macros defined in c-common.h.
3356         (cp_tree_index): New enumeration.
3357         (cp_global_trees): Declare new array.  Add accessor macros for it, and
3358         delete declarations of tree nodes replaced by it.
3359         (builtin_function): Delete macro, add declaration for new function.
3360         Include c-common.h.
3361         * decl.c: Delete definitions for tree nodes that were replaced by
3362         cp_global_trees and c_global_trees.
3363         (init_decl_processing): Call c_common_nodes_and_builtins; delete code
3364         to generate the common builtins here.
3365         (builtin_function): New function.
3366         * decl2.c (abort_fndecl): Delete declaration.
3367         * except.c (expand_builtin_return_address): Delete declaration.
3368         (builtin_return_address_fndecl): Delete variable.
3369         (const_ptr_type_node): Delete declaration.
3370         * lex.c (cons_up_default_function): Delete declaration of
3371         void_list_node.
3372         * parse.y (void_list_node): Delete declaration.
3373         * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
3374         Delete variables.
3375         (const_string_type_node): Delete declaration.
3376         * search.c (abort_fndecl): Delete declaration.
3377         * Makefile.in: Update dependencies.
3378
3379 1999-07-19  Mark Mitchell  <mark@codesourcery.com>
3380
3381         * pt.c (check_default_tmpl_args): Move test for missing default
3382         arguments here, from ...
3383         (end_template_parm_list): Here.
3384
3385 1999-07-18  Mark Mitchell  <mark@codesourcery.com>
3386
3387         * decl.c (lookup_nested_type): Remove.
3388         (pushtag): Don't call it.
3389
3390 Sat Jul 17 23:51:30 1999  Jeffrey A Law  (law@cygnus.com)
3391
3392         * Makefile.in (INTERFACE): Bump to 2.
3393
3394 1999-07-17  Alexandre Oliva  <oliva@dcc.unicamp.br>
3395         
3396         * typeck2.c (my_friendly_abort): Updated URL with bug reporting
3397         instructions to gcc.gnu.org.  Removed e-mail address.
3398
3399 1999-07-17  Mark Mitchell  <mark@codesourcery.com>
3400
3401         * pt.c (determine_specialization): Tighten error-checking.
3402         (end_template_parm_list): Likewise.
3403
3404 1999-07-14  Mark Mitchell  <mark@codesourcery.com>
3405
3406         * pt.c (check_default_tmpl_args): Handle friends defined in the
3407         class just like member functions defined in the class.
3408
3409 1999-07-09  Michael Tiemann  <tiemann@happy.cygnus.com>
3410             Jason Merrill  <jason@yorick.cygnus.com>
3411
3412         * cp-tree.h (struct lang_decl): Added field for storing sorted
3413         FIELD_DECLs (used in TYPE_DECLs).
3414         (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
3415         (DECL_SORTED_FIELDS): New macro.
3416         * class.c (method_name_cmp): New function.
3417         (finish_struct_methods): Modified to support sorting and searching
3418         methods.
3419         (finish_struct_anon): Changed code in inner loop to use ELT rather 
3420         than UELT (which required an extra indirection for every reference).
3421         (field_decl_cmp): New function to support sorting FIELD_DECLs.
3422         (finish_struct_1): Sort fields.
3423         * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
3424         (lookup_fnfields_1): Search sorted methods in METHOD_VEC.
3425         Also, switch to using array indexing rather than a changing pointer.
3426         * ptree.c (print_lang_decl): Handle TYPE_DECLs that have
3427         DECL_SORTED_FIELDS.
3428
3429 1999-07-09  Jason Merrill  <jason@yorick.cygnus.com>
3430
3431         * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
3432         casts in system headers or extern "C" blocks.
3433
3434         * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
3435         errors to pedwarn.
3436
3437 1999-07-09  Michael Tiemann  <tiemann@happy.cygnus.com>
3438
3439         * decl2.c (write_virtuals): Deleted declaration.
3440         * cp-tree.h (write_virtuals): Deleted extern declaration.
3441         * class.c (finish_struct_1): Removed #if 0'd code that mentions
3442         write_virtuals.
3443         * semantics.c (begin_class_definition): Rewrite code to not depend
3444         on write_virtuals.
3445
3446         * lex.c (cp_pragma_interface): New function.
3447         (cp_pragma_implementation): Likewise.
3448         (handle_cp_pragma): Call them.
3449
3450         * typeck.c (comptypes): Simplify C code in look_hard.
3451
3452         * xref.c (PALLOC): Use xcalloc, not calloc.
3453         (SALLOC): Use xmalloc, not malloc.
3454
3455         * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
3456
3457         * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
3458         is NO_DEBUG.
3459
3460         * decl.c (duplicate_decls): If a redeclaration doesn't match the
3461         initial declaration, then don't save the inline info and by all
3462         means don't mark the function as a builtin function.
3463
3464         * decl.c (lookup_name_real): Set NONCLASS to 1 if 
3465         CURRENT_CLASS_TYPE is 0.
3466
3467         * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
3468         NULL_TREE.
3469
3470         * ptree.c (print_lang_type): Added vtable-needs-writing.
3471
3472 Wed Jul  7 01:26:47 1999  Alexandre Oliva  <oliva@dcc.unicamp.br>
3473
3474         * decl2.c (mark_vtable_entries): Fix check for rtti offset.
3475
3476 1999-07-06  Gavin Romig-Koch  <gavin@cygnus.com>
3477
3478         * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
3479         Merged into c-common.
3480
3481 1999-07-05  Dave Brolley  <brolley@cygnus.com>
3482
3483         * lex.c (errorcount): Declare it.
3484         (finish_parse): Update errorcount for when using CPPLIB.
3485
3486 1999-07-05  Mark Mitchell  <mark@codesourcery.com>
3487
3488         * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
3489         parameters.
3490         (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
3491         * decl.c (push_class_binding): Use it.
3492         (lookup_name_real): Likewise.
3493
3494 1999-07-02  Gavin Romig-Koch  <gavin@cygnus.com>
3495
3496         * cp-tree.h (widest_integer_literal_type_node,
3497         widest_unsigned_literal_type) : New.
3498         * decl.c (widest_integer_literal_type_node,
3499         widest_unsigned_literal_type) : New.
3500         (init_decl_processing): Handle/use the two new types.
3501         * lex.c (real_yylex): Same.
3502         * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
3503         Same. 
3504
3505 1999-07-01  Mark Mitchell  <mark@codesourcery.com>
3506
3507         * decl.c (grokdeclarator): Don't give names "for linkage purposes"
3508         to anonymous cv-qualified types.
3509
3510 1999-07-01  Gavin Romig-Koch  <gavin@cygnus.com>
3511
3512         * lex.c (real_yylex) : Change integer literal overflow handling to
3513         be like c-lex.c.
3514
3515         * lex.c (real_yylex): Improve 'integer constant out of range' messages.
3516
3517 1999-06-28  Richard Henderson  <rth@cygnus.com>
3518
3519         * decl.c (cp_finish_decl): Fix typo in cp_warning_at call.
3520
3521 1999-06-28  Jason Merrill  <jason@yorick.cygnus.com>
3522
3523         * error.c (dump_type_real): Handle TREE_LIST again.
3524
3525         * typeck.c (comp_target_parms): Don't complain about 
3526         converting from () to (...) if !flag_strict_prototype.
3527
3528         * decl.c (grokdeclarator): Update the names of all variants when
3529         de-anonymizing.
3530
3531 1999-06-21  Mark Mitchell  <mark@codesourcery.com>
3532
3533         * init.c (expand_aggr_vbase_init): Rename to
3534         construct_virtual_bases.  Conditionalize construction here, 
3535         rather than ...
3536         (emit_base_init): Here.
3537
3538 1999-06-19  Mark Mitchell  <mark@codesourcery.com>
3539
3540         * semantics.c (finish_asm_statement): Apply decay conversions to
3541         input operands.
3542
3543         * decl.c (expand_static_init): When building an anonymous function
3544         for use with atexit, compute its body before and after entering
3545         the function.
3546
3547         * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
3548         EXIT_EXPR.
3549         
3550 1999-06-18  Mark Mitchell  <mark@codesourcery.com>
3551
3552         * init.c (expand_aggr_vbase_init): Add flag parameter.
3553         (build_partial_cleanup_for): Remove, inlining into ..
3554         (expand_cleanup_for_base): ... here.  Take flag parameter.
3555         (emit_base_init): Pass the in_chrg parameter to
3556         emit_aggr_vbase_init. 
3557         (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.
3558         
3559 1999-06-16  Mark Mitchell  <mark@codesourcery.com>
3560
3561         * decl2.c (import_export_decl): Use same_type_p, rather than
3562         relying on pointer-equality for types.
3563
3564         * method.c (do_build_copy_constructor): Simplify.
3565
3566         * call.c (build_method_call): Remove bogus code for two-argument
3567         delete.
3568         * init.c (build_new_1): Expand on comment, and remove dead code.
3569
3570         * init.c (expand_cleanup_for_base): New function, split out
3571         from ...
3572         (emit_base_init): Here.
3573         (expand_aggr_vbase_init): Use it.
3574
3575 1999-06-15  Mark Mitchell  <mark@codesourcery.com>
3576
3577         * cp-tree.h (class_cache_firstobj): Declare.
3578         (maybe_push_cache_obstack): Rename to push_cache_obstack.
3579         * class.c (permanent_obstack): Remove declaration.
3580         (class_cache_firstobj): Make it global.
3581         (add_method): Don't use permanent_obstack directly.
3582         (pushclass): Only free the class_cache_obstack if we know how far
3583         back to free it.
3584         (maybe_push_cache_obstack): Rename to push_cache_obstack.
3585         * decl.c: Remove dead comment.
3586         (saved_scope): Add class_cache_firstobj.
3587         (push_to_top_level): Save it.
3588         (pop_from_top_level): Restore it.
3589         (push_class_level_binding): Use push_cache_obstack, not
3590         maybe_push_cache_obstack.
3591         * search.c (push_class_decls): Likewise.
3592         
3593 1999-06-14  Martin von Löwis  <loewis@informatik.hu-berlin.de>
3594
3595         * pt.c (tsubst_friend_function): Push into namespace of friend
3596         function before pushdecl'ing it.
3597
3598 1999-06-14  Nathan Sidwell  <nathan@acm.org>
3599
3600         * call.c (build_new_op): Remove REF_BIND from all operands.
3601
3602 1999-06-13  Alexandre Oliva  <oliva@dcc.unicamp.br>
3603
3604         * init.c (build_new_1): Look up operator delete even if there was
3605         no explicit new placement.
3606
3607 1999-06-08  Nathan Sidwell  <nathan@acm.org>
3608
3609         * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
3610         of ...
3611         (build_throw): ... here. Call it.
3612         (process_start_catch_block): Call it.
3613
3614 1999-06-07  Mark Mitchell  <mark@codesourcery.com>
3615
3616         * search.c (convert_pointer_to_single_level): Reimplement without
3617         using get_binfo.
3618
3619 1999-06-06  Mark Mitchell  <mark@codesourcery.com>
3620
3621         * method.c (is_back_referenceable_type): Back-reference bools when
3622         not squangling.
3623
3624 1999-06-07  Dave Brolley  <brolley@cygnus.com>
3625
3626         * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
3627         * input.c (putback_buffer): New structure type.
3628         (putback): Replaces putback_char member.
3629         (putback): Replaces putback_char static variable.
3630         (feed_input): Use putback.
3631         (end_input): Use putback.
3632         (sub_getch): Use putback.
3633         (put_back): Use putback.
3634
3635 1999-06-05  Mark Mitchell  <mark@codesourcery.com>
3636
3637         * decl.c (grokdeclarator): Fix typo in last change.
3638
3639 1999-06-04  Jason Merrill  <jason@yorick.cygnus.com>
3640
3641         * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
3642         (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
3643
3644 1999-06-04  Nathan Sidwell  <nathan@acm.org>
3645
3646         * except.c (build_throw): Check throw expression validity.
3647
3648 1999-06-03  Mark Mitchell  <mark@codesourcery.com>
3649
3650         * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
3651         just because flag_signed_bitfields is false.
3652
3653 1999-06-03  Nathan Sidwell  <nathan@acm.org>
3654
3655         * semantics.c (begin_class_definition): Update the struct's
3656         location here ...
3657         * class.c (finish_struct): ... rather than here.
3658
3659         * decl.c (make_typename_type): Don't rely on uninitialized
3660         variable.
3661
3662 1999-05-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3663
3664         * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
3665
3666 1999-05-31  Mark Mitchell  <mark@codesourcery.com>
3667
3668         * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
3669         and friends rather than messing with current_obstack directly.
3670         (cp_build_qualified_type_real): Rework ARRAY_TYPE
3671         allocation to match practice throughout the rest of the 
3672         compiler.
3673
3674 1999-05-30  Mark Mitchell  <mark@codesourcery.com>
3675
3676         * lex.c (make_lang_type): Create TYPE_BINFO for
3677         TEMPLATE_TYPE_PARMs just like for non-template types.
3678
3679         * decl.c (start_decl): Move checks on initialization to ...
3680         (cp_finish_decl): Here.  Tidy formatting slightly.
3681
3682 1999-05-28  Mark Mitchell  <mark@codesourcery.com>
3683
3684         * decl.c (add_binding): Don't complain about a redeclaration of a
3685         semantically identical typedef in a local scope.
3686
3687 1999-05-28  Nathan Sidwell  <nathan@acm.org>
3688
3689         * decl.c (complete_array_type): Allocate off same obstack. Fix
3690         DO_DEFAULT comment to match reality.
3691
3692         * friend.c (make_friend_class): Fix diagnostic typo.
3693
3694 1999-05-28  Mark Mitchell  <mark@codesourcery.com>
3695
3696         * decl.c (lookup_namespace_name): Handle getting a
3697         TEMPLATE_ID_EXPR.
3698         (expand_static_init): Don't call pushdecl for implicitly declared
3699         `atexit' used to register destructors.
3700
3701 1999-05-25  Mark Mitchell  <mark@codesourcery.com>
3702
3703         * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
3704         intialize a vtable.
3705
3706         * cp-tree.h (NAMESPACE_LEVEL): Reformat.
3707         (lang_decl_flags): Document MEMFUNC_POINTER_TO.  Save four bytes
3708         by combining TEMPLATE_INFO and LEVEL into a single union.
3709         (DECL_TEMPLATE_INFO): Reformat.
3710         (DECL_SAVED_TREE): Document.
3711         (DECL_TEMPLATE_INJECT): Remove.
3712         * class.c (finish_struct): Remove code to deal with
3713         DECL_TEMPLATE_INJECT. 
3714
3715         * decl.c (maybe_process_template_type_declaration): Handle all new
3716         types in templates uniformly.
3717         * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
3718         DECL_CONTEXT.
3719         * pt.c (lookup_template_class): Inject template instantiations of
3720         forward-declarations.
3721         (instantiate_class_template): Remove code processing
3722         DECL_TEMPLATE_INJECT.
3723         
3724         * pt.c (lookup_template_class): Tweak lookup to find member
3725         templates.
3726
3727         * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
3728         ASM_CV_QUAL.
3729         * semantics.c (finish_asm_stmt): Make strings permanent if they're
3730         used in a template.
3731         
3732 1999-05-25  Jason Merrill  <jason@yorick.cygnus.com>
3733
3734         * typeck.c (casts_away_constness, casts_away_constness_r): Strip both
3735         parts of pointer to data member types.
3736
3737 1999-05-24  Mark Mitchell  <mark@codesourcery.com>
3738
3739         * decl2.c (mark_vtable_entries): Don't make a copy of a function,
3740         and then make it look like `abort'.  Just use `abort' instead.
3741         
3742         * typeck.c (build_static_cast): Don't allow static_casts that cast
3743         away constness.
3744         (casts_away_constness_r): New function.
3745         (casts_away_constness): Likewise.
3746
3747         * decl.c (lookup_tag): Remove code no longer needed after
3748         name-lookup improvements.
3749         * decl2.c (handle_class_head): Make error-recovery more robust.
3750         * friend.c (make_friend_class): Reject templated typename types.
3751         * lex.c (is_global): A template parameter isn't global.
3752         * parse.y (class_head): Robustify.
3753         * parse.c: Regenerated.
3754         
3755 1999-05-22  Mark Mitchell  <mark@codesourcery.com>
3756
3757         * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
3758         INDIRECT_REFs, and COMPONENT_REFs.  Handle FIELD_DECLs.
3759         
3760         * cp-tree.h (push_nested_namespace): Declare.
3761         (pop_nested_namespace): Likewise.
3762         * decl.c (push_nested_namespace): New function.
3763         (pop_nested_namespace): Likewise.
3764         * pt.c (instantiate_class_template): Use them.
3765
3766         * tree.c (mapcar): Handle NON_LVALUE_EXPR.
3767
3768         * cp-tree.h (cplus_expand_constant): Declare.
3769         * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
3770         converted from one pointer-to-object type to another.
3771         * expr.c (cplus_expand_constant): Don't make it static.
3772         * typeck.c (build_component_ref): Don't crash when presented with
3773         a component which is a TEMPLATE_DECL.
3774         (build_ptrmemfunc): Tidy.  Clarify comment.  Make sure that even a
3775         cast from a pointer-to-member constant to its own type does not
3776         result in a valid non-type template argument.
3777
3778 1999-05-21  Mark Mitchell  <mark@codesourcery.com>
3779             Nathan Sidwell  <nathan@acm.org>
3780         
3781         * Make-lang.in (cc1plus): Make it depend on gxx.gperf.
3782         * cp-tree.h: Fix typo in documentation on pointers-to-members.
3783         (cp_build_qualified_type): Make it a macro.
3784         (cp_build_qualified_type_real): Declare.
3785         * decl.c (grokdeclarator): Remove misleading comment.  Avoid
3786         problem with template parameters and restrict-qualification.
3787         * gxx.gperf: Replace NORID with RID_UNUSED throughout.
3788         * hash.h: Regenerated.
3789         * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
3790         the enumeration.
3791         (NORID): Remove definition.
3792         * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
3793         (tsubst): Likewise.  Remove special handling for FUNCTION_TYPEs.
3794         (fn_type_unification): Check that the function type resulting from
3795         the deduction is legal.
3796         (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
3797         (unify): Use cp_build_qualified_type_real.
3798         * tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
3799         (cp_build_qualified_type): Rename to ...
3800         (cp_build_qualified_type_real): Add additional COMPLAIN parameter
3801         and modify appropriately.
3802         
3803         * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
3804         reveal optimization opportunities.
3805
3806         * pt.c (tsubst): Don't issue error messages when we're not
3807         complaining, even if we see a qualified function type.
3808         (check_cv_quals_for_unify): Don't allow a qualified function
3809         type.
3810
3811 1999-05-20  Jason Merrill  <jason@yorick.cygnus.com>
3812
3813         * class.c (instantiate_type): Downgrade errors for object-dependent
3814         memfn refs to pedwarn.
3815
3816 1999-05-20  Mark Mitchell  <mark@codesourcery.com>
3817
3818         * decl.c (grokdeclarator): Don't treat [] as indicating a
3819         zero-sized array in a typedef.
3820
3821         * call.c (build_object_call): Don't look at DECL_NAME for a type.
3822         (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
3823         (typeck.c): Or TYPE_MAIN_VARIANT for a type.
3824
3825         * pt.c (for_each_template_parm): Rework to match documentation.
3826         Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
3827
3828 1999-05-20  Jason Merrill  <jason@yorick.cygnus.com>
3829
3830         * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
3831
3832         * class.c (finish_base_struct): Allow non-COM bases for COM classes
3833         except at the leftmost position.
3834         (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
3835         Pass the binfo's class, not the most derived, to skip_rtti_stuff.
3836         * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
3837
3838         * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
3839         (build_cplus_new): Make sure that what we return is of the right type.
3840
3841 1999-05-20  Mark Mitchell  <mark@codesourcery.com>
3842
3843         * cp-tree.h (make_ptrmem_cst): New function.
3844         * expr.c (cplus_expand_constant): Split out from ...
3845         (cplus_expand_expr): Here.  Use cplus_expand_constant.
3846         (init_cplus_expand): Set lang_expand_constant.
3847         * pt.c (convert_nontype_argument): Use make_ptrmem_cst.
3848
3849         * tree.c (make_ptrmem_cst): Define.
3850         * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
3851         * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.
3852
3853 1999-05-19  Mark Mitchell  <mark@codesourcery.com>
3854
3855         * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
3856
3857         * decl2.c (start_static_storage_duration_function): Fix comment.
3858         (finish_file): Create static storage duration functions lazily.
3859
3860 1999-05-19  Jason Merrill  <jason@yorick.cygnus.com>
3861
3862         Implement anonymous structs.
3863         * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
3864         * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
3865         * class.c (finish_struct_1): Remove redundant check for anon struct.
3866         * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
3867         (check_tag_decl): Check for anonymous struct here.
3868         * decl2.c (build_anon_union_vars): Catch anon struct at file scope.
3869         * init.c (sort_member_init, emit_base_init): Handle getting fields
3870         as well as names in current_member_init_list.
3871         (perform_member_init): Handle getting an anon aggr.
3872         * method.c (do_build_assign_ref): Don't descend into anon aggrs.
3873         (do_build_copy_constructor): Likewise.
3874
3875 1999-05-19  Mark Mitchell  <mark@codesourcery.com>
3876
3877         * tree.c (cp_build_qualified_type): Don't allow qualified function
3878         types.
3879
3880 Wed May 19 02:50:53 1999  Arvind Sankar <arvinds@mit.edu>
3881
3882         * gxxint.texi: Fix typo.
3883
3884 1999-05-19  Jason Merrill  <jason@yorick.cygnus.com>
3885
3886         * call.c (find_scoped_type, resolve_scope_to_name): Lose.
3887         * class.c (finish_struct_1): Use CLASS_TYPE_P.
3888         * ptree.c (print_lang_type): Likewise.
3889         * typeck.c (build_modify_expr, c_expand_asm_operands): Use
3890         IS_AGGR_TYPE_CODE.
3891         * typeck2.c (digest_init): Likewise.
3892
3893 1999-05-18  Jason Merrill  <jason@yorick.cygnus.com>
3894
3895         * call.c (joust): Compare the types of the conv ops, not the
3896         target types of the conversions.
3897
3898 Tue May 18 00:21:34 1999  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3899
3900         * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
3901         was not given.
3902
3903 1999-05-17  Mark Mitchell  <mark@codesourcery.com>
3904
3905         * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation.
3906         * decl.c (grokfndecl): Don't allow inline declarations of friend
3907         template specializations, or friend template specializations with
3908         default arguments.
3909         * pt.c (tsubst): Handle substitution into array types that does
3910         not yield a fixed upper bound, even when not processing a
3911         template.
3912         (tsubst_copy): Deal with the fact that the second operand to a
3913         TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC.
3914         * search.c (marked_pushdecls_p): Don't descend into
3915         TEMPLATE_TYPE_PARMs and the like.
3916         (unmarked_pushdecls_p): Likewise.
3917         
3918         * call.c (build_over_call): Don't throw away
3919         initializations/copies of empty classes; use MODIFY_EXPR and
3920         INIT_EXPR as for non-empty classes.
3921         * class.c (finish_struct_1): Put the padding byte for an empty
3922         class on the TYPE_NONCOPIED_PARTS list for the class.
3923
3924 1999-05-16  Mark Mitchell  <mark@codesourcery.com>
3925
3926         * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
3927         indicate a reference to a field that is a qualified name.
3928
3929 1999-05-16  Jason Merrill  <jason@yorick.cygnus.com>
3930
3931         * decl2.c (finish_objects): Don't use .?tors.* if we don't have
3932         ASM_OUTPUT_CONSTRUCTOR.
3933
3934         * friend.c (do_friend): Add attrlist arg.  Remove support for
3935         getting a non-decl as 'decl'.
3936         * decl.c (grokfndecl): Remove attrlist arg.  Don't set attrs or
3937         rtl.
3938         (grokdeclarator): Adjust.
3939         * cp-tree.h: Adjust.
3940
3941 1999-05-16  Mark Mitchell  <mark@codesourcery.com>
3942
3943         * cp-tree.h (permanent_p): New function.
3944         * init.c (build_new_1): Use mapcar, not copy_node, to copy a
3945         possibly complex tree node.
3946         * tree.c (mapcar): Adjust comments, and follow coding standards in
3947         conditional.
3948         (permanent_p): New function.
3949
3950 1999-05-13  Per Bothner  <bothner@cygnus.com>
3951
3952         * class.c (push_lang_context):  Turn off DECL_IGNORED_P for
3953         primitive Java types, if we actually see `extern "Java"'.
3954
3955 1999-05-10 18:21 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
3956
3957         * lang-specs.h: Pass -$ to the preprocessor.
3958
3959 1999-05-10  Jason Merrill  <jason@yorick.cygnus.com>
3960
3961         * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too.
3962         Don't bother wrapping an OFFSET_TYPE around unknown_type_node.
3963         (resolve_offset_ref): Don't handle a raw baselink.
3964         * cvt.c (build_expr_type_conversion): Likewise.
3965         * typeck.c (decay_conversion, build_c_cast, convert_for_assignment,
3966         convert_for_initialization): Likewise.
3967         * class.c (instantiate_type): Handle seeing a baselink under an
3968         OFFSET_REF.
3969         * error.c (dump_expr): Likewise.        
3970         * pt.c (for_each_template_parm): Likewise.
3971         (resolve_overloaded_unification): Likewise.
3972         * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise.
3973         * typeck.c (expr_sizeof): Also complain about other permutations
3974         of overloaded functions.
3975
3976 1999-05-07  Jason Merrill  <jason@yorick.cygnus.com>
3977
3978         * init.c (resolve_offset_ref): Don't return a raw method.
3979         Use BASELINK_P.
3980         * typeck.c (decay_conversion): Don't handle a raw method.
3981         Resolve all OFFSET_REFs.
3982         (get_member_function_from_ptrfunc): 0 is a valid vtable index.
3983         (build_binary_op_nodefault): Handle resolving overloaded fns.  Use
3984         same_type_p for pmf bits.  Don't use build_binary_op to compare
3985         raw pointers to methods.
3986         (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE,
3987         to decide when to call resolve_offset_ref.
3988         (build_c_cast, convert_for_initialization): Likewise.
3989         * cvt.c (build_expr_type_conversion): Likewise.
3990
3991 1999-05-06  Nathan Sidwell  <nathan@acm.org>
3992
3993         * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class.
3994
3995 1999-05-05  Mark Mitchell  <mark@codesourcery.com>
3996
3997         * decl2.c (start_objects): Don't let static constructors and
3998         destructors get inlined.
3999
4000         * parse.y (nested_name_specifier): Make sure ordinary types are
4001         complete, just like template types.
4002         * parse.c: Regenerated.
4003
4004         * pt.c (check_explicit_specialization): Improve error messages.
4005
4006 1999-05-04  Martin von Löwis  <loewis@informatik.hu-berlin.de>
4007
4008         * typeck.c (string_conv_p): Use same_type_p to check whether we
4009         try to convert between char and wchar_t.
4010
4011 1999-05-03  Mark Mitchell  <mark@codesourcery.com>
4012
4013         * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous
4014         lookup to error_mark_node here.
4015         (lookup_member): Revise documentation.  Add comments.  Don't set
4016         the TREE_TYPE to error_mark_node here, and don't build up an extra
4017         TREE_LIST for ambiguous lookups.
4018         (setup_class_bindings): Adjust accordingly.
4019         (push_class_decls): Revise out-of-date comments.
4020         
4021         * typeck.c (build_const_cast): Tighten checks for legality.
4022
4023 1999-05-02  Martin von Löwis  <loewis@informatik.hu-berlin.de>
4024
4025         * init.c (build_member_call): Lookup names coming from
4026         namespace-scoped LOOKUP_EXPR.
4027
4028 1999-05-03  Jim Blandy  <jimb@zwingli.cygnus.com>
4029
4030         * gxxint.texi: Add documentation for 'I'.
4031
4032 1999-05-02  Martin von Löwis  <loewis@informatik.hu-berlin.de>
4033
4034         * tinfo.cc (operator==): Qualify type_info with std::.
4035
4036 1999-05-02  Mark Mitchell  <mark@codesourcery.com>
4037
4038         * cp-tree.h (lang_decl_flags): Remove comdat.  Updated dummy.
4039         (DECL_COMDAT): Remove definition.
4040
4041 1999-05-01  Mark Mitchell  <mark@codesourcery.com>
4042
4043         * decl.c (wrapup_globals_for_namespace): Fix thinko in previous
4044         change.
4045
4046 1999-04-30  Mark Mitchell  <mark@codesourcery.com>
4047
4048         * class.c (build_vtable): Use build_lang_decl when building
4049         vtables, not just build_decl.
4050         (prepare_fresh_vtable): Likewise.
4051         * decl.c (wrapup_globals_for_namespace): Mark vtables as
4052         DECL_EXTERNAL when calling wrapup_global_declarations.
4053         * decl2.c (priority_info_s): Add initializations_p and
4054         destructions_p members.
4055         (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED,
4056         when deciding what vtables to write out.
4057         (ssdf_decls): New variable.
4058         (ssdf_decls_used): Likewise.
4059         (start_static_storage_duration_function): Deal with being called
4060         multiple times.  Avoid inlining this function.
4061         (generate_inits_for_priority): Deal with reuse of priority map.
4062         (get_priority_info): Clear initializations_p and destructions_p.
4063         (do_static_initialization): Tweak comment.
4064         (do_static_destruction): Likewise.  Fix condition on sentries for
4065         destruction.
4066         (generate_ctor_or_dtor_function): Call all of the static storage
4067         duration functions.
4068         (generate_ctor_or_dtor_function_for_priority): Check
4069         initializations_p and destructions_p to see what priorities need
4070         initialization functions.
4071         (finish_file): Rework to generate multiple static storage duration
4072         functions, rather than just one.
4073
4074         * typeck.c (build_const_cast): Tweak last change to handle
4075         templates correctly.
4076
4077         * typeck.c (build_const_cast): Disallow use of const_cast to
4078         anything but a pointer or reference type.
4079
4080 1999-04-30  Nathan Sidwell  <nathan@acm.org>
4081
4082         * decl.c (cp_finish_decl): Don't permit arrays of abstract or
4083         signature type.
4084
4085 1999-04-29  Mark Mitchell  <mark@codesourcery.com>
4086
4087         * decl2.c (do_static_destruction): Remove obsolete FIXME comment.
4088         (finish_file): Indent comments properly.
4089
4090 1999-04-29  Richard Henderson  <rth@cygnus.com>
4091
4092         * decl2.c (do_static_initialization): Call do_pending_stack_adjust.
4093         (do_static_destruction): Likewise.
4094
4095 1999-04-29  Nathan Sidwell  <nathan@acm.org>
4096
4097         * cp-tree.h (TYPE_NOTHROW_P): New macro.
4098         * decl2.c (delete_sanity): Warn on deleting void *.
4099         * init.c (build_new_1): Use TYPE_NOTHROW_P.
4100         * typeck.c (c_expand_return): cp_pedwarn on returning NULL from
4101         throwing operator new.
4102
4103 1999-04-28  Nathan Sidwell  <nathan@acm.org>
4104
4105         * cp-tree.h (build_component_addr): Remove prototype.
4106         * typeck.c (build_component_addr): Make static. Remove MSG
4107         argument.
4108         (build_component_addr): Remove MSG parameter, clean up
4109         comment.
4110         (build_x_function_call): Use cp_error.
4111         (build_unary_op): Adjust call of build_component_addr.
4112
4113 1999-04-28  Mark Mitchell  <mark@codesourcery.com>
4114
4115         * pt.c (tsubst_friend_class): Check for NULL.
4116
4117 Wed Apr 28 11:42:22 1999  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
4118
4119         * search.c (binfo_for_vtable): Initialize bfvi.var.
4120
4121 1999-04-27  Nathan Sidwell  <nathan@acm.org>
4122
4123         * rtti.c (build_x_typeid): Check rtti is enabled.
4124
4125 1999-04-26  Mark Mitchell  <mark@codesourcery.com>
4126
4127         * search.c (is_subobject_of_p): Make sure we're looking at the
4128         right baseclasses.
4129
4130 1999-04-26  Marc Espie  <espie@cvs.openbsd.org>
4131
4132         * Make-lang.in (cplib2.ready): Don't depend on phony targets.
4133
4134 1999-04-23  Mark Mitchell  <mark@codesourcery.com>
4135
4136         * decl2.c (finish_file): Tweak handling of extern inlines so that
4137         they are not unnecessarily put out.
4138
4139         * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
4140         such as base classes.
4141
4142 1999-04-22  Brendan Kehoe  <brendan@cygnus.com>
4143
4144         * tree.c (build_exception_variant): Fix typo: use the chain of U,
4145         not trying V, while cycling through U.
4146
4147 1999-04-22  Mark Mitchell  <mark@codesourcery.com>
4148
4149         * cp-tree.h (lang_decl_flags): Remove returns_first_arg and
4150         preserves_first_arg.  Enlarge dummy accordingly.
4151         (DECL_TINFO_FN_P): New macro.
4152         (SET_DECL_TINFO_FN_P): Likeiwse.
4153         (DECL_RETURNS_FIRST_ARG): Remove.
4154         (DECL_PRESERVES_THIS): Likewise.
4155         (DECL_INIT_PRIORITY): New macro.
4156         (finish_struct_1): Change prototype.
4157         (cat_namespace_levels): Remove prototype.
4158         (vtable_decl_p): New prototype.
4159         (vtype_decl_p): Likewise.
4160         (sigtable_decl_p): Likewise.
4161         (walk_globals_pred): New typedef.
4162         (walk_globals_fn): Likewise.
4163         (walk_globals): New prototype.
4164         (walk_namespaces_fn): New typedef.
4165         (walk_namespaces): New prototype.
4166         (wrapup_globals_for_namespace): Likewise.
4167         (walk_vtables): Remove prototype.
4168         (walk_sigtables): Likewise.
4169         (instantiate_pending_templates): New prototype.
4170         * class.c (finish_struct_1): Don't return a value.
4171         * decl.h (pending_statics): Remove declaration.
4172         * decl.c (walk_namespaces_r): New function.
4173         (walk_globals_r): Likewise.
4174         (vtable_decl_p): Likewise.
4175         (vtype_decl_p): Likewise.
4176         (sigtable_decl_p): Likewise.
4177         (walk_namespaces): Likewise.
4178         (walk_globals_data): New type.
4179         (walk_globals): New function.
4180         (wrapup_globals_for_namespace): Likewise.
4181         (expand_static_init): Remove assertion.  Remove redundancy in
4182         conditional.  Don't put static data members in static_aggregates
4183         Tidy.
4184         (finish_function): Remove redundancy in conditional.  Don't set
4185         DECL_RETURNS_FIRST_ARG.
4186         (cat_namespace_levels): Remove.
4187         * decl2.c: Include splay-tree.h and varray.h.
4188         (priority_info_s): New structure.
4189         (finish_vtable_vardecl): Change prototype.  Adjust for new calling
4190         conventions.
4191         (prune_vtable_vardecl): Likewise.
4192         (finish_sigtable_vardecl): Likewise.
4193         (setup_initp): Remove.
4194         (do_dtors): Remove.
4195         (do_ctors): Remove.
4196         (start_static_storage_duration_function): New function.
4197         (generate_inits_for_priority): Likewise.
4198         (finish_static_storage_duration_function): Likewise.
4199         (get_priority_info): Likewise.
4200         (do_static_initialization): Likewise.
4201         (do_static_destruction): Likewise.
4202         (do_static_initialization_and_destruction): Likewise.
4203         (generate_ctor_or_dtor_function): Likewise.
4204         (generate_ctor_and_dtor_functions_for_priority): Likewise.
4205         (pending_statics): Make it a varray.
4206         (pending_statics_used): New variable.
4207         (saved_inlines): Make it a varray.
4208         (saved_inlines_used): New variable.
4209         (finish_static_data_member): Change method of updating
4210         pending_statics.
4211         (mark_inline_for_output): Remove #if 0'd code.  Change method of
4212         updating saved_inlines.
4213         (walk_vtables): Remove.
4214         (walk_sigtables): Likewise.
4215         (import_export_decl): Use DECL_TINFO_FN_P.
4216         (pending_templates): Remove declaration.
4217         (maybe_templates): Likewise.
4218         (static_aggregates_initp): Likewise.
4219         (setup_initp): Likewise.
4220         (finish_objects): Simplify.
4221         (INITIALIZE_P_IDENTIFIER): New macro.
4222         (PRIORITY_IDENTIFIER): New macro.
4223         (SSDF_IDENTIFIER): New macro.
4224         (initialize_p_decl): New variable.
4225         (priority_decl): Likewise.
4226         (ssdf_decl): Likewise.
4227         (priority_info_map): Likewise.
4228         (finish_file): Recode output of static intializers and other
4229         file-scope finalization tasks.
4230         * error.c (OB_END_TEMPLATE_ID): New macro.
4231         (dump_type_real): Use it.
4232         (dump_decl): Likewise.
4233         (dump_function_name): Likewise.
4234         * lex.c (set_typedecl_interface_info): Adjust for new walk_globals
4235         interface.
4236         (check_newline): Use walk_globals, not walk_vtables.
4237         * pt.c (pending_tempalte_expansions): Remove.
4238         (set_vardecl_interface_info): Likewise.
4239         (pending_templates): Make static.
4240         (maybe_templates): Likewise.
4241         (instantiate_class_template): Adjust call to finish_struct_1.
4242         (instantiate_pending_templates): New function.
4243         * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P.
4244         * tree.c (static_aggregates_initp): Remove.
4245         (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY
4246         instead.
4247         * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h.
4248
4249         * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes
4250         with the RTL code RETURN.
4251         * hash.h: Regenerated.
4252         * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD.
4253         * parse.y: Replace RETURN with RETURN_KEYWORD throughout.
4254         * parse.c: Regenerated.
4255         * pt.c: Include varray.h.  Include rtl.h since varray.h requires
4256         it.
4257         (inline_parm_levels): New variable.
4258         (inline_parm_levels_used): Likewise.
4259         (maybe_begin_member_template_processing): Update them.
4260         (maybe_end_member_template_processing): Use them, rather than
4261         guessing how many levels to pop.
4262
4263         * decl.c (make_typename_type): Tighten error-checking.
4264
4265 1999-04-20  Mark Mitchell  <mark@codesourcery.com>
4266
4267         * cp-tree.h (build_binary_op): Remove unneeded parameter.
4268         * class.c (build_vrable_entry_ref): Adjust call to
4269         build_binary_op.
4270         * decl.c (expand_static_init): Likewise.
4271         (grokdeclarator): Likewise.
4272         (finish_function): Likewise.
4273         * decl2.c (delete_sanity): Likewise.
4274         (do_dtors): Likewise.
4275         (do_ctors): Likewise.
4276         * error.c (dump_type_suffix): Likewise.
4277         * expr.c (cplus_expand_expr): Likewise.
4278         * init.c (resolve_offset_ref): Likewise.
4279         (build_new): Likewise.
4280         (build_new_1): Likewise.
4281         (build_vec_delete_1): Likewise.
4282         (expand_vec_init_catch_clause): Likewise.
4283         (build_delete): Likewise.
4284         * pt.c (tsubst): Likewise.
4285         * rtti.c (synthesize_tinfo_fn): Likewise.
4286         * search.c (expand_upcast_fixups): Likewise.
4287         (expand_direct_vtbls_init): Likewise.
4288         * typeck.c (get_member_function_from_ptrfunc): Likewise.
4289         (build_binary_op_nodefault): Likewise.
4290         (point_int_sum): Likewise.
4291         (pointer_diff): Likewise.
4292         (build_unary_op): Likewise.
4293         (build_modify_expr): Likewise.
4294         (get_delta_difference): Likewise.
4295         (build_ptrmemfunc): Likewise.
4296         (expand_ptrmemfunc_cst): Likewise.
4297
4298 1999-04-20  Jason Merrill  <jason@yorick.cygnus.com>
4299
4300         * decl.c (grokfndecl): Always call cplus_decl_attributes.
4301         * decl2.c (grokfield): Pass attrlist to grokdeclarator.
4302
4303 1999-04-19  Mark Mitchell  <mark@codesourcery.com>
4304
4305         * cp-tree.h (finish_static_data_member_decl): New function.
4306         * decl2.c (finish_static_data_member_decl): Split out from ...
4307         (grokfield): Here.
4308         * pt.c (instantiate_class_template): Use it here instead of
4309         trying to fake it.
4310         (tsubst_decl): Don't set DECL_ASSEMBLER_NAME;
4311         finish_static_data_member_decl will do that.  Explicit set
4312         DECL_EXTERNAL to match non-template processing.
4313
4314 1999-04-18  Mark Mitchell  <mark@codesourcery.com>
4315
4316         * cp-tree.h (finish_class_definition): Add parameter.
4317         * parse.y (structsp): Use it.  Don't call pop_scope here.
4318         * parse.c: Regenerated.
4319         * semantics.c (finish_class_definition): Pop it here.
4320
4321 1999-04-17  Mark Mitchell  <mark@codesourcery.com>
4322
4323         * decl.c (xref_tag): Revise handling of nested template
4324         declarations.
4325         * pt.c (check_explicit_specialization): Tweak handling of friend
4326         templates in template classes.
4327         (tsubst_friend_class): Handle friend declarations for nested
4328         member template classes.
4329
4330 1999-04-16  Mark Mitchell  <mark@codesourcery.com>
4331
4332         * class.c (finish_struct): Remove unused variable.
4333         (pushclass): Likewise.
4334         (invalidate_class_lookup_cache): Likewise.
4335         * cp-tree.def (TYPENAME_TYPE): Improve documentation.
4336         * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME
4337         doesn't get obliterated.
4338         (make_typename_type): Handle template classes correctly.
4339
4340         * cp-tree.h (TREE_NONLOCAL_FLAG): Remove.
4341         (storetags): Declare.
4342         * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG.
4343         (pushclass): Likewise.  Use storetags to install tag declarations,
4344         not pushtag.
4345         (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG.
4346         * decl.c (storetags): Make it global.
4347         (push_class_binding): Set INHERITED_VALUE_BINDING_P for an
4348         implicit typename declaration.
4349         (pushtag): Tidy.  Don't use TREE_NONLOCAL_FLAG.
4350         * method.c (hack_identifier): Likewise.
4351         * search.c (lookup_member): Likewise.
4352
4353         * decl.c (warn_about_implicit_typename_lookup): New function.
4354         (lookup_name_real): Use it.  Rework handling of implicit typename
4355         extension.
4356
4357 1999-04-15  Mark Mitchell  <mark@codesourcery.com>
4358
4359         * cp-tree.h (lookup_nested_field): Remove.
4360         * class.c (push_nested_class): Handle UNION_TYPEs.
4361         (pop_nested_class): Likewise.
4362         * decl.c (lookup_name_real): Don't call lookup_nested_field.
4363         (start_decl): Use push_nested_class, not just pushclass.
4364         (cp_finish_decl): Use pop_nested_class, not just popclass.
4365         * search.c (lookup_nested_field): Remove.
4366
4367         * cp-tree.h (lang_type): Add documentation.
4368         * decl2.c (handle_class_head): Create template declarations here,
4369         as appropriate.
4370         * parse.y (class_head): Return whether or not we entered a new
4371         scope, as well as the type named.
4372         (named_class_head): Likewise.
4373         (named_complex_class_head_sans_basetype): Likewise.
4374         (structsp): Adjust accordingly.  Pop scope when required.
4375         * parse.c: Regenerated.
4376         * pt.c (check_default_tmpl_args): Robustify.
4377         (redeclare_class_template): Likewise.
4378         (instantiate_class_template): An instantiation of an
4379         anonymous union is itself an anonymous union.
4380         * semantics.c (begin_class_definition): Don't create template
4381         declarations here.
4382
4383 1999-04-15  Jason Merrill  <jason@yorick.cygnus.com>
4384
4385         * parse.y (after_type_declarator_intern): New nonterminal.
4386         (after_type_declarator): Use it.
4387         (direct_after_type_declarator): Likewise.  Move above
4388         nonnested_type to fix reduce/reduce conflict resolution.
4389         (declmods): Reducing from just 'attributes' has EMPTY precedence.
4390         * Makefile.in (CONFLICTS): Update.
4391
4392         * decl.c (define_label): Downgrade error for jumping over a
4393         non-POD decl to pedwarn.
4394
4395 1999-04-14  Mark Mitchell  <mark@codesourcery.com>
4396
4397         * cp-tree.h (popclass): Change declaration.
4398         (pop_nested_class): Likewise.
4399         (poplevel_class): Remove declaration.
4400         * call.c (convert_default_argument): Pass no arguments to
4401         popclass.
4402         * class.c (finish_struct_1): Likewise.
4403         (finish_struct): Likewise.
4404         (popclass): Remove argument.  Simplify code accordingly.
4405         (pop_nested_class): Likewise.
4406         * decl.c (poplevel_class): Declare it here, and make it static.
4407         (poplevel): Handle class scopes.
4408         (poplevel_class): Don't take an rgument.  Simplify.
4409         (pop_everything): Pass no arguments to pop_nested_class.
4410         (cp_finish_decl): Pass no arguments to popclass.
4411         (grokdeclarator): Pass no arguments to pop_nested_class.
4412         (finish_function): Likewise.
4413         * decl2.c (grokfield): Likewise.
4414         (pop_scope): Pass no arguments to popclass.
4415         * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
4416         * pt.c (instantiate_class_template): Move call to pushclass, and
4417         document.  Pass no arguments to popclass.
4418         (regenerate_decl_from_template): Likewise.
4419
4420 1999-04-14  Jason Merrill  <jason@yorick.cygnus.com>
4421
4422         * typeck.c (build_unary_op): Handle taking the address of a unique
4423         bound non-static member function.
4424
4425 1999-04-13  Martin von Loewis  <loewis@informatik.hu-berlin.de>
4426
4427         * lang-options.h (-Wdeprecated): New flag.
4428         * decl2.c (warn_deprecated): New flag.
4429         (lang_decode_option): Deprecated this-is-variable,
4430         external-templates, alt-external-templates.
4431         Support -Wdeprecated.
4432         * errfn.c (cp_deprecated): New function.
4433
4434 1999-04-13  Jason Merrill  <jason@yorick.cygnus.com>
4435
4436         * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
4437         of the decls themselves.
4438
4439         * pt.c (tsubst_function_type): Copy attributes over.
4440
4441         * tree.c (cp_valid_lang_attribute): New fn.  Handle init_priority
4442         and com_interface.
4443         * cp-tree.h: Add prototype.
4444         * decl.c (init_decl_processing): Set valid_lang_attribute.
4445
4446 1999-04-13  Mark Mitchell  <mark@codesourcery.com>
4447
4448         * class.c (finish_struct_1): Look at the const-ness of the field's
4449         type, not the TREE_READONLY-ness of the declaration.
4450         * method.c (synthesize_method): Likewise.
4451         * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
4452         creating new declarations.
4453
4454 1999-04-13  Mike Stump  <mrs@wrs.com>
4455
4456         * decl2.c (import_export_decl): Because vtables always reference
4457         virtual functions, even if they are inlined, don't allow
4458         -fno-implement-inlines to not emit them, instead, emit them with
4459         the vtable.
4460         * decl.c (start_function): Likewise.
4461
4462 1999-04-12  Jason Merrill  <jason@yorick.cygnus.com>
4463
4464         * cp-tree.h (struct lang_type): Add com_interface.
4465         (CLASSTYPE_COM_INTERFACE): New macro.
4466         * class.c (set_rtti_entry): COM interface classes have no RTTI
4467         entries in their vtables; adjust.
4468         (add_virtual_function, finish_base_struct, skip_rtti_stuff,
4469         modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
4470         finish_struct_1): Likewise.
4471         * decl2.c (mark_vtable_entries): Likewise.
4472         * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
4473         * search.c (get_abstract_virtuals_1, get_abstract_virtuals,
4474         expand_upcast_fixups): Likewise.
4475         * tree.c (debug_binfo): Likewise.
4476
4477         * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
4478         * typeck.c (comptypes): If we get it, ignore attributes.
4479         * class.c (instantiate_type): Use BASELINK_P.  Change complain
4480         parameter to flags; 2 means ignore attributes.
4481         * call.c (build_op_delete_call): Pass it.
4482
4483         * decl.c (xref_tag): Only complain once about using a typedef-name
4484         with 'struct'.  Downgrade to pedwarn.
4485
4486         * decl.c (grokdeclarator): Allow [] syntax for zero-length array.
4487
4488         * parse.y (absdcl_intern): New nonterminal.
4489         (absdcl, direct_abstract_declarator): Use it.
4490
4491         * pt.c (lookup_template_class): Look through implict typename.
4492
4493 1999-04-11  Mark Mitchell  <mark@codesourcery.com>
4494
4495         * friend.c (add_friend): Deal gracefully with error_mark_node.
4496         * method.c (build_overload_value): Handle pointers-to-members as
4497         template parameters.
4498
4499         * decl.c (push_binding): Fix typo in comment.
4500
4501 1999-04-10  Mark Mitchell  <mark@codesourcery.com>
4502
4503         * error.c (dump_type_real): If a typename is a template-id, put
4504         out the template arguments.
4505         (dump_expr): Handle TEMPLATE_ID_EXPR.
4506         * pt.c (lookup_template_class): Now that full arguments are
4507         available everywhere, remove code that tried to guess them.
4508
4509 1999-04-09  Mark Mitchell  <mark@codesourcery.com>
4510
4511         * decl.c (make_typename_type): Complain if we don't find a type
4512         when trying to make a typename type for a non-template type.
4513
4514 1999-04-09  Jason Merrill  <jason@yorick.cygnus.com>
4515
4516         * decl.c (start_decl): Pass attributes to grokdeclarator.
4517         (grokdeclarator): Handle attributes on constructor-syntax
4518         initializers.
4519
4520 1999-04-08  Mark Mitchell  <mark@codesourcery.com>
4521
4522         * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands
4523         don't have types.
4524
4525         * search.c (template_self_reference_p): Tweak.
4526
4527 1999-04-07  Mark Mitchell  <mark@codesourcery.com>
4528
4529         * init.c (build_offset_ref): Don't build yet another weird data
4530         structure to describe overloaded functions.
4531
4532 1999-04-06  Mark Mitchell  <mark@codesourcery.com>
4533
4534         * cp-tree.h (BASELINK_P): New macro.
4535         (SET_BASELINK_P): Likewise.
4536         * init.c (build_member_call): Remove needless assignment in if
4537         statement.
4538         * search.c (lookup_field_r): Fix handling when we are looking
4539         specifically for a type; these are not hidden by functions and
4540         variables.
4541         (lookup_member): Use SET_BASELINK_P.
4542         * tree.c (is_overloaded_fn): Use BASELINK_P.
4543         (really_overloaed_fn): Likewise.
4544         (get_first_fn): Likewise.
4545
4546 1999-04-05  Mark Mitchell  <mark@codesourcery.com>
4547
4548         * decl.c (lookup_name_current_level): Tweak, and improve
4549         documentation.
4550
4551         * class.c (maybe_fixup_vptrs): Remove declaration.
4552         (build_class_init_list): Likewise.
4553         * decl.c (pushdecl_class_level): Call check_template_shadow here
4554         ...
4555         (push_class_level_binding): ... not here.
4556         * search.c (dfs_push_type_decls): Only avoid
4557         template-self-reference TYPE_DECLs if they are from base classes.
4558
4559 1999-04-04  Mark Mitchell  <mark@codesourcery.com>
4560
4561         * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL
4562         nodes.  Tidy.
4563
4564 1999-04-03  Jason Merrill  <jason@yorick.cygnus.com>
4565
4566         * class.c (maybe_fixup_vptrs, build_class_init_list): Lose.
4567         (finish_struct_1): Don't call build_class_init_list.
4568
4569 1999-04-02  Mark Mitchell  <mark@codesourcery.com>
4570
4571         * tinfo.h (__class_type_info): Fix illegal declaration.
4572
4573         * cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
4574         * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
4575         (IDENTIFIER_CLASS_VALUE): Improve documentation.
4576         (is_properly_derived_from): Declare.
4577         (invalidate_class_lookup_cache): Likewise.
4578         (maybe_maybe_note_name_used_in_class): Likewise.
4579         (note_name_declared_in_class): Likewise.
4580         (push_using_decl): Remove duplicate declaration.
4581         (id_in_current_class): Remove declaration.
4582         (push_class_binding): Change prototype.
4583         (clear_identitifer_class_values): Declare.
4584         * call.c (is_properly_derived_from): Make it global.
4585         (build_new_function_call): Be careful about updating candidates.
4586         (build_new_method_call): Handle COMPONENT_REFs.  Don't crash when
4587         asked to make illegal calls.
4588         * class.c: Include splay-tree.h.
4589         (class_stack_node): Add names_used slot.
4590         (check_member_decl_is_same_in_complete_scope): Remove.
4591         (add_method): Fix comment.  Push the declaration into class
4592         scope.
4593         (finish_struct_1): When popping the class, pop the bindings too.
4594         Remove check for data member/function member conflict.
4595         (finish_struct): Remove calls to
4596         check_member_decl_is_same_in_complete_scope.  Change calls to
4597         popclass.
4598         (pushclass): Clear names_used in the class stack entry.
4599         Use invalidate_class_lookup_cache to remove cached entries, rather
4600         than magic values with popclass.  Clear IDENTIFIER_CLASS_VALUE
4601         before entering a new class.  Remove dead code.  Don't mess with
4602         current_function_decl when pushing declarations.
4603         (invalidate_class_lookup_cache): New function, split out from ...
4604         (popclass): Here.  Clean up names_used on our way out.
4605         (instantiate_type): Adjust.
4606         (build_self_reference): Don't push the declaration here.
4607         (maybe_note_name_used_in_class): New function.
4608         (note_name_declared_in_class): Likewise.
4609         * decl.c (add_binding): Change prototype.
4610         (find_class_binding_level): New function.
4611         (innermost_nonclass_level): Likewise.
4612         (current_binding_level): Update documentation.
4613         (inner_binding_level): Remove.  Replace with current_binding_level
4614         throughout.
4615         (push_binding_level): Remove special handling of
4616         class_binding_level.
4617         (pop_binding_level): Likewise.  Use find_class_binding_level.
4618         (suspend_binding_level): Likewise.
4619         (global_bindings_p): Use innermost_nonclass_level.
4620         (toplevel_bindings_p): Likewise.
4621         (namespace_bindings_p): Likewise.
4622         (pseudo_global_level_p): Likewise.
4623         (push_binding): Clear INHERITED_VALUE_BINDING_P.
4624         (add_binding): Check for illegal multiple declarations.  Return a
4625         value indicating whether or not the new binding was legal.
4626         (push_local_binding): Skip over class binding levels.  Check
4627         return value from add_binding.
4628         (push_class_binding): Set INHERITED_VALUE_BINDING_P.  Call
4629         note_name_declared_in_class.
4630         (pushlevel_class): Remove "fake out the rest of the compiler"
4631         code.
4632         (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
4633         (clear_identifier_class_values): New function.
4634         (pop_from_top_level): Use it.
4635         (pop_everything): Tweak.
4636         (maybe_process_template_type_declaration): Don't push the
4637         declaration for the template here.
4638         (pushtag): Don't push tag declarations into class scope here.
4639         (pushdecl): Apply DeMorgan's law for readability.
4640         (pushdecl_class_level): Remove special-case code for
4641         TYPE_BEING_DEFINED.  Handle OVERLOADs and anonymous unions.
4642         (push_class_level_bindng): Deal with inherited bindings.
4643         (lookup_name_real): Remove special-case code for
4644         TYPE_BEING_DEFINED, and some implicit typename magic.
4645         (grokdeclarator): Handle COMPONENT_REF for a template function.
4646         (build_enumerator): Don't call pushdecl_class_level here.
4647         (id_in_current_class): Remove.
4648         * decl2.c (grokfield): Don't call pushdecl_class_level or
4649         check_template_shadow.
4650         * errfn.c (cp_file_of): Don't declare.
4651         (cp_line_of): Likewise.
4652         * error.c (dump_decl): Handle an OVERLOAD.
4653         (cp_file_of): Likewise.
4654         (cp_line_of): Likewise.
4655         * init.c (build_member_call): Handle a COMPONENT_REF.
4656         * lex.c (do_identifier): Call maybe_note_name_used_in_class, not
4657         pushdecl_class_level.
4658         * method.c (hack_identifier): Build COMPONENT_REFs for references
4659         to member templates as well as member functions.  Remove dead
4660         code.
4661         * parse.y (left_curly): Remove.
4662         (nonnested_type): Call maybe_note_name_used_in_class, not
4663         pushdecl_class_level.
4664         * parse.c: Regenerated.
4665         (nested_name_specifier_1): Likewise.
4666         * pt.c (check_explicit_specialization): Adjust, for robustness.
4667         (check_template_shadow): Handle OVERLOADs.
4668         (build_template_decl): Set DECL_CONSTRUCTOR_P on the
4669         TEMPLATE_DECL, if appropriate.
4670         * search.c (envelope_add_decl): Remove.
4671         (dfs_pushdecls): Likewise.
4672         (dfs_compress_decls): Likewise.
4673         (dfs_push_decls): New function.
4674         (dfs_push_type_decls): Likewise.
4675         (setup_class_bindings): Likewise.
4676         (template_self_reference_p): Likewise.
4677         (lookup_field_r): Use it.
4678         (looup_member): Remove old comment.  Deal with ambiguity.
4679         (push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
4680         and remove envelope processing.
4681         * semantics.c (begin_class_definition): Let pushclass push
4682         declarations for base classes.
4683         (finish_member_declaration): Push declarations into class scope.
4684         * typeck.c (build_component_ref): Just put an OVERLOAD into the
4685         COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
4686         (build_x_function_call): Deal with OVERLOAD.  Handle template-ids.
4687         * Makefile.in (class.o): Depend on splay-tree.h.
4688
4689 Wed Mar 31 11:30:43 1999  Nathan Sidwell  <nathan@acm.org>
4690
4691         * cvt.c (convert_pointer_to_real): Use same_type_p.
4692         * typeck.c (comp_target_types): Use same_type_p.
4693
4694 1999-03-31  Jason Merrill  <jason@yorick.cygnus.com>
4695
4696         * semantics.c (begin_inline_definitions,
4697         finish_inline_definitions): Rename from finish_default_args and
4698         begin_inline_definitions, respectively, to something that isn't a
4699         total lie.  :)
4700         * parse.y (structsp): Adjust.
4701
4702         * tree.c (hash_tree_cons): Remove obsolete via_* parms.
4703         (list_hash_lookup): Likewise.
4704         (hash_tree_chain): Adjust.
4705         * pt.c (tsubst): Adjust.
4706         (tsubst_arg_types): Use plain hash_tree_cons.
4707         * cp-tree.h (hash_tree_cons_simple): Lose.
4708         * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons.
4709
4710 Wed Mar 31 10:48:29 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4711
4712         * Makefile.in (hash.h): Generate using gperf language 'C', not
4713         'KR-C', so gperf uses the `const' keyword on strings.
4714
4715         * gxx.gperf (resword): Const-ify a char*.
4716
4717 1999-03-30  Jason Merrill  <jason@yorick.cygnus.com>
4718
4719         * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
4720         CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
4721         CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
4722         CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
4723         CLASSTYPE_BINFO_AS_LIST): Remove cruft.
4724         * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
4725         tree.c: Adjust.
4726
4727 1999-03-29  Jason Merrill  <jason@yorick.cygnus.com>
4728
4729         * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
4730
4731 1999-03-28  Jason Merrill  <jason@yorick.cygnus.com>
4732
4733         * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops.
4734
4735 1999-03-27  Mark Mitchell  <mark@codesourcery.com>
4736
4737         * cp-tree.h (add_friend): Declare.
4738         (add_friends): Likewise.
4739         * friend.c (add_friend): Make it global.  Don't add to
4740         DECL_BEFRIENDING_CLASSES if the befriending class is a template.
4741         (add_friends): Make it global.
4742         (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
4743         befriending class is a template.
4744         * parse.y (component_decl_1): Fix typo in comment.
4745         * parse.c: Regenerated.
4746         * pt.c (instantiate_class_template): Use add_friend and
4747         add_friends rather that duplicating some of their functionality
4748         here.
4749
4750 1999-03-27  Jason Merrill  <jason@yorick.cygnus.com>
4751
4752         * call.c (build_field_call): Unify 'this' and non-'this' cases.
4753
4754         * typeck.c (build_indirect_ref): Check for 'this' sooner.
4755
4756 Fri Mar 26 10:20:34 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4757
4758         * call.c (op_error): Const-ify a char*.
4759         (add_candidate, source_type, add_warning): Add static prototype.
4760         (print_z_candidates): Const-ify a char*.
4761
4762         * class.c (resolve_address_of_overloaded_function,
4763         fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
4764         (get_vtable_name, finish_struct_1): Const-ify a char*.
4765
4766         * cvt.c (convert_to_reference): Likewise.
4767
4768         * decl.c (redeclaration_error_message, record_builtin_type,
4769         record_unknown_type, member_function_or_else, bad_specifiers):
4770         Likewise.
4771         (find_binding, select_decl, unqualified_namespace_lookup,
4772         lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
4773         Add static prototype.
4774         (warn_extern_redeclared_static, duplicate_decls, pushdecl,
4775         implicitly_declare, record_builtin_java_type, define_function,
4776         grok_op_properties, tag_name): Const-ify a char*.
4777
4778         * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
4779         (define_function, finish_builtin_type): Const-ify a char*.
4780         (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
4781         cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
4782         (file_name_nondirectory): Const-ify a char*.
4783         (init_filename_times): Don't prototype.
4784         (compiler_error): Prototype.
4785         (yyerror, init_repo): Const-ify a char*.
4786         (build_srcloc): Don't prototype.
4787         (build_x_indirect_ref, build_indirect_ref, build_component_addr):
4788         Const-ify a char*.
4789         (warn_for_assignment): Don't prototype.
4790         (convert_for_initialization, readonly_error, check_for_new_type,
4791         GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
4792         Const-ify a char*.
4793
4794         * decl2.c (acceptable_java_type, output_vtable_inherit,
4795         setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
4796         merge_functions, decl_namespace, validate_nonmember_using_decl,
4797         do_nonmember_using_decl): Add static prototype.
4798         (lang_f_options): Const-ify a char*.
4799         (finish_builtin_type): Likewise.
4800         (add_function, arg_assoc_namespace, arg_assoc_class): Add static
4801         prototype.
4802
4803         * errfn.c: Include cp-tree.h.
4804         (cp_thing): Add static prototype.
4805         (compiler_error): Don't protoptype.
4806         (cp_compiler_error): Cast `compiler_error' to `errorfn' before
4807         passing it to `cp_thing'.
4808
4809         * error.c (interesting_scope_p): Add static prototype.
4810
4811         * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
4812         a char*.
4813
4814         * init.c (compiler_error): Don't prototype.
4815         (member_init_ok_or_else): Const-ify a char*.
4816         (build_java_class_ref): Add static prototype.
4817
4818         * lex.c (compiler_error): Don't prototype.
4819         (get_time_identifier, interface_strcmp, extend_token_buffer,
4820         handle_cp_pragma): Const-ify a char*.
4821         (is_global, init_filename_times): Add static prototype.
4822         (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
4823         (compiler_error): Change from fixed args to variable args.
4824         (yyerror): Const-ify a char*.
4825
4826         * parse.y (cond_stmt_keyword): Const-ify a char*.
4827         (parse_decl): Add static prototype.
4828
4829         * pt.c (template_args_equal, print_template_context): Likewise.
4830         (print_candidates, check_default_tmpl_args): Const-ify a char*.
4831         (instantiate_class_template): Likewise.
4832
4833         * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
4834
4835         * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
4836         expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
4837
4838         * search.c (lookup_field_info, lookup_member): Likewise.
4839         (lookup_member): Cast the first argument of `bzero' to a PTR.
4840
4841         * sig.c (compiler_error): Don't prototype.
4842         (build_signature_pointer_or_reference_nam): Const-ify a char*.
4843         (get_sigtable_name, build_member_function_pointer): Likewise.
4844
4845         * tree.c (compiler_error): Don't prototype.
4846         (no_linkage_helper, build_srcloc): Add static prototype.
4847         (build_vbase_pointer_fields): Const-ify a char*.
4848         (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
4849
4850         * typeck.c (compiler_error): Don't prototype.
4851         (convert_for_assignment): Const-ify a char*.
4852         (comp_cv_target_types): Add static prototype.
4853         (build_x_indirect_ref, build_indirect_ref, convert_arguments,
4854         build_component_addr, build_unary_op, convert_for_initialization):
4855         Const-ify a char*.
4856
4857         * typeck2.c (ack): Add static prototype and change from fixed args
4858         to variable args.
4859         (readonly_error, check_for_new_type): Const-ify a char*.
4860
4861         * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
4862         fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
4863         (GNU_xref_file): Likewise.  Also use `xmalloc' instead of `malloc'.
4864         (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
4865         gen_assign, GNU_xref_member): Const-ify a char*.
4866
4867 1999-03-25  Martin von Löwis  <loewis@informatik.hu-berlin.de>
4868
4869         * gxxint.texi: Remove old discussion on copying virtual bases.
4870
4871 1999-03-25  Zack Weinberg  <zack@rabi.columbia.edu>
4872
4873         * Make-lang.in: Remove all references to g++.o/g++.c.
4874         Link g++ from gcc.o.
4875
4876 1999-03-25  Jason Merrill  <jason@yorick.cygnus.com>
4877
4878         * decl2.c (comdat_linkage): Treat vtables like functions.
4879
4880 1999-03-25  Mark Mitchell  <mark@codesourcery.com>
4881
4882         * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES.
4883
4884 1999-03-25  Nathan Sidwell  <nathan@acm.org>
4885
4886         * decl.c (init_decl_processing): Add `signed' type as a synonym
4887         for `int'.
4888
4889 1999-03-25  Jason Merrill  <jason@yorick.cygnus.com>
4890
4891         * typeck.c (common_type): Handle cv-qual unification for pointers
4892         to members.
4893
4894         * decl.c (unqualified_namespace_lookup): Return error_mark_node
4895         on error.
4896         (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
4897         * lex.c (do_identifier): If we got error_mark_node, call
4898         lookup_name again.
4899
4900 1999-03-24  Martin von Löwis  <loewis@informatik.hu-berlin.de>
4901
4902         * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
4903         classes.
4904
4905 1999-03-24  Jason Merrill  <jason@yorick.cygnus.com>
4906
4907         * decl.c (lookup_name_real): Do nested field lookup regardless of
4908         TYPE_BEING_DEFINED.
4909
4910 1999-03-24  Mark Mitchell  <mark@codesourcery.com>
4911
4912         * cp-tree.h (lang_type): Remove has_assignment and
4913         has_real_assignment.  Add befriending_classes.
4914         (TYPE_HAS_ASSIGNMENT): Remove.
4915         (TYPE_HAS_REAL_ASSIGNMENT): Likewise.
4916         (CLASSTYPE_BEFRIENDING_CLASSES): New macro.
4917         (lang_decl): Document.
4918         (DECL_BEFRIENDING_CLASSES): New macro.
4919         (FRIEND_NAME): Move declaration to more obvious location.
4920         (FRIEND_DECLS): Likewise.
4921         * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
4922         * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
4923         (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
4924         (grok_op_properties): Likewise.
4925         * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
4926         (add_friend): Likewise.  Don't do weird things with assignment
4927         operators.  Update DECL_BEFRIENDING_CLASSES.
4928         (add_friends): Don't do weird things with assignment operators.
4929         (make_friend_class): Likewise.  Update
4930         CLASSTYPE_BEFRIENDING_CLASSES.
4931         * pt.c (instantiate_class_template): Don't set
4932         TYPE_HAS_ASSIGNMENT.
4933         (tsubst_copy): Substitute the TREE_TYPE for more unary
4934         expressions.
4935         * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
4936         * search.c (protected_accessible_p): New function.
4937         (friend_accessible_p): Likewise.
4938         (accessible_p): Use them.
4939
4940 1999-03-23  Mark Mitchell  <mark@codesourcery.com>
4941
4942         * pt.c (convert_nontype_argument): Don't create things that aren't
4943         PTRMEM_CSTs when applying a qualification conversion to a
4944         PTRMEM_CST.
4945
4946 1999-03-23  Mark Mitchell  <mark@codesourcery.com>
4947
4948         * Makefile.in (OBJS): Don't mention hash.o.
4949         (OBJDEPS): Likewise.
4950
4951 1999-03-23  Jason Merrill  <jason@yorick.cygnus.com>
4952
4953         * decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
4954         * decl.c (expand_static_init): Make sure we don't add any after
4955         then.
4956
4957         * decl.c (cp_finish_decl): Move intelligence about handling
4958         DECL_COMDAT for variables from here...
4959         * decl2.c (comdat_linkage): ...to here.
4960         (maybe_make_one_only): Tweak.
4961         (import_export_decl): Call comdat_linkage for variables, too.
4962         (finish_file): Handle template statics properly.
4963
4964 1999-03-22  Mark Mitchell  <mark@codesourcery.com>
4965
4966         * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
4967         Document internals of pointer-to-member-functions.
4968         (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
4969         (PFN_FROM_PTRMEMFUNC): Likewise.
4970         (build_type_conversion): Remove unused parameter.
4971         (build_ptrmemfunc1): Declare.
4972         (expand_ptrmemfunc_cst): New function.
4973         (delta2_from_ptrmemfunc): Likewise.
4974         (pfn_from_ptrmemfunc): Likewise.
4975         * cvt.c (cp_convert_to_pointer): Remove unused parameter to
4976         build_type_conversion.  Use TYPE_PTRMEM_P for readability.
4977         (convert_to_reference): Remove unused parameter to
4978         build_type_conversion.
4979         (ocp_convert): Likewise.
4980         (build_user_type_conversion): Likewise.
4981         * error.c (dump_expr): Handle NULL pointer-to-member functions.
4982         * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
4983         * method.c (build_overload_value): Don't go splitting CONSTRUCTORs
4984         open when handling pointer-to-member functions.
4985         * pt.c (convert_nontype_argument): Clean up error messages.  Be
4986         more stringent with pointers-to-members.
4987         * typeck.c (build_ptrmemfunc1): Don't declare.  Make it global.
4988         (build_unary_op): Tidy ever-so-slightly.
4989         (build_conditional_expr): Remove extra parameter to
4990         build_type_conversion.
4991         (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
4992         we're using.
4993         (expand_ptrmemfunc_cst): Define.
4994         (delta2_from_ptrmemfunc): Likewise.
4995         (pfn_from_ptrmemfunc): Likewise.
4996
4997 1999-03-19  Mark Mitchell  <mark@codesourcery.com>
4998
4999         * init.c (build_member_call): Handle template-id expressions
5000         correctly.
5001         * typeck.c (build_x_function_call): Likewise.
5002
5003 1999-03-19  Chip Salzenberg  <chip@perlsupport.com>
5004
5005         * friend.c (make_friend_class): Avoid core dump when
5006         not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
5007
5008 1999-03-18  Jason Merrill  <jason@yorick.cygnus.com>
5009
5010         * decl.c (start_function): Suppress normal linkage heuristics
5011         for #pragma interface under MULTIPLE_SYMBOL_SPACES.
5012
5013 1999-03-19  Alexandre Oliva  <oliva@dcc.unicamp.br>
5014
5015         * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c.
5016         ($(srcdir)/cp/parse.c): Moved from ../Makefile.in.
5017
5018 1999-03-17  Martin von Löwis  <loewis@informatik.hu-berlin.de>
5019
5020         * parse.y (named_complex_class_head_sans_basetype):
5021         Do not push a scope for error_mark_node.
5022         (maybe_base_class_list): Likewise.
5023
5024         * decl.c (start_decl): Check for error_mark_node as a type.
5025         Detected by g++.brendan/array-refs.C.
5026         (start_decl_1): Likewise.  Detected by g++.bugs/900322_01.C.
5027         (maybe_build_cleanup_1): Likewise.  Detected by
5028         g++.jason/incomplete1.C.
5029
5030         * tree.c (build_dummy_object): Use void_zero_node instead of the
5031         error_mark_node.
5032         (is_dummy_object): Check for such a node.
5033         Detected by g++.bob/inherit1.C
5034
5035 1999-03-16  Jason Merrill  <jason@yorick.cygnus.com>
5036
5037         * method.c (old_backref_index): Split out...
5038         (flush_repeats): From here.  Rename back from try_old_backref.
5039         (build_mangled_name): Put back some old-style repeat handling.
5040
5041 Mon Mar 15 21:57:16 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5042
5043         * lex.c: Don't include setjmp.h.
5044         (parse_float): New static function.
5045         (pf_args): New struct.
5046         (real_yylex): Use them in call to `do_float_handler'.
5047
5048 1999-03-15  Mark Mitchell  <mark@markmitchell.com>
5049
5050         * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
5051         * tree.c (layout_basetypes): Not here.
5052         * search.c (dfs_search): Remove; no longer used.
5053
5054 1999-03-12  Mark Mitchell  <mark@markmitchell.com>
5055
5056         * decl2.c (validate_nonmember_using_decl): Issue sensible
5057         error-messages on bogus qualifiers.
5058
5059 1999-03-14  Jason Merrill  <jason@yorick.cygnus.com>
5060
5061         * call.c (add_function_candidate): Fix uninitialized variable.
5062
5063         * Makefile.in (search.o): Add dependency on varray.h.
5064
5065 1999-03-13  Jason Merrill  <jason@yorick.cygnus.com>
5066
5067         * decl.c (duplicate_decls): Use same_type_p.
5068         * method.c (try_old_backref): Renamed from flush_repeats.  Use
5069         same_type_p.  Don't try to handle repeats.  Return success.
5070         (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA.  Support
5071         calls from old-style code, too.
5072         (check_ktype): Use same_type_p.
5073         (check_btype): Use same_type_p.  Don't pull out TYPE_MAIN_VARIANT.
5074         (build_qualified_name): Simplify logic.
5075         (process_overload_item): Strip typedefs and quals at the top.
5076         (build_mangled_name_for_type_with_Gcode): Remove call to
5077         type_canonical_variant.
5078         (build_mangled_name): Likewise.  Remove support for old-style
5079         repeats, which have been disabled since 2.7.2.  Don't mess with
5080         TREE_USED.
5081         (build_decl_overload_real): Don't mess with TREE_USED.
5082
5083 1999-03-13  Nathan Sidwell  <nathan@acm.org>
5084
5085         * error.c (cp_printers): Add 'F' escape character.
5086         (dump_type_real): Remove TREE_LIST (fnargs) printing.
5087         Functionality moved to dump_parameters.
5088         (dump_type_suffix): Use dump_parameters and dump_exception_spec.
5089         (dump_function_decl): Extend meaning of V parameter.  Use
5090         dump_parameters and dump_exception_spec.
5091         (dump_parameters): New static function.
5092         (dump_exception_spec): New static function.
5093         (fndecl_as_string): Change argument semantics.  Use
5094         dump_function_decl directly.
5095
5096         * sig.c (build_signature_table_constructor): Use cp_error.
5097
5098 1999-03-13  Martin von Löwis  <loewis@informatik.hu-berlin.de>
5099
5100         * semantics.c (finish_switch_cond): Handle error cases gracefully.
5101         Detected by g++.law/enum5.C.
5102
5103         * typeck.c (build_modify_expr): Check for errors after resolving
5104         offsets.  Detected by g++.brendan/static1.C.
5105
5106         * decl.c (complete_array_type): Ignore initial_value if it is an
5107         error.  Detected by g++.benjamin/17930.C.
5108
5109         * typeck2.c (process_init_constructor): Return error if one argument
5110         is in error.  Detected by g++.benjamin/13478.C.
5111
5112 1999-03-12  Martin von Löwis  <loewis@informatik.hu-berlin.de>
5113
5114         * decl.c (select_decl): Allow class templates when we need types.
5115         * decl2.c (ambiguous_decl): Likewise.
5116
5117 1999-03-12  Mark Mitchell  <mark@markmitchell.com>
5118
5119         * lex.c (do_identifier): Correct call to enforce_access.
5120         * search.c (accessible_p): Tweak comment.
5121
5122 1999-03-10  Mark Mitchell  <mark@markmitchell.com>
5123
5124         * semantics.c (begin_class_definition): Call build_self_reference.
5125         (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
5126
5127         * search.c (assert_canonical_unmarked): Fix typo in prototype.
5128
5129         * search.c (dfs_canonical_queue): New function.
5130         (dfs_assert_unmarked_p): Likewise.
5131         (assert_canonical_unmarked): Likewise.
5132         (access_in_type): Use it.
5133         (accessible_p): Likewise.  Walk the whole tree when umarking.
5134
5135         * sig.c (build_signature_table_constructor): Use accessible_p
5136         instead of compute_access.
5137
5138 1999-03-09  Jason Merrill  <jason@yorick.cygnus.com>
5139
5140         * call.c (add_builtin_candidates): Handle overloaded conversion ops.
5141
5142 1999-03-09  Mark Mitchell  <mark@markmitchell.com>
5143
5144         * cp-tree.h (flag_access_control): Declare.
5145         (TREE_VIA_PPUBLIC): Document.
5146         (DECL_NONSTATIC_MEMBER_P): New macro.
5147         (enforce_access): Return an indication of whether or not access
5148         was permitted.
5149         (build_self_reference): Change prototype.
5150         (compute_access): Replace with ...
5151         (accessible_p): New function.
5152         (dfs_walk): Change prototype.
5153         (dfs_unmark): Likewise.
5154         (markedp): Likewise.
5155         * call.c (enforce_access): Use accessible_p.
5156         * class.c (build_self_reference): Insert the declaration into the
5157         list of members for this type, and make it public.
5158         * decl.c (xref_basetypes): Avoid ill-timed recursion.
5159         * init.c (build_offset_ref): Use lookup_member, not three separate
5160         name-lookups.  Call enforce_access rather than checking for
5161         illegal accesses here.
5162         (resolve_offset_ref): Likewise.
5163         * lex.c (do_identifier): Likewise.
5164         * method.c (hack_identifier): Likewise.
5165         * parse.y (self_reference): Remove.
5166         (opt_component_decl_list): Don't use it.
5167         * parse.c: Regenerated.
5168         * pt.c (print_candidates): Generalize to handle lists of
5169         overloaded functions.
5170         (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's
5171         not set.
5172         (get_template_base): Use new calling convention for dfs_walk.
5173         * search.c: Include varray.h.  Add prototypes.
5174         (dfs_walk): Accept a data pointer to pass to the work functions.
5175         All callers changed.  All work functions changed.
5176         (breadth_first_search): Rename to bfs_walk, and make consistent
5177         with dfs_walk.
5178         (dfs_walk_real): New function.
5179         (canonical_binfo): New function.
5180         (context_for_name_lookup): Likewise.
5181         (shared_marked_p): Likewise.
5182         (shared_unmarked_p): Likewise.
5183         (lokup_field_queue_p): Likewise.
5184         (lookup_field_r): Generalize to handle both functions and fields.
5185         (lookup_field): Just call lookup_member.
5186         (lookup_fnfields): Likewise.
5187         (lookup_member): Move body of lookup_field here and generalize.
5188         (dfs_accessible_queue_p): Likewise.
5189         (dfs_accessible_p): Likewise.
5190         (dfs_access_in_type): Likewise.
5191         (access_in_type): Likewise.
5192         (compute_access): Remove, and replace with ...
5193         (accessible_p): New function.
5194         (vbase_types): Remove.
5195         (vbase_decl_ptr_intermediate): Likewise.
5196         (vbase_decl_ptr): Likewise.
5197         (vbase_init_result): Likewise.
5198         (closed_envelopes): Likewise.
5199         (bvtable): Likewise.
5200
5201 1999-03-09  Jason Merrill  <jason@yorick.cygnus.com>
5202
5203         * call.c (add_function_candidate): Check for proper number of args
5204         before checking the validity of those args.
5205
5206 1999-03-06  Jason Merrill  <jason@yorick.cygnus.com>
5207
5208         * cp-tree.h (struct lang_type): Add anon_union field.
5209         (ANON_UNION_TYPE_P): Use it instead of examining type.
5210         (SET_ANON_UNION_TYPE_P): New macro.
5211         * decl.c (check_tag_decl): Use it.
5212
5213         * search.c (compute_access): Handle non-type contexts earlier, and
5214         handle NULL_TREE.
5215
5216         * tree.c (build_exception_variant): Use copy_to_permanent.
5217
5218         * decl2.c (setup_initp): Give statics with no priority the default
5219         priority here.
5220         (do_dtors, do_ctors, finish_file): Remove special handling of
5221         non-prioritized statics.
5222
5223 1999-03-05  Mark Mitchell  <mark@markmitchell.com>
5224
5225         * cp-tree.h (ANON_UNION_TYPE_P): Robustify.
5226         * decl.c (make_typename_type): Don't issue an error if an
5227         immediate lookup fails; it migt be resolved later.
5228         * friend.c (is_friend): Add comment.
5229         * search.c (breadth_first_search): Add POSTFN and DATA
5230         parameters.  Tidy.  All callers changed.
5231         (lookup_field_queue_p): New function.
5232         (lookup_field_r): Likewise.
5233         (lookup_field_post): Likewise.
5234         (lookup_field): Use them, via breadth_first_search, instead of
5235         duplicating logic.
5236         (compute_access): Robustify.
5237         (lookup_fnfield_info): New structure.
5238
5239 1999-03-05  Jason Merrill  <jason@yorick.cygnus.com>
5240
5241         * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again.
5242
5243 1999-03-03  Jason Merrill  <jason@yorick.cygnus.com>
5244
5245         * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
5246         cc happy.
5247
5248         * decl2.c (import_export_class): Also return if
5249         CLASSTYPE_INTERFACE_ONLY is set.
5250
5251 1999-03-03  Martin von Löwis  <loewis@informatik.hu-berlin.de>
5252
5253         * decl.c (push_overloaded_decl): Only overwrite the old binding if
5254         there was one.
5255         * decl2.c (do_local_using_decl): Fix loop termination.
5256
5257 1999-03-02  Mark Mitchell  <mark@markmitchell.com>
5258
5259         * cp-tree.h (determine_specialization): Don't declare.
5260         * pt.c (determine_specialization): Make it static.  Eliminate
5261         complain parameter.  Note that decl is always non-NULL now, and
5262         simplify accordingly.
5263
5264         * decl.c (maybe_push_to_top_level): Always call
5265         push_cp_function_context.
5266         (pop_from_top_level): Always call pop_cp_function_context.
5267
5268 1999-02-26  Nathan Sidwell  <nathan@acm.org>
5269
5270         * typeck.c (complete_type_or_else): Add VALUE arg, for helpful
5271         diagnostics.
5272         * cp-tree.h (complete_type_or_else): Added VALUE parameter.
5273         * init.c (build_new_1): Extra arg to complete_type_or_else.
5274         (build_delete): Likewise.
5275         * typeck.c (require_complete_type): Likewise.
5276         (pointer_int_sum): Likewise.
5277         (pointer_diff): Likewise.
5278         (build_component_ref): Likewise.
5279
5280         * typeck2.c (incomplete_type_error): Always use cp_error.
5281         Show declaration of undefined type, if appropriate.
5282         Deal with UNKNOWN_TYPE nodes.
5283
5284         * typeck.c (require_complete_type): Use TYPE_SIZE as
5285         size_zero_node to mean incomplete type.
5286         (require_complete_type_in_void): New function.
5287         (build_compound_expr): Call complete_type_in_void for LHS.
5288         (build_c_cast): Call complete_type_in_void for void cast.
5289         * cvt.c (ocp_convert): Call complete_type_in_void for void cast.
5290         * decl.c (cplus_expand_expr_stmt): Void expression checks moved to
5291         require_complete_type_in_void.  Call it.
5292         * cp-tree.h (require_complete_type_in_void): Prototype new function.
5293
5294         * typeck.c (convert_arguments): Use alternative format for
5295         function decls.  Don't require_complete_type here.  Simplify
5296         diagnostic printing.
5297         (convert_for_initialization): Don't require_complete_type on RHS yet.
5298         * call.c (convert_arg_to_ellipsis): Call require_complete_type.
5299
5300         * call.c (build_over_call): Cope with qualified void return type.
5301         * semantics.c (finish_call_expr): Likewise.
5302         * typeck.c (build_function_call_real): Likewise.
5303         (c_expand_return): Likewise.
5304         * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
5305
5306         * call.c (print_z_candidates): Use alternate print format, to be
5307         consistent with (pt.c) print_candidates.
5308         * method.c (hack_identifier): List candidate members.
5309         * search.c (lookup_field): Build ambiguous list, and show it, if
5310         ambiguous.
5311
5312 1999-02-26  Mark Mitchell  <mark@markmitchell.com>
5313
5314         * typeck.c (decay_conversion): Don't confuse constant array
5315         variables with their initializers.
5316
5317         * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when
5318         merging decls.
5319         * pt.c (regenerate_decl_from_template): Tweak for clarity.
5320         (instantiate_decl): Mark a decl instantiated before regenerating
5321         it to avoid recursion.
5322         * tree.c (mapcar): Don't call decl_constant_value unless we know
5323         something is TREE_READONLY_DECL_P.
5324
5325         * class.c (check_for_override): Don't stop checking when we find
5326         the first overridden function.  Delete #if 0'd code.
5327         * search.c (get_matching_virtual): Likewise.
5328
5329 1999-02-25  Richard Henderson  <rth@cygnus.com>
5330
5331         * lang-specs.h: Define __FAST_MATH__ when appropriate.
5332
5333 1999-02-24  Mike Stump  <mrs@wrs.com>
5334
5335         * typeck.c (convert_for_assignment): Allow boolean integral constant
5336         expressions to convert to null pointer.
5337
5338 1999-02-24  Martin von Loewis  <loewis@informatik.hu-berlin.de>
5339
5340         * decl.c (lookup_namespace_name): Resolve namespace aliases.
5341
5342         * class.c (push_nested_class): Allow namespaces.
5343
5344         * decl2.c (set_decl_namespace): Add friendp parameter.
5345         * decl.c (grokfndecl): Pass it.
5346         (grokvardecl): Likewise.
5347         * cp-tree.h: Change declaration.
5348
5349 1999-02-24  Jason Merrill  <jason@yorick.cygnus.com>
5350
5351         * pt.c (tsubst): Allow an array of explicit size zero.
5352
5353 1999-02-23  Jason Merrill  <jason@yorick.cygnus.com>
5354
5355         * errfn.c: Change varargs code to look like toplev.c.
5356
5357         * method.c (process_modifiers): Don't prepend 'U' for char or
5358         wchar_t.
5359
5360 1999-02-20  Craig Burley  <craig@jcb-sc.com>
5361
5362         * Make-lang.in (cplib2.ready): Don't consider updating
5363         cplib2 stuff if the current directory isn't writable, as
5364         it won't work (such as during a `make install').
5365
5366 Sun Feb 21 20:38:00 1999  H.J. Lu  (hjl@gnu.org)
5367
5368         * decl2.c (start_objects): Make file scope constructors and
5369         destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
5370         ASM_OUTPUT_DESTRUCTOR are defined.
5371
5372 1999-02-19  Mark Mitchell  <mark@markmitchell.com>
5373
5374         * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
5375         (fn_type_unification): Adjust prototype.
5376         (lookup_fnfields_1): Declare.
5377         * call.c (add_template_candidate_real): Adjust call to
5378         fn_type_unification.
5379         * class.c (add_method): Don't allow duplicate declarations of
5380         constructors or destructors.
5381         (resolve_address_of_overloaded_function): Remove unused variable.
5382         Adjust call to fn_type_unification.
5383         * decl.c (grokfndecl): Be more robust in the face of illegal
5384         specializations.
5385         * decl2.c (check_classfn): Remove hokey handling of member
5386         templates.
5387         * pt.c (determine_specialization): Improve comments.  Adjust to
5388         handle template argument deduction as per the standard.
5389         (check_explicit_specialization): Fix comment spacing.  Handle
5390         type-conversion operators correctly.  Improve error-recovery.
5391         (fn_type_unification): Remove EXTRA_FN_ARG parameter.
5392         (get_bindings_real): Simplify handling of static members.
5393         * search.c (lookup_fnfields_1): Make it have external linkage.
5394         * typeck.c (compparms): Fix comment.
5395         (build_unary_op): Don't try to figure out which template
5396         specialization is being referred to when when the address-of
5397         operator is used with a template function.
5398
5399 Thu Feb 18 23:40:01 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5400
5401         * cp-tree.h (lvalue_or_else): Qualify a char* with the `const'
5402         keyword to match an analogous change at the top level.
5403
5404         * tree.c (lvalue_or_else): Likewise.
5405
5406 1999-02-17  Mark Mitchell  <mark@markmitchell.com>
5407
5408         * decl.c (xref_basetypes): Comment.
5409         * pt.c (instantiate_class_template): Use xref_basetypes.
5410
5411 1999-02-16  Mark Mitchell  <mark@markmitchell.com>
5412
5413         * cp-tree.h (tsubst): Change prototype.
5414         (tsubst_expr): Likewise.
5415         (tsubst_copy): Likewise.
5416         (type_unification): Remove prototype.
5417         * call.c (convert_default_arg): Adjust call to tsubst_expr.
5418         * class.c (resolve_address_of_overloaded_function): Just use
5419         fn_type_unification.
5420         * decl.c (grokdeclarator): Adjust call to tsubst.
5421         * method.c (build_template_parm_names): Likewise.
5422         * pt.c (GTB_VIA_VIRTUAL): New macro.
5423         (GTB_IGNORE_TYPE): Likewise.
5424         (resolve_overloaded_unification): Add `complain' parameter.
5425         (try_one_overload): Likewise.
5426         (tsubst_template_arg_vector): Likewise.
5427         (tsubst_template_parms): Likewise.
5428         (tsubst_aggr_type): Likewise.
5429         (tsubst_arg_types): Likewise.
5430         (tsubst_call_declarator_parms): Likewise.
5431         (unify): Remove explicit_mask.
5432         (type_unification_real): Likewise.
5433         (get_template_base_recursive): Likewise.
5434         (coerce_template_template_parms): Provide prototype.
5435         (tsubst_function_type): Likewise.
5436         (try_class_unification): New function.
5437         All callers changed to use new complain parameter.
5438         (get_template_base): Use try_class_unification.
5439         (unify): Adjust handling of classes derived from template types.
5440         (fn_type_unification): Substitute explicit arguments before
5441         unification.
5442
5443 1999-02-16  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
5444
5445         * decl.c (pushdecl): Remove dead code.
5446
5447 1999-02-16  Jason Merrill  <jason@yorick.cygnus.com>
5448
5449         * decl2.c (finish_objects): Fix code I missed in previous change.
5450
5451 1999-02-13  Jason Merrill  <jason@yorick.cygnus.com>
5452
5453         * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
5454         (grokdeclarator): Don't expect error_mark_node from grokfndecl.
5455
5456         * pt.c (maybe_process_partial_specialization): Complain about
5457         'template <>' on non-specialization.
5458
5459 1999-02-10  Jason Merrill  <jason@yorick.cygnus.com>
5460
5461         * decl.c (grokdeclarator): Catch wierd declarators.
5462         * decl2.c (finish_file): Don't abort because of namespace parsing
5463         failure.
5464         (check_decl_namespace): Remove.
5465
5466 1999-02-09  Mark Mitchell  <mark@markmitchell.com>
5467
5468         * cp-tree.h (get_template_base): Don't declare.
5469         (dfs_walk): Declare.
5470         (dfs_unmark): Likewise.
5471         (markedp): Likewise.
5472         * pt.c (unify): Remove duplicate declaration.  Pass tparms and
5473         targs to get_template_base.
5474         (get_template_base_recursive): Move here from search.c.  Check to
5475         see that the base found can be instantiated to form the desired
5476         type.
5477         (get_template_base): Likewise.
5478         (get_class_bindings): Simplify.
5479         * search.c (get_template_base_recursive): Move to pt.c.
5480         (get_template_base): Likewise.
5481         (markedp): Make it global.
5482         (dfs_walk): Likewise.
5483         (dfs_unmark): Likewise.
5484
5485 1999-02-07  Jason Merrill  <jason@yorick.cygnus.com>
5486
5487         * pt.c (maybe_process_partial_specialization): Complain about
5488         specialization in wrong namespace.
5489         * tree.c (decl_namespace_context): New fn.
5490
5491 1999-02-06  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
5492
5493         * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
5494         * pt.c (coerce_template_template_parms): Handle nested
5495         template template parameters.
5496
5497 Sat Feb  6 18:08:40 1999  Jeffrey A Law  (law@cygnus.com)
5498
5499         * typeck2.c: Update email addresses.
5500
5501 1999-02-04  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
5502
5503         * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag
5504         turned off.
5505
5506 1999-02-04  Jason Merrill  <jason@yorick.cygnus.com>
5507
5508         * lex.c (retrofit_lang_decl): Split out...
5509         (build_lang_decl): From here.
5510         * decl.c (pushdecl): Call it for functions generated by the middle
5511         end that don't have DECL_LANG_SPECIFIC.
5512         * cp-tree.h: Declare it.
5513
5514         * decl2.c: Remove flag_init_priority.  Always enable initp stuff.
5515         (start_objects, finish_objects): Only use special
5516         init_priority code if the user specified a priority.
5517         (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
5518         objects.
5519
5520 Wed Feb  3 22:50:17 1999  Marc Espie  <Marc.Espie@liafa.jussieu.fr>
5521
5522         * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and
5523         mkstemp.o.  Get them from libiberty now.
5524         (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o.
5525
5526 Tue Feb  2 22:38:48 1999  Theodore Papadopoulo  <Theodore.Papadopoulo@sophia.inria.fr>
5527
5528         * decl2.c (lang_decode_option): Use read_integral_parameter.
5529
5530 1999-02-01  Mark Mitchell  <mark@markmitchell.com>
5531
5532         * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
5533         before calling complete_type_or_else.
5534
5535 Mon Feb  1 09:49:52 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5536
5537         * input.c (inline): Don't define, its handled by system.h.
5538
5539 Sun Jan 31 20:34:29 1999  Zack Weinberg  <zack@rabi.columbia.edu>
5540
5541         * decl2.c: Don't define flag_no_ident here.  Don't process
5542         -f(no-)ident here.
5543         * cp-tree.h: Don't declare flag_no_ident here.
5544         * lang-specs.h: Map -Qn to -fno-ident.
5545
5546 1999-01-28  Jason Merrill  <jason@yorick.cygnus.com>
5547
5548         * cp-tree.h (struct tree_binding): Replace scope field with a union.
5549         (BINDING_SCOPE): Adjust.
5550         * decl.c (BINDING_LEVEL): Adjust.
5551
5552 1999-01-26  Jason Merrill  <jason@yorick.cygnus.com>
5553
5554         * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
5555         member constants.
5556
5557         * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
5558         a ctor initializer.
5559
5560         * tree.c (equal_functions): Fix name in prototype.
5561
5562         * decl.c (push_local_binding): Add FLAGS argument.
5563         (pushdecl, push_overloaded_decl): Pass it.
5564         * decl2.c (do_local_using_decl): Likewise.
5565         * cp-tree.h: Adjust prototype.
5566         * decl.c (poplevel): Fix logic.
5567
5568         * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
5569         (poplevel): Handle that.  Fix logic for removing TREE_LISTs.
5570         (cat_namespace_levels): Don't loop forever.
5571
5572 1999-01-25  Richard Henderson  <rth@cygnus.com>
5573
5574         * typeck.c (build_reinterpret_cast): Fix typo in duplicated test.
5575
5576 1999-01-25  Jason Merrill  <jason@yorick.cygnus.com>
5577
5578         * class.c (resolve_address_of_overloaded_function): Mark the
5579         chosen function used.
5580
5581         * call.c (build_call): Make sure that a function coming in has
5582         been marked used already.
5583         * decl.c (expand_static_init): Call mark_used instead of
5584         assemble_external.
5585         * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
5586         alloc_eh_object, expand_throw): Likewise.
5587         * init.c (build_builtin_delete_call): Likewise.
5588         * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
5589         expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
5590         expand_generic_desc): Likewise.
5591
5592 1999-01-25  Martin von Löwis  <loewis@informatik.hu-berlin.de>
5593
5594         * tree.c (equal_functions): New function.
5595         (ovl_member): Call it.
5596
5597 1999-01-24  Jason Merrill  <jason@yorick.cygnus.com>
5598
5599         * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf.
5600
5601 1999-01-25  Martin von Loewis  <loewis@informatik.hu-berlin.de>
5602
5603         * decl.c (decls_match): Return 1 if old and new are identical.
5604         (push_overloaded_decl): Set OVL_USED when PUSH_USING.
5605
5606 1999-01-24  Jason Merrill  <jason@yorick.cygnus.com>
5607
5608         * decl.c (start_function): Make member functions one_only on windows.
5609         * decl2.c (import_export_decl): Likewise.
5610
5611         * decl.c (grokdeclarator): Don't complain about implicit int in
5612         a system header.  Change same-name field check to not complain in
5613         a system header instead of within extern "C".
5614
5615 1999-01-21  Mark Mitchell  <mark@markmitchell.com>
5616
5617         * cp-tree.h (PUSH_GLOBAL): New macro.
5618         (PUSH_LOCAL): Likewise.
5619         (PUSH_USING): Likewise.
5620         (namespace_bindings_p): Declare.
5621         (push_overloaded_decl): Likewise.
5622         * decl.c (push_overloaded_decl): Don't make it static.  Check for
5623         illegal declarations after using declarations here.
5624         (namespace_bindings_p): Likewise.
5625         (duplicate_decls): Don't consider declarations from different
5626         namespaces to be the same.
5627         (pushdecl): Use symbolic PUSH_ constants in calls to
5628         push_overloaded_decl.
5629         (push_overloaded_decl_1): Likewise.
5630         * decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
5631         (do_nonmember_using_decl): Check for illegal using declarations
5632         after ordinary declarations here.
5633         (do_local_using_decl): Call pushdecl to insert declarations.
5634
5635 1999-01-21  Jason Merrill  <jason@yorick.cygnus.com>
5636
5637         * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo.
5638
5639 1999-01-21  Mark Mitchell  <mark@markmitchell.com>
5640
5641         * tree.c (build_cplus_array_type_1): Don't call build_array_type
5642         for types involving template parameters.
5643
5644         * cp-tree.h (PARM_DECL_EXPR): Delete.
5645         (convert_default_arg): Change prototype.
5646         (check_default_argument): Declare.
5647         (search_tree): Likewise.
5648         * call.c (convert_default_arg): Take the function to which the
5649         default argument belongs as a parameter, and do any necessary
5650         instantiation here, instead of ...
5651         (build_over_call): Here.
5652         * decl.c (local_variable_p): New function.
5653         (check_default_argument): Likewise, split out and tidied from ...
5654         (grokparms): Here.
5655         * error.c (dump_expr): Don't set PARM_DECL_EXPR.
5656         * pt.c (tsubst_call_declarator_parms): New function.
5657         (for_each_template_parm): Handle ARRAY_REFs.  Do the obvious thing
5658         with CALL_EXPRs, rather than trying to be clever.
5659         (tsubst): Use tsubst_call_declarator_parms.
5660         * tree.c (search_tree): Don't make it static.
5661         * typeck.c (convert_arguments): Use new interface to
5662         convert_default_arg.
5663
5664 1999-01-20  Mark Mitchell  <mark@markmitchell.com>
5665
5666         * error.c (dump_function_decl): Don't print the argument types for
5667         a function when the verbosity level is negative.
5668
5669         * call.c (build_over_call): Check format attributes at call-time.
5670
5671         * pt.c (tsubst_copy): Fix comment.
5672         (unify): Don't allow unification with variable-sized arrays.
5673
5674         * semantics.c (finish_stmt_expr): When processing a template make
5675         the BIND_EXPR long-lived.
5676
5677 1999-01-19  Jason Merrill  <jason@yorick.cygnus.com>
5678
5679         * decl2.c (finish_vtable_vardecl): Make vtables comdat here.
5680         (import_export_vtable): Not here.
5681
5682 1999-01-18  Jason Merrill  <jason@yorick.cygnus.com>
5683
5684         * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique
5685         non-static member function.
5686
5687 1999-01-18  Nathan Sidwell  <nathan@acm.org>
5688
5689         * class.c (instantiate_type): Only diagnose illegal address of member
5690         function if complaining.
5691
5692         * decl.c (lookup_name_real): Remove duplicate code.
5693
5694 1999-01-18  Jason Merrill  <jason@yorick.cygnus.com>
5695
5696         * tree.c (copy_template_template_parm): Use permanent_obstack.
5697
5698 1999-01-18  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
5699
5700         * pt.c (unify): Remove restrictions on deduction of argument
5701         of template template parameters.
5702
5703 1999-01-18  Nathan Sidwell  <nathan@acm.org>
5704
5705         * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
5706
5707         * class.c (resolve_address_of_overloaded_function): Show list of
5708         all candidates, when none of them match.
5709
5710 1999-01-18  Chip Salzenberg  <chip@perlsupport.com>
5711
5712         * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
5713         definition of 'casting away const' in reinterpret_cast<>.
5714
5715 1999-01-18  Graham  <grahams@rcp.co.uk>
5716
5717         * cvt.c: Add include for decl.h, remove extern for
5718         static_aggregates which is now provided by decl.h.
5719
5720         * Makefile.in (cvt.o): Add dependency for decl.h and missing
5721         dependencies for convert.h and flags.h.
5722
5723 1999-01-18  Nathan Sidwell  <nathan@acm.org>
5724
5725         * decl2.c (do_dtors): Set current location to that of the
5726         decl, for sensible diagnostics and debugging.
5727         (check_classfn): Issue `incomplete type' error, if
5728         class is not defined.
5729
5730 1999-01-16  Jason Merrill  <jason@yorick.cygnus.com>
5731
5732         * cp-tree.h: Add prototype for bound_pmf_p.
5733
5734 1999-01-16  Jason Merrill  <jason@yorick.cygnus.com>
5735             Manfred Hollstein <manfred@s-direktnet.de>
5736
5737         * decl.c (grokdeclarator): Don't make 'main(){}' an error with only
5738         -Wreturn-type.
5739
5740 1999-01-16  Nathan Sidwell  <nathan@acm.org>
5741
5742         * cp-tree.h (struct lang_type): Added has_mutable flag.
5743         (CLASSTYPE_HAS_MUTABLE): New macro to access it.
5744         (TYPE_HAS_MUTABLE_P): New macro to read it.
5745         (cp_has_mutable_p): Prototype for new function.
5746         * class.c (finish_struct_1): Set has_mutable from members.
5747         * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if
5748         it contains a mutable.
5749         * typeck.c (cp_has_mutable_p): New function.
5750
5751 1999-01-15  Mark Mitchell  <mark@markmitchell.com>
5752
5753         * pt.c (process_template_parm): Ignore top-level qualifiers on
5754         non-type parameters.
5755
5756         * decl.c (start_function): Use current_function_parms in the call
5757         to require_complete_type_for_parms, not the probably empty
5758         DECL_ARGUMENTS.
5759
5760 1999-01-14  Jason Merrill  <jason@yorick.cygnus.com>
5761
5762         * semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
5763
5764         * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
5765         that we don't suppress the other copies.
5766         * lex.c (handle_cp_pragma): Likewise.
5767
5768 1999-01-13  Mark Mitchell  <mark@markmitchell.com>
5769
5770         * decl.c (grokdeclarator): Undo 1998-12-14 change.
5771         * tree.c (build_cplus_array_type_1): Likewise.
5772         * pt.c (instantiate_class_template): Remove misleading comment.
5773         (tsubst_aggr_type): Substitute if there are template parameters,
5774         regardless of whether or not they use template arguments.
5775         (unify): Likewise, but for unification.
5776
5777 1999-01-12  Richard Henderson  <rth@cygnus.com>
5778
5779         * cp-tree.h (flag_permissive): Declare extern.
5780
5781 1999-01-06  Mark Mitchell  <mark@markmitchell.com>
5782
5783         * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT
5784         here.
5785         (lang_type): Add is_partial_instantiation.  Decrease width of
5786         dummy.
5787         (PARTIAL_INSTANTIATION_P): New macro.
5788         (OPERATOR_TYPENAME_P): Remove.
5789         * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not
5790         OPERATOR_TYPENAME_P.
5791         (grok_op_properties): Likewise.
5792         * friend.c (do_friend): Handle friends that are member functions
5793         correctly.
5794         * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT.
5795         * pt.c (instantiate_class_template): Rework for clarity.  Avoid
5796         leaving TYPE_BEING_DEFINED set in obscure cases.  Don't do
5797         any more partial instantiation than is absolutely necessary for
5798         implicit typename.  Set PARTIAL_INSTANTIATION_P.
5799         (tsubst_decl): Use IDENTIFIER_TYPENAME_P.
5800         * semantics.c (begin_class_definition): Handle partial
5801         specializations of a type that was previously partially
5802         instantiated.
5803
5804 Wed Jan  6 03:18:53 1999  Mark Elbrecht  <snowball3@usa.net.
5805
5806         * g++spec.c (LIBSTDCXX): Provide default definition.
5807         (lang_specific_driver): Use LIBSTDCXX instead of "-lstdc++".
5808
5809 Tue Jan  5 22:11:25 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5810
5811         * Make-lang.in (g++.o): Depend on prefix.h.
5812
5813 1999-01-04  Jason Merrill  <jason@yorick.cygnus.com>
5814
5815         * tree.c (bound_pmf_p): New fn.
5816         * typeck.c (build_c_cast): Use it.
5817
5818         * decl.c (grok_op_properties): Use same_type_p.
5819
5820 Tue Dec 22 15:09:25 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5821
5822         * Makefile.in (cvt.o): Depend on toplev.h.
5823
5824         * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes.
5825
5826         * cvt.c: Include toplev.h.
5827
5828         * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and
5829         definitions.
5830
5831         * init.c (expand_vec_init): Initialize variable `itype'.
5832
5833         * lex.c (yyerror): Cast the argument passed to a ctype function to
5834         an unsigned char.
5835
5836         * method.c (build_mangled_C9x_name): Wrap prototype and definition
5837         in "HOST_BITS_PER_WIDE_INT >= 64".
5838
5839         * typeck.c (build_binary_op): Mark parameter `convert_p' with
5840         ATTRIBUTE_UNUSED.
5841
5842 1998-12-22  Mark Mitchell  <mark@markmitchell.com>
5843
5844         * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
5845         * tree.c (build_exception_variant): Don't crash on empty throw
5846         specs.
5847
5848 1998-12-18  DJ Delorie  <dj@cygnus.com>
5849
5850         * cvt.c (convert_to_reference): Check for both error_mark_node
5851         and NULL_NODE after call to convert_for_initialization.
5852
5853 1998-12-17  Jason Merrill  <jason@yorick.cygnus.com>
5854
5855         * error.c (interesting_scope_p): New fn.
5856         (dump_simple_decl): Use it.
5857         (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
5858         (dump_expr, case OFFSET_REF): Print ->* if appropriate.
5859
5860 1998-12-16  Mark Mitchell  <mark@markmitchell.com>
5861
5862         * class.c (resolve_address_of_overloaded_function): Do conversion
5863         to correct type here, rather than ...
5864         (instantiate_type): Here.
5865
5866         * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
5867         (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
5868         (decl_template_parm_p): Remove.
5869         * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
5870         parameter.
5871         * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
5872         * pt.c (push_inline_template_parms_recursive): Set it.
5873         (decl_template_parm_p): Remove.
5874         (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
5875         (process_template_parm): Set it.
5876
5877 Wed Dec 16 16:33:58 1998  Dave Brolley  <brolley@cygnus.com>
5878
5879         * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
5880         if configured with cpplib.
5881
5882 1998-12-15  Mark Mitchell  <mark@markmitchell.com>
5883
5884         * decl.c (poplevel): Make sure ns_binding is initialized.
5885
5886         * decl.c (finish_function): Undo inadvertent change in previous
5887         patch.
5888
5889 1998-12-14  Mark Mitchell  <mark@markmitchell.com>
5890
5891         * class.c (pushclass): Tweak handling of class-level bindings.
5892         (resolve_address_of_overloaded_function): Update pointer-to-member
5893         handling.
5894         (instantiate_type): Likewise.
5895         * cvt.c (cp_convert_to_pointer): Likewise.
5896         * decl.c (pop_binding): Take the DECL to pop, not just the name.
5897         Deal with `struct stat' hack.
5898         (binding_level): Add to documentation.
5899         (push_binding): Clear BINDING_TYPE.
5900         (add_binding): New function.
5901         (push_local_binding): Use it.
5902         (push_class_binding): Likewise.
5903         (poplevel): Adjust calls to pop_binding.
5904         (poplevel_class): Likewise.
5905         (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
5906         declarations to current binding level.
5907         (push_class_level_binding): Likewise.
5908         (push_overloaded_decl): Adjust handling of OVERLOADs in local
5909         bindings.
5910         (lookup_namespace_name): Don't crash when confronted with a
5911         TEMPLATE_DECL.
5912         (lookup_name_real): Do `struct stat' hack in local binding
5913         contexts.
5914         (build_ptrmemfunc_type): Adjust documentation.
5915         (grokdeclarator): Don't avoid building real array types when
5916         processing templates unless really necessary.
5917         (finish_method): Adjust calls to pop_binding.
5918         * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
5919         not reparse_decl_as_expr.
5920         (build_expr_from_tree): Deal with a template-id as the function to
5921         call in a METHOD_CALL_EXPR.
5922         * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
5923         (maybe_adjust_types_For_deduction): Don't do peculiar things with
5924         METHOD_TYPEs here.
5925         (resolve_overloaded_unification): Handle COMPONENT_REFs.  Build
5926         pointer-to-member types where necessary.
5927         * tree.c (build_cplus_array_type_1): Don't avoid building real
5928         array types when processing templates unless really necessary.
5929         (build_exception_variant): Compare the exception lists correctly.
5930
5931 1998-12-13  Mark Mitchell  <mark@markmitchell.com>
5932
5933         * cp-tree.def (CPLUS_BINDING): Update documentation.
5934         * cp-tree.h (LOCAL_BINDING_P): New macro.
5935         (lang_identifier): Rename local_value to bindings.
5936         (tree_binding): Make `scope' of type `void*', not `tree'.
5937         (BINDING_SCOPE): Update documentation.
5938         (IDENTIFIER_LOCAL_VALUE): Remove.
5939         (IDENTIFIER_CLASS_VALUE): Document.
5940         (IDENTIFIER_BINDING): New macro.
5941         (IDENTIFIER_VALUE): Likewise.
5942         (TIME_IDENTIFIER_TIME): Likewise.
5943         (TIME_IDENTIFIER_FILEINFO): Likewise.
5944         (IMPLICIT_TYPENAME_P): Likewise.
5945         (set_identifier_local_value): Remove.
5946         (push_local_binding): New function.
5947         (push_class_binding): Likewise.
5948         * class.c (pushclass): Update comments; use push_class_binding.
5949         * decl.c (set_identifier_local_value_with_scope): Remove.
5950         (set_identifier_local_value): Likewise.
5951         (push_binding): New function.
5952         (pop_binding): Likewise.
5953         (binding_level): Update documentation.  Remove shadowed.
5954         (BINDING_LEVEL): New macro.
5955         (free_binding_nodes): New variable.
5956         (poplevel): Adjust for new name-lookup scheme.  Don't mess up
5957         BLOCK_VARs when doing for-scope extension.  Remove effectively
5958         dead code.
5959         (pushlevel_class): Tweak formatting.
5960         (poplevel_class): Adjust for new name-lookup scheme.
5961         (print_binding_level): Likewise.
5962         (store_bindings): Likewise.
5963         (pushdecl): Likewise.
5964         (pushdecl_class_level): Likewise.
5965         (push_class_level_binding): Likewise.
5966         (push_overloaded_decl): Update comments.  Adjust for new
5967         name-lookup scheme.
5968         (lookup_name_real): Likewise.
5969         (lookup_name_current_level): Likewise.
5970         (cp_finish_decl): Likewise.
5971         (require_complete_types_for_parms): Likewise.  Remove misleading
5972         #if 0'd code.
5973         (grok_parms): Likewise.  Don't call
5974         require_complete_types_for_parms here.
5975         (grok_ctor_properties): Don't treat templates as copy
5976         constructors.
5977         (grop_op_properties): Or as assignment operators.
5978         (start_function): Document.  Adjust for new name-lookup scheme.
5979         (finish_function): Likewise.
5980         * decl2.c (do_local_using_decl): Use push_local_binding.
5981         * lex.c (begin_definition_of_inclass_inline): New function, split
5982         out from ...
5983         (do_pending_inlines): Here, and ...
5984         (process_next_inline): Here.
5985         (get_time_identifier): Use TIME_IDENTIFIER_* macros.
5986         (init_filename_times): Likewise.
5987         (extract_interface_info): Likewise.
5988         (ste_typedecl_interface_info): Likewise.
5989         (check_newline): Likewise.
5990         (dump_time_statistics): Likewise.
5991         (handle_cp_pragma): Likewise.
5992         (do_identifier): Adjust for new name-lookup scheme.
5993         * parse.y (function_try_block): Return ctor_initializer_opt value.
5994         (fndef): Use it.
5995         (fn.defpen): Pass appropriate values to start_function.
5996         (pending_inline): Use functor_try_block value, and pass
5997         appropriate values to finish_function.
5998         * pt.c (is_member_template): Update documentation; remove handling
5999         of FUNCTION_DECLs.  As per name, this function should deal only in
6000         TEMPLATE_DECLs.
6001         (decl_template_parm_p): Change name of olddecl parameter to decl.
6002         (check_template_shadow): Adjust for new name-lookup scheme.
6003         (lookup_template_class): Likewise.
6004         (tsubst_decl): Tweak so as not to confuse member templates with
6005         copy constructors and assignment operators.
6006         (unify): Handle UNION_TYPEs.
6007         * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
6008         (lang_print_xnode): Adjust for new name-lookup scheme.
6009         * typeck.c (mark_addressable): Likewise.
6010         (c_expand_return): Likewise.
6011
6012 1998-12-08  Jason Merrill  <jason@yorick.cygnus.com>
6013
6014         * decl.c (grokdeclarator): Allow field with same name as class
6015         in extern "C".
6016
6017         * decl.c (lookup_name_real): Don't limit field lookup to types.
6018         * class.c (check_member_decl_is_same_in_complete_scope): No error
6019         if icv and x are the same.
6020         * lex.c (do_identifier): Tweak error message.
6021
6022 1998-12-10  Mark Mitchell  <mark@markmitchell.com>
6023
6024         * decl.c (start_enum): Use push_obstacks, not
6025         end_temporary_allocation.
6026         (finish_enum): Call pop_obstacks.
6027
6028 1998-12-10  Mark Mitchell  <mark@markmitchell.com>
6029
6030         * class.c (instantiate_type): Return error_mark_node rather than
6031         junk.
6032
6033 1998-12-09  Mark Mitchell  <mark@markmitchell.com>
6034
6035         * cp-tree.h (most_specialized_instantiation): New function.
6036         (print_candidates): Likewise.
6037         * class.c (validate_lhs): Remove.
6038         (resolve_address_of_overloaded_function): New function, split out
6039         and then substantially reworked, from ...
6040         (instantiate_type): Use it.  Simplify.
6041         * cvt.c (convert_to_reference): Complain when caller has indicated
6042         that's the right thing to do.  Don't crash if instantiate_type
6043         fails.
6044         * pt.c: Substitute `parameters' for `paramters' throughout.
6045         (print_candidates): Don't make it static.
6046         (most_specialized_instantiation): Split out from ...
6047         (most_specialized): Here.
6048
6049 Wed Dec  9 15:33:01 1998  Dave Brolley  <brolley@cygnus.com>
6050
6051         * lex.c (lang_init_options): Initialize cpplib.
6052         * decl2.c (parse_options,cpp_initialized): Removed.
6053         (lang_decode_option): Move initialization of cpplib to
6054         lang_init_options.
6055
6056 1998-12-09  Mark Mitchell  <mark@markmitchell.com>
6057
6058         * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
6059         well as the TYPE_DECL, when a typedef name is assigned to a
6060         previously anonymous type.
6061
6062 1998-12-08  Andrew MacLeod  <amacleod@cygnus.com>
6063
6064         * cp/except.c (call_eh_info): Use __start_cp_handler instead of
6065         __cp_eh_info for getting the eh info pointer.  Add table_index to
6066         field list.
6067         (push_eh_cleanup): Don't increment 'handlers' data field.
6068         (process_start_catch_block): Don't set the 'caught' field.
6069
6070         * cp/exception.cc (CP_EH_INFO): New macro for getting the
6071         exception info pointer within library routines.
6072         (__cp_eh_info): Use CP_EH_INFO.
6073         (__start_cp_handler): Get exception info pointer, set caught field,
6074         and increment the handlers field.  Avoids this being done by handlers.
6075         (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
6076         (uncaught_exception): Use CP_EH_INFO macro.
6077
6078 Tue Dec  8 10:48:21 1998  Jeffrey A Law  (law@cygnus.com)
6079
6080         * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
6081
6082 Mon Dec  7 17:56:06 1998  Mike Stump  <mrs@wrs.com>
6083
6084         * lex.c (check_newline): Add support for \ as `natural'
6085         characters in file names in #line to be consistent with #include
6086         handling.  We support escape processing in the # 1 "..." version of
6087         the command.  See also support in cp/lex.c.
6088
6089 1998-12-07  Zack Weinberg  <zack@rabi.phys.columbia.edu>
6090
6091         * cp/decl2.c: s/data/opts/ when initializing cpp_reader
6092         structure.
6093
6094 1998-12-07  Jason Merrill  <jason@yorick.cygnus.com>
6095
6096         * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
6097
6098         * error.c (dump_simple_decl): Also print namespace context.
6099         (dump_function_decl): Likewise.
6100
6101         * decl2.c (ambiguous_decl): Don't print old value if it's
6102         error_mark_node.
6103
6104         * decl.c (lookup_name_real): Fix handling of local types shadowed
6105         by a non-type decl.  Remove obsolete code.
6106         * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
6107
6108         * lang-options.h: Add -fpermissive.
6109         * decl2.c: Likewise.
6110         * cp-tree.h: Add flag_permissive.
6111         * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
6112         were specified, set flag_pedantic_errors.
6113         * call.c (build_over_call): Turn dropped qualifier messages
6114         back into pedwarns.
6115         * cvt.c (convert_to_reference): Likewise.
6116         * typeck.c (convert_for_assignment): Likewise.
6117
6118 1998-12-05  Jason Merrill  <jason@yorick.cygnus.com>
6119
6120         * decl2.c (coerce_new_type): Use same_type_p.
6121         (coerce_delete_type): Likewise.
6122
6123         * call.c (check_dtor_name): Return 1, not error_mark_node.
6124
6125 1998-12-04  Jason Merrill  <jason@yorick.cygnus.com>
6126
6127         * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
6128         if MULTIPLE_SYMBOL_SPACES.
6129
6130         * pt.c (check_template_shadow): New fn.
6131         * decl2.c (grokfield): Use it.
6132         * decl.c (pushdecl): Likewise.
6133         (pushdecl_class_level): Likewise.
6134         (start_method): Likewise.
6135         (xref_tag): Don't try to use 't' if we're defining.
6136
6137         * call.c (check_dtor_name): Just return an error_mark_node.
6138         * pt.c (lookup_template_class): Complain about using non-template here.
6139         * parse.y (apparent_template_type): Not here.
6140
6141         * pt.c (check_explicit_specialization): Complain about specialization
6142         with C linkage.
6143
6144         * lang-options.h: Add -f{no-,}implicit-inline-templates.
6145
6146         * pt.c (convert_nontype_argument): Don't assume that any integer
6147         argument is intended to be a constant-expression.
6148
6149 1998-12-03  Mark Mitchell  <mark@markmitchell.com>
6150
6151         * class.c (handle_using_decl): Fix comment.  Don't lookup
6152         constructors in base classes.
6153         (validate_lhs): Fix typo in comment.
6154         * search.c (lookup_field_1): Don't return a USING_DECL.
6155
6156         * cp-tree.h (DECL_ACCESS): Improve documentation.
6157
6158         * decl.c (expand_static_init): Don't set the initialization-done
6159         flag until the initialization is done.
6160
6161 1998-12-02  Mark Mitchell  <mark@markmitchell.com>
6162
6163         * decl2.c (validate_nonmember_using_decl): Complain about using
6164         declarations for class members.
6165
6166 1998-11-29  Jason Merrill  <jason@yorick.cygnus.com>
6167
6168         * typeck2.c (process_init_constructor): Use same_type_p.
6169
6170         * decl.c (check_tag_decl): Don't warn about null decl inside a
6171         class.
6172
6173         * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
6174         UNIFY_ALLOW_NONE.
6175         (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
6176         (resolve_overloaded_unification): Strip baselinks.
6177
6178 Fri Nov 27 13:07:23 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6179
6180         * g++spec.c: Don't prototype xmalloc.
6181
6182 1998-11-25  Jason Merrill  <jason@yorick.cygnus.com>
6183
6184         * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
6185
6186         * decl.c (check_tag_decl): Do complain about null friend decl at
6187         file scope.
6188
6189 1998-11-25  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
6190
6191         * lex.c (make_lang_type): Clear the whole struct lang_type, not
6192         only the first multiple of sizeof (int).
6193
6194 1998-11-24  Jason Merrill  <jason@yorick.cygnus.com>
6195
6196         * decl.c (start_decl): An explicit specialization of a static data
6197         member is only a definition if it has an initializer.
6198
6199         * except.c (expand_throw): Use cp_finish_decl for the throw temp.
6200         * cvt.c (build_up_reference): Pass DIRECT_BIND down into
6201         cp_finish_decl.
6202         * init.c (expand_default_init): Check for DIRECT_BIND instead of
6203         DECL_ARTIFICIAL.
6204
6205         * call.c (build_over_call): Use build_decl.
6206
6207         * except.c (expand_throw): Just use convert, not
6208         build_reinterpret_cast.
6209
6210         * lex.c (handle_generic_pragma): Use token_buffer.
6211
6212         * decl.c (check_tag_decl): Don't complain about null friend decl.
6213
6214 1998-11-24  Dave Pitts  <dpitts@cozx.com>
6215
6216         * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the
6217         first position.
6218         * lex.c (check_newline): Use ISALPHA.
6219         (readescape): Use ISGRAPH.
6220         (yyerror): Use ISGRAPH.
6221
6222 1998-11-24  Nathan Sidwell  <nathan@acm.org>
6223
6224         * search.c (get_abstract_virtuals): Do not use initial
6225         CLASSTYPE_ABSTRACT_VIRTUALS.
6226         * typeck2.c (abstract_virtuals_error): Show location of abstract
6227         declaration.
6228         * call.c (build_new_method_call): Use
6229         CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
6230         * class.c (finish_struct_bits): Don't bother working out whether
6231         get_abstract_virtuals will do anything, just do it.
6232
6233 1998-11-24  Graham  <grahams@rcp.co.uk>
6234
6235         * typeck.c (build_component_ref): Remove unused statement.
6236
6237 1998-11-24  Jason Merrill  <jason@yorick.cygnus.com>
6238
6239         * class.c (add_method): Catch invalid overloads.
6240
6241         * class.c (add_method): Build up OVERLOADs properly for conversion ops.
6242         * search.c (lookup_conversions): Handle getting real OVERLOADs.
6243         (add_conversions): Likewise.  Revert last change.
6244         * call.c (add_conv_candidate): Pass totype to add_candidate instead
6245         of fn.  Don't add a new candidate if the last one was for the same
6246         type.
6247         (print_z_candidates): Handle getting a type as a function.
6248         (joust): If we got two conversion candidates to the same type,
6249         just pick one.
6250         (build_object_call): Lose 'templates'.
6251         (build_user_type_conversion_1): Handle getting real OVERLOADs.
6252
6253 1998-11-23  Jason Merrill  <jason@yorick.cygnus.com>
6254
6255         * typeck2.c (process_init_constructor): If there are elements
6256         that don't have initializers and they need to have constructors
6257         run, supply them with initializers.
6258
6259         * class.c (finish_struct_1): A class with a 0-width bitfield is
6260         still empty.
6261
6262 1998-11-23  Mark Mitchell  <mark@markmitchell.com>
6263
6264         * pt.c (instantiate_class_template): Don't try to figure out what
6265         specialization to use for a partial instantiation.  Correct
6266         typos in a couple of comments.  Avoid calling uses_template_parms
6267         multiple times.
6268
6269 1998-11-23  Benjamin Kosnik  <bkoz@cygnus.com>
6270
6271         * method.c (process_overload_item): Add call to
6272         build_mangled_C9x_name for intTI_type_nodes.
6273         (build_mangled_C9x_name): Add prototype, define.
6274         * decl.c (init_decl_processing): Add names for
6275         TImode_type_node.
6276
6277 1998-11-23  Jason Merrill  <jason@yorick.cygnus.com>
6278
6279         * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
6280
6281         * class.c (finish_struct_1): Set things up for 0-width bitfields
6282         like we do for others.
6283
6284         * decl.c (check_tag_decl): New fn.
6285         (shadow_tag): Split out from here.
6286         * decl2.c (grok_x_components): Call it.
6287
6288 1998-11-22  Jason Merrill  <jason@yorick.cygnus.com>
6289
6290         * decl.c: Lose warn_about_return_type.
6291         (grokdeclarator): Always complain about implicit int, except for
6292         `main () { ... }'.
6293
6294         * decl.c (tag_name): New fn.
6295         (xref_tag): Complain about using typedef-name after class-key.
6296
6297         * init.c (expand_vec_init): Also keep going if from_array.
6298
6299         * tree.c (is_overloaded_fn): Also handle the output of
6300         build_offset_ref.
6301
6302         * decl.c (grokdeclarator): Use constructor_name when comparing
6303         field name against enclosing class.
6304         * class.c (finish_struct_anon): Likewise.
6305
6306 1998-11-22  Mark Mitchell  <mark@markmitchell.com>
6307
6308         * decl.c (poplevel): Remove code to handle KEEP == 2.
6309         (finish_function): Don't confuse BLOCK-order when
6310         processing a destructor.
6311
6312 1998-11-21  Jason Merrill  <jason@yorick.cygnus.com>
6313
6314         * decl.c (require_complete_types_for_parms): Call layout_decl
6315         after we've completed the type.
6316
6317 1998-11-21  Martin von Löwis  <loewis@informatik.hu-berlin.de>
6318
6319         * decl2.c (validate_nonmember_using_decl): Allow using templates
6320         from the global namespace.
6321
6322 1998-11-21  Jason Merrill  <jason@yorick.cygnus.com>
6323
6324         Handle specifying template args to member function templates.
6325         * tree.c (build_overload): Always create an OVERLOAD for a template.
6326         * search.c (add_conversions): Handle finding an OVERLOAD.
6327         * decl2.c (check_classfn): Likewise.
6328         * lex.c (identifier_type): See through a baselink.
6329         * parse.y (do_id): Don't call do_identifier if we got a baselink.
6330         * class.c (instantiate_type, case TREE_LIST): Recurse.
6331
6332         * decl.c (grokdeclarator): Allow a boolean constant for array
6333         bounds, odd as that sounds.
6334
6335         * pt.c (unify): Be more strict about non-type parms, except for
6336         array bounds.
6337         (UNIFY_ALLOW_INTEGER): New macro.
6338
6339 1998-11-19  Manfred Hollstein  <manfred@s-direktnet.de>
6340
6341         * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir).
6342
6343 1998-11-19  Jason Merrill  <jason@yorick.cygnus.com>
6344
6345         * semantics.c (begin_class_definition): Call
6346         maybe_process_partial_specialization before push_template_decl.
6347         Don't call push_template_decl for a specialization.
6348         * search.c (lookup_field): Do return a member template class.
6349         * decl2.c (handle_class_head): Handle member template classes.
6350
6351         * decl.c (grokdeclarator): A parm type need not be complete.
6352
6353         * pt.c (convert_nontype_argument): Fix thinko.
6354
6355 1998-11-18  Mark Mitchell  <mark@markmitchell.com>
6356
6357         * cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
6358         (global_delete_fndecl): New variable.
6359         * decl.c (global_delete_fndecl): Define it.
6360         (init_decl_processing): Set it.
6361         * init.c (build_builtin_delete_call): Use it.
6362         * tree.c (mapcar): Recursively call mapcar for the type of EXPR
6363         nodes.
6364
6365 1998-11-18  Jason Merrill  <jason@yorick.cygnus.com>
6366
6367         * decl.c (cplus_expand_expr_stmt): Always complain about unresolved
6368         type.
6369
6370         * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue.
6371         * call.c (build_object_call): Also support references to functions.
6372         * typeck.c (convert_for_initialization): Don't decay a function
6373         if the target is a reference to function.
6374
6375         * search.c (add_conversions): Get all the overloads from a class.
6376
6377         * decl.c (grok_ctor_properties): Complain about any constructor
6378         that will take a single arg of the class type by value.
6379
6380         * typeck2.c (build_functional_cast): Can't create objects of
6381         abstract classes this way.
6382         * cvt.c (ocp_convert): Likewise.
6383
6384         * decl.c (grokfndecl): Member functions of local classes are not
6385         public.
6386
6387 1998-11-18  Mark Mitchell  <mark@markmitchell.com>
6388
6389         * Make-lang.in (cc1plus): Add dependency on hash.o.
6390
6391 1998-11-18  Jason Merrill  <jason@yorick.cygnus.com>
6392
6393         * search.c (get_abstract_virtuals): Complain about virtuals with
6394         no final overrider.
6395         * typeck2.c (abstract_virtuals_error): Remove handling for virtuals
6396         with no final overrider.
6397         * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
6398         on virtuals with no final overrider.
6399
6400         * lex.c (reinit_parse_for_block): Add a space after the initial ':'.
6401
6402         * class.c (finish_struct_1): Don't remove zero-width bit-fields until
6403         after layout_type.
6404
6405         * friend.c (do_friend): Don't set_mangled_name_for_decl.
6406
6407         * class.c (finish_struct_anon): Complain about non-fields.
6408         * decl2.c (build_anon_union_vars): Likewise.
6409
6410         * decl.c (grokdeclarator): Normal data members can't have the same
6411         name as the class, either.
6412         * class.c (finish_struct_anon): Neither can members of an
6413         anonymous union.
6414
6415 1998-11-17  Mark Mitchell  <mark@markmitchell.com>
6416
6417         * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses.
6418         (TYPE_BINFO): Likewise.
6419         (IS_AGGR_TYPE): Tweak.
6420         (SET_IS_AGGR_TYPE): New macro.
6421         (CLASS_TYPE_P): Tweak.
6422         (lang_type): Group mark bitfields together.  Remove linenum.
6423         (CLASSTYPE_SOURCE_LINE): Remove macro.
6424         (CLASSTYPE_MARKED_N): New macro.
6425         (SET_CLASSTYPE_MARKED_N): Likewise.
6426         (CLEAR_CLASSTYPE_MARKED_N): Likewise.
6427         (CLASS_TYPE_MARKED_*): Use them.
6428         (SET_CLASSTYPE_MARKED_*): Likewise.
6429         (CLEAR_CLASSTYPE_MARKED_*): Likewise.
6430         (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
6431         (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well.
6432         (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE.
6433         * class.c (class_cache_obstack): New variable.
6434         (class_cache_firstobj): Likewise.
6435         (finish_struct): Don't set CLASSTYPE_SOURCE_LINE.
6436         (pushclass): Free the cache, when appropriate.
6437         (popclass): Tidy.
6438         (maybe_push_cache_obstack): Use class_cache_obstack.
6439         * decl.c (include hash.h).
6440         (typename_hash): New function.
6441         (typename_compare): Likewise.
6442         (build_typename_type): Check the hash table to avoid creating
6443         duplicates.
6444         (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE.
6445         (grokdeclarator): Use CLASS_TYPE_P.
6446         (xref_basetypes): Likewise.
6447         (start_function): Likewise.  Don't put current_class_ref on the
6448         permanent obstack.
6449         * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO
6450         and TYPE_TI_ARGS.
6451         * lex.c (note_got_semicolon): Use CLASS_TYPE_P.
6452         (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated
6453         fields for types other than class types.  Do clear TYPE_ALIAS_SET
6454         for types other than class types, though.
6455         * method.c (build_overload_identifier): Use CLASS_TYPE_P and
6456         TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
6457         * pt.c (process_template_parm): Don't set
6458         CLASSTYPE_GOT_SEMICOLON.
6459         (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
6460         Coerce arguments on the momentary obstack.
6461         (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
6462         (instantiate_class_template): Calculate template arguments on the
6463         momentary obstack.  Tidy.
6464         (tsubst_template_arg_vector): Use make_temp_vec.
6465         (tsubst_aggr_type): Put template arguments on the momentary
6466         obstack.
6467         (tsubst_decl): Likewise.
6468         (tsubst): Copy the array bounds index to the permanent obstack
6469         before building index types.  Use new macros.
6470         (unify): Use new macros.
6471         (do_type_instantiation): Likewise.
6472         * search.c (lookup_fnfields_1): Use new macros.
6473         (dfs_pushdecls): Build envelopes on the cache obstack.
6474         (dfs_compress_decls): Use new macros.
6475         (push_class_decls): Build on the cache obstack.
6476         * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON.
6477         * sign.c (build_signature_pointer_or_reference_type): Use
6478         SET_IS_AGGR_TYPE.
6479         * tree.c (make_binfo): Check CLASS_TYPE_P.
6480         (copy_template_template_parm): Adjust.
6481         (make_temp_vec): Use push_expression_obstack.
6482         * typeck.c (complete_type): Use new macros.
6483         (comptypes): Likewise.
6484
6485 1998-11-17  Jason Merrill  <jason@yorick.cygnus.com>
6486
6487         * pt.c (tsubst): Add diagnostics for invalid array, reference
6488         and pointer to member types.
6489
6490 1998-11-16  Jason Merrill  <jason@yorick.cygnus.com>
6491
6492         * typeck2.c (my_friendly_abort): Don't fatal twice in a row.
6493
6494         * typeck.c (c_expand_start_case): Use build_expr_type_conversion.
6495         Simplify.
6496
6497         * parse.y (structsp): Fix cut-and-paste error.
6498
6499         * init.c (build_new): Complain about non-integral size.
6500
6501         * parse.y (unary_expr): Complain about defining types in sizeof.
6502
6503         * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn.
6504
6505         * rtti.c (build_x_typeid): Complain about typeid without
6506         including <typeinfo>.
6507         (get_typeid): Likewise.  Complain about typeid of incomplete type.
6508         (get_tinfo_fn_dynamic): Likewise.
6509         (get_typeid_1): Not static anymore.
6510         * except.c (build_eh_type_type): Use get_typeid_1.
6511
6512         * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to
6513         ambiguous or private bases.  Fix warning for reference cast.
6514
6515 1998-11-16  Mark Mitchell  <mark@markmitchell.com>
6516
6517         * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
6518         * decl.c (duplicate_decls): Remove special-case code to deal with
6519         template friends, and just do the obvious thing.
6520         * pt.c (register_specialization): Tweak for clarity, and also to
6521         clear DECL_INITIAL for an instantiation before it is merged with a
6522         specialization.
6523         (check_explicit_specialization): Fix indentation.
6524         (tsubst_friend_function): Handle both definitions in friend
6525         declaration and outside friend declarations.
6526         (tsubst_decl): Don't clear DECL_INITIAL for an instantiation.
6527         (regenerate_decl_from_template): Tweak accordingly.
6528         (instantiate_decl): Likewise.
6529
6530 1998-11-16  Jason Merrill  <jason@yorick.cygnus.com>
6531
6532         * decl.c (cplus_expand_expr_stmt): Promote warning about naked
6533         member function reference to error.
6534         * cvt.c (ocp_convert): Complain about converting an overloaded
6535         function to void.
6536
6537         * init.c (build_offset_ref): Just return a lone static member
6538         function.
6539
6540         * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs,
6541         not internal ones.
6542
6543         * typeck.c (build_binary_op_nodefault): Improve error handling.
6544
6545         * decl.c (grokfndecl): Complain about making 'main' a template.
6546
6547         * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*.
6548
6549         * call.c (build_method_call): Handle a BIT_NOT_EXPR around a
6550         TYPE_DECL in a template.
6551
6552 1998-11-15  Jason Merrill  <jason@yorick.cygnus.com>
6553
6554         * typeck2.c (my_friendly_abort): Add URL in the other case, too.
6555
6556         * decl.c (struct cp_function): Add named_label_uses.
6557         (push_cp_function_context): Save it.
6558         (pop_cp_function_context): Restore it.
6559         (define_label): Also complain about jumping into the scope of
6560         non-POD objects that don't have constructors.
6561         * tree.c (pod_type_p): New fn.
6562
6563         * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner.
6564         * rtti.c (synthesize_tinfo_fn): Call import_export_decl here.
6565         (get_tinfo_fn): Not here.
6566         * repo.c (repo_get_id): Abort if we get called for an incomplete
6567         type.
6568
6569 1998-11-13  Mark Mitchell  <mark@markmitchell.com>
6570
6571         * except.c (expand_throw): Make sure first argument to
6572         __cp_push_exception is of type `void*' to avoid spurious error
6573         messages.
6574
6575 1998-11-11  Jason Merrill  <jason@yorick.cygnus.com>
6576
6577         * pt.c (try_one_overload): Take orig_targs again.  Only check for
6578         mismatches against them; we don't care what a previous call found.
6579         (resolve_overloaded_unification): Adjust.
6580
6581         * search.c (lookup_field): Don't return anything for a non-type
6582         field from a dependent type.
6583         * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
6584         in an array declarator.
6585         (start_decl): Push into the class before looking for the field.
6586
6587 1998-11-08  Mark Mitchell  <mark@markmitchell.com>
6588
6589         * method.c (build_overload_value): Handle REFERENCE_TYPE.
6590
6591 1998-11-08  Martin von Löwis  <loewis@informatik.hu-berlin.de>
6592
6593         * decl.c (grokdeclarator): Allow namespace-scoped members if they
6594         are friends.
6595
6596 1998-11-08  Jason Merrill  <jason@yorick.cygnus.com>
6597
6598         * pt.c (tsubst_decl): Don't mess with the global value of an
6599         un-mangled DECL_ASSEMBLER_NAME.
6600
6601 1998-11-03  Christopher Faylor  <cgf@cygnus.com>
6602
6603         * decl.c (init_decl_processing): Remove CYGWIN conditional
6604         since CYGWIN is now able to deal with trapping signals.
6605
6606 Sat Nov  7 15:48:02 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
6607
6608         * cp-tree.h: Don't include gansidecl.h.
6609         * exception.cc: Include gansidecl.h (since we don't include config.h)
6610         * g++spec.c: Don't include gansidecl.h.
6611
6612 1998-11-06  Mark Mitchell  <mark@markmitchell.com>
6613
6614         * cp-tree.h (lang_decl_flags): Add defined_in_class.  Decrease
6615         size of dummy.
6616         (DECL_DEFINED_IN_CLASS_P): New macro.
6617         (TEMPLATE_PARMS_FOR_INLINE): Document.
6618         (check_static_variable_definition): New function.
6619         * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if
6620         appropriate.
6621         (check_static_variable_definition): Split out from ...
6622         (grokdeclarator): Here.
6623         * pt.c (check_default_tmpl_args): New function, split out from ...
6624         (push_template_decl_real): Here.
6625         (instantiate_template): Fix comment.
6626
6627 1998-11-04  Mark Mitchell  <mark@markmitchell.com>
6628
6629         * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued.
6630         (CP_TYPE_VOLATILE_P): Likewise.
6631         (CP_TYPE_RESTRICT_P): Likewise.
6632
6633 1998-11-03  Mark Mitchell  <mark@markmitchell.com>
6634
6635         * pt.c (tsubst): Use build_index_type, not build_index_2_type.
6636
6637 1998-11-02  Jason Merrill  <jason@yorick.cygnus.com>
6638
6639         * class.c (instantiate_type): Be more helpful.
6640
6641         * decl2.c (import_export_decl): Call import_export_class.
6642
6643         * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
6644         * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
6645         * pt.c (tsubst_copy): Likewise.
6646
6647 1998-11-02  Mark Mitchell  <mark@markmitchell.com>
6648
6649         * init.c (expand_vec_init): Fix off-by-one error.
6650
6651 1998-11-02  Alexandre Oliva  <oliva@dcc.unicamp.br>
6652
6653         * parse.y (apparent_template_type): New type.
6654         (named_complex_class_head_sans_basetype): Use it.
6655         * Makefile.in (CONFLICTS): One new conflict.
6656         * parse.c: Regenerated.
6657
6658 1998-11-01  Mark Mitchell  <mark@markmitchell.com>
6659
6660         * cp-tree.h (COMPARE_STRICT): New macro.
6661         (COMPARE_BASE): Likewise.
6662         (COMPARE_RELAXED): Likewise.
6663         (COMPARE_REDECLARATION): Likewise.
6664         (same_type_p): Likewise.
6665         (same_or_base_type_p): Likewise.
6666         * call.c (standard_conversion): Use them, in place of comptypes
6667         with numeric arguments.
6668         (reference_binding): Likewise.
6669         (convert_like): Likewise.
6670         (build_over_call): Likewise.
6671         (is_subseq): Likewise.
6672         (is_properly_derived_from): Likewise.
6673         (compare_ics): Likewise.
6674         (joust): Likewise.
6675         * class.c (delete_duplicate_fields_1): Likewise.
6676         (resolves_to_fixed_type_p): Likewise.
6677         (instantiate_type): Likewise.  Remove #if 0'd code.
6678         * decl.c (decls_match): Likewise.  Use COMPARE_REDECLARATION here.
6679         (pushdecl): Likewise.
6680         (lookup_name_real): Likewise.
6681         (grokdeclarator): Likewise.  Check for illegal array declarations.
6682         (grokparms): Likewise.
6683         (grok_op_properties): Likewise.
6684         * decl2.c (check_classfn): Likewise.
6685         * friend.c (is_friend): Likewise.
6686         (make_friend_class): Likewise.
6687         * init.c (expand_aggr_init): Likewise.
6688         (expand_vec_init): Likewise.
6689         * pt.c (is_member_template_class): Remove declaration.
6690         (is_specialization_of): Use COMPARE_* and new macros.
6691         (comp_template_parms): Likewise.
6692         (convert_nontype_argument): Likewise.
6693         (coerce_template_template_parms): Likewise.
6694         (template_args_equal): Likewise.
6695         (lookup_template_class): Likewise.
6696         (type_unification_real): Likewise.
6697         (unify): Likewise.
6698         (get_bindings_real): Likewise.
6699         * search.c (covariant_return_p): Likewise.
6700         (get_matching_virtual): Likewise.
6701         * sig.c (match_method_types): Likewise.
6702         * tree.c (vec_binfo_member): Likewise.
6703         (cp_tree_equal): Likewise.
6704         * typeck.c (common_type): Likewise.
6705         (comp_array_types): Likewise.  Get issues involving unknown array
6706         bounds right.
6707         (comptypes): Update comments.  Use new flags.
6708         (comp_target_types): Use new macros.
6709         (compparms): Likewise.
6710         (comp_target_parms): Likewise.
6711         (string_conv_p): Likewise.
6712         (build_component_ref): Likewise.
6713         (build_indirect_ref): Likewise.
6714         (build_conditional_expr): Likewise.
6715         (build_static_cast): Likewise.
6716         (build_reinterpret_cast): Likewise.
6717         (build_const_cast): Likewise.
6718         (build_modify_expr): Likewise.
6719         (convert_for_assignment): Likewise.
6720         (comp_ptr_ttypes_real): Likewise.
6721         (ptr_reasonably_similar): Likewise.
6722         (comp_ptr_ttypes_const): Likewise.
6723
6724 1998-10-31  Jason Merrill  <jason@yorick.cygnus.com>
6725
6726         * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error.
6727
6728 1998-10-30  Mark Mitchell  <mark@markmitchell.com>
6729
6730         * decl2.c (delete_sanity): Pass integer_zero_node, not
6731         integer_two_node, to build_vec_delete.
6732         * init.c (build_array_eh_cleanup): Remove.
6733         (expand_vec_init_try_block): New function.
6734         (expand_vec_init_catch_clause): Likewise.
6735         (build_vec_delete_1): Don't deal with case that auto_delete_vec
6736         might be integer_two_node anymore.
6737         (expand_vec_init): Rework for initialization-correctness and
6738         exception-correctness.
6739         * typeck2.c (process_init_constructor): Make mutual exclusivity
6740         of cases more obvious.
6741
6742 1998-10-29  Jason Merrill  <jason@yorick.cygnus.com>
6743
6744         * decl.c (lookup_name_real): OK, only warn if not lexing.
6745         Simplify suggested fix.
6746
6747         * cp-tree.h (IDENTIFIER_MARKED): New macro.
6748         * search.c (lookup_conversions): Use breadth_first_search.
6749         (add_conversions): Avoid adding two conversions to the same type.
6750         (breadth_first_search): Work with base binfos, rather
6751         than binfos and base indices.
6752         (get_virtual_destructor): Adjust.
6753         (tree_has_any_destructor_p): Adjust.
6754         (get_matching_virtual): Adjust.
6755
6756         * pt.c (push_template_decl_real): Generalize check for incorrect
6757         number of template parms.
6758         (is_member_template_class): #if 0.
6759
6760 1998-10-29  Richard Henderson  <rth@cygnus.com>
6761
6762         * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
6763         last.
6764
6765 1998-10-28  Zack Weinberg  <zack@rabi.phys.columbia.edu>
6766
6767         * lex.c: Call check_newline from lang_init always.  After
6768         calling cpp_start_read, set yy_cur and yy_lim to read from the
6769         cpplib token buffer.
6770
6771 1998-10-28  Jason Merrill  <jason@yorick.cygnus.com>
6772
6773         * class.c (instantiate_type): Don't consider templates for a normal
6774         match.
6775
6776         * class.c (finish_struct_1): Don't complain about non-copy
6777         assignment ops in union members.
6778
6779         * class.c (build_vtable): Don't pass at_eof to import_export_vtable.
6780         (prepare_fresh_vtable): Likewise.
6781         (finish_struct_1): Don't call import_export_class.
6782         * decl2.c (finish_vtable_vardecl): Do import/export stuff.
6783         (finish_prevtable_vardecl): Lose.
6784         (finish_file): Don't call it.
6785         * pt.c (instantiate_class_template): Likewise.
6786         * cp-tree.h: Remove it.
6787
6788         * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
6789         * decl.c (finish_function): Not here.
6790         (start_function): Do set DECL_INITIAL.
6791
6792         * pt.c (push_template_decl_real): Complain about default template
6793         args for enclosing classes.
6794
6795         * call.c (add_function_candidate): Treat conversion functions
6796         as coming from the argument's class.
6797         * cp-tree.h (DECL_CONV_FN_P): New fn.
6798         (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE.
6799         * class.c (add_method): Use DECL_CONV_FN_P.
6800         * decl2.c (check_classfn): Likewise.
6801         * error.c (dump_function_name): Likewise.
6802         (dump_function_decl): Likewise.
6803         * pt.c (fn_type_unification): Likewise.
6804         * search.c (add_conversions): Likewise.
6805
6806 1998-10-27  Jason Merrill  <jason@yorick.cygnus.com>
6807
6808         * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL.
6809         * method.c (hack_identifier): Also check for using RESULT_DECL
6810         from outer context.
6811
6812 1998-10-27  Mark Mitchell  <mark@markmitchell.com>
6813
6814         * decl.c (grokdeclarator): Use type_quals, rather than constp,
6815         consistently.
6816
6817 1998-10-27  Jason Merrill  <jason@yorick.cygnus.com>
6818
6819         * call.c (standard_conversion): instantiate_type here.
6820         (reference_binding): And here.
6821         (implicit_conversion): Not here.
6822         (build_op_delete_call): No need to cons up an OVERLOAD.
6823         * cvt.c (cp_convert_to_pointer): instantiate_type here.
6824         (convert_to_reference): And here.
6825         * decl.c (grok_reference_init): Not here.
6826         (grokparms): Or here.
6827         * typeck2.c (digest_init): Or here.
6828         * typeck.c (decay_conversion): Take the address of overloaded
6829         functions, too.
6830         (require_instantiated_type): Lose.
6831         (convert_arguments): Don't handle unknown types here.
6832         (build_c_cast): Likewise.
6833         (build_binary_op): Gut.
6834         (build_conditional_expr): Don't require_instantiated_type.
6835         (build_modify_expr): Likewise.
6836         (build_static_cast): Don't instantiate_type.
6837         (build_reinterpret_cast): Likewise.
6838         (build_const_cast): Likewise.
6839         (convert_for_initialization): Likewise.
6840         (build_ptrmemfunc): Use type_unknown_p.
6841         (convert_for_assignment): Also do default_conversion on overloaded
6842         functions.  Hand them off to ocp_convert.
6843
6844 1998-10-26  Mark Mitchell  <mark@markmitchell.com>
6845
6846         * error.c (dump_decl): Deal with TEMPLATE_DECLs that are
6847         VAR_DECLs.  Handle vtables whose DECL_CONTEXT is not a type.
6848
6849         * class.c (finish_struct_1): Use build_cplus_array_type to build
6850         array types.
6851         * decl.c (init_decl_processing): Likewise.
6852         * except.c (expand_end_eh_spec): Likewise.
6853         * search.c (expand_upcast_fixups): Simplify very slightly.
6854
6855 1998-10-26  Jason Merrill  <jason@yorick.cygnus.com>
6856
6857         * decl.c (grokdeclarator): Complain about a variable using
6858         constructor syntax coming back null from start_decl.
6859
6860         * friend.c (make_friend_class): Complain about trying to make
6861         a non-class type a friend.
6862
6863         * decl.c (grokfndecl): Set DECL_INITIAL for a defn here.
6864         (start_function): Not here.
6865
6866 1998-10-26  Brendan Kehoe  <brendan@cygnus.com>
6867
6868         * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
6869
6870 1998-10-26  Jason Merrill  <jason@yorick.cygnus.com>
6871
6872         * typeck2.c (process_init_constructor): Only skip anonymous fields
6873         if they are bitfields.
6874
6875         * cp-tree.def (TYPEOF_TYPE): New code.
6876         * error.c (dump_type_real): Handle it.
6877         * pt.c (tsubst): Likewise.
6878         * tree.c (search_tree): Likewise.
6879         * semantics.c (finish_typeof): New fn.
6880         * parse.y (typespec): Use it.
6881         * cp-tree.h: Declare it.
6882
6883 1998-10-26  Manfred Hollstein  <manfred@s-direktnet.de>
6884
6885         * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional.
6886
6887 1998-10-26  Jason Merrill  <jason@yorick.cygnus.com>
6888
6889         * typeck.c (convert_arguments): Don't handle pmf references
6890         specially.
6891
6892         * init.c (build_member_call): Don't try to convert to the base type
6893         if it's ambiguous or pedantic.
6894
6895         * typeck2.c (check_for_new_type): Only depend on pedantic for
6896         C-style casts.
6897
6898 1998-10-25  Mark Mitchell  <mark@markmitchell.com>
6899
6900         * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all
6901         non-converting constructors.
6902
6903 1998-10-24  Martin von Löwis  <loewis@informatik.hu-berlin.de>
6904
6905         * gxxint.texi: Correct documentation for n, N, Q, and B.
6906
6907 1998-10-23  Martin von Löwis  <loewis@informatik.hu-berlin.de>
6908
6909         * parse.y (condition): Convert VAR_DECL from reference to indirect
6910         reference.
6911
6912 1998-10-23  Andrew MacLeod  <amacleod@cygnus.com>
6913
6914         * exception.cc (__cp_pop_exception): Free the original exception
6915         value, not the potentially coerced one.
6916
6917 1998-10-23  Mark Mitchell  <mark@markmitchell.com>
6918
6919         * Makefile.in (hash.h): Run gperf when necessary.
6920
6921         * cp-tree.h (CP_TYPE_READONLY): Remove.
6922         (CP_TYPE_VOLATILE): Likewise.
6923         (CP_TYPE_QUALS): New macro.
6924         (CP_TYPE_CONST_P): Likewise.
6925         (CP_TYPE_VOLATILE_P): Likewise.
6926         (CP_TYPE_RESTRICT_P): Likewise.
6927         (CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
6928         (cp_build_type_variant): Rename to ...
6929         (cp_build_qualified_type): New function.
6930         (c_apply_type_quals_to_decl): Declare.
6931         (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
6932         (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
6933         (cp_type_qual_from_rid): New function.
6934         (compparms): Remove unused parameter.  All callers changed.
6935         (cp_type_quals): New function.
6936         (at_least_as_qualified_p): Likewise.
6937         (more_qualified_p): Likewise.
6938
6939         * call.c (standard_conversion): Replace calls to
6940         cp_build_type_variant with cp_build_qualified_type.  Use
6941         CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
6942         compare them.  Use CP_TYPE_* macros to check qualifiers.
6943         (reference_binding): Likewise.
6944         (implicit_conversion): Likewise.
6945         (add_builtin_candidates): Likewise.
6946         (build_over_call): Likewise.
6947         * class.c (overrides): Compare all qualifiers, not just `const',
6948         on method declarations.
6949         * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
6950         (convert_pointer_to_real): Likewise.
6951         (type_promotes_to): Likewise.
6952         * decl.c (check_for_uninitialized_const_var): New function.
6953         (init_decl_processing): More CP_TYPE_QUALS conversion, etc.
6954         (cp_finish_decl): Use check_for_uninitialized_const_var.
6955         (grokdeclarator): More CP_TYPE_QUALS conversion, etc.  Update to
6956         handle `restrict'.
6957         (grok_ctor_properties): Likewise.
6958         (grok_op_properties): Likewise.
6959         (start_function): Likewise.
6960         (rever_static_member_fn): Likewise.
6961         * decl2.c (grok_method_quals): Likewise.
6962         (grokfield): Likewise.
6963         * error.c (dump_readonly_or_volatile): Rename to ...
6964         (dump_qualifiers): New function.  Handle `restrict'.
6965         (dump_type_real): Use it.
6966         (dump_aggr_type): Likewise.
6967         (dump_type_prefix): Likewise.
6968         (dump_type_suffix): Likewise.
6969         (dump_function_decl): Likewise.
6970         (cv_as_string): Likewise.
6971         * gxx.gperf: Add __restrict and __restrict__.
6972         * gxxint.texi: Document `u' as used for `__restrict', and a few
6973         other previously undocumented codes.
6974         * hash.h: Regenerated.
6975         * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
6976         (build_member_call): Likewise.
6977         (build_new_1): Likewise.
6978         * lex.c (init_parse): Add entry for RID_RESTRICT.
6979         (cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
6980         (cp_type_qual_from_rid): Define.
6981         * lex.h (enum rid): Add RID_RESTRICT.
6982         * method.c (process_modifiers): Deal with `restrict'.
6983         * parse.y (primary): More CP_TYPE_QUALS conversion, etc.
6984         * parse.c: Regenerated.
6985         * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
6986         (tsubst_aggr_type): Likewise.
6987         (tsubst): Likewise.
6988         (check_cv_quals_for_unify): Likewise.
6989         (unify): Likewise.
6990         * rtti.c (init_rtti_processing): Likewise.
6991         (build_headof): Likewise.
6992         (get_tinfo_var): Likewise.
6993         (buidl_dynamic_cast_1): Likewise.  Fix `volatile' handling.
6994         (expand_class_desc): Likewise.
6995         (expand_attr_desc): Likewise.
6996         (synthesize_tinfo_fn): Likewise.
6997         * search.c (covariant_return_p): Likewise.  Fix `volatile' handling.
6998         (get_matching_virtual): Likewise.
6999         (expand_upcast_fixups): Likewise.
7000         * sig.c (build_signature_pointer_or_reference_name): Take
7001         type_quals, not constp and volatilep.
7002         (build_signature_pointer_or_reference_type): Likewise.
7003         (match_method_types): More CP_TYPE_QUALS conversion, etc.
7004         (build_signature_pointer_constructor): Likewise.
7005         (build_signature_method_call): Likewise.
7006         * tree.c (build_cplus_array_type): Likewise.
7007         (cp_build_type_variant): Rename to ...
7008         (cp_build_qualified_type): New function.  Deal with `__restrict'.
7009         (canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
7010         (build_exception_variant): Likewise.
7011         (mapcar): Likewise.
7012         * typeck.c (qualif_type): Likewise.
7013         (common_type): Likewise.
7014         (comptypes): Likewise.
7015         (comp_cv_target_types): Likewise.
7016         (at_least_as_qualified_p): Define.
7017         (more_qualified_p): Likewise.
7018         (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
7019         (compparms): Likewise.
7020         (inline_conversion): Likewise.
7021         (string_conv_p): Likewise.
7022         (build_component_ref): Likewise.
7023         (build_indirect_ref): Likewise.
7024         (build_array_ref): Likewise.
7025         (build_unary_op): Likewise.
7026         (build_conditional_expr): Likewise.
7027         (build_static_cast): Likewise.
7028         (build_c_cast): Likewise.
7029         (build_modify_expr): Likewise.
7030         (convert_For_assignment): Likewise.
7031         (comp_ptr_ttypes_real): Likewise.
7032         (cp_type_quals): New function.
7033
7034 1998-10-23  Jason Merrill  <jason@yorick.cygnus.com>
7035
7036         * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
7037         (CP_TYPE_VOLATILE): Likewise.
7038         * decl.c (grokdeclarator): Use them.
7039         * tree.c (canonical_type_variant): Likewise.
7040
7041 1998-10-22  Martin von Löwis  <loewis@informatik.hu-berlin.de>
7042
7043         * parse.y (named_class_head): Push into class while parsing the
7044         base class list.
7045         * decl2.c (push_scope, pop_scope): New functions.
7046         * cp-tree.h: Declare them.
7047         * init.c (build_new_1): Delay cleanup until end of full expression.
7048
7049 1998-10-21  Jason Merrill  <jason@yorick.cygnus.com>
7050
7051         * typeck.c (build_component_ref): Use of a type here is an error.
7052
7053 1998-10-19  Jason Merrill  <jason@yorick.cygnus.com>
7054
7055         Revamp references to member functions.
7056         * method.c (hack_identifier): Call build_component_ref for a
7057         reference to a member function.
7058         * typeck.c (build_component_ref): Only return a single function
7059         if it's static.  Otherwise, return a COMPONENT_REF.
7060         (build_x_function_call): Handle a COMPONENT_REF.
7061         (build_unary_op): Handle all unknown-type things.
7062         * decl2.c (arg_assoc): Handle COMPONENT_REF.
7063         * class.c (instantiate_type): Complain if the function we get is a
7064         nonstatic member function.  Remove code for finding "compatible"
7065         functions.
7066         * pt.c (tsubst_copy): Handle NOP_EXPR.
7067         * tree.c (build_dummy_object): New fn.
7068         (maybe_dummy_object): New fn.
7069         (is_dummy_object): New fn.
7070         * cp-tree.h: Declare them.
7071         * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
7072         * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
7073         * init.c (build_member_call): Use maybe_dummy_object and
7074         is_dummy_object.
7075         (build_offset_ref): Use maybe_dummy_object.
7076         (resolve_offset_ref): Use is_dummy_object.
7077         * typeck.c (build_x_function_call): Call build_dummy_object.
7078         (unary_complex_lvalue): Call is_dummy_object.
7079
7080         * typeck.c (build_component_addr): Make sure field is a field.
7081
7082         * call.c (build_new_op): Delete obsolete code.
7083
7084         * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
7085
7086 1998-10-18  Martin von Löwis  <loewis@informatik.hu-berlin.de>
7087
7088         * decl2.c (validate_nonmember_using_decl): Fix using-directives of
7089         std if std is ignored.
7090
7091 1998-10-18  Jason Merrill  <jason@yorick.cygnus.com>
7092
7093         * decl.c (grokvardecl): Fix thinko.
7094
7095         * decl.c (grokdeclarator): Embedded attrs bind to the right,
7096         not the left.
7097
7098         * parse.y (fn.def2): Fix 'attrs' format.
7099
7100 1998-10-18  Alastair J. Houghton  <ajh8@doc.ic.ac.uk>
7101
7102         * Makefile.in (CONFLICTS): Update.
7103         * parse.y (expr_or_declarator_intern): New rule.
7104         (expr_or_declarator, direct_notype_declarator, primary,
7105         functional_cast): Use it.
7106         (notype_declarator_intern): New rule.
7107         (notype_declarator, complex_notype_declarator): Use it.
7108
7109 1998-10-17  Jason Merrill  <jason@yorick.cygnus.com>
7110
7111         * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate.
7112         (grokvardecl): Likewise.
7113
7114 Sat Oct 17 23:27:20 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7115
7116         * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR).
7117         (add_method): Likewise for arguments 1 & 2 of `bcopy'.
7118
7119         * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN.
7120
7121         * pt.c (process_partial_specialization): Cast 1st argument of
7122         `bzero' to (PTR).
7123
7124         * tree.c (build_base_fields): Cast `base_align' to (int) when
7125         comparing against one.
7126
7127 1998-10-16  Mark Mitchell  <mark@markmitchell.com>
7128
7129         * decl.c (lookup_name_real): Handle template parameters for member
7130         templates where said parameters have the same name as the
7131         surrounding class.
7132
7133         * decl.c (expand_static_init): Build cleanups before entering the
7134         anonymous function used to do them to avoid access-checking
7135         confusion.
7136
7137         * decl.c (grokfndecl): Add back call to cplus_decl_attributes
7138         accidentally removed by previous change, and make DECL_RTL here.
7139         * class.c (add_method): Don't make DECL_RTL here.
7140
7141         * pt.c (for_each_template_parm): Don't examine uninstantiated
7142         default arguments.
7143
7144 1998-10-16  Dave Brolley  <brolley@cygnus.com>
7145
7146         * lex.c (real_yylex): Fix unaligned access of wchar_t.
7147
7148 1998-10-16  Mark Mitchell  <mark@markmitchell.com>
7149
7150         * class.c (add_method): Fix documentation to reflect previous
7151         changes.  Check for duplicate method declarations here.
7152         * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL
7153         correctly; such things never match.
7154         (grokfndecl): Don't look for duplicate methods here.
7155         * decl2.c (check_classfn): Don't assume names are mangled.
7156         Don't add bogus member function declarations to a class before the
7157         class type is complete.
7158         (grokfield): Reformat error message.
7159         * method.c (set_mangled_name_for_decl): Don't mangle names while
7160         processing_template_decl.
7161
7162 1998-10-16  Jason Merrill  <jason@yorick.cygnus.com>
7163
7164         * typeck.c (build_indirect_ref): Complain about a pointer to data
7165         member, too.
7166         * typeck2.c (build_m_component_ref): Don't indirect a pointer to
7167         data member.
7168         * init.c (resolve_offset_ref): Don't undo the above.
7169
7170         * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros.
7171         (struct lang_decl_flags): Add `bitfield'.
7172         * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of
7173         DECL_BIT_FIELD.
7174         * decl2.c (grokbitfield, grok_alignof): Likewise.
7175         * init.c (build_offset_ref): Likewise.
7176         * typeck.c (build_component_addr, expr_sizeof): Likewise.
7177         * cvt.c (build_up_reference): Don't crash if taking the address
7178         returns error_mark_node.
7179
7180         * decl.c (grokfndecl): Also check ctype when checking for ::main().
7181
7182 1998-10-15  Jason Merrill  <jason@yorick.cygnus.com>
7183
7184         * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
7185         Do mangling here.
7186         (grokdeclarator): Instead of here.
7187         * friend.c (do_friend): Lose special handling of ::main and
7188         __builtin_*.
7189         * cp-tree.h (DECL_MAIN_P): Check for C linkage.
7190
7191         * spew.c (yylex): Clear looking_for_typename if we got
7192         'enum { ... };'.
7193
7194 1998-10-15  Mark Mitchell  <mark@markmitchell.com>
7195
7196         * class.c (maybe_warn_about_overly_private_class): Improve error
7197         messages for class with only private constructors.
7198
7199         * cp-tree.def (TYPENAME_TYPE): Add to documentation.
7200         * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
7201         (build_typename_type): New function.
7202         * decl.c (build_typename_type): Broken out from ...
7203         (make_typename_type): Use it.
7204         * search.c (lookup_field): Likewise.
7205
7206 1998-10-14  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
7207
7208         * pt.c (convert_nontype_argument): Check against type_referred_to.
7209         * decl.c (grokvardecl): Check for declarator name before building
7210         DECL_ASSEMBLER_NAME.
7211
7212 1998-10-14  Mark Mitchell  <mark@markmitchell.com>
7213
7214         * pt.c (lookup_template_class): Add comment.
7215         (instantiate_class_template): Don't mark the _TYPE node for
7216         member class templates as an instantiation.
7217
7218 1998-10-14  Jason Merrill  <jason@yorick.cygnus.com>
7219
7220         * decl.c (grokfndecl): Fix my thinko.
7221
7222 1998-10-13  Jason Merrill  <jason@yorick.cygnus.com>
7223
7224         * tinfo2.cc (fast_compare): Remove.
7225         (before): Just use strcmp.
7226         * tinfo.cc (operator==): Just use strcmp.
7227
7228 1998-10-13  Klaus-Georg Adams  <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
7229
7230         * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
7231         declarations.
7232
7233 1998-10-13  Mark Mitchell  <mark@markmitchell.com>
7234
7235         * cp-tree.h (specializations_of_same_template_p): Remove.
7236         * search.c (get_template_base): Don't use it.
7237         (get_template_base_recursive): Likewise.
7238         * pt.c (specializations_of_same_template_p): Remove.
7239         (unify): Don't use it.
7240         (lookup_template_class): Find the correct parent when setting
7241         CLASSTYPE_TI_TEMPLATE.
7242
7243 1998-10-12  Jason Merrill  <jason@yorick.cygnus.com>
7244
7245         * tinfo.cc (operator==): Always compare names.
7246
7247 1998-10-12  Herman ten Brugge  <Haj.Ten.Brugge@net.HCC.nl>
7248
7249         * decl.c (start_function): Fix cut-and-paste error.
7250
7251 1998-10-12  Jason Merrill  <jason@yorick.cygnus.com>
7252
7253         * inc/typeinfo: Add #pragma interface.
7254         (operator!=): Just call operator==.
7255         * tinfo.cc: Add #pragma implementation.
7256         (operator==): Move from inc/typeinfo and tinfo2.cc.
7257         Check __COMMON_UNRELIABLE instead of _WIN32.
7258
7259         * typeck2.c (my_friendly_abort): Add URL.
7260
7261 1998-10-12  Alastair J. Houghton  <ajh8@doc.ic.ac.uk>
7262
7263         * decl.c (start_method): Added extra parameter for attributes.
7264         * cp-tree.h (start_method): Update prototype.
7265         * parse.y (fn.def2): Update start_method parameter list.
7266
7267 1998-10-11  Mark Mitchell  <mark@markmitchell.com>
7268
7269         * cp-tree.h (specializations_of_same_template_p): Declare.
7270         * pt.c (specializations_of_same_template_p): New function.
7271         (unify): Use it.
7272         * search.c (get_template_base): Use it.
7273         (get_template_base_recursive): Likewise.
7274
7275 1998-10-10  Manfred Hollstein  <manfred@s-direktnet.de>
7276
7277         * decl2.c (start_objects): Add new variable `joiner' and
7278         initialize it properly.
7279
7280 1998-10-09  Mark Mitchell  <mark@markmitchell.com>
7281
7282         * search.c (expand_upcast_fixups): Tweak to match 1998-10-07
7283         change to vtable types.
7284
7285         * cvt.c (ocp_convert): Avoid infinite recursion caused by
7286         1998-10-03 change.
7287
7288 1998-10-08  Jason Merrill  <jason@yorick.cygnus.com>
7289
7290         * pt.c (resolve_overloaded_unification): New fn.
7291         (try_one_overload): Likewise.
7292         (unify): Don't fail on unknown type.
7293         (type_unification_real): Likewise.  Use resolve_overloaded_unification
7294         to handle an overloaded argument.
7295         (template_args_equal): Split out...
7296         (comp_template_args): From here.
7297         (determine_specialization): Also allow a template with more
7298         parms than were explicitly specified.
7299         * cp-tree.h: Add template_args_equal.
7300         * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code.
7301
7302 Thu Oct  8 15:58:30 1998  Anthony Green  <green@cygnus.com>
7303
7304         * semantics.c (finish_asm_stmt): Revert my 1998-09-28
7305         change.
7306
7307 Thu Oct  8 06:00:19 1998  Jeffrey A Law  (law@cygnus.com)
7308
7309         * typeck.c (unsigned_type): Only return TItype nodes when
7310         HOST_BITS_PER_WIDE_INT is >= 64 bits.
7311         (signed_type): Likewise.
7312         * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
7313         when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7314         (init_decl_processing): Only create TItype nodes when
7315         HOST_BITS_PER_WIDE_INT is >= 64 bits.
7316         * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare
7317         when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7318
7319 Wed Oct  7 12:32:44 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7320
7321         * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
7322         (gxx.gperf): Update comments describing invocation flags.
7323         (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
7324
7325 1998-10-07  Mark Mitchell  <mark@markmitchell.com>
7326
7327         * class.c (finish_struct_1): Add commentary on previous change.
7328
7329         * cp-tree.h (vtbl_ptr_type_node): New variable.
7330         * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
7331         already of the right type.
7332         (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
7333         Simplify code to grow vtable.
7334         * decl.c (vtbl_ptr_type_node): Define.
7335         (init_decl_processing): Initialize it.
7336
7337 1998-10-06  Mark Mitchell  <mark@markmitchell.com>
7338
7339         * cp-tree.def (PTRMEM_CST): New tree node.
7340         * cp-tree.h (ptrmem_cst): New type.
7341         (lang_type): Remove local_typedecls.
7342         (dummy): Increase to 12 bits from 11.
7343         (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
7344         (PTRMEM_CST_CLASS): New macro.
7345         (PTRMEM_CST_MEMBER): Likewise.
7346         (current_access_specifier): New variable.
7347         (current_class_type): Remove duplicate declaration.
7348         (finish_struct): Change prototype.
7349         (unreverse_member_declarations): New function.
7350         (pushdecl_class_level): Change prototype.
7351         (grok_enum_decls): Remove.
7352         (fixup_anonymous_union): New function.
7353         (grok_x_components): Change prototype.
7354         (tsubst_chain): Remove.
7355         (finish_member_template_decl): Likewise.
7356         (check_explicit_specialization): Fix indentation.
7357         (finish_class_definition): Change prototype.
7358         (finish_member_class_template): Likewise.
7359         (finish_member_declaration): New function.
7360         (check_multiple_declarators): Likewise.
7361         * class.c (class_stack_node_t): New type.
7362         (current_class_base): Remove.
7363         (current_class_stack): Change type.
7364         (current_access_specifier): New variable.
7365         (grow_method): Remove.
7366         (check_member_decl_is_same_in_complete_scope): Break out from
7367         finish_struct.
7368         (make_method_vec): New function.
7369         (free_method_vec): Likewise.
7370         (add_implicitly_declared_members): Break out from finish_struct_1.
7371         (free_method_vecs): New variable.
7372         (add_method): Rework for direct use from parser.
7373         (handle_using_decl): Watch for NULL_TREE while iterating through
7374         CLASSTYPE_METHOD_VEC.
7375         (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
7376         just do some error-checking.
7377         (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
7378         (finish_struct_1): Simplify.  Use add_implicitly_declared_members.
7379         (finish_struct): Change prototype.  Simplify; fields and methods
7380         are already set up at this point.
7381         (init_class_processing): Set up current_class_stack.
7382         (pushclass): Save current_access_specifier.
7383         (popclass): Restore it.
7384         (currently_open_class): Simplify.
7385         (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
7386         * decl.c (saved_scope): Add access_specifier.
7387         (maybe_push_to_top_level): Save it.
7388         (pop_from_top_level): Restore it.
7389         (maybe_process_template_type_declaration): Use
7390         finish_member_declaration.
7391         (pushtag): Likewise.
7392         (pushdecl_class_level): Don't return a value.
7393         (fixup_anonymous_union): Break out from grok_x_components.
7394         (shadow_tag): Use it.
7395         (xref_tag): Complain about using an elaborated type specifier to
7396         reference a template type parameter or typedef name.
7397         (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
7398         (current_local_enum): Remove.
7399         (build_enumerator): Call finish_member_declaration.
7400         (grok_enum_decls): Remove.
7401         * decl2.c (grok_x_components): Simplify.
7402         (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
7403         (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
7404         (merge_functions): Add to comment.
7405         (arg_assoc_type): Prototype.
7406         (arg_assoc): Pass as many arguments as there are parameters.
7407         * error.c (dump_expr): Handle PTRMEM_CST.  Improve handling of
7408         OFFSET_REF.
7409         * expr.c (cpls_expand_expr): Remove dead code.  Handle
7410         PTRMEM_CST.
7411         * friend.c (do_friend): Lookup friends when in nested classes.
7412         Change comments.
7413         * init.c (build_offset_ref): Do lookup even for classes that are
7414         only partially defined.
7415         (decl_constant_value): Remove dead code.
7416         * method.c (build_overload_value): Remove hack where by TYPE was
7417         not a TYPE.  Handle PTRMEM_CST.
7418         (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
7419         should go.
7420         * parse.y (components, notype_components, component_decl,
7421         component_decl_1, component_declarator, component_declarator0):
7422         Now all are itype rather than ttype.  Rework to add members to
7423         classes on the fly.
7424         (typesqpecqual_reserved): Use check_multiple_declarators.
7425         (structsp): Update class to finish_class_definition.
7426         (do_xref_defn): Unsplit into named_class_head.
7427         (access_specifier): Set current_access_specifier.
7428         * pt.c (set_current_access_from_decl): New function.
7429         (finish_member_template_decl): Don't take the parameters.
7430         (comp_template_args): Make more robust.
7431         (lookup_template_class): Don't use current_local_enum.
7432         (for_each_template_parm): Handle PTRMEM_CST.
7433         (instantiate_class_template): Use set_current_access_from_decl,
7434         finish_member_declaration and unreverse_member_declarations.  Set
7435         lineno/input_filename before generating implicit member functions.
7436         (type_unification_real): Don't assume back-unification happens
7437         only for the last argument.
7438         (regenerate_decl_from_template): Call pushclass a bit earlier.
7439         (tsubst_chain): Remove.
7440         (tsubst_enum): Use set_current_access_from_decl.
7441         (set_mangled_name_for_template_decl): Fix indentation.
7442         * search.c (lookup_fnfields_1): Change iteration through
7443         CLASSTYPE_METHOD_VEC.
7444         (dfs_pushdecls): Likewise.
7445         (dfs_compress_decls): Likewise.
7446         (add_conversions): Likewise.
7447         * semantics.c (finish_class_definition): Don't take components.
7448         Change call to finish_struct.
7449         (finish_member_declaration): New function.
7450         (finish_member_class_template): Don't take template parameters.
7451         Change call to grok_x_components.  Call finish_member_template_decl.
7452         (check_multiple_declarators): New function.
7453         * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
7454         a passed in fieldlist.
7455         * tree.c (search_tree): Handle PTRMEM_CST.
7456         (mapcar): Likewise.
7457         * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
7458         INTEGER_CSTs, for pointer-to-data members.
7459
7460         * call.c (resolve_args): Resolve template specializations, if
7461         possible.
7462
7463 Tue Oct  6 07:57:26 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7464
7465         * Makefile.in (spew.o): Depend on toplev.h.
7466
7467         * call.c (compare_ics): Initialize variables `deref_from_type2',
7468         `deref_to_type1' and `deref_to_type2'.
7469
7470         * except.c (get_eh_type): Hide prototype and definition.
7471         (process_start_catch_block_old): Remove unused static prototype.
7472
7473         * pt.c (tsubst_decl): Initialize variable `argvec'.
7474
7475         * spew.c: Include toplev.h.
7476
7477 1998-10-05  Jason Merrill  <jason@yorick.cygnus.com>
7478
7479         * pt.c (instantiate_decl): Do save and restore file position.
7480
7481 1998-10-05  Martin von Löwis  <loewis@informatik.hu-berlin.de>
7482
7483         * method.c (build_decl_overload_real): Clear
7484         numeric_output_need_bar after __.
7485
7486 1998-10-05  Nathan Sidwell  <nathan@acm.org>
7487
7488         * call.c (build_new_method_call): Issue 'incomplete type' error,
7489         if class is not defined.
7490
7491 1998-10-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7492
7493         * call.c (build_object_call): Move declaration of variable
7494         `fn' into the scope where it is used.  Don't access variable
7495         `fn' when it is uninitialized, instead use `fns'.
7496
7497 1998-10-04  Theodore Papadopoulo  <Theodore.Papadopoulo@sophia.inria.fr>
7498
7499         * errfn.c (cp_thing): Print buf as a string not as a printf format
7500         to avoid problems with the operator%.  Consequently, `%%' sequences
7501         in format are copied as `%' in buf.
7502
7503 1998-10-04  Jason Merrill  <jason@yorick.cygnus.com>
7504
7505         * pt.c (pop_tinst_level): Call extract_interface_info.
7506         (instantiate_decl): Don't save and restore file position.
7507
7508         * decl.c (cp_finish_decl): Make statics in extern inlines and
7509         templates common, if possible and the target doesn't support weak
7510         symbols.
7511
7512         * decl.c (grokdeclarator): Remove redundant calls to
7513         build_type_variant and some duplicated code.
7514         * sig.c (build_signature_reference_type): Only take the type parm.
7515         (build_signature_pointer_type): Likewise.
7516         * tree.c (build_cplus_method_type): Adjust.
7517         * cp-tree.h: Update.
7518
7519 1998-10-04  Mark Mitchell  <mark@markmitchell.com>
7520
7521         * call.c (build_over_call): Make pedwarns about dropped qualifiers
7522         into full-fledged errors.
7523         * cvt.c (convert_to_reference): Likewise.
7524         * typeck.c (convert_for_assignment): Likewise.
7525
7526         * search.c (expand_upcast_vtables): In addition to unsetting
7527         TREE_READONLY, remove top-level const type qualifier.
7528
7529 1998-10-03  Mark Mitchell  <mark@markmitchell.com>
7530
7531         * class.c (current_class_ptr, current_class_ref): Clarify
7532         documentation.
7533         * cvt.c (ocp_convert): Don't expect fold to remove all trivial
7534         NOP type conversions.
7535         * decl.c (decls_match): Use comptypes directly; ignore
7536         qualifiers on the DECL.
7537         (duplicate_decls): Remove qualifier checks on DECL.
7538         (grokdeclarator): Make the type built up include top-level
7539         qualifiers.
7540         * decl2.c (do_dtors): Fix spelling error.
7541         * error.c (dump_simple_decl): Don't look at qualifiers on the decl
7542         when printing type information.
7543         * init.c (build_new_1): Add documentation.  Deal with the fact
7544         that type of allocated memory now contains qualifiers.
7545         * lex.c (is_global): Improve error-recovery.
7546         * sig.c (build_member_function_pointer): Don't cast away const
7547         on fields of sigtable_entry_type.
7548         * tree.c (lvalue_type): Don't look at top-level qualifiers on
7549         expressions.
7550         * typeck.c (decay_conversion): Likewise.
7551         (build_component_ref): Make sure the type of the COMPONENT_REF
7552         contains top-level qualifiers, as appropriate.  Improve
7553         error-handling.
7554         (build_indirect_ref): Simplify.  Don't strip top-level qualifiers.
7555         (build_array_ref): Likewise.
7556         (build_unary_op): Improve error-recovery.
7557         (unary_complex_lvalue): Make taking the address a bound member
7558         function an error, not a sorry.
7559         (build_conditional_expr): Look at the type qualifiers, not the
7560         qualifiers on the expression itself.
7561
7562 1998-10-03  Jason Merrill  <jason@yorick.cygnus.com>
7563
7564         * decl2.c (merge_functions): Remove duplicates.
7565
7566         * decl2.c: Add -f{no-,}implicit-inline-templates.
7567         (import_export_decl): Check it.
7568
7569         * decl.c (lookup_name_real): Template parms also take precedence
7570         over implicit typename.  Only warn if yylex.
7571
7572         * typeck.c (build_conditional_expr): Only fold if ifexp is an
7573         INTEGER_CST.
7574
7575         * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
7576         instead of linkage.
7577
7578 1998-10-01  Jason Merrill  <jason@yorick.cygnus.com>
7579
7580         * cp-tree.h (FORMAT_VBASE_NAME): New macro.
7581         * class.c (build_vbase_pointer): Use it.
7582         * rtti.c (expand_class_desc): Likewise.
7583         * tree.c (build_vbase_pointer_fields): Likewise.
7584
7585 Thu Oct  1 10:43:45 1998  Nick Clifton  <nickc@cygnus.com>
7586
7587         * decl.c (start_decl): Add invocation of
7588         SET_DEFAULT_DECL_ATTRIBUTES, if defined.
7589         (start_function): Add invocation of
7590         SET_DEFAULT_DECL_ATTRIBUTES, if defined.
7591
7592         * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with
7593         HANDLE_GENERIC_PRAGMAS.
7594
7595 1998-09-28  Anthony Green  <green@cygnus.com>
7596
7597         * semantics.c (finish_asm_stmt): Always permit volatile asms.
7598
7599 1998-09-28  Mark Mitchell  <mark@markmitchell.com>
7600
7601         * decl.c (grokdeclarator): Tighten checks for invalid
7602         destructors.  Improve error-messages and error-recovery.
7603         * decl2.c (check_classfn): Don't assume that mangled destructor
7604         names contain type information.
7605
7606 1998-09-25  Jason Merrill  <jason@yorick.cygnus.com>
7607
7608         * search.c (get_base_distance): Remove assert.
7609
7610         * decl2.c (build_anon_union_vars): Don't process a field with no
7611         name.
7612         (finish_anon_union): Also complain about local anon unions with no
7613         members.
7614
7615 1998-09-25  Martin von Löwis  <loewis@informatik.hu-berlin.de>
7616
7617         * decl.c (lookup_namespace_name): If the name is a namespace,
7618         return it immediately.
7619
7620 Fri Sep 25 11:45:38 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7621
7622         * cp-tree.h (define_case_label): Remove unused parameter.
7623         (check_java_method): Likewise.
7624         (grokclassfn): Likewise.
7625         (expand_aggr_init): Likewise.
7626         (build_x_delete): Likewise.
7627         (maybe_end_member_template_processing): Likewise.
7628         (unshare_base_binfos): Add prototype.
7629         (string_conv_p): Likewise.
7630         (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
7631
7632         * cvt.c (build_up_reference): Remove unused parameter
7633         `checkconst', all callers changed.
7634         (build_type_conversion): Mark parameter `code' with
7635         ATTRIBUTE_UNUSED.
7636         (build_expr_type_conversion): Initialize variable `conv'.
7637
7638         * decl.c (push_namespace): Initialize variable `d'.
7639         (define_case_label): Remove unused parameter `decl', all callers
7640         changed.
7641
7642         * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
7643         `argc' with ATTRIBUTE_UNUSED.
7644         (grokclassfn): Remove unused parameter `cname', all callers
7645         changed.
7646         (check_java_method): Likewise for parameter `ctype'.
7647         (copy_assignment_arg_p): Mark parameter `virtualp' with
7648         ATTRIBUTE_UNUSED.
7649         (finish_prevtable_vardecl): Likewise for parameter `prev'.
7650
7651         * expr.c (extract_init): Likewise for parameters `decl' and `init'.
7652
7653         * init.c (expand_aggr_init_1): Remove unused parameter
7654         `alias_this', all callers changed.
7655         (expand_aggr_init): Likewise.
7656         (expand_default_init): Likewise.
7657         (build_new_1): Initialize variable `susp'.
7658         (build_x_delete): Remove unused parameter `type', all callers
7659         changed.
7660
7661         * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
7662         ATTRIBUTE_UNUSED.
7663         (readescape): Use (unsigned) value in shift.
7664         (real_yylex): Likewise.  Likewise.  Also cast `sizeof' to int when
7665         comparing to a signed quantity.
7666
7667         * pt.c (maybe_end_member_template_processing): Remove unused
7668         parameter `decl', all callers changed.
7669         (check_explicit_specialization): Add braces around empty body in
7670         an else-statement.
7671         (current_template_args): Initialize variable `args'.
7672         (lookup_template_class): Likewise for variable `prev_local_enum'.
7673         (tsubst_decl): Likewise for variable `r'.
7674         (set_mangled_name_for_template_decl): Initialize variable
7675         `context'.
7676
7677         * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
7678         Likewise for variable `i'.
7679         (yylex): Initialize variable `trrr'.
7680
7681         * typeck.c (compparms): Mark variable `strict' with
7682         ATTRIBUTE_UNUSED.
7683
7684         * xref.c (simplify_type): Cast argument of ctype function to
7685         `unsigned char'.
7686
7687 1998-09-24  Mark Mitchell  <mark@markmitchell.com>
7688
7689         * cp-tree.h (language_lvalue_valid): Remove.
7690         * decl.c (grokdeclarator): Don't disallow references to functions.
7691         * tree.c (lvalue_p_1): New function, combining duplicated
7692         code from ...
7693         (lvalue_p): Use it.
7694         (real_lvalue_p): Likewise.
7695         * typeck.c (language_lvalue_valid): Remove.
7696         (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
7697         they don't have TREE_READONLY set.
7698         * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
7699
7700 1998-09-24  Benjamin Kosnik  <bkoz@loony.cygnus.com>
7701
7702         * spew.c (yylex): Give diagnostic.
7703         * hash.h (is_reserved_word): Add export.
7704         * gxx.gperf: Likewise.
7705         * lex.h (rid): Add RID_EXPORT.
7706         * lex.c (init_parse): Likewise.
7707
7708 Tue Sep 22 21:01:19 1998  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
7709
7710         * friend.c (do_friend): Make warning a full sentence.
7711
7712 1998-09-22  Mark Mitchell  <mark@markmitchell.com>
7713
7714         * parse.y (component_decl_list): Improve error-recovery.
7715
7716 1998-09-22  Benjamin Kosnik  <bkoz@loony.cygnus.com>
7717
7718         * decl.c (make_typename_type): Move error to point where name
7719         variable can be used by dump_type.
7720
7721 1998-09-22  Mark Mitchell  <mark@markmitchell.com>
7722
7723         * decl.c (grokfndecl): Improve error-recovery.
7724         * decl2.c (grokfield): Likewise.
7725         * pt.c (finish_member_template_decl): Likewise.
7726
7727 1998-09-20  Martin von Löwis  <loewis@informatik.hu-berlin.de>
7728
7729         * method.c (hack_identifier): Finding multiple members is always
7730         an error.
7731
7732 1998-09-21  Per Bothner  <bothner@cygnus.com>
7733
7734         * Make-lang.in (c++-filt):  Link libiberty.a after cxxmain.o.
7735
7736 Mon Sep 21 01:53:05 1998  Felix Lee  <flee@cygnus.com>
7737
7738         * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
7739
7740 1998-09-20  Mark Mitchell  <mark@markmitchell.com>
7741
7742         * class.c (maybe_warn_about_overly_private_class): Reformat.
7743
7744 1998-09-17  Andrew MacLeod  <amacleod@cygnus.com>
7745
7746         * exception.cc (__cplus_type_matcher): Realign some code.
7747
7748 1998-09-16  Mark Mitchell  <mark@markmitchell.com>
7749
7750         * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
7751         (tinfo2.o): Likewise.
7752         (exception.o): Likewise.
7753         (new.o): Likewise.
7754         (opnew.o): Likewise.
7755         (opnewnt.o): Likewise.
7756         (opvnew.o): Likewise.
7757         (opvnewnt.o): Likewise.
7758         (opdel.o): Likewise.
7759         (opdelnt.o): Likewise.
7760         (opvdel.o): Likewise.
7761         (opvdelnt.o): Likewise.
7762
7763 1998-09-16  Richard Henderson  <rth@cygnus.com>
7764
7765         * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
7766
7767 1998-09-15  Alexandre Oliva  <oliva@dcc.unicamp.br>
7768
7769         * call.c (build_field_call): Handle static data members too.
7770
7771         * typeck.c (comptypes): When comparing pointer types, check
7772         whether referred types match even in strictest modes.
7773
7774 1998-09-15  Mark Mitchell  <mark@markmitchell.com>
7775
7776         * cp-tree.h: Revert previous change.
7777         (finish_struct_methods): Remove declaration.
7778         * class.c: Revert previous change.
7779         (maybe_warn_about_overly_private_class): New function.
7780         (finish_struct_methods): Declare here, and make static.  Remove
7781         unnecessary parameters.  Tidy slightly.  Use
7782         maybe_warn_about_overly_private_class.
7783         (finish_struct_1): Adjust.  Remove check for private constructors,
7784         now done elsewhere.
7785         (finish_struct): Adjust.
7786
7787 1998-09-15  Andrew MacLeod  <amacleod@cygnus.com>
7788
7789         * except.c (expand_start_catch_block): No need to check for new
7790         exception model.
7791         (process_start_catch_block_old): Deleted.
7792         (process_start_catch_block): Add call to start_decl_1().
7793         (expand_end_catch_block): Add call to end_catch_handler().
7794         * exception.cc (__cplus_type_matcher): Only check the exception
7795         language if there is an exception table.
7796
7797 1998-09-15  Andrew MacLeod  <amacleod@cygnus.com>
7798
7799         * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
7800         as used to prevent conflicts with virtual function tables.
7801
7802 1998-09-14  Mark Mitchell  <mark@markmitchell.com>
7803
7804         * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
7805         (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
7806         * class.c (maybe_class_too_private_p): New function.
7807         (finish_struct_methods): Use it.
7808         (finish_struct_1): Likewise.
7809         (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
7810         appropriate.
7811
7812         * pt.c (check_specialization_scope): Fix spelling error.
7813         (check_explicit_specialization): Remove code to handle explicit
7814         specializations in class scope; they are now correctly diagnosed
7815         as errors.
7816
7817 1998-09-10  Mark Mitchell  <mark@markmitchell.com>
7818
7819         * decl.c (pushdecl): Don't copy types if the
7820         DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
7821         type.
7822
7823 1998-09-09  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
7824
7825         * class.c (get_enclosing_class): New function.
7826         (is_base_of_enclosing_class): Likewise.
7827         * cp-tree.h (get_enclosing_class): Declare.
7828         (is_base_of_enclosing_class): Likewise.
7829         * pt.c (coerce_template_parms): Use them.
7830
7831 1998-09-09  Jason Merrill  <jason@yorick.cygnus.com>
7832
7833         * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
7834         null to decide whether to use it.
7835
7836         * error.c (dump_type_real): Handle NAMESPACE_DECL.
7837         * parse.y (base_class.1): Avoid crash on error.
7838
7839 1998-09-08  Martin von Löwis  <loewis@informatik.hu-berlin.de>
7840
7841         * decl.c (make_typename_type): If context is a namespace, the code
7842         is in error.
7843
7844 1998-09-08  Mumit Khan  <khan@xraylith.wisc.edu>
7845
7846         * parse.y (nomods_initdcl0): Set up the parser stack correctly.
7847
7848 1998-09-08  Mark Mitchell  <mark@markmitchell.com>
7849
7850         * cp-tree.h (anonymous_namespace_name): Declare.
7851         * decl.c: Define it.
7852         (push_namespace): Use anonymous_namespace_name, rather than local
7853         static anon_name.
7854         * error.c (dump_decl): If a namespace is named
7855         anonymous_namespace_name, call it {anonymous}.
7856
7857         * decl.c (grokparms): Distinguish between references and pointers
7858         in error message.
7859
7860 1998-09-08  Richard Henderson  <rth@cygnus.com>
7861             Mark Mitchell  <mark@markmitchell.com>
7862
7863         * pt.c (process_partial_specialization): Consistently allocate
7864         and zero tpd.parms based on ntparms.  Use tpd2.parms, not
7865         tpd.parms, where appropriate.
7866
7867 Sun Sep  6 00:00:51 1998  Jeffrey A Law  (law@cygnus.com)
7868
7869         * Makefile.in (INCLUDES): Update after recent toplevel gcc
7870         reorganizations.
7871
7872 1998-09-05  Mark Mitchell  <mark@markmitchell.com>
7873
7874         * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
7875         * class.c (finish_struct): Remove hackery to deal with explicit
7876         specializations in class scope.
7877         * decl.c (grokfndecl): Improve error-recovery.
7878         * decl2.c (grokfield): Likewise.
7879         * pt.c (check_specialization_scope): New function.
7880         (begin_specialization): Call it.
7881         (process_partial_specialization): New function, split out from
7882         push_template_decl.  Check partial specializations more
7883         stringently.
7884         (push_template_decl): Call it.
7885         (check_explicit_specialization): Don't attempt to handle explicit
7886         specializations in class scope.
7887         (template_parm_data): Document.  Add current_arg and
7888         arg_uses_template_parms.
7889         (mark_template_parm): Set it.
7890         (tsubst_arg_types): Remove unused variable.
7891         * semantics.c (begin_class_definition): Tweak.
7892
7893 1998-09-04  Mark Mitchell  <mark@markmitchell.com>
7894
7895         * inc/typeinfo (type_info::type_info(const char*)): Make
7896         `explicit'.
7897
7898         * cp-tree.h (hash_tree_cons_simple): New macro.
7899         * pt.c (tsubst_arg_types): New function.  Use hash_tree_cons.
7900         (coerce_template_parms): Use make_temp_vec, instead of
7901         make_tree_vec.  Document this behavior.
7902         (lookup_template_class): Likewise.
7903         (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
7904         Remove dead code (and add assertion to check its deadness).  Fix
7905         bug w.r.t. exception specifications.
7906
7907 1998-09-03  Jason Merrill  <jason@yorick.cygnus.com>
7908
7909         * decl2.c (import_export_vtable): Always make artificials comdat.
7910         (import_export_decl): Likewise.
7911         * pt.c (mark_decl_instantiated): Likewise.
7912
7913 1998-09-03  Mark Mitchell  <mark@markmitchell.com>
7914
7915         * cp-tree.h (finish_globally_qualified_member_call_expr):
7916         Rename to ...
7917         (finish_qualified_call_expr).
7918         * semantics.c: Likewise.
7919         * parse.y (primary): Use it.
7920         * method.c (hack_identifier): Remove redundant code.
7921
7922         * init.c (resolve_offset_ref): Call convert_from_reference to
7923         handle members of reference type.  Improve error recovery.
7924
7925 1998-09-03  Benjamin Kosnik  <bkoz@cygnus.com>
7926
7927         * cp-tree.h: Declare warn_nontemplate_friend.
7928         * decl2.c (lang_decode_option): Set.
7929         * lang-options.h: Add -Wnon-template-friend.
7930         * friend.c (do_friend): Use to toggle non-template function warning.
7931
7932 1998-09-03  Mark Mitchell  <mark@markmitchell.com>
7933
7934         * decl.c (finish_enum): Don't resolve CONST_DECLs to their
7935         corresponding INTEGER_CSTs when processing_template_decl.
7936         * pt.c (tsubst_enum): Tweak accordingly.
7937
7938 1998-09-03  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
7939
7940         * decl.c (pushdecl_class_level): Add warning here.
7941         (pushdecl): Tweak.
7942
7943 1998-09-02  Jason Merrill  <jason@yorick.cygnus.com>
7944
7945         * cvt.c (convert_pointer_to_real): Tidy.
7946         * search.c (get_base_distance_recursive): Simplify.
7947         (get_base_distance): Likewise.
7948
7949         * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
7950         parms.
7951
7952 Wed Sep 02 09:25:29 1998  Nick Clifton  <nickc@cygnus.com>
7953
7954         * lex.c (check_newline):  Call HANDLE_PRAGMA before
7955         HANDLE_SYSV_PRAGMA if both are defined.  Generate warning messages
7956         if unknown pragmas are encountered.
7957         (handle_sysv_pragma): Interpret return code from
7958         handle_pragma_token ().  Return success/failure indication rather
7959         than next unprocessed character.
7960         (pragma_getc): New function: retrieves characters from the
7961         input stream.  Defined when HANDLE_PRAGMA is defined.
7962         (pragma_ungetc): New function: replaces characters back into the
7963         input stream.  Defined when HANDLE_PRAGMA is defined.
7964
7965 1998-09-01  Jason Merrill  <jason@yorick.cygnus.com>
7966
7967         * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
7968         * class.c (build_vtable_entry_ref): Likewise.
7969
7970 1998-09-01  Mark Mitchell  <mark@markmitchell.com>
7971
7972         * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
7973         * decl2.c (import_export_decl): Likewise.
7974         * pt.c (instantiate_decl): Use it.
7975
7976 1998-09-01  Jason Merrill  <jason@yorick.cygnus.com>
7977
7978         * decl.c (lookup_name_real): Also do implicit typename thing for
7979         artificial TYPE_DECLs.
7980         * search.c (lookup_field): Likewise.
7981         (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
7982         * semantics.c (begin_constructor_declarator): Use enter_scope_of.
7983         (enter_scope_of): Extract type from implicit typename.
7984         (begin_class_definition): Likewise.
7985         * lex.c (identifier_type): Handle implicit typename when checking
7986         for SELFNAME.
7987
7988         * cp-tree.h: Declare flag_strict_prototype.
7989         * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
7990         -fstrict-prototype.
7991         * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
7992         specified, set it to the value of pedantic.
7993
7994 1998-09-01  Mark Mitchell  <mark@markmitchell.com>
7995
7996         * decl2.c (arg_assoc): Handle template-id expressions as arguments.
7997
7998 1998-08-31  Mark Mitchell  <mark@markmitchell.com>
7999
8000         * decl.c (finish_enum): Handle member enums of classes declared in
8001         template functions.
8002
8003         * decl2.c (grok_x_components): Strip attributes before calling
8004         groktypename.
8005
8006 1998-08-31  Jason Merrill  <jason@yorick.cygnus.com>
8007
8008         * cp-tree.h, decl2.c: Remove support for -fall-virtual,
8009         -fenum-int-equivalence and -fno-nonnull-objects.
8010         * class.c (check_for_override): Remove support for -fall-virtual.
8011         (finish_struct_1): Likewise.
8012         * call.c (build_new_op): Remove support for -fenum-int-equivalence.
8013         * typeck.c (build_binary_op_nodefault): Likewise.
8014         * cvt.c (ocp_convert): Likewise.
8015         * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
8016         * class.c (build_vbase_path): Likewise.
8017
8018 Sun Aug 30 22:16:31 1998  H.J. Lu  (hjl@gnu.org)
8019
8020         * Makefile.in (INTERFACE): New, set to 1.
8021
8022 1998-08-30  Mark Mitchell  <mark@markmitchell.com>
8023
8024         * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
8025         comparing with global_namespace.
8026         (dump_aggr_type): Likewise.
8027
8028         * decl.c (grokfndecl): Issue error on declaration of friend
8029         templates with explicit template arguments.
8030
8031         * pt.c (convert_template_argument): New function, split out
8032         from...
8033         (coerce_template_parms): Here.
8034         (tsubst): Attempt better error-recovery.
8035
8036 1998-08-28  Benjamin Kosnik  <bkoz@loony.cygnus.com>
8037
8038         * pt.c (decl_template_parm_p): Add checks for
8039         TEMPLATE_TEMPLATE_PARM.
8040
8041 1998-08-28  Mark Mitchell  <mark@markmitchell.com>
8042
8043         * lex.c (do_identifier): Fix thinko in previous change.
8044
8045 1998-08-28  Jason Merrill  <jason@yorick.cygnus.com>
8046
8047         * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
8048         * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
8049
8050 1998-08-28  Richard Henderson  <rth@cygnus.com>
8051
8052         Add support for discarding unused virtual functions.
8053         * lang-options.h: Add -fvtable-gc.
8054         * cp-tree.h: Add flag_vtable_gc.
8055         * decl2.c (output_vtable_inherit): New fn.
8056         (finish_vtable_vardecl): Call it.
8057         * class.c (build_vtable_entry_ref): New fn.
8058         (build_vtbl_ref): Call it.
8059
8060 1998-08-28  Mark Mitchell  <mark@markmitchell.com>
8061
8062         * cp-tree.h (build_enumerator): Take the enumeration type as a
8063         parameter.
8064         * decl.c (finish_enum): Don't set the TREE_TYPE for the
8065         enumeration constant values if we're processing_template_decls.
8066         Don't set the type for the CONST_DECLs either; that's done in
8067         build_enumerator.
8068         (build_enumerator): Take the enumeration type as a
8069         parameter.
8070         * lex.c (do_identifier): Don't resolve enumeration constants while
8071         processing template declarations, even if they happen to be
8072         TEMPLATE_PARM_INDEXs.
8073
8074         * parse.y (current_enum_type): New variable.
8075         (primary): Don't allow statement-expression in local classes just
8076         as we don't in global classes.
8077         (structsp): Use current_enum_type.
8078         (enum_list): Likewise.
8079         * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
8080         finish_enum; they no longer occur.
8081
8082         * cp-tree.h (finish_base_specifier): New function.
8083         * parse.y (base_class): Use it.
8084         * semantics.c (finish_base_specifier): Define it.
8085
8086         * parse.y (structsp): Warn on use of typename outside of template
8087         declarations.
8088
8089 1998-08-27  Jason Merrill  <jason@yorick.cygnus.com>
8090
8091         * lex.c (handle_cp_pragma): Remove #pragma vtable.
8092         * lang-options.h: Remove +e options.
8093         * decl2.c (lang_decode_option): Likewise.
8094         (import_export_vtable): Don't check write_virtuals.
8095         (finish_vtable_vardecl, finish_file): Likewise.
8096         * search.c (dfs_debug_mark): Likewise.
8097         * semantics.c (begin_class_definition): Likewise.
8098         * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
8099
8100         * call.c (build_over_call): Check flag_elide_constructors.
8101         * decl2.c: flag_elide_constructors defaults to 1.
8102         * typeck.c (convert_arguments): Remove return_loc parm.
8103         (build_function_call_real): Adjust.
8104
8105         * search.c: Tear out all mi_matrix and memoize code.
8106         (lookup_field, lookup_fnfields): Use scratch_tree_cons.
8107         * lang-options.h: Remove documentation for -fhandle-exceptions,
8108         -fmemoize-lookups and -fsave-memoized.
8109         * cp-tree.h: Lose mi_matrix and memoize support.
8110         * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
8111         * class.c: Lose struct class_level.
8112         (pushclass, popclass): Lose memoize support.
8113         * init.c (build_offset_ref): Likewise.
8114
8115         Never change BINFO_INHERITANCE_CHAIN.
8116         * init.c (emit_base_init): Change modification of
8117         BINFO_INHERITANCE_CHAIN to an assert.
8118         * search.c (get_base_distance_recursive): Likewise.
8119         (get_base_distance): Likewise.
8120         (lookup_member): Likewise.
8121         (convert_pointer_to_single_level): Likewise.
8122         (lookup_field): Likewise.  Lose setting TREE_VIA_* on TREE_LISTs.
8123         (lookup_fnfields): Likewise.
8124         * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
8125         (unshare_base_binfos): Don't call propagate_binfo_offsets.
8126         (layout_basetypes): Call propagate_binfo_offsets instead of
8127         unshare_base_binfos.
8128         * decl.c (xref_basetypes): Call unshare_base_binfos.
8129         * pt.c (instantiate_class_template): Likewise.
8130         * tree.c (reverse_path): Remove 'copy' parm; always make a
8131         temporary copy.
8132         * class.c (build_vbase_path): Just call it.
8133         * search.c (compute_access): Likewise.  Don't re-reverse.
8134
8135 1998-08-27  Mark Mitchell  <mark@markmitchell.com>
8136
8137         * class.c (build_vbase_path): Use reverse_path.
8138         (finish_base_struct): Move warnings for inaccessible bases to
8139         layout_basetypes.
8140         (modify_one_vtable): Remove check of TREE_USED (binfo).
8141         (fixup_vtable_deltas1): Likewise.
8142         * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
8143         (xref_tag): Remove binfos parameter.
8144         (make_binfo): Remove chain parameter.
8145         (reverse_path): Add copy parameter.
8146         * decl.c (init_decl_processing): Change calls to xref_tag.
8147         (xref_tag): Remove binfos parameter.
8148         (xref_basetypes): Change calls to make_binfo.
8149         * decl2.c (grok_x_components): Change calls to xref_tag.
8150         (handle_class_head): Likewise.
8151         * friend.c (do_friend): Likewise.
8152         * lex.c (make_lang_type): Change calls to make_binfo.
8153         * parse.y (structsp): Change calls to xref_tag.
8154         (named_complex_class_head_sans_basetype): Likewise.
8155         (named_class_head): Likewise.
8156         * rtti.c (init_rtti_processing): Likewise.
8157         * search.c (compute_access): Change calls to reverse_path.
8158         (dfs_get_vbase_types): Change calls to make_binfo.
8159         (get_vbase_types): Remove dead code.
8160         * tree.c (unshare_base_binfos): Change calls to make_binfo.
8161         (layout_basetypes): Warn here about inaccessible bases.
8162         (make_binfo): Remove chain parameter.
8163         (reverse_path): Add copy parameter.
8164
8165 1998-08-27  Jason Merrill  <jason@yorick.cygnus.com>
8166
8167         * class.c: #if 0 complete_type_p.
8168         * init.c (build_java_class_ref, build_new_1): Remove unused locals.
8169         * method.c (process_overload_item): Likewise.
8170         * typeck.c (comp_target_types): Likewise.
8171
8172         Stop sharing binfos for indirect virtual bases.
8173         * tree.c (propagate_binfo_offsets): Unshare vbases, too.
8174         (layout_basetypes): Likewise.
8175         (unshare_base_binfos): Copy vbases, too.
8176         * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
8177         BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
8178         (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
8179         CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
8180         * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
8181         reference to BINFO_VIA_PUBLIC.
8182         (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
8183         (push_class_decls): Use them.
8184         (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
8185         (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
8186
8187 1998-08-27  Mark Mitchell  <mark@markmitchell.com>
8188
8189         * decl.c (build_enumerator): Set DECL_CONTEXT for the
8190         CONST_DECLs.
8191
8192 1998-08-26  Mark Mitchell  <mark@markmitchell.com>
8193
8194         * cp-tree.h (finish_enum): Change prototype.
8195         * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
8196         VALUES parameter.  Don't try to compute mins/maxs if
8197         processing_template_decl.
8198         * parse.y (structsp): Use new calling sequence for finish_enum.
8199         * pt.c (tsubst_enum): Likewise.  Take the new type as input.
8200         (lookup_template_class): Remove unused variables.  Tweak.
8201         Register enums on instantiation list before substituting
8202         enumeration constants.
8203         (tsubst_decl): Remove unused variables.
8204         (regenerate_decl_from_template): Likewise.
8205
8206         * decl.c (duplicate_decls): Don't obliterate the
8207         DECL_TEMPLATE_INFO for a template if we're not replacing it with
8208         anything.
8209
8210         * lex.c (do_identifier): Fix typo in comment.
8211
8212 Wed Aug 26 10:54:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
8213
8214         * errfn.c: Remove stdarg.h/varargs.h.
8215         * tree.c: Likewise.
8216
8217 1998-08-25  Brendan Kehoe  <brendan@cygnus.com>
8218
8219         * pt.c (tsubst_copy): Only do typename overloading on an
8220         IDENTIFIER_NODE that happens to look like a typename if it actually
8221         has a type for us to use.
8222
8223 1998-08-25  Jason Merrill  <jason@yorick.cygnus.com>
8224
8225         * typeck.c (comp_cv_target_types): Split out...
8226         (comp_target_types): From here.  Don't allow cv-qual changes under
8227         a pointer if nptrs == 0.  Fix OFFSET_TYPE handling.
8228         (build_ptrmemfunc): Pass 1 to nptrs.
8229         * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
8230
8231 1998-08-25  Mark Mitchell  <mark@markmitchell.com>
8232
8233         * search.c (dependent_base_p): Don't compare a binfo to
8234         current_class_type; use the TREE_TYPE of the binfo instead.
8235
8236         * cp-tree.h (CLASS_TYPE_P): Revise definition.
8237
8238 1998-08-25  Jason Merrill  <jason@yorick.cygnus.com>
8239
8240         * decl.c (duplicate_decls): Don't complain about different
8241         exceptions from an internal decl even if pedantic.
8242
8243         * typeck.c (convert_for_assignment): Converting from pm of vbase
8244         to derived is an error, not a sorry.
8245
8246         * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
8247         * class.c (fixed_type_or_null): Rename from
8248         resolves_to_fixed_type_p.  Return the dynamic type of the
8249         expression, if fixed, or null.
8250         (resolves_to_fixed_type_p): Use it.  Return 0 if the dynamic type
8251         does not match the static type.
8252         (build_vbase_path): Rename 'alias_this' to 'nonnull'.  Use
8253         resolves_to_fixed_type_p again.
8254
8255 1998-08-24  Mark Mitchell  <mark@markmitchell.com>
8256
8257         * pt.c (tsubst_decl): Move special case code for dealing with
8258         tricky friend templates here from ...
8259         (regenerate_decl_from_template): Here.
8260
8261 1998-08-24  Jason Merrill  <jason@yorick.cygnus.com>
8262
8263         * decl.c (start_decl): Remove redundant linkage check.
8264
8265 1998-08-24  Gavin Romig-Koch  <gavin@cygnus.com>
8266
8267         * typeck.c (c_expand_return): Handle the case that valtype
8268         is wider than the functions return type.
8269
8270 1998-08-24  Mark Mitchell  <mark@markmitchell.com>
8271
8272         * cp-tree.h (CLASS_TYPE_P): New macro.
8273         * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
8274         * pt.c (process_template_parm): Undo previous change.
8275
8276 1998-08-24  Benjamin Kosnik  <bkoz@cygnus.com>
8277
8278         * cp-tree.h: Declare.
8279         * pt.c (decl_template_parm_p): New function.
8280         * decl.c (pushdecl): Check decls for redeclaring template parms.
8281         (xref_tag): Make redeclaration an error, print decl.
8282         * decl2.c (grokfield): Check field_decls for redeclaration as well.
8283
8284 1998-08-24  Jason Merrill  <jason@yorick.cygnus.com>
8285
8286         * parse.y (primary): Fix up the type of string constants.
8287
8288 1998-08-24  Mark Mitchell  <mark@markmitchell.com>
8289
8290         * typeck.c (convert_for_initialization): Move check for odd uses
8291         of NULL to avoid duplicate warnings.
8292
8293 1998-08-24  Jason Merrill  <jason@yorick.cygnus.com>
8294
8295         * tree.c (lvalue_type): Fix for arrays.
8296         * typeck.c (string_conv_p): New fn.
8297         (convert_for_assignment): Use it.
8298         (build_unary_op): Use lvalue_type.
8299         * call.c (standard_conversion, convert_like): Use string_conv_p.
8300         (add_function_candidate): Use lvalue_type.
8301         * cvt.c (convert_to_reference): Likewise.
8302         * decl2.c (lang_decode_option): Ignore -traditional.
8303         * decl.c (init_decl_processing): flag_writable_strings inhibits
8304         flag_const_strings.
8305
8306 1998-08-24  Andrew MacLeod  <amacleod@cygnus.com>
8307
8308         * lang-options.h (lang_options): Add fconst-strings to the list
8309         of valid options.
8310         * decl2.c (lang_f_options, lang_decode_option): Likewise.
8311
8312 1998-08-24  Nathan Sidwell  <nathan@acm.org>
8313
8314         * lex.c (real_yylex): Don't warn about long long constants if
8315         we're allowing long long.
8316
8317 1998-08-24  Martin von Löwis  <loewis@informatik.hu-berlin.de>
8318
8319         * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
8320         accessing bindings directly.
8321
8322         * search.c (my_tree_cons): Reimplement.
8323
8324         * lang-specs.h: Remove __HONOR_STD.
8325         * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
8326
8327 1998-08-23  Mark Mitchell  <mark@markmitchell.com>
8328
8329         * decl.c (grokdeclarator): Complain about in-class initialization
8330         of aggregates and/or references.
8331         * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
8332         TEMPLATE_TYPE_PARMs.
8333
8334         * decl2.c (grok_array_decl): Add comment.
8335         (mark_used): Don't instantiate an explicit instantiation.
8336         * friend.c (make_friend_class): Remove bogus comment.  Fix check
8337         for partial specializations.
8338         * pt.c (check_explicit_specialization): Don't
8339         SET_DECL_EXPLICIT_INSTANTIATION here.
8340         (mark_decl_instantiated): Or here.
8341         (do_decl_instantiation): Do it here, instead.  Add checks for
8342         duplicate explicit instantiations, etc.  Tidy.
8343         (do_type_instantiation): Likewise.
8344         (instantiate_decl): Improve comments.  Complain about explicit
8345         instantiations where no definition is available.
8346
8347         * cp-tree.h (ansi_null_node): Remove.
8348         * call.c (build_over_call): Warn about converting NULL to an
8349         arithmetic type.
8350         * cvt.c (build_expr_type_conversion): Likewise.  Use
8351         null_ptr_cst_p instead of expanding it inline.
8352         * decl.c (ansi_null_node): Remove.
8353         (init_decl_processing): Make null_node always have integral type.
8354         * except.c (build_throw): Warn about converting NULL to an
8355         arithmetic type.
8356         * lex.c (init_parse): Remove handling of ansi_null_node.
8357         * pt.c (type_unification_real): Don't convert NULL to void* type.
8358         * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
8359         (convert_for_assignment): Warn about converting NULL to an
8360         arithmetic type.
8361         (convert_for_initialization): Likewise.
8362
8363 1998-08-20  Jason Merrill  <jason@yorick.cygnus.com>
8364
8365         * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
8366         * pt.c (coerce_template_parms): Use no_linkage_check.
8367         * decl.c (grokvardecl): Likewise.
8368         (grokfndecl): Likewise.  Members of anonymous types have no linkage.
8369
8370         * method.c (process_overload_item): Remove useless code.
8371
8372 1998-08-20  Per Bothner  <bothner@cygnus.com>
8373
8374         Handle new'ing of Java classes.
8375         * init.c (build_class_classref):  New function.
8376         (build_new_1):  If type is TYPE_FOR_JAVA:  Call _Jv_AllocObject;
8377         constructor does not return this;  don't need to exception-protect.
8378
8379         * pt.c (lookup_template_class):  Copy TYPE_FOR_JAVA flag.
8380         * decl2.c (acceptable_java_type):  Handle template-derived types.
8381
8382 1998-08-20  Per Bothner  <bothner@cygnus.com>
8383
8384         * decl2.c (import_export_vtable):  Suppress vtables for Java classes.
8385
8386 1998-08-20  Mark Mitchell  <mark@markmitchell.com>
8387
8388         * decl.c (duplicate_decls): Always merge the old and new patterns
8389         for templates, regardless of whether or not the new one has
8390         DECL_INITIAL.  Don't throw away specializations.  Merge
8391         DECL_SAVED_TREE.
8392         * pt.c (tsubst_decl): Use the right pattern when calculating the
8393         complete args for a new template instance.
8394         (do_decl_instantiation): Fix typo in comment.
8395         (regenerate_decl_from_template): Deal with tricky friend template
8396         case.
8397         (instantiate_decl): Likewise.
8398
8399 Thu Aug 20 09:09:45 1998  Jeffrey A Law  (law@cygnus.com)
8400
8401         * init.c (build_builtin_delete_call): Add missing assemble_external
8402         call.
8403
8404 1998-08-20  Jason Merrill  <jason@yorick.cygnus.com>
8405
8406         * parse.y (notype_unqualified_id): Also accept ~A<int>.
8407
8408 1998-08-19  Mark Mitchell  <mark@markmitchell.com>
8409
8410         * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
8411         arithmetic.
8412         * except.c (build_throw): Warn when NULL is thrown, even with
8413         -ansi.  Use ansi_null_node, rather than integer_zero_node, in the
8414         thrown expression.
8415
8416         * cp-tree.h (ansi_null_node): New variable.
8417         * decl.c (ansi_null_node): New variable.
8418         (init_decl_processing): Initialize its type.
8419         * lex.c (init_parse): Initialize its value.  Use ansi_null_node
8420         for null_node in non-ANSI mode.
8421         * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
8422         place of null_node to avoid spurious errors.
8423
8424 1998-08-17  Mark Mitchell  <mark@markmitchell.com>
8425
8426         * cp-tree.h (enter_scope_of): New function.
8427         * parse.y (complex_direct_notype_declarator): Use it.
8428         * semantics.c (enter_scope_of): New function.
8429
8430 1998-08-17  Jason Merrill  <jason@yorick.cygnus.com>
8431
8432         * decl.c (grokparms): No, here.
8433
8434         * decl.c (grokdeclarator): Catch parm with pointer to array of
8435         unknown bound here...
8436         * method.c (process_overload_item): ...not here.
8437
8438         * gxxint.texi: Remove obsolete documentation of overloading code.
8439
8440         * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
8441         * class.c (finish_struct_bits): Likewise.
8442
8443         * tree.c (lvalue_type): Fix for arrays.
8444         * typeck.c (build_unary_op): Use lvalue_type.
8445         * call.c (add_function_candidate): Likewise.
8446         * cvt.c (convert_to_reference): Likewise.
8447
8448         * decl2.c (lang_decode_option): Ignore -traditional.
8449
8450         * init.c (build_offset_ref): Don't mess with error_mark_node.
8451         * lex.c (do_scoped_id): Use cp_error.
8452
8453         * rtti.c (get_tinfo_fn): Don't mess with the context for now.
8454
8455 1998-08-17  Benjamin Kosnik  <bkoz@loony.cygnus.com>
8456
8457         * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
8458
8459 Mon Aug 17 10:40:18 1998  Jeffrey A Law  (law@cygnus.com)
8460
8461         * cp-tree.h (set_identifier_local_value): Provide prototype.
8462
8463         * decl2.c (do_namespace_alias): Remove unused variables `binding'
8464         and `old'.
8465
8466 Fri Aug 14 16:42:27 1998  Nick Clifton  <nickc@cygnus.com>
8467
8468         * Makefile.in: Rename BBISON to BISON so that it can be properly
8469         inherited from the parent makefile.
8470
8471 1998-08-13  Jason Merrill  <jason@yorick.cygnus.com>
8472
8473         * lang-options.h: Add -finit-priority.
8474         * decl2.c: Likewise.  Check flag_init_priority instead of
8475         USE_INIT_PRIORITY.
8476
8477         * decl2.c (setup_initp): New fn.
8478         (start_objects, finish_objects, do_ctors): Handle init_priority.
8479         (do_dtors, finish_file): Likewise.
8480
8481 1998-08-13  Jason Merrill  <jason@yorick.cygnus.com>
8482
8483         * pt.c (tsubst_copy): Hush warning.
8484
8485         * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
8486
8487 1998-08-12  Mark Mitchell  <mark@markmitchell.com>
8488
8489         * pt.c (print_template_context): Don't abort when instantiating a
8490         synthesized method.
8491
8492         * decl.c (grokdeclarator): Issue errors on namespace qualified
8493         declarators in parameter lists or in class scope.
8494
8495 1998-08-09  Mark Mitchell  <mark@markmitchell.com>
8496
8497         * pt.c (check_explicit_specialization): Don't abort on bogus
8498         explicit instantiations.
8499
8500 1998-08-07  Mark Mitchell  <mark@markmitchell.com>
8501
8502         * typeck.c (require_complete_type): Use complete_type_or_else.
8503         (complete_type_or_else): Always return NULL_TREE on failure, as
8504         documented.
8505
8506         * pt.c (tsubst_aggr_type): Prototype.
8507         (tsubst_decl): New function, split out from tsubst.  Set
8508         input_filename and lineno as appropriate.
8509         (pop_tinst_level): Restore the file and line number saved in
8510         push_tinst_level.
8511         (instantiate_class_template): Set input_filename and lineno as
8512         appropriate.
8513         (tsubst): Move _DECL processing to tsubst_decl.  Make sure the
8514         context for a TYPENAME_TYPE is complete.
8515
8516         * decl2.c (grokbitfield): Issue errors on bitfields declared with
8517         function type.
8518         (do_dtors): As in do_ctors, pretend to be a member of the same
8519         class as a static data member while generating a call to its
8520         destructor.
8521
8522         * cvt.c (cp_convert_to_pointer): Handle NULL pointer
8523         conversions, even in complex virtual base class hierarchies.
8524
8525 1998-08-06  Mark Mitchell  <mark@markmitchell.com>
8526
8527         * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
8528         (TYPE_TEMPLATE_INFO): Likewise.
8529         (SET_TYPE_TEMPLATE_INFO): Likewise.
8530         (ENUM_TI_TEMPLATE): Likewise.
8531         (ENUM_TI_ARGS): Likewise.
8532         (lookup_nested_type_by_name): Remove.
8533         * decl.c (maybe_process_template_type_declaration): Handle enums.
8534         (start_enum): Don't check for primary-template enum declarations
8535         here.
8536         (finish_enum): Clean up, document.  Make sure template enum
8537         constants get the correct type.
8538         (build_enumerator): Copy initializers for template enumerations,
8539         too.
8540         (grok_enum_decls): Document.
8541         * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
8542         better.  Build LOOKUP_EXPRs for local variables, even if they are
8543         TREE_PERMANENT.
8544         * pt.c (tsubst_enum): Remove field_chain parameter.
8545         (template_class_depth): Include the depth of surrounding function
8546         contexts.
8547         (push_template_decl): Check for primary-template enum declarations
8548         here.  Deal with enumeration templates.
8549         (lookup_template_class): Likewise.
8550         (for_each_template_parm): Likewise.
8551         (instantiate_class_template): Don't call tsubst_enum directly,
8552         call tsubst instead, to instantiate enums.  Deal with all
8553         field_chain issues here, not in tsubst_enum.
8554         (lookup_nested_type_by_name): Remove.
8555         (tsubst_aggr_type): Revise handling of enumeration types.
8556         (tsubst): Likewise.
8557         (tsubst_copy): Likewise.
8558         (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
8559
8560 1998-08-04  Mark Mitchell  <mark@markmitchell.com>
8561
8562         * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
8563         uses template parameters.
8564         * method.c (build_template_parm_names): Use the full set of
8565         template arguments for tsubst'ing.
8566         (build_overload_identifier): Pass the full set of template
8567         arguments to build_template_parm_names, not just the
8568         innermost_args.
8569         * pt.c (TMPL_ARGS_DEPTH): Define using
8570         TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
8571         (NUM_TMPL_ARGS): New macro.
8572         (add_outermost_template_args): Deal with the case where the outer
8573         args will be completely discarded.
8574         (coerce_template_parms): Use the full set of template arguments
8575         for tsubst'ing.  Simplify.  Add some asserts.  Improve
8576         error messages.
8577         (lookup_template_class): Pass the full set of template arguments
8578         to coerce_template_parms.
8579         (tsubst): Add assertion.
8580         (do_type_instantiation): Don't instantiate member template
8581         classes.
8582
8583         * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
8584         name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
8585
8586 1998-08-03  Jason Merrill  <jason@yorick.cygnus.com>
8587
8588         * method.c (set_mangled_name_for_decl): Change return type to void.
8589
8590         * decl.c (lookup_name_real): A namespace-level decl takes priority
8591         over implicit typename.  Avoid doing the same lookup twice.
8592
8593         * search.c (dependent_base_p): New fn.
8594         (dfs_pushdecls, dfs_compress_decls): Use it.
8595
8596         * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
8597         virtual functions if the type doesn't have any.
8598
8599 1998-08-03  Mark Mitchell  <mark@markmitchell.com>
8600
8601         * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
8602         uses template parameters.
8603
8604 1998-08-02  Mark Mitchell  <mark@markmitchell.com>
8605
8606         * cp-tree.def (LOOKUP_EXPR): Document.  Remove second argument.
8607         * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
8608         * lex.c (do_identifier): Don't use a second argument, or a type,
8609         when building LOOKUP_EXPRs.
8610         (do_identifier): Likewise.
8611         (do_scoped_id): Likewise.
8612         * method.c (hack_identifier): Improve error message.
8613         * pt.c (lookup_template_function): Don't needlessly call
8614         copy_to_permanent or build_min.
8615         (tsubst_copy): Remove #if 0'd code.  tsubst into LOOKUP_EXPRs if
8616         necessary.
8617         (do_decl_instantiation): Improve error message.
8618         * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
8619         (build_min): Copy the type to the permanent obstack, too.
8620
8621 1998-08-01  Jason Merrill  <jason@yorick.cygnus.com>
8622
8623         * init.c (init_init_processing): Remove BI* handling.
8624         (build_builtin_call): Remove.
8625         (build_builtin_delete_call): New fn.
8626         (build_delete): Use it.
8627
8628 1998-07-31  Mark Mitchell  <mark@markmitchell.com>
8629
8630         * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
8631         (maybe_check_template_type): New function.
8632         * decl.c (maybe_process_template_type_declaration): New function,
8633         split out from pushtag  Call maybe_check_template_type.
8634         (pushtag): Use it.  Use PROCESSING_REAL_TEMPLATE_DECL_P.
8635         (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
8636         * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
8637         * pt.c (template_class_depth_real): Generalization of ...
8638         (template_class_depth): Use it.
8639         (register_specialization): Use duplicate_decls for duplicate
8640         declarations of specializations.
8641         (maybe_check_template_type): New function.
8642         (push_template_decl_real): Fix comment.
8643         (convert_nontype_argument): Likewise.
8644         (lookup_template_class): Likewise.  Avoid an infinite loop on
8645         erroneous code.
8646         (tsubst_friend_function): Fix comment.
8647         (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
8648         an IDENTIFIER_NODE.
8649         * semantics.c (begin_function_definition): Use
8650         reset_specialization to note that template headers don't apply
8651         directly to declarations after the opening curly for a function.
8652
8653 1998-07-29  Jason Merrill  <jason@yorick.cygnus.com>
8654
8655         * decl.c (push_overloaded_decl): Use current_namespace instead of
8656         DECL_CONTEXT (decl) to determine where we go.
8657
8658         * decl.c (lookup_name_real): Fix typo.
8659
8660 1998-07-28  Mark Mitchell  <mark@markmitchell.com>
8661
8662         * friend.c (is_friend): Be lenient with member functions to deal
8663         with nested friends.
8664
8665 1998-07-28  Jason Merrill  <jason@yorick.cygnus.com>
8666
8667         * class.c (finish_struct_1): Convert integer_zero_node to
8668         ssizetype before passing it to set_rtti_entry.
8669         * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
8670         of any size to a pointer.
8671
8672 1998-07-27  Mark Mitchell  <mark@markmitchell.com>
8673
8674         * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
8675         (build_template_decl_overload): Remove.
8676         (set_mangled_name_for_decl): New function.
8677         (innermost_args): Remove is_spec parameter.
8678         (most_specialized, most_specialized_class): Remove declarations.
8679         (lookup_template_class): Add entering_scope parameter.
8680         (maybe_process_partial_specialization): New function.
8681         (finish_template_decl): Likewise.
8682         (finish_template_type): Likewise.
8683         * class.c (finish_struct): Clean up processing of member template
8684         specializations.
8685         * decl.c (pushtag): Fix formatting.
8686         (lookup_tag): Improve handling of pseudo-global levels.
8687         (make_typename_type): Adjust call to lookup_template_class.
8688         (shadow_tag): Use maybe_process_partial_specialization.
8689         (xref_tag): Improve handling of member friends.
8690         (start_function): Call push_nested_class before
8691         push_template_decl.  Don't call push_template_decl for
8692         specializations.
8693         * decl2.c (grok_x_components): Don't call xref_tag for
8694         template instantiations.  Handle UNION_TYPEs like RECORD_TYPEs.
8695         (grokclassfn): Use set_mangled_name_for_decl.
8696         (arg_assoc_class): Adjust call to innermost_args.
8697         (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
8698         * error.c (dump_function_name): Improve printing of template
8699         function names.
8700         * friend.c (is_friend): Don't compare types of decls to determine
8701         friendship, unless flag_guiding_decls.
8702         (make_friend_class): Partial specializations cannot be friends.
8703         (do_friend): Use set_mangled_name_for_decl.  Call
8704         push_template_decl_real instead of push_template_decl.
8705         * method.c (build_decl_overload_real): Remove prototype.  Give it
8706         external linkage.
8707         (build_overload_identififer): Adjust call to innermost_args.
8708         (build_template_decl_overload): Remove.
8709         (set_mangled_name_for_decl): New function.
8710         * parse.y (.finish_template_type): New non-terminal.
8711         (template_def): Use finish_template_decl.  Use template_extdef
8712         instead of extdef.
8713         (template_extdef, template_datadef): New non-terminals, containing
8714         only those rules for things which can be templates.
8715         (datadef): Tidy.
8716         (template_type, self_template_type): Use .finish_template_type.
8717         (named_class_head): Use maybe_process_partial_specialization.
8718         * pt.c (mangle_class_name_for_template): Remove context parameter.
8719         (get_class_bindings): Remove outer_args parameter.
8720         (complete_template_args): Remove.
8721         (add_outermost_template_args): New function.
8722         (register_specialization): Return the specialization.
8723         (unregister_specialization): New function.
8724         (tsubst_template_parms): Likewise.
8725         (most_specialized, most_specialized_class): Prototype here as
8726         static.
8727         (original_template): Rename to most_general_template.
8728         (tsubst_template_parms): New function.
8729         (set_mangled_name_for_template_decl): Likewise.
8730         (TMPL_ARGS_DEPTH): New macro.
8731         (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
8732         (TMPL_ARGS_LEVEL): New macro.
8733         (SET_TMPL_ARGS_LEVEL): Likewise.
8734         (TMPL_ARG): Likewise.
8735         (SET_TMPL_ARG): Likewise.
8736         (TMPL_ARGS_DEPTH): Likewise.
8737         (finish_member_template_decl): Use finish_template_decl.
8738         (maybe_process_partial_specialization): New function, split out
8739         from tsubst.
8740         (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
8741         (maybe_begin_member_template_processing): Use new macros.
8742         (is_member_template): Likewise.
8743         (is_member_template_class): Likewise.
8744         (add_to_template_args): Likewise.  Deal with multiple levels of
8745         args.
8746         (maybe_process_partial_specialization): New function.
8747         (retrieve_specialization): Add consistency check.
8748         (determine_specialization): Return full argument list.
8749         (check_explicit_specialization): Tweak friend handling.  Use full
8750         argument lists.  Simplify.
8751         (current_template_args): Use new macros.
8752         (push_template_decl_real): Change ill-named mainargs to specargs.
8753         Check that a partial specialization actually specializes at least
8754         one parameter.   Improve friend handling.  Modify for full
8755         template arguments.
8756         (classtype_mangled_name): Don't mangle the names of
8757         specializations.
8758         (lookup_template_class): Add entering_scope parameter.  Use it to
8759         avoid finding a template type when an instantiation is required.
8760         Simplify.  Use full template arguments.
8761         (tsubst_friend_function): Use unregister_specialization.  Use new
8762         macros.  Use full template arguments.
8763         (tsubst_friend_class): Substitute, using tsubst_template_parms,
8764         into the template parameters before passing them to
8765         redeclare_class_template.
8766         (instantiate_class_template): Simplify.  Use full template
8767         arguments.  Adjust calls to get_class_bindings.  Use
8768         SET_IDENTIFIER_TYPE_VALUE where needed.  Improve friend handling.
8769         (innermost_args): Use new macros.
8770         (tsubst_aggr_type): New function, split out from tsubst.
8771         (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
8772         conventions for lookup_template_class.  Refine handling of partial
8773         instantiations.   Remove calls to complete_template_args.
8774         Simplify.  Add consistency checks.  Use set_mangled_name_for_decl
8775         and set_mangled_name_for_template_decl.
8776         (tsubst_copy): Use tsubst_aggr_type.
8777         (instantiate_template): Use full template arguments.
8778         (more_specialized): Improve formatting.
8779         (more_specialized_class): Adjust calls to get_class_bindings.
8780         (get_bindings_real): Don't call complete_template_args.
8781         (most_specialized): Don't overwrite input; create a new list.
8782         (most_specialized_class): Use most_general_template.
8783         (regenerate_decl_from_template): Use unregister_specialization.
8784         Use full template arguments.
8785         (instantiate_decl): Use full template arguments.
8786         (set_mangled_name_for_template_decl): New function.
8787         * semantics.c (begin_class_definition): Use
8788         maybe_process_partial_specialization.
8789         (finish_member_class_template): New function.
8790         (finish_template_decl): Likewise.
8791         (finish_template_type): Likewise.
8792         (typeck.c): Don't crash after issuing a compiler_error.
8793         * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
8794
8795 1998-07-27  Jason Merrill  <jason@yorick.cygnus.com>
8796
8797         * typeck2.c (build_functional_cast): Handle default-initialization.
8798
8799         * call.c (build_over_call): Pass 1 to popclass.
8800
8801         * parse.y (direct_notype_declarator): Add precedence declaration
8802         to notype_unqualified_id case.
8803         * Makefile.in (EXPECT): Adjust.
8804
8805         * tree.c (ovl_member): Fix for single function in OVL.
8806
8807 1998-07-27  Dave Brolley  <brolley@cygnus.com>
8808
8809         * c-lex.c (yylex): Fix boundary conditions in character literal and
8810         string literal loops.
8811
8812 1998-07-24  Jason Merrill  <jason@yorick.cygnus.com>
8813
8814         * decl.c (lookup_name_real): OK, do return the from_obj value
8815         unless got_object depends on template parms.
8816
8817         * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
8818
8819         * pt.c (coerce_template_parms): Also complain about local enums.
8820
8821         * cp-tree.h: Add prototype for set_identifier_local_value.
8822         * decl.c (set_identifier_local_value_with_scope): Make static,
8823         prototype.
8824         * search.c (covariant_return_p): Likewise.
8825         * except.c (build_terminate_handler, alloc_eh_object): Likewise.
8826
8827         * call.c (build_method_call): Only pull out the type of a destructor
8828         if it's a template type parm.
8829         * decl.c (lookup_name_real): Never return the from_obj value.
8830
8831 1998-07-23  Jason Merrill  <jason@yorick.cygnus.com>
8832
8833         * except.c (process_start_catch_block_old): Call start_decl_1 for
8834         catch parm.
8835         * decl.c (start_decl_1): Avoid duplicate error.
8836
8837         * init.c (expand_default_init): Only perform the initialization if
8838         it will do something.
8839
8840 1998-07-23  H.J. Lu  (hjl@gnu.org)
8841
8842         * parse.y (base_class): Check for invalid base class.
8843
8844 1998-07-23  Jason Merrill  <jason@yorick.cygnus.com>
8845
8846         * decl2.c (import_export_template): Fold in...
8847         (import_export_class): ...to here.  Handle dllimport/export.
8848
8849         * class.c (build_vtable): Pass at_eof to import_export_vtable.
8850         (prepare_fresh_vtable): Likewise.
8851         * decl2.c (import_export_class): Split out...
8852         (finish_prevtable_vardecl): From here.
8853         * class.c (finish_struct_1): Call import_export_class if at_eof.
8854
8855         * decl.c (start_function): #if 0 mysterious code I wrote and have
8856         forgotten why.
8857         * rtti.c (get_tinfo_fn): If this is for a class type, set
8858         DECL_CONTEXT.
8859
8860 1998-07-22  Jason Merrill  <jason@yorick.cygnus.com>
8861
8862         * inc/exception: Change terminate and unexpected to ().
8863
8864         * parse.y (named_class_head_sans_basetype_defn): A
8865         named_class_head_sans_basetype followed by '{' or ':' is a defn.
8866
8867 1998-07-21  Jason Merrill  <jason@yorick.cygnus.com>
8868
8869         * tree.c (canonical_type_variant): New fn to handle arrays.
8870         * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
8871         * pt.c (unify, default case): Also fold arg.  Fix array bounds case.
8872         * method.c (process_overload_item): Use build_overload_value for
8873         arrays.
8874
8875 1998-07-20  Dave Brolley  <brolley@cygnus.com>
8876
8877         * lex.c (mbchar.h): #include it.
8878         (GET_ENVIRONMENT): New macro.
8879         (init_parse): Set character set based on LANG environment variable.
8880         (real_yylex): Handle multibyte characters in character literals.
8881         (real_yylex): Handle multibyte characters in string literals.
8882
8883 1998-07-19  Jason Merrill  <jason@yorick.cygnus.com>
8884
8885         * lex.c (do_identifier): Look for class value even if we don't
8886         have a global value.  Do implicit declaration if parsing is 2.
8887         * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
8888         lookup.
8889
8890 1998-07-19  Mark Mitchell  <mark@markmitchell.com>
8891
8892         * decl.c (pushtag): Revert previous change.
8893         * pt.c (lookup_template_class): Don't put out debugging
8894         information for types that use template parameters.
8895
8896         * decl.c (pushtag): Don't put out debugging information for
8897         compiler-generated typedefs.
8898
8899         * error.c (dump_type_real): Don't crash when presented with
8900         intQI_type_node or the like.
8901
8902         * semantics.c (finish_translation_unit): Fix spelling error in
8903         comment.
8904
8905 1998-07-17  Jason Merrill  <jason@yorick.cygnus.com>
8906
8907         * decl.c (lookup_name_real): Pull out single function here.
8908         (select_decl): Not here.
8909         (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
8910
8911         * decl.c (qualify_lookup): Tweak again.
8912
8913         * pt.c (lookup_template_class): Don't mess with the context of the
8914         instantiation.
8915         * decl2.c (current_decl_namespace): Remove special handling for
8916         templates.
8917
8918         * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
8919         a member template specialization.
8920
8921         * tree.c (ovl_member): Use decls_match to compare functions.
8922         * decl.c (decls_match): Check the context of a function.
8923
8924         * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
8925         in Koenig lookup support rules.
8926         * semantics.c (finish_call_expr): Handle the new cases.
8927
8928         * typeck.c (build_x_function_call): Handle overloaded methods.
8929
8930         * decl.c (grokvardecl): Don't call build_static_name for extern "C".
8931
8932 1998-07-16  Mark Mitchell  <mark@markmitchell.com>
8933
8934         * semantics.c (finish_object_call_expr): Revert previous change.
8935         * call.c (build_new_method_call): Likewise.  Instead, convert
8936         TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
8937
8938 1998-07-16  Jason Merrill  <jason@yorick.cygnus.com>
8939
8940         * decl.c (qualify_lookup): Handle templates.
8941
8942         * decl2.c (do_using_directive): Don't pass ancestor.
8943         * decl.c (push_using_directive): Calculate ancestor.
8944
8945         * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
8946         * decl.c (pushdecl): Move type shadowing handling from here...
8947         (duplicate_decls): ...to here.
8948         * decl.c (set_identifier_local_value_with_scope): New fn.
8949         (pushdecl): Use it.
8950         (set_identifier_local_value, lookup_type_current_level): New fns.
8951         * decl2.c (do_local_using_decl): Handle types and binding level
8952         stuff properly.
8953
8954         * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
8955         * decl.c (select_decl): Extract a lone function from an OVERLOAD.
8956         (lookup_namespace_name): Likewise.
8957         * typeck.c (build_unary_op): Not here anymore.
8958
8959         * decl2.c (do_class_using_decl): Make sure we get an identifier.
8960         * class.c (handle_using_decl): Ignore TYPE_DECLs.
8961
8962         * decl.c (qualify_lookup): New fn.
8963         (lookup_name_real): Use it.
8964
8965 1998-07-16  Martin v. Loewis  <loewis@informatik.hu-berlin.de>
8966
8967         * decl2.c (add_using_namespace): When directly using a namespace
8968         that was indirect before, promote it.
8969
8970         * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
8971         LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
8972         LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
8973         * decl.c (select_decl): Replace two flag parameters by one.
8974         (unqualified_namespace_lookup): Likewise, pass flag.
8975         (lookup_flags): New function.
8976         (lookup_name_real): Compute flags, pass them.
8977         (lookup_namespace_name): Call with zero-flag.
8978         * decl2.c (ambiguous_decl): Add flag parameter, complain only
8979         according to flags.
8980         (lookup_using_namespace, qualified_lookup_using_namespace):
8981         Add flag parameter, pass them through.
8982         * lex.c (do_scoped_id): Call with zero-flag.
8983
8984 1998-07-16  Jason Merrill  <jason@yorick.cygnus.com>
8985
8986         * typeck.c (convert_for_assignment): Use comptypes.
8987
8988 1998-07-16  Mark Mitchell  <mark@markmitchell.com>
8989
8990         * semantics.c (finish_object_call_expr): Move test for the
8991         function called being a TYPE_DECL to ...
8992         * call.c (build_new_method_call): Here.
8993
8994 1998-07-15  Jason Merrill  <jason@yorick.cygnus.com>
8995
8996         * decl2.c (arg_assoc_class): Also look at template arguments, if any.
8997         (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
8998
8999         * lex.c (looking_for_typename): Don't initialize.
9000
9001         * decl2.c (ambiguous_decl): Clarify error message.
9002
9003         * decl.c (push_using_directive): Iterate over namespaces used
9004         indirectly.
9005
9006 1998-07-15  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
9007
9008         * decl2.c (add_using_namespace): Iterate over namespaces used
9009         indirectly.
9010
9011         * decl.c (lookup_name_real): Accept namespace aliases as locals.
9012         (cat_namespace_levels): Ignore aliases.
9013         (duplicate_decls): Ignore duplicate aliases.
9014         * decl2.c (do_namespace_alias): Process block level namespace
9015         aliases.  Store alias with pushdecl.  Remove odr errors.
9016         * parse.y (namespace_alias): New non-terminal.
9017         (extdef): Use it.
9018
9019 1998-07-15  Jason Merrill  <jason@yorick.cygnus.com>
9020
9021         * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
9022         Handle TEMPLATE_TYPE_PARM.
9023         (arg_assoc): Rewrite.
9024
9025         * pt.c (complete_template_args): Don't look at the context unless
9026         we have to.
9027
9028         * method.c (build_decl_overload_real): Fix namespace handling.
9029
9030         * typeck.c (build_unary_op): Extract a lone function from an
9031         OVERLOAD.
9032
9033         * call.c (build_scoped_method_call): Handle getting a namespace
9034         for basetype in a destructor call.
9035         (check_dtor_name): Handle enums.
9036
9037         * parse.y (using_directive): New nonterminal.
9038         (extdef, simple_stmt): Use it.
9039
9040 1998-07-14  Martin von Löwis  <loewis@informatik.hu-berlin.de>
9041
9042         * decl2.c (add_function): Move error message ...
9043         (arg_assoc_namespace): ... from here.
9044
9045 1998-07-14  Jason Merrill  <jason@yorick.cygnus.com>
9046
9047         * parse.y (namespace_qualifier): Fix multiple level handling.
9048         * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
9049         (arg_assoc): Don't skip the first argument of a function.
9050
9051 Tue Jul 14 20:09:22 1998  Jeffrey A Law  (law@cygnus.com)
9052
9053         * search.c (my_tree_cons): Clean up.
9054
9055 1998-07-14  Jason Merrill  <jason@yorick.cygnus.com>
9056
9057         * call.c (joust): Don't warn about "confusing" conversions to the
9058         same type.
9059
9060 1998-07-14  Martin von Löwis  <loewis@informatik.hu-berlin.de>
9061
9062         * class.c (push_nested_class): Complain about namespaces.
9063         * decl.c (start_decl): Enter the object's namespace.
9064         (cp_finish_decl): Leave it.
9065         (grokdeclarator): Likewise.
9066         * decl2.c (check_decl_namespace): New function.
9067         (finish_file): Call it.
9068         * parse.y (complex_direct_notype_declarator): Set complexity
9069         of namespace-qualified ids to -1, enter the namespace.
9070
9071         * method.c (build_template_decl_overload): Expect _DECL as first
9072         parameter.  Put context temporarily into current_namespace.
9073         * pt.c (check_explicit_specialization): Change caller.
9074         (tsubst): Likewise.
9075
9076         * init.c (build_offset_ref): Call mark_used and
9077         convert_from_reference for namespace members.
9078
9079 Mon Jul 13 23:25:28 1998  Martin von Löwis  <loewis@informatik.hu-berlin.de>
9080
9081         * search.c (my_tree_cons): The bitfield is at index 2.
9082
9083 Mon Jul 13 17:21:01 1998  Nick Clifton  <nickc@cygnus.com>
9084
9085         * lang-options.h: Format changed to work with new --help support
9086         in gcc/toplev.c
9087
9088 1998-07-12  Martin von Löwis  <loewis@informatik.hu-berlin.de>
9089
9090         * decl2.c (build_expr_from_tree): Change calls of do_identifier.
9091         Do Koenig lookup in CALL_EXPR.
9092         (arg_assoc): Handle error_mark.
9093         * lex.c (is_global): New function.
9094         (do_identifier): Expect arguments for Koenig lookup.
9095         * parse.y (primary): Add rules for calls of unqualified function calls.
9096         (do_id): Change call of do_identifier.
9097         * pt.c (finish_stmt_expr): Likewise.
9098         * semantics.c (finish_id_expr): Likewise.
9099         (finish_call_expr): Add integer parameter to indicate
9100         argument-dependent lookup.
9101
9102         * decl.c (struct binding_level): New field using_directives.
9103         (push_using_decl): Not sorry anymore.
9104         (push_using_directive): New function.
9105         (lookup_tag): Use CP_DECL_CONTEXT to iterate.
9106         (unqualified_namespace_lookup): New function, code from ...
9107         (lookup_name_real): ... here.
9108         * decl2.c (lookup_using_namespace): Pass using list instead of
9109         initial scope.
9110         (validate_nonmember_using_decl): New function.
9111         (do_nonmember_using_decl): New function.
9112         (do_toplevel_using_decl): Use them.
9113         (do_local_using_decl): New function.
9114         (do_using_directive): Support block-level directives.
9115         * parse.y (simple_stmt): Support using declarations and
9116         directives.
9117         (namespace_qualifier, namespace_using_decl): New non-terminals.
9118
9119         * xref.c (classname): New function.
9120         (GNU_xref_hier): Change class and base parameters to tree.
9121         * decl.c (xref_baseypes): Change caller.
9122         * friend.c (make_friend_class): Likewise.
9123
9124 1998-07-12  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
9125
9126         * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
9127         comparison.
9128
9129         * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
9130         template template parameter, record its use.
9131         (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
9132         its template arguments if exists.
9133
9134         * pt.c (coerce_template_template_parms): New function equivalent
9135         to coerce_template_parms when IS_TMPL_PARM is true.
9136         (coerce_template_parms): Use it.  Remove the IS_TMPL_PARM parameter,
9137         all callers changed.
9138
9139         (coerce_template_parms): Access ARGLIST properly when creating a
9140         new vector.  Only accept implicit TYPE_DECL as valid argument for
9141         a template template parameter when it is a base class of
9142         current_class_type.  Don't display error message when COMPLAIN is
9143         false.
9144
9145 1998-07-12  Klaus Kaempf  (kkaempf@progis.de)
9146
9147         * repo.c (get_base_filename): Use file_name_nondirectory.
9148         (open_repo_file): Likewise.
9149         * cp-tree.h (file_name_nondirectory): Add prototype.
9150
9151 1998-07-12  Jason Merrill  <jason@yorick.cygnus.com>
9152
9153         * friend.c (do_friend): Pull the identifier out of declarator.
9154         Use cp_error and friends.
9155         * decl2.c (qualified_lookup_using_namespace): Fix call to
9156         purpose_member.
9157         * decl.c (lookup_name_real): Don't call complete_type on a namespace.
9158         (grokvardecl): Use DECL_CLASS_SCOPE_P.
9159         * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
9160         * class.c (warn_hidden): Fix for OVERLOAD.
9161         From grahams@rcp.co.uk:
9162         * cp-tree.h (DEFARG_NODE_CHECK): New macro.
9163         (DEFARG_LENGTH, DEFARG_POINTER): Use it.
9164
9165 Sun Jul 12 01:20:57 1998  Jeffrey A Law  (law@cygnus.com)
9166
9167         * g++.1 (-traditional): Remove duplicated documentation.
9168
9169 1998-07-11  Mark Mitchell  <mark@markmitchell.com>
9170
9171         * method.c (flush_repeats): Add nrepeats parameter.
9172         (issue_nrepeats): Likewise.
9173         (is_back_referenceable_type): New function.  Don't back-reference
9174         TEMPLATE_TYPE_PARMs as well as simple types like integers.
9175         (build_mangled_name_for_type): Likewise.
9176         (build_mangled_name_for_type_with_Gcode): Likewise.
9177         (lasttype): Remove.
9178         (nrepeats): Likewise.
9179         (Nrepeats): Likewise.
9180         (start_squangling): Don't clear the variables removed above.
9181         (end_squangling): Likewise.
9182         (flush_repeats): Tidy.  Use nrepeats parameter rather than
9183         Nrepeats global.
9184         (issue_nrepeats): Likewise, but with nrepeats global.  Use
9185         is_backreferenceable_type.
9186         (build_overload_nested_name): Tidy.  Add comment.  Use
9187         build_mangled_name_for_type.
9188         (build_underscore_int): Comment.
9189         (build_overload_scope_ref): Use build_mangled_name_for_type.
9190         (build_overload_int): Likewise.
9191         (build_template_template_parm_names): Tidy.
9192         (build_template_parm_names): Use build_mangled_name_for_type.
9193         (build_overload_identifier): Add comments.
9194         (build_mangled_name_for_type_with_Gcode): Split out from
9195         build_mangled_name.
9196         (build_mangled_name_for_type): Use it.
9197         (build_mangled_name): Rework to use build_mangled_name_for_type
9198         and to not use global nrepeats/Nrepeats.  Tidy.
9199         (process_modifiers): Tidy.
9200         (check_btype): Use is_backreferenceable_type.  Add comment.
9201         Rename `node' to `type'.
9202         (process_overload_item): Set numeric_output_need_bar here.
9203         Use build_mangled_name_for_type.  Tidy.
9204         (build_decl_overload_real): Tidy.  Don't use Nrepeats.  Use
9205         build_mangled_name_for_type.
9206
9207         * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
9208         for TYPE_DECLs.
9209
9210 1998-07-08  Vladimir N. Makarov  <vmakarov@cygnus.com>
9211
9212         * cp-tree.h (warn_long_long): Define.
9213         * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
9214         warning "ANSI C++ does not support `long long'".
9215         * decl2.c (warn_long_long): Define.
9216         (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
9217
9218 1998-07-07  Jason Merrill  <jason@yorick.cygnus.com>
9219
9220         * decl.c (xref_tag): Handle attributes between 'class' and name.
9221         * parse.y (aggr): Likewise.
9222         * semantics.c (finish_class_definition): Likewise.
9223         * Makefile.in (EXPECTED): Adjust.
9224
9225         * cp-tree.h: Declare flag_optional_diags and warn_multichar.
9226         * decl2.c: Define them.
9227         (lang_decode_option): Handle them.
9228         * lang-options.h: Add -foptional-diags.
9229         * class.c (finish_struct): Don't complain about multiple meanings of
9230         name if -fno-optional-diags.
9231         * decl.c (pushdecl_class_level): Likewise.
9232         * lex.c (real_yylex): Check warn_multichar.
9233
9234 1998-07-06  Jason Merrill  <jason@yorick.cygnus.com>
9235
9236         * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
9237
9238         * tree.c (make_binfo): Fix length.
9239
9240 1998-06-30  Benjamin Kosnik  <bkoz@bliss.nabi.net>
9241
9242         * decl2.c (lang_decode_option): Remove warn_template_debugging.
9243         * lang-options.h: Likewise.
9244
9245 Mon Jun 29 20:17:40 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9246
9247         * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
9248         (process_start_catch_block): Likewise for variables
9249         `false_label_rtx', `call_rtx' and `return_value_rtx'.
9250
9251 1998-06-29  Brendan Kehoe  <brendan@cygnus.com>
9252
9253         * tree.c (build_srcloc): Make sure we allocate this node on the
9254         permanent obstack.
9255
9256 Sat Jun 27 23:34:18 1998  Fred Fish  <fnf@ninemoons.com>
9257
9258         * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
9259         (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
9260         (lang_specific_driver): Only add -lm automatically if need_math is
9261         nonzero.
9262
9263 Sat Jun 27 12:22:56 1998  Jeffrey A Law  (law@cygnus.com)
9264
9265         * Make-lang.in (g++): Depend on mkstemp.o.  Link in mkstemp.o
9266
9267 Sat Jun 27 07:36:09 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9268
9269         * Makefile.in (EXPR_H): New dependency variable.
9270         (decl2.o): Depend on $(EXPR_H).
9271         (typeck.o): Likewise.
9272         (init.o): Likewise.
9273         (expr.o): Likewise.
9274
9275 1998-06-25  Benjamin Kosnik  <bkoz@lisa.cygnus.com>
9276
9277         * decl.c (start_enum): Put local enums on permanent_obstack.
9278
9279 1998-06-25  Mark Mitchell  <mark@markmitchell.com>
9280
9281         * cp-tree.h (c_get_alias_set): Declare.
9282         * decl.c (init_decl_processing): Set lang_get_alias_set.
9283
9284 1998-06-25  Andrew MacLeod  <amacleod@cygnus.com>
9285
9286         * cp-tree.h (mark_all_runtime_matches): Add function prototype.
9287         * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
9288         flag for all function decls which are in the exception table.
9289         * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
9290         * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
9291         code is emitted for any referenced rtti function.
9292
9293 1998-06-25  Dave Brolley  <brolley@cygnus.com>
9294
9295         * lang-specs.h: Use new | syntax to eliminate
9296         string concatenation.
9297
9298 1998-06-25  Jason Merrill  <jason@yorick.cygnus.com>
9299
9300         * cp-tree.h (CP_DECL_CONTEXT): New macro.
9301         * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
9302         * method.c (build_overload_nested_name): Likewise.
9303         * sig.c (build_signature_pointer_or_reference_type): Don't set
9304         DECL_CONTEXT.
9305
9306 1998-06-24  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
9307
9308         Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
9309         * cp-tree.h (FROB_CONTEXT): New macro.
9310         (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
9311         * decl.c (namespace_binding): Replace NULL_TREE with
9312         global_namespace.
9313         (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
9314         * decl2.c (is_namespace_ancestor, lookup_using_namespace):
9315         Likewise.
9316         * decl.c (pushtag): Use FROB_CONTEXT.
9317         (pushdecl, make_typename_type, define_function, grokdeclarator):
9318         Likewise.
9319         * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
9320         * pt.c (push_template_decl_real, lookup_template_class, tsubst):
9321         Likewise.
9322         * decl2.c (decl_namespace): Return global_namespace if no context.
9323         * method.c (build_overload_nested_name): Expect null as context.
9324         * pt.c (mangle_class_name_for_template): Do nothing for null
9325         contexts.
9326         (lookup_template_class): Allow for null id_context.
9327
9328 1998-06-25  Richard Henderson  <rth@cygnus.com>
9329
9330         * method.c (emit_thunk): Set current_function_is_thunk for the
9331         ASM_OUTPUT_MI_THUNK case as well.
9332
9333 1998-06-23  Andrew MacLeod  <amacleod@cygnus.com>
9334
9335         * exception.cc (__cplus_type_matcher): Get a match_info pointer
9336         instead of an exception table entry as a parameter.
9337
9338 1998-06-23  Andrew MacLeod  <amacleod@cygnus.com>
9339
9340         * parse.y (function_try_block): Don't call start_catch_handler.
9341         * except.c (call_eh_info): Remove coerced field from declaration.
9342         (build_eh_type_type_ref): New function to create an address of a
9343         rtti function for the new style exception tables.
9344         (expand_start_catch_block): Split function, this contains the
9345         common part.
9346         (process_start_catch_block_old): New function to perform the rest
9347         of expand_start_catch_block under old style exceptions.
9348         (process_start_catch_block_old): New function to perform the rest
9349         of expand_start_catch_block under new style exceptions.
9350         (expand_end_catch_block): Only pop the false label off the stack under
9351         the old style of exceptions.
9352         * semantics.c (finish_try_block): Don't call start_catch_handler.
9353         * exception.cc (struct cp_eh_info): Add original_value field.
9354         (__cplus_type_matcher): Perform type matching on the original exception
9355         value, and if we have a match, set the current value.
9356         (__cp_push_exception): Set the original exception value.
9357
9358 1998-06-23  Jason Merrill  <jason@yorick.cygnus.com>
9359
9360         * call.c (joust): Fix confusing conversion warning.
9361
9362         * call.c (build_op_delete_call): Add placement parm.  Check
9363         LOOKUP_SPECULATIVELY.
9364         * cp-tree.h, decl2.c, init.c: Adjust.
9365         * decl.c (finish_function): Use it.
9366
9367         * pt.c (tsubst): Diagnose creating void fields or variables.
9368
9369 Mon Jun 22 08:50:26 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9370
9371         * call.c (build_scoped_method_call): Remove unused variable `tmp'.
9372
9373         * cp-tree.h (check_dtor_name): Add prototype.
9374
9375         * init.c (expand_member_init): Remove unused variables
9376         `ptr_type_node', `parm' and `rval'.
9377
9378         * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
9379         in call to fprintf.
9380         (lang_print_xnode): Likewise.
9381
9382         * typeck2.c (enum_name_string): Cast argument to sprintf to long
9383         and use %ld specifier.
9384
9385         * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
9386         specifier in call to fprintf.
9387         (GNU_xref_member): Cast argument to sprintf to int.
9388
9389 Fri Jun 19 23:22:42 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
9390
9391         * typeck2.c (pop_init_level): Warn about implicit zero initialization
9392         of struct members.
9393
9394 Thu Jun 18 09:32:32 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9395
9396         * cp-tree.h: Prototype function `check_java_method'.
9397
9398 1998-06-17  Jason Merrill  <jason@yorick.cygnus.com>
9399
9400         * class.c (finish_struct): Make conflicting use of id a pedwarn.
9401         * decl.c (pushdecl_class_level): Likewise.
9402
9403 1998-06-17  Mark Mitchell  <mark@markmitchell.com>
9404
9405         * pt.c (convert_nontype_argument): Issue an error when presented
9406         with an integer (real) constant that cannot be simplified to an
9407         INT_CST (REAL_CST).
9408
9409         * cp-tree.h (c_get_alias_set): Remove declaration added in
9410         1998-06-13 change that should never have been checked in.
9411
9412 1998-06-17  Jason Merrill  <jason@yorick.cygnus.com>
9413
9414         * typeck.c (build_binary_op_nodefault): Change % in format strings
9415         to %%.
9416
9417         * decl.c (grokvardecl): Don't build_static_name for decls that
9418         aren't at namespace scope.
9419
9420         * init.c (perform_member_init): Catch default-initialization of
9421         references.
9422
9423 1998-06-17  Mark Mitchell  <mark@markmitchell.com>
9424
9425         * errfn.c (cp_thing): Handle the `%%' formatting sequence.
9426
9427 1998-06-17  Jason Merrill  <jason@yorick.cygnus.com>
9428
9429         * method.c (hack_identifier): Complain about getting a namespace
9430         or class template.
9431         * typeck.c (decay_conversion): Remove check for namespaces.
9432         * typeck2.c (incomplete_type_error): Likewise.
9433         * parse.y (template_arg): Add PTYPENAME expansion.
9434
9435 1998-06-16  Andrew MacLeod  <amacleod@cygnus.com>
9436
9437         * decl.c (grokvardecl): Don't build external assembler names for
9438         TYPENAMEs in other namespaces as there is no declarator.
9439         * error.c (cp_file_of, cp_line_of): Don't extract file or line number
9440         info from DECL_CONTEXT if it is NULL.
9441
9442 1998-06-16  Jason Merrill  <jason@yorick.cygnus.com>
9443
9444         * call.c (check_dtor_name): Split out.
9445         (build_scoped_method_call): Use it.
9446         (build_method_call): Use it.
9447         * init.c (build_offset_ref): Use it.
9448
9449         * typeck.c (build_static_cast): Fix handling of pointers to members.
9450
9451         * decl.c (finish_function): Just return nothing from a constructor.
9452         * typeck.c (c_expand_return): Complain about returning a void
9453         expression from a destructor.
9454
9455 1998-06-13  Mark Mitchell  <mark@markmitchell.com>
9456
9457         * class.c (alter_access): Accept a BINFO explaining how to get
9458         from the entity whose accessed is being altered to the type doing
9459         the altering.
9460         (handle_using_decl): New function containing code split out from ...
9461         (finish_struct_1): Here.
9462
9463         * cp-tree.h (complete_type_or_else): Declare.
9464         * init.c (build_new_1, build_delete): Use it.
9465         * typeck.c (require_complete_type): Use complete_type, rather than
9466         expanding it inline.
9467         (complete_type_or_else): New function.
9468         (build_component_ref): Use it.
9469         (pointer_int_sum): Make sure the type pointed to is complete.
9470         (pointer_diff): Likewise.
9471
9472         * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
9473         types.
9474
9475         * search.c (get_matching_virtual): Note that member templates
9476         cannot override virtual functions.
9477
9478 1998-06-12  Brendan Kehoe  <brendan@cygnus.com>
9479
9480         * pt.c (check_explicit_specialization): If DECLARATOR turned into
9481         an error_mark_node from lookup_template_function, return the same.
9482         (determine_specialization): Also make sure TEMPLATE_ID isn't an
9483         error_mark_node, before we try to read its operands.
9484         * decl.c (grokdeclarator): If we got an error_mark_node from
9485         check_explicit_specialization, just return it right back.
9486
9487 1998-06-12  Mark Mitchell  <mark@markmitchell.com>
9488
9489         * class.c (instantiate_type): Don't treat template-ids that don't
9490         specify any template arguments as equivalent to ordinary
9491         identifiers.  Use OFFSET_REF instead of SCOPE_REF to refer to
9492         pointer-to-members for member templates.  Tidy slightly.
9493         * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
9494         * init.c (build_offset_ref): Handle template-ids like ordinary
9495         identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
9496         offset part of the OFFSET_REF.
9497         * typeck.c (build_unary_op): Change check for unknown types to
9498         look for OFFSET_REFs, not SCOPE_REFs.
9499
9500 1998-06-11  Mark Mitchell  <mark@markmitchell.com>
9501
9502         * pt.c (is_member_template_class): New function.
9503         (push_template_decl_real): Use it.
9504
9505 1998-06-11  Benjamin Kosnik  <bkoz@elmo.cygnus.com>
9506
9507         * friend.c (do_friend): Add support for nested classes using
9508         member functions of the enclosing class as friends.
9509
9510 1998-06-10  Mark Mitchell  <mark@markmitchell.com>
9511
9512         * call.c (convert_default_arg): Make global, not static.
9513         (convert_arg_for_ellipsis): Split out from ...
9514         (build_over_call): Here.
9515         * cp-tree.h (convert_default_arg); Declare.
9516         (convert_arg_to_ellipsis): Likewise.
9517         (do_member_init): Remove.
9518         * init.c (do_member_init): Remove; this code is dead.
9519         (expand_member_init): Remove much of this code; it is dead.
9520         * typeck.c (convert_arguments): Use convert_default_arg and
9521         convert_arg_for_ellipsis, rather than duplicating here.
9522
9523         * call.c (convert_like): Don't fail silently if
9524         build_user_type_conversion fails.  Always return error_mark_node
9525         for failure.
9526
9527 1998-06-10  Jason Merrill  <jason@yorick.cygnus.com>
9528
9529         * search.c (covariant_return_p): Complain about ambiguous base.
9530
9531         * typeck.c (build_component_ref): Diagnose ref to nested type.
9532
9533 1998-06-10  Brendan Kehoe  <brendan@cygnus.com>
9534
9535         * decl.c (grokparms): Check that INIT isn't an error_mark_node
9536         before giving error about invalid type for default arg.
9537
9538 1998-06-10  Jason Merrill  <jason@yorick.cygnus.com>
9539
9540         * call.c (build_method_call): Fix thinko.
9541
9542 1998-06-10  Dave Brolley  <brolley@cygnus.com>
9543
9544         * decl2.c (lang_decode_option): New argc/argv interface.
9545         * cp-tree.h (lang_decode_option): New argc/argv interface.
9546         * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
9547         specified for cpplib-enabled compilers.
9548         * lex.c (lang_init): Don't check_newline for cpplib.
9549         (init_parse): Don't initialize cpplib here.
9550
9551 1998-06-10  Brendan Kehoe  <brendan@cygnus.com>
9552
9553         * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
9554         piece before checking DECL_MUTABLE_P.
9555
9556 1998-06-10  John Carr  <jfc@mit.edu>
9557
9558         * tree.c (debug_binfo): Make printf format match arguments.
9559
9560         * error.c (OB_PUTI): Make printf format match arguments.
9561
9562 1998-06-10  Jason Merrill  <jason@yorick.cygnus.com>
9563
9564         * init.c (perform_member_init): Handle default-initialization.
9565
9566         * except.c (build_throw): Handle throwing NULL.
9567
9568         * typeck.c (build_x_function_call): Use resolve_offset_ref.
9569
9570         * search.c (compute_access): Only strip an anonymous union
9571         for a FIELD_DECL.
9572
9573         * call.c (add_builtin_candidates): Tweak.
9574
9575         * cvt.c (build_expr_type_conversion): Restore code for conversion
9576         from class types.
9577         * decl2.c (delete_sanity): Use it.  Clean up.
9578
9579         * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
9580
9581 1998-06-10  Branko Cibej  <branko.cibej@hermes.si>
9582
9583         * typeck.c (c_expand_return): Don't warn about void expressions on
9584         return statements in functions returning void.
9585
9586 1998-06-09  Mark Mitchell  <mark@markmitchell.com>
9587
9588         * pt.c (fn_type_unification): Revise documentation.  Tidy.
9589         (type_unification): Likewise.
9590
9591 1998-06-09  Andrew MacLeod  <amacleod@cygnus.com>
9592
9593         * semantics.c (finish_try_block): Rename expand_start_catch, and delete
9594         expand_end_catch.
9595         * parse.y (function_try_block): Rename expand_start_catch, and delete
9596         expand_end_catch.
9597         * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
9598         expand_end_catch.
9599
9600 1998-06-09  Jason Merrill  <jason@yorick.cygnus.com>
9601
9602         * search.c (lookup_member): New fn.
9603         * class.c (finish_struct_1): Use it.
9604         * decl.c (lookup_name_real): Use it.
9605
9606 Mon Jun  8 20:45:52 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9607
9608         * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
9609
9610         * cp-tree.h: Add prototype for `maybe_print_template_context' and
9611         `maybe_make_one_only'.
9612
9613         * decl.c (auto_function): Remove unused variable `decl'.
9614
9615         * decl2.c: Include dwarf2out.h and dwarfout.h.
9616
9617         * lex.c: Remove redundant declarations of `set_float_handler' and
9618         `asm_out_file'.
9619
9620 1998-06-08  Andrew MacLeod  <amacleod@cygnus.com>
9621
9622         * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
9623         time flag.  Call __cp_eh_info instead of __cp_exception_info.
9624         * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
9625         (__cp_exception_info): Return offset into cp_eh_info structure to
9626         match what use to be the start of this structure.
9627         (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
9628         (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
9629         compile time flag.
9630         (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
9631         __cp_eh_info instead of __cp_exception_info.
9632
9633 1998-06-08  Jason Merrill  <jason@yorick.cygnus.com>
9634
9635         * decl.c (cp_finish_decl): Disable inlining of extern inlines
9636         with static variables.
9637
9638 1998-06-08  Mark Mitchell  <mark@markmitchell.com>
9639
9640         * init.c (build_offset_ref): Correct previous change to use build,
9641         not build_min.
9642
9643 1998-06-07  Mark Mitchell  <mark@markmitchell.com>
9644
9645         * class.c (instantiate_type): Handle pointer-to-members where the
9646         member is a template.
9647         * init.c (build_offset_ref): Likewise.
9648         * typeck.c (build_unary_op): Likewise.
9649
9650 1998-06-07  Richard Henderson  <rth@cygnus.com>
9651
9652         * lex.c (lang_init_options): New function.
9653         (lang_init): Remove flag_exceptions == 2 hack.
9654
9655 1998-06-05  Jason Merrill  <jason@yorick.cygnus.com>
9656
9657         * search.c (envelope_add_decl): Tweak for implicit typename.
9658
9659         * call.c (joust): Also warn about confusing conversion op/constructor
9660         overload resolution.
9661
9662         * spew.c (yylex): Also return the TYPE_DECL if got_object.
9663         Don't clear got_object after '~'.
9664         * call.c (build_scoped_method_call): Tweak destructor handling.
9665         (build_method_call): Likewise.
9666         * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
9667         TYPE_MAIN_VARIANT for destructors.
9668         * semantics.c (finish_object_call_expr): Complain about calling a
9669         TYPE_DECL.
9670
9671 1998-06-05  Per Bothner  <bothner@cygnus.com>
9672
9673         * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
9674         Define - update needed by gcc.c change.
9675
9676 1998-06-05  Jason Merrill  <jason@yorick.cygnus.com>
9677
9678         * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
9679
9680 1998-06-05  Martin v. Loewis  <loewis@informatik.hu-berlin.de>
9681
9682         * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
9683         * decl.c (lookup_name_real): Add namespaces_only parameter.
9684         If set, return only NAMESPACE_DECLs.
9685         (select_decl): Likewise.
9686         (identifier_type_value): Give additional parameter.
9687         (lookup_name_nonclass): Likewise.
9688         (lookup_name): Likewise.
9689         (find_binding): Skip namespace aliases.
9690         (binding_for_name): Likewise.
9691         (push_namespace): Check for namespace aliases.
9692         (lookup_name_namespace_only): New function.
9693         (begin_only_namespace_names, end_only_namespace_names): New functions.
9694         * decl2.c (set_decl_namespace): Skip namespace aliases.
9695         (do_using_directive): Likewise.
9696         (do_namespace_alias): Produce namespace aliases, fix alias
9697         redeclaration.
9698         * error.c (dump_decl): Support SCOPE_REF.
9699         * parse.y (extdef): Wrap lookup with namespace_only for namespace
9700         aliases and using declarations.
9701
9702 1998-06-04  Jason Merrill  <jason@yorick.cygnus.com>
9703
9704         * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
9705
9706         * error.c (dump_expr): Clean up NEW_EXPR case.
9707
9708 1998-06-04  Martin von Löwis  <loewis@informatik.hu-berlin.de>
9709
9710         Suggested by Brendan Kehoe
9711         * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
9712         treat it as using ::decl.
9713
9714         * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
9715
9716         * tree.c (mapcar): Support NEW_EXPR.
9717
9718         * error.c (dump_expr): Support NEW_EXPR.
9719
9720 1998-06-03  Jason Merrill  <jason@yorick.cygnus.com>
9721
9722         * method.c (make_thunk): Use overload machinery to make name.
9723         * search.c (covariant_return_p): New fn.
9724         (get_matching_virtual): Use it.
9725
9726         * init.c (build_new_1): Fix check for void.
9727
9728 1998-06-01  Per Bothner  <bothner@cygnus.com>
9729
9730         * cp-tree.h (TYPE_FOR_JAVA):  New macro.
9731         * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
9732         java_int_type_node, java_long_type_node, java_float_type_node,
9733         java_double_type_node, java_char_type_node, java_boolean_type_node):
9734         New "primitive" types, with predefined names __java_byte etc.
9735         (record_builtin_java_type):  New function.
9736         (init_decl_processing):  Make Java types with record_builtin_java_type.
9737         (pushtag, grokdeclarator):  Set TYPE_FOR_JAVA if in extern "JAVA".
9738         (xref_baseypes):  If base class was TYPE_FOR_JAVA, so is this class.
9739         (grokfndecl):  Call check_java_method for Java classes.
9740         * method.c (is_java_type):  Removed.  Replaced with TYPE_FOR_JAVA.
9741         (process_overload_item):  Match types against specific
9742         java_XX_type_node types, rather than using is_java_type.
9743         * class.c (finish_struct_1):  Don't add default copy constructor
9744         or operator= if TYPE_FOR_JAVA.
9745         (pop_lang_conext):  Restore strict_prototyp proper if Java.
9746         * decl2.c (acceptable_java_type, check_java_method):  New functions.
9747         * pt.c (instantiate_class_template):  Copy TYPE_FOR_JAVA from pattern.
9748         (tsubst):  Move common statement after if statement.
9749         * typeck.c (comptypes):  If strict, TYPE_FOR_JAVA must match.
9750
9751 1998-06-01  Jason Merrill  <jason@yorick.cygnus.com>
9752
9753         * pt.c (for_each_template_parm): Use first_rtl_op.
9754
9755         * tree.c (build_cplus_array_type_1): Also check index_type for
9756         template parms.
9757
9758 1998-05-31  Jason Merrill  <jason@yorick.cygnus.com>
9759
9760         * pt.c (tsubst): Always copy BINFO_BASETYPES.
9761
9762 1998-05-29  scott snyder  <snyder@d0sgif.fnal.gov>
9763
9764         * tree.c (layout_basetypes): If we change TYPE_SIZE, change
9765         TYPE_SIZE_UNIT too.
9766
9767 1998-05-29  Mark Mitchell  <mark@markmitchell.com>
9768
9769         * decl.c (grokdeclarator): Don't complain about in-class
9770         initialization of static consts if we don't really know the type
9771         of the variable.
9772
9773 1998-05-29  Jason Merrill  <jason@yorick.cygnus.com>
9774
9775         * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
9776         * method.c (build_destructor_name): New fn.
9777         * decl2.c (maybe_retrofit_in_chrg): Split out...
9778         (grokclassfn): From here.  Reorganize.
9779         * decl.c (grok_ctor_properties): Make sure ctors for types with
9780         vbases have the in_chrg parm.
9781         * pt.c (instantiate_class_template): Update
9782         TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases.  Don't call
9783         grok_*_properties.
9784         (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
9785
9786 1998-05-28  Mark Mitchell  <mark@markmitchell.com>
9787
9788         * pt.c (instantiate_decl): Make test for whether or not static
9789         variables should be instantiated early match its comment.
9790
9791 1998-05-28  Jason Merrill  <jason@yorick.cygnus.com>
9792
9793         * decl.c (start_decl): Always pedwarn about vacuously redeclaring
9794         a member.
9795         (start_function): Call check_default_args.
9796         * decl2.c (grokfield): Don't call check_default_args.
9797         (check_default_args): Use cp_error_at.
9798         * lex.c (do_pending_defargs): Call check_default_args.
9799
9800 1998-05-27  Brendan Kehoe  <brendan@cygnus.com>
9801
9802         * call.c (build_method_call): Make sure get_type_value returns
9803         something before we try to use its TYPE_MAIN_VARIANT.
9804         (build_scoped_method_call): Likewise.
9805
9806 1998-05-27  Jason Merrill  <jason@yorick.cygnus.com>
9807
9808         * typeck2.c (digest_init): Complain about getting a TREE_LIST to
9809         initialize an array.
9810
9811         * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
9812         DECL_VIRTUAL_P.
9813
9814         * friend.c (do_friend): Clarify template warning.
9815
9816 1998-05-27  Mark Mitchell  <mark@markmitchell.com>
9817
9818         * decl.c (shadow_label): Don't treat decls as identifiers.
9819         (maybe_push_to_top_level): Clear shadowed_labels.
9820
9821         * pt.c (instantiate_decl): Reset lineno and filename after calling
9822         regenerate_decl_from_template.
9823
9824         * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
9825         error_mark_node.
9826
9827 1998-05-27  Kevin Buhr  <buhr@stat.wisc.edu>
9828
9829         * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
9830
9831 1998-05-26  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
9832
9833         * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
9834         (convert_nontype_argument): Handle cases when nontype template
9835         parameters become classes after substitution.
9836
9837 1998-05-26  Mark Mitchell  <mark@markmitchell.com>
9838
9839         * friend.c (is_friend): Use comptypes, rather than == to compare
9840         types.  Modify for new representation of template friends.
9841         (make_friend_class): Likewise.
9842         * pt.c (tsubst_friend_class): Undo 1998-05-21 change.  Tweak.
9843         (instantiate_class_template): Deal with template friends.
9844
9845         * decl.c (store_parm_decls): Remove redundant call to
9846         expand_main_function.
9847
9848 1998-05-26  Benjamin Kosnik  <bkoz@loony.cygnus.com>
9849
9850         * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
9851         DECL_USE_TEMPLATE.
9852
9853 1998-05-26  Per Bothner  <bothner@cygnus.com>
9854
9855         * language_as_string:  Handle lang_java.
9856
9857 1998-05-26  Jason Merrill  <jason@yorick.cygnus.com>
9858
9859         * decl.c (pushdecl): Don't copy the type_decl.
9860
9861 1998-05-26  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
9862
9863         * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
9864         current_class_type.
9865         * decl.c (grokdeclarator): Put typedefs on the type's obstack.
9866
9867         * parse.y (complex_direct_notype_declarator): Use $1 to access
9868         scope of notype_qualified_id.
9869
9870 1998-05-26  Dave Brolley  <brolley@cygnus.com>
9871
9872         * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
9873         (init_parse): Initialize cpplib interface.
9874
9875         * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
9876         empty continuation.
9877
9878 1998-05-26  Mark Mitchell  <mark@markmitchell.com>
9879
9880         * decl.c (pushtag): Avoid crashing on erroneous input.
9881
9882 1998-05-25  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
9883
9884         * decl.c (push_namespace): Only produce one unique name for
9885         anonymous namespaces.
9886         (get_unique_name): Remove.
9887
9888 1998-05-25  Mark Mitchell  <mark@markmitchell.com>
9889
9890         * call.c (tourney): Don't do any extra comparisons.
9891
9892         * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
9893
9894         * cp-tree.h (processing_template_parmlist): Declare.
9895         * decl.c (pushtag): Don't call push_template_decl when we
9896         shouldn't.
9897         * pt.c (processing_template_parmlist): New variable.
9898         (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
9899         (complete_template_args): Use it.
9900         (add_to_template_args): Likewise.
9901         (innermost_args): Likewise.
9902         (tsubst): Likewise.
9903         (begin_template_parm_list): Use processing_template_parmlist.
9904         (end_template_parm_list): Likewise.
9905
9906         * cp-tree.h (ANON_UNION_TYPE_P): New macro.
9907         * decl.c (grokdeclarator): Use it.
9908         * decl2.c (grok_x_components): Likewise.
9909         * init.c (initializing_context): Likewise.
9910         * method.c (do_build_copy_constructor): Likewise.
9911         (do_build_assign_ref): Likewise.
9912         * search.c (compute_access): Likewise.
9913         * typeck.c (build_component_ref): Likewise.
9914
9915         * decl.c (grokdeclarator): Don't give a cv-qualified version of an
9916         unnamed type a typedef name "for linkage purposes".
9917
9918         * pt.c (lookup_template_class): Don't look at
9919         IDENTIFIER_CLASS_VALUE when there's no current_class_type.
9920
9921         * method.c (build_overload_int): Handle error cases gracefully.
9922
9923         * pt.c (instantiate_decl): Handle static member variables
9924         correctly.
9925
9926         * pt.c (tsubst): Use the tsubst'd type when producing new
9927         TEMPLATE_PARM_INDEX nodes.
9928
9929 1998-05-24  Mark Mitchell  <mark@markmitchell.com>
9930
9931         * tree.c (cp_tree_equal): Handle pointers to member functions.
9932
9933         * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs.  Make
9934         sure the type of the REF_BIND is a reference type.
9935         (maybe_handle_ref_bind, compare_ics): Rename reference_type to
9936         target_type for clarity.
9937
9938         * parse.y (xcond): Move call to condition_conversion ...
9939         * semantics.c (finish_for_cond): Here.
9940         * parse.c: Regenerated.
9941
9942 1998-05-24  Jason Merrill  <jason@yorick.cygnus.com>
9943
9944         * decl.c (push_namespace): Namespaces have type void.
9945         * typeck2.c (incomplete_type_error): Complain about namespace
9946         used as expression.
9947         * typeck.c (decay_conversion): Likewise.
9948
9949 1998-05-24  Martin von Löwis  <loewis@informatik.hu-berlin.de>
9950
9951         * error.c (dump_expr): Support namespaces.
9952
9953 1998-05-23  Jason Merrill  <jason@yorick.cygnus.com>
9954
9955         * cp-tree.def: Add SRCLOC.
9956         * cp-tree.h: Add struct tree_srcloc and accessor macros.
9957         * tree.c (build_srcloc, build_srcloc_here): New fns.
9958         * pt.c (add_pending_template): Use build_srcloc_here.
9959         (push_tinst_level): Update last_template_error_tick before erroring.
9960         (instantiate_decl): Restore lineno and input_filename before
9961         calling add_pending_template.
9962         * decl2.c (finish_file): Set up lineno and input_filename for
9963         pending templates.
9964
9965 1998-05-22  Jason Merrill  <jason@yorick.cygnus.com>
9966
9967         * decl.c (lang_print_error_function): New fn.
9968         (init_decl_processing): Set print_error_function to use it.
9969         * errfn.c (cp_thing): Don't call maybe_print_template_context here.
9970
9971         * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
9972         ICS_BAD_FLAG.
9973
9974         * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
9975         copy-initialization.
9976
9977         * class.c (build_vtable_entry): Use int_fits_type_p.
9978         (build_vtable): Pass a signed offset to build_vtable_entry.
9979         (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
9980         set_rtti_entry): Likewise.
9981
9982 1998-05-22  Per Bothner  <bothner@cygnus.com>
9983
9984         * cp-tree.h:  Add comments documenting which LANG_FLAGS are used.
9985         (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE):  Removed, not used.
9986
9987 1998-05-22  Jason Merrill  <jason@yorick.cygnus.com>
9988
9989         * pt.c (print_template_context): Use fprintf instead of cp_error.
9990
9991         * pt.c (determine_specialization): Just return an error_mark_node.
9992         Also print the decl we want in error messages.  If we complain,
9993         return error_mark_node.
9994         (tsubst_friend_function): Set lineno and input_filename so
9995         error messages will be useful.
9996         (instantiate_template): Just return an error_mark_node.
9997         (check_explicit_specialization): Don't mess with a returned
9998         error_mark_node.
9999
10000         * pt.c (print_template_context): Add new argument.
10001         (maybe_print_template_context): New fn.
10002         (push_tinst_level): Increment tinst_level_tick.
10003         (pop_tinst_level): Likewise.
10004         * errfn.c (cp_thing): Call maybe_print_template_context.  Use
10005         xrealloc instead of xmalloc.
10006
10007         * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
10008
10009 1998-05-21  Jason Merrill  <jason@yorick.cygnus.com>
10010
10011         * pt.c (tsubst_friend_class): Don't call redeclare_class_template
10012         if the template we looked up is the same as the one we already
10013         have.
10014
10015 Thu May 21 11:54:44 1998  Dave Brolley  <brolley@cygnus.com>
10016
10017         * lex.c: (handle_sysv_pragma): FILE* parameter not used.
10018         (cpp_reader,parse_in): Add for cpplib.
10019         (check_newline): Call handle_sysv_pragma with new interface.
10020         (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
10021
10022         * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
10023         (sub_getch): Call GETC for cpplib.
10024
10025         * cp-tree.h: (get_directive_line): Different prototype for cpplib.
10026         (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
10027
10028         * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib.
10029
10030 1998-05-21  Jason Merrill  <jason@yorick.cygnus.com>
10031
10032         * decl2.c (maybe_make_one_only): New fn.
10033         (import_export_vtable): Use it.
10034         (import_export_decl): Likewise.
10035         * pt.c (mark_decl_instantiated): Likewise.
10036
10037 1998-05-21  Mark Mitchell  <mmitchell@usa.net>
10038
10039         * decl2.c (find_representative_member): Rename to ...
10040         (build_anon_union_vars): New function.
10041         (finish_anon_union): Fix stupidity of previous change.
10042
10043 1998-05-20  Jason Merrill  <jason@yorick.cygnus.com>
10044
10045         * decl.c (grokfndecl): Handle definition of specialization in
10046         friend declaration.
10047
10048         * error.c (dump_decl): Fix LOOKUP_EXPR handling.
10049
10050 1998-05-20  Mark Mitchell  <mmitchell@usa.net>
10051
10052         * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
10053         to look for type declarations.
10054         (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
10055         * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
10056         (finish_member_class_template): Declare.
10057         * decl.c (pushtag): Put member class templates on the
10058         CLASSTYPE_TAGS list, just as for ordinary member classes.
10059         (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
10060         (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
10061         IDENTIFIER_NAMESPACE_VALUEs.
10062         * parse.y (component_decl): Move code to ...
10063         * semantics.c (finish_member_class_template): New function.
10064         Don't put member class templates on the list of components for a
10065         class.
10066         * parse.c: Regenerated.
10067         * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
10068         In fact, don't use DECL_CONTEXT at all here.
10069
10070 1998-05-20  Martin von Loewis  <loewis@informatik.hu-berlin.de>
10071
10072         * decl.c (record_unknown_type): New function.
10073         (init_decl_processing): Call it for the unknown and global type
10074         nodes.
10075
10076 1998-05-20  Mark Mitchell  <mmitchell@usa.net>
10077
10078         * decl2.c (find_representative_member): New function.
10079         (finish_anon_union): Use it.
10080
10081         * cp-tree.h (MAIN_NAME_P): New macro.
10082         (DECL_MAIN_P): Likwise.
10083         * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
10084         (grokfndecl): Use the new macros.
10085         (grokdeclarator): Likewise.
10086         (start_function): Likewise.
10087         (store_parm_decls): Likewise.
10088         (finsh_function): Likewise.
10089         * friend.c (do_friend): Likewise.
10090         * typeck.c (build_function_call_real): Likewise.
10091         (build_unary_op): Likewise.
10092
10093 Wed May 20 02:16:01 1998  Jason Merrill  <jason@yorick.cygnus.com>
10094
10095         * decl2.c (start_objects, finish_objects, do_dtors,
10096         do_ctors): Split out from...
10097         (finish_file): ...here.
10098
10099 Tue May 19 20:36:23 1998  Jason Merrill  <jason@yorick.cygnus.com>
10100
10101         * tree.c (is_overloaded_fn): Don't abort on placeholders from
10102         push_class_decls.
10103
10104 Tue May 19 15:16:22 1998  Brendan Kehoe  <brendan@cygnus.com>
10105
10106         * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
10107
10108         * error.c (dump_expr): Handle an ARROW_EXPR.
10109
10110 Tue May 19 15:13:39 1998  Mark Mitchell  <mmitchell@usa.net>
10111
10112         * decl.c (saveable_obstack): Declare.
10113         (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
10114         declare, if necessary.
10115
10116 Tue May 19 14:50:27 1998  Mark Mitchell  <mmitchell@usa.net>
10117
10118         * call.c (compare_qual): Remove.
10119         (is_subseq): Tweak.
10120         (is_properly_derived_from): New function.
10121         (maybe_handle_ref_bind): Likewise.
10122         (maybe_handle_implicit_object): Likewise.
10123         (compare_ics): Modify substantially to bring into conformance with
10124         the standard.
10125         * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
10126         (comp_cv_qualification): Declare.
10127         (comp_cv_qual_signature): Likewise.
10128         * typeck.c (comp_cv_qualification): Likewise.
10129         (comp_cv_qual_signature): Likewise.
10130
10131 Tue May 19 10:05:02 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
10132
10133         * Makefile.in (parse.o): Depend on toplev.h.
10134
10135         * class.c (typecode_p): Remove prototype and definition.
10136
10137         * cp-tree.h (currently_open_class, is_empty_class, member_p):
10138         Add prototype.
10139
10140         * decl.c (push_overloaded_decl_top_level): Remove prototype and
10141         definition.
10142
10143         * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
10144         in call to `cp_thing'.
10145         (cp_warning): Likewise for function pointer `warning'.
10146
10147         * except.c (do_function_call): Remove prototype and definition.
10148         (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
10149
10150         * method.c (is_java_type): Add prototype and make it static.
10151
10152         * parse.y: Include toplev.h.
10153
10154         * pt.c (type_unification): Remove unused variable `arg'.
10155         (instantiate_decl): Likewise for `save_ti'.
10156
10157         * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
10158
10159 Tue May 19 02:43:25 1998  Jason Merrill  <jason@yorick.cygnus.com>
10160
10161         * init.c (build_member_call): Handle template_ids.
10162         * parse.y (primary): Add global_scope template_id.
10163
10164 Mon May 18 23:22:52 1998  Jason Merrill  <jason@yorick.cygnus.com>
10165
10166         * decl2.c (get_sentry): Use end_temporary_allocation.
10167         Don't declare permanent_obstack.
10168
10169 Mon May 18 12:28:44 1998  Mark Mitchell  <mmitchell@usa.net>
10170
10171         * parse.y (.finish_new_placement): New non-terminal.
10172         (unary_expr, new_type_id): Use it.
10173         * parse.c: Regenerated.
10174
10175 Mon May 18 12:20:27 1998  Brendan Kehoe  <brendan@cygnus.com>
10176
10177         * pt.c (redeclare_class_template): Say where the original definition
10178         of the template-parameter's default argument appeared.
10179
10180 Mon May 18 03:00:57 1998  Jason Merrill  <jason@yorick.cygnus.com>
10181
10182         * call.c (build_over_call): Tweak empty class handling.
10183
10184         * decl.c (make_typename_type): Use currently_open_class.
10185
10186         * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
10187
10188 Mon May 18 01:43:01 1998  Martin v. Loewis  <loewis@informatik.hu-berlin.de>
10189
10190         * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
10191         for a type unless it is one.
10192
10193         * class.c (finish_struct_1): Use OVL_CURRENT in error message.
10194
10195 Mon May 18 01:24:08 1998  Jeffrey A Law  (law@cygnus.com)
10196
10197         * Makefile.in (program_transform_name, objdir): Define.
10198
10199         * Makefile.in (BISON): Use bison from the build tree if it exists.
10200         (FLEX): Likewise.
10201
10202 Sun May 17 14:52:08 1998  Martin v. Loewis  <loewis@informatik.hu-berlin.de>
10203
10204         * typeck.c (type_unknown_p): Return true for TREE_LIST also.
10205
10206         * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
10207
10208 Sun May 17 14:51:41 1998  Jason Merrill  <jason@yorick.cygnus.com>
10209
10210         * call.c (build_scoped_method_call): Likewise.
10211
10212 Sun May 17 13:53:48 1998  Mark Mitchell  <mmitchell@usa.net>
10213
10214         * init.c (build_new_1): Call suspend_momentary around the creation
10215         of values that must be saved for exception handling.
10216         * parse.y (.build_new_placement): New non-terminal.
10217         (unary_expr, new_placement): Use it.
10218         * parse.c: Regenerated.
10219
10220 Sun May 17 12:32:08 1998  Jason Merrill  <jason@yorick.cygnus.com>
10221
10222         * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
10223         old and new types.
10224
10225         * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
10226         canonical type.
10227
10228         * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
10229
10230 Fri May 15 20:28:00 1998  Jason Merrill  <jason@yorick.cygnus.com>
10231
10232         * decl.c (start_decl): Revert problem change.
10233
10234         * Makefile.in (CONFLICTS): Fix.
10235
10236 Fri May 15 15:34:02 1998  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
10237
10238         * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
10239
10240 Fri May 15 00:46:05 1998  Jason Merrill  <jason@yorick.cygnus.com>
10241
10242         * class.c (finish_struct_1): Use BINFO_SIZE.
10243
10244         * decl.c (start_decl): Use 'tem'.
10245
10246 Thu May 14 16:30:47 1998  Andrew MacLeod  <amacleod@cygnus.com>
10247
10248         * exception.cc: Include eh-common.h.
10249         (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL.
10250         (__cplus_type_matcher): First stab at new C++ runtime type matcher.
10251         (__cp_push_exception): Initialize eh_info struct as well.
10252         * except.c: Remove local structs and include eh-common.h.
10253         (init_exception_processing): Set language and version codes.
10254         (call_eh_info): Add presence of eh_info to runtime description of
10255         struct cp_eh_info.
10256         (expand_end_eh_spec): Call start_catch_block() and end_catch_block().
10257         * semantics.c (finish_try_block): Call start_catch_block() and
10258         end_catch_block().
10259         * parse.y (function_try_block): Call start_catch_block() and
10260         end_catch_block().
10261
10262 Thu May 14 12:27:34 1998  Brendan Kehoe  <brendan@cygnus.com>
10263
10264         * typeck.c (original_type): New function.
10265         (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
10266         to see if they're actually the same.
10267         * cp-tree.h (original_type): Declare.
10268
10269 Wed May 13 12:54:30 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
10270
10271         * Makefile.in (lex.o): Depend on output.h.
10272
10273         * call.c (add_function_candidate): Remove unused variable `cand'.
10274         (add_conv_candidate): Likewise.
10275         (build_builtin_candidate): Likewise.
10276
10277         * cp-tree.h: Add prototype for `types_overlap_p'.
10278
10279         * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
10280
10281         * decl2.c (merge_functions): Remove unused variables `tmp' and
10282         `tempn'.
10283
10284         * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
10285         (code_as_string): Likewise.
10286         (language_as_string): Likewise.
10287         (parm_as_string): Likewise.
10288         (op_as_string): Likewise.
10289         (assop_as_string): Likewise.
10290         (cv_as_string): Likewise.
10291
10292         * lex.c: Include output.h.
10293
10294         * pt.c (type_unification): Cast first argument of `bzero' to a char*.
10295
10296         * search.c (dfs_no_overlap_yet): Mark parameter `t' with
10297         ATTRIBUTE_UNUSED.
10298
10299         * tinfo.cc (__class_type_info::dcast): Change the type of variable
10300         `i' from int to size_t.
10301
10302         * typeck.c (language_lvalue_valid): Mark parameter `exp' with
10303         ATTRIBUTE_UNUSED.
10304
10305 Tue May 12 21:37:49 1998  Jason Merrill  <jason@yorick.cygnus.com>
10306
10307         * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
10308         DECL_NAMESPACE_SCOPE_P.
10309         (lang_decl_name): Likewise.
10310         * pt.c (tsubst_friend_function, tsubst): Likewise.
10311         * decl.c (pushdecl, redeclaration_error_message, start_decl,
10312         cp_finish_decl, start_function): Likewise.
10313         * class.c (finish_struct_1): Likewise.
10314         * call.c (build_over_call): Likewise.
10315         (compare_ics): Use DERIVED_FROM_P.
10316
10317 Tue May 12 07:24:18 1998  Mark Mitchell  <mmitchell@usa.net>
10318
10319         * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
10320         * method.c (build_mangled_name): Use it.
10321         (build_decl_overload_real): Likewise.
10322
10323         * error.c (dump_simple_decl): New function, broken out from ...
10324         (dump_decl): Use it.
10325
10326 Mon May 11 11:38:07 1998  Mark Mitchell  <mmitchell@usa.net>
10327
10328         * ptree.c (lang_print_xnode): Add missing `break'.
10329
10330         * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
10331
10332         * call.c (add_template_candidate): Adjust for changes to
10333         fn_type_unification.
10334         (add_template_candidate_real): Likewise.
10335         (add_template_conv_candidate): Likewise.
10336         (build_user_type_conversion_1): Likewise.
10337         (build_new_function_call): Likewise.
10338         (build_object_call): Likewise.
10339         (build_new_op): Likewise.
10340         (build_new_method_call): Likewise.
10341         * class.c (instantiate_type): Likewise.
10342         * cp-tree.h (unification_kind_t): New type.
10343         (fn_type_unification): Adjust prototype.
10344         (type_unificaiton): Likewise.
10345         * pt.c (UNIFY_ALLOW_NONE): New macro.
10346         (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
10347         (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
10348         (UNIFY_ALLOW_DERIVED): Likewise.
10349         (unify): Change prototype.
10350         (maybe_adjust_types_for_deduction): New function.
10351         (check_cv_quals_for_unify): Likewise.
10352         (determine_specialization): Adjust.
10353         (fn_type_unification): Likewise.
10354         (type_unification): Likewise.
10355         (type_unification_real): Likewise.  Use
10356         maybe_adjust_types_for_deduction.  Fix mishandling of
10357         back-unification of template functions passed as arguments.  Pass
10358         appropriate combination of UNIFY_ALLOW_* to unify.
10359         (unify): Remove unused NTPARMS parameter.  Use
10360         check_cv_quals_for_unify.  Remove bogus code that allowed
10361         too-generous unification in order to adhere more closely to standard.
10362         (get_bindings_real): Adjust.
10363         (get_class_bindings): Likewise.
10364
10365         * method.c (build_overload_identifier): Only use the innermost
10366         template arguments when mangling.
10367         * pt.c (tsubst_template_argument_vector): New function.
10368         (complete_template_args): Deal with the situation where the
10369         extra_args contain more than one level of arguments.
10370         (lookup_template_class): Deal with member template classes, which
10371         may have more than one level of arguments.
10372         (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
10373         Improve handling of member template classes.  Use
10374         DECL_PRIMARY_TEMPLATE instead of inline expansion.  Use
10375         tsubst_template_argument_vector where appropriate.
10376         (regenerate_decl_from_template): Break out from ...
10377         (instantiate_decl): Here.
10378
10379         * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
10380         * parse.h: Regenerated.
10381         * parse.c: Really regenerated.
10382
10383         * cp-tree.h (finish_unary_op_expr): New function.
10384         (finish_id_expr): Likewise.
10385         (begin_new_placement): Likewise.
10386         (finish_new_placement): Likewise.
10387         (finish_declarator): Likewise.
10388         (finish_translation_unit): Likewise.
10389         (finish_parmlist): Likewise.
10390         (begin_class_definition): Likewise.
10391         (finish_class_definition): Likewise.
10392         (finish_default_args): Likewise.
10393         (finish_inline_definitions): Likewise.
10394         * parse.y (GCC_ASM_KEYWORD): Remove.
10395         (TYPENAME_ELLIPSIS): Likewise.
10396         * parse.c: Regenerated.
10397         Use new functions in semantics.c in the actions for many rules.
10398         * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
10399         * hash.h: Regenerated.
10400         * semantics.c (finish_expr_stmt): Allow NULL expr.
10401         (finish_unary_op_expr): New function, containing
10402         code previously in parse.y.
10403         (finish_id_expr): Likewise.
10404         (begin_new_placement): Likewise.
10405         (finish_new_placement): Likewise.
10406         (finish_declarator): Likewise.
10407         (finish_translation_unit): Likewise.
10408         (finish_parmlist): Likewise.
10409         (begin_class_definition): Likewise.
10410         (finish_class_definition): Likewise.
10411         (finish_default_args): Likewise.
10412         (finish_inline_definitions): Likewise.
10413
10414 Sun May 10 23:43:13 1998  Mark Mitchell  <mmitchell@usa.net>
10415
10416         * typeck.c (build_c_cast): Don't decay arrays and functions to
10417         pointer type when converting to a class type.
10418
10419 Sun May 10 22:53:56 1998  Jason Merrill  <jason@yorick.cygnus.com>
10420
10421         * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
10422         (DECL_CLASS_SCOPE_P): Likewise.
10423
10424 Sun May 10 22:48:22 1998  H.J. Lu  (hjl@gnu.org)
10425
10426         * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
10427         * decl2.c (constructor_name_full): Likewise.
10428
10429 Sun May 10 22:48:12 1998  Mike Stump  <mrs@wrs.com>
10430
10431         * tree.c (mapcar): Add OVERLOAD support.
10432
10433         * init.c (resolve_offset_ref): We must use basetype_path before we
10434         destroy it with a call to convert_pointer_to.
10435
10436 Sat May  9 14:44:37 1998  Jason Merrill  <jason@yorick.cygnus.com>
10437
10438         * class.c (currently_open_class): New fn.
10439         * decl.c (lookup_name_real): Use it.
10440         * search.c (lookup_field): Likewise.
10441
10442 Fri May  8 23:32:42 1998  Martin von Loewis  <loewis@informatik.hu-berlin.de>
10443
10444         * cp-tree.def (OVERLOAD): New node.
10445         * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
10446         SET_IDENTIFIER_NAMESPACE_VALUE): Define.
10447         (NAMESPACE_BINDING): Remove.
10448         (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
10449         namespace_binding.
10450         (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
10451         Define.
10452         (tree_overload): New struct.
10453         (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
10454         (REAL_IDENTIFIER_TYPE_VALUE): Define.
10455         (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
10456         (lang_decl_flags): Remove in_namespace.
10457         (lang_decl): Remove chain.
10458         (DECL_CHAIN, DECL_NAMESPACE): Remove.
10459         (flag_honor_std): Declare extern.
10460         (identifier_type_value, pushdecl_namespace_level, push_using_decl,
10461         namespace_binding, set_namespace_binding,
10462         lookup_function_nonclass, cat_namespace_levels,
10463         set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
10464         scratch_ovl_cons, ovl_member, build_overload): Declare.
10465         (decl_list_length, get_namespace_id, current_namespace_id,
10466         overloaded_globals_p): Remove.
10467         (lookup_using_namespace, qualified_lookup_using_namespace): Change
10468         return type.
10469         (push_scratch_obstack): New macro.
10470         * call.c (add_function_candidate): Special-case type of OVERLOAD node.
10471         (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
10472         convs, fns.
10473         (build_new_function_call): Iterate using OVL_CHAIN.
10474         Print DECL_NAME in when reporting ambiguities.
10475         (build_object_call): Iterate using OVL_NEXT for fns, convs.
10476         (build_new_op): Call lookup_function_nonclass.
10477         Iterate using OVL_NEXT.
10478         (build_op_delete_call): Change detection of members.
10479         Do not wrap TREE_LIST around fields and single global functions.
10480         (build_over_call): Don't push a class level if the context is a
10481         namespace.
10482         (build_new_method_call): Iterate using OVL_NEXT.
10483         * class.c (add_method): Chain overloaded members using
10484         build_overload.  Remove copying of method.
10485         (grow_method): When iterating through the obstack, expect OVERLOAD
10486         nodes.  Chain overload members.
10487         (finish_struct_methods): Chain overload members.  Unpack OVERLOAD
10488         nodes in call to get_baselinks.
10489         (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
10490         (finish_struct_1): Iterate over ctor using OVL_NEXT.  Handle
10491         fdecls that are OVERLOAD nodes.
10492         (validate_lhs): New function.
10493         (instantiate_type): Do not copy OVERLOAD nodes.  Remove dead
10494         code.  Use DECL_NAME in error messages.  Split code between global
10495         and member function processing.
10496         * decl.c (global_type_node): New static variable.
10497         (in_std): New global.
10498         (struct binding_level): New field usings.
10499         (resume_binding_level): Assert that we are not in a class.
10500         (toplevel_bindings_p): Just check for namespace_p or
10501         pseudo_global.
10502         (resume_level): Remove.
10503         (find_binding): New function.
10504         (binding_for_name): Call it.
10505         (namespace_binding, set_namespace_binding): New functions.
10506         (push_namespace): Associate binding level with new namespace,
10507         resume_binding_level for existing namespace.  Remove old code.
10508         Fake std by counting.
10509         (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
10510         (maybe_push_to_top_level): Save current namespace.
10511         (pop_from_top_level): Restore saved namespace.
10512         (pop_namespace): Call suspend_binding_level.  Remove old code.
10513         (cat_namespace_levels): New function.
10514         (set_identifier_type_value_with_scope): For namespace bindings,
10515         set BINDING_TYPE, and use global_type_node.
10516         Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
10517         (identifier_type_value): New function.
10518         (pushtag): If no context, use current_namespace.
10519         (duplicate_decls): Don't process DECL_CHAIN.
10520         (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
10521         already set.  Never reset it to NULL_TREE.  Lookup global variables
10522         in their namespace.  Push overloaded templates if they are on
10523         namespace level.
10524         (pushdecl_namespace_level): New function.
10525         (pushdecl_top_level): Implement using pushdecl_namespace_level.
10526         (pushdecl_using_decl): New function.
10527         (overloaded_globals_p): Remove.
10528         (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
10529         them.  Use namespace_binding and set_namespace_value.
10530         (redeclaration_error_message): Complain if the declarations come
10531         from different namespaces.
10532         (lookup_tag): On namespace level, look in the BINDING_TYPE.
10533         (lookup_namespace_name): Pass tree_bindings from stack.  Remove
10534         old code.
10535         (select_decl): New function.
10536         (lookup_name_real): Call it for qualified and unqualified lookup.
10537         Pass tree_bindings from the stack.
10538         If prefer_type is 1, also accept namespaces.
10539         (lookup_function_nonclass): New function.
10540         (init_decl_processing): Set the binding level of the global
10541         namespace to global_binding_level.
10542         Build a proper type list for __builtin_apply.
10543         Initialize std_node to "fake std" if flag_honor_std is set.
10544         Initialize global_type_node.
10545         Allocated bad_alloc in namespace std if flag_honor_std.
10546         (define_function): Set the DECL_CONTEXT to the current_namespace.
10547         (start_decl): A namespace is not considered as a context here.  If
10548         the DECL_CONTEXT is a namespace, push the decl.
10549         (cp_finish_decl): Check for namespaces used as initializers.
10550         (grokfndecl): Add namespace parameter.  Remove processing of
10551         DECL_CHAIN.
10552         (grokvardecl): Add namespace parameter.
10553         (grokdeclarator): Process SCOPEs that are namespaces.  For
10554         mangling, temporarily set the DECL_CONTEXT on anonymous structs.
10555         (start_function): Check for contexts that are namespaces.
10556         Set context for declarations that have not been pushed.
10557         (store_parm_decls): Check for ::main only.
10558         (finish_function): Likewise.
10559         (start_method): Check for contexts that are namespaces.
10560         (start_method): Remove DECL_CHAIN processing.
10561         * decl2.c (flag_honor_std): Declare.
10562         (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
10563         (decl_namespace_list): New static global.
10564         (grok_x_components): Ignore namespaces as type contexts.
10565         (check_classfn): Expect OVERLOAD nodes.
10566         (grokfield): Remove DECL_CHAIN processing.
10567         (finish_file): Call cat_namespace_levels.
10568         (merge_functions): New function.
10569         (ambiguous_decl): Rewrite.
10570         (lookup_using_namespace): Produce tree_bindings.
10571         (qualified_lookup_using_namespace): Likewise.
10572         (set_decl_namespace, decl_namespace, current_decl_namespace,
10573         push_decl_namespace, pop_decl_namespace): New functions.
10574         (arg_lookup): New struct.
10575         (add_function, arg_assoc_namespace, arg_assoc_class,
10576         arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
10577         New functions.
10578         (get_namespace_id, current_namespace_id): Remove.
10579         (do_toplevel_using_decl): Rewrite.
10580         (do_class_using_decl): Complain about namespace qualifiers.
10581         (do_using_directive): Sorry if not on namespace level.  Complain
10582         about unknown namespaces.
10583         * error.c (dump_aggr_type): Check for namespace contexts.
10584         * except.c (init_exception_processing): Push terminate into std.
10585         * friend.c (is_friend): A namespace is not a context, here.
10586         * init.c (expand_member_init): Remove DECL_CHAIN processing.
10587         (build_offset_ref): Process OVERLOAD nodes.
10588         * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
10589         * lex.c (identifier_type): Loop using OVL_CHAIN.
10590         (see_typename): Set looking_for_typename to 2.
10591         (real_yylex): Likewise.
10592         (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
10593         (do_scoped_id): Expect OVERLOAD nodes.
10594         Change calling convention for qualified_lookup_using_namespace.
10595         (build_lang_decl): Don't set in_namespace anymore.
10596         * method.c (typevec_size): New global.
10597         (build_overload_nested_name): Return if global_namespace.
10598         Otherwise, always expect a declaration context.
10599         (build_qualified_name): Likewise.
10600         Make sure we don't write beyond typevec_size.
10601         (build_decl_overload_real): Likewise.
10602         Allocate one extra slot for the namespace.
10603         (hack_identifier): Mark code dead.
10604         Process OVERLOAD and NAMESPACE_DECL nodes.
10605         * parse.y (program): Pop namespaces until in global namespace.
10606         (extdef): In a using-declaration, don't discard the identifier if
10607         there is no declaration.
10608         (left_curly): Ignore type contexts which are namespaces.
10609         (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
10610         used as scope.
10611         * pt.c (template_class_depth): Expect types to be namespaces.
10612         (determine_specialization): Simplify by expecting OVERLOAD nodes.
10613         (push_template_decl): Push into namespace level.
10614         Reset ctx if it is a namespace.
10615         Set DECL_CONTEXT to current_namespace if not set already.
10616         Ignore real contexts that are namespaces.
10617         (mangle_class_name_for_template): Skip global_namespace.
10618         Mangle other namespaces as declarations.
10619         (lookup_template_function): Set type of OVERLOAD nodes to unknown.
10620         (lookup_template_class): Push into namespace of context.
10621         If the context is a namespace, set it to global_namespace.
10622         Use id_context for mangling.
10623         (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
10624         (tsubst_friend_function): Ignore namespace contexts.
10625         Push into namespace level.
10626         (tsubst): Handle NAMESPACE_DECL nodes.
10627         Remove DECL_CHAIN processing.
10628         (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
10629         * ptree.c (print_lang_identifier): Print bindings.
10630         (lang_print_xnode): Print OVERLOAD nodes.
10631         * rtti.c (init_rtti_processing): Push type_info into std.
10632         * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
10633         (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
10634         dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
10635         lookup_fnfields_here): Likewise.
10636         Process all nodes, instead of going through TREE_CHAIN.
10637         * sig.c (build_signature_pointer_or_reference_type): Set context
10638         to global_namespace.
10639         (build_signature_table_constructor): Expect OVERLOAD nodes.
10640         * spew.c (yylex): Save old setting of looking_for_typename.
10641         * tree.c (decl_list_length): Remove.
10642         (binding_init): New function.
10643         (count_functions): Rewrite.
10644         (is_overloaded_fn): Expect OVERLOAD nodes.
10645         (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
10646         (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
10647         ovl_member): New functions.
10648         * typeck.c (require_complete_type): Expect OVERLOAD nodes.
10649         (type_unknown_p): Likewise.
10650         (require_instantiated_type): Likewise.
10651         (build_component_ref): Declare code dead.
10652         (build_x_function_call): Create and expect OVERLOAD nodes.
10653         (build_function_call_real): Check for ::main only.
10654         (build_unary_op): Likewise.  Expect OVERLOAD nodes.
10655         (convert_for_assignment): Check for TREE_LIST before accessing
10656         TREE_VALUE.
10657         * decl.c (duplicate_decls): Check for namespace bindings instead
10658         of global bindings.
10659         (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
10660         lookup_name_current_level, start_decl, xref_tag,
10661         finish_enum): Likewise.
10662         * init.c (build_offset_ref): Likewise.
10663         * search.c (lookup_field): Likewise.
10664         (lookup_fnfields): Likewise.
10665         (dfs_debug_mark): Likewise.
10666         * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
10667         (poplevel_class, pop_from_top_level): Likewise.
10668         * decl2.c (finish_method): Likewise.
10669         * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
10670         * decl.c (record_builtin_type): Likewise.
10671         (init_decl_processing, grokfndecl): Likewise.
10672         * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
10673         (make_lang_type): Likewise.
10674         * parse.y (make_thunk): Likewise.
10675         * pt.c (tsubst): Likewise.
10676         * tree.c (debug_binfo): Likewise.
10677         * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
10678         tinfo2.cc, inc/new.h: Add std qualifications.
10679         * inc/new: Wrap with namespace std if __HONOR_STD.
10680         * inc/typeinfo: Likewise.
10681
10682 Fri May  8 00:43:50 1998  Jason Merrill  <jason@yorick.cygnus.com>
10683
10684         * call.c (build_user_type_conversion_1): Handle second_conv
10685         properly for templates.
10686
10687 Thu May  7 17:09:25 1998  Andrew MacLeod  <amacleod@cygnus.com>
10688
10689         * method.c (build_decl_overload_real): Set TREE_USED flag to
10690         zero for build_type_variants nodes as well.
10691
10692 Wed May  6 19:27:09 1998  Jason Merrill  <jason@yorick.cygnus.com>
10693
10694         * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE.
10695
10696 Wed May  6 16:49:48 1998  Jim Wilson  <wilson@cygnus.com>
10697
10698         * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o,
10699         except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o,
10700         rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o,
10701         xref.o): Add toplev.h dependencies.
10702
10703 Wed May  6 16:44:58 1998  Jeffrey A Law  (law@cygnus.com)
10704
10705         * errfn.c (cp_error, cp_warning): Remove declarations for
10706         error and warning respectively.
10707
10708 Wed May  6 14:28:18 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
10709
10710         * error.c: Convert to using ctype macros defined in system.h.
10711         * method.c: Likewise.
10712         * xref.c: Likewise.
10713         * lex.c: Likewise.  Also remove redundant system header stuff.
10714
10715 Wed May  6 06:36:41 1998  Robert Lipe  <robertl@dgii.com>
10716
10717         * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
10718         expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c,
10719         search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c,
10720         xref.c: Add include of toplev.h.
10721
10722 Wed May  6 02:33:39 1998  Jason Merrill  <jason@yorick.cygnus.com>
10723
10724         * tree.c (perm_manip): Also regenerate the RTL of an extern.
10725         (copy_to_permanent): Use end_temporary_allocation.
10726
10727 Tue May  5 23:54:04 1998  Jason Merrill  <jason@yorick.cygnus.com>
10728
10729         * init.c (expand_vec_init): The initialization of each array
10730         element is a full-expression.
10731
10732 Tue May  5 18:24:13 1998  Andrew MacLeod  <amacleod@cygnus.com>
10733
10734         * method.c (build_mangled_name): Add a call to build_type_variant
10735         to get the right type.
10736
10737 Tue May  5 01:25:03 1998  Jason Merrill  <jason@yorick.cygnus.com>
10738
10739         * Makefile.in: Add .SUFFIXES.
10740
10741         * cp-tree.def: Remove NAMESPACE_DECL.
10742
10743 Sun May  3 01:32:14 1998  Jason Merrill  <jason@yorick.cygnus.com>
10744
10745         * call.c (build_over_call): Do evaluate arg even if it has empty
10746         class type.
10747         * decl.c (start_function): Don't push a member function.
10748
10749 Thu Apr 30 18:59:23 1998  Jim Wilson  <wilson@cygnus.com>
10750
10751         * Makefile.in (g++FAQ.info): Put -o option before input file.
10752
10753 Thu Apr 30 13:05:33 1998  Andrew MacLeod  <amacleod@cygnus.com>
10754
10755         * gxxint.texi: Add info for squangling codes K and B.
10756
10757 Tue Apr 28 13:22:01 1998  Mark Mitchell  <mmitchell@usa.net>
10758
10759         * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
10760         the expression in templates.
10761         (finish_stmt_expr): Likewise.
10762
10763 1998-04-28  Brendan Kehoe  <brendan@cygnus.com>
10764
10765         * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int.
10766
10767 Mon Apr 27 13:58:10 1998  Mark Mitchell  <mmitchell@usa.net>
10768
10769         * decl.c (maybe_push_to_top_level): Always clear
10770         current_template_parms and processing_template_decl.
10771         (pushtag): Remove check of current_class_type and some comments,
10772         since maybe_push_to_top_level no longer creates confusion.
10773
10774 Sun Apr 26 12:10:18 1998  Mark Mitchell  <mmitchell@usa.net>
10775
10776         * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
10777         (DECL_CLASS_TEMPLATE_P): Likewise.
10778         (DECL_PRIMARY_TEMPLATE): Likewise.
10779         (PRIMARY_TEMPLATE_P): Use it.
10780         (push_template_decl_real): New function.
10781         (redeclare_class_template): Take new template parameters as
10782         input.
10783         (is_specialization_of): New function.
10784         (comp_template_args): Declare.
10785         * decl.c (pushtag): Handle friend template classes.
10786         (xref_tag): Likewise.  Use new calling convention for
10787         redeclare_class_template.
10788         * decl2.c (grok_x_components): Handle friend templates.
10789         * friend.c (is_friend): Use is_specialization_of where
10790         appropriate.  Deal with friend class templates.
10791         (make_friend_class): Let a class template be friends with itself.
10792         * pt.c (comp_template_args): Remove declaration.
10793         (tsubst_friend_class): New function.
10794         (push_template_decl_real): New function.
10795         (push_template_decl): Use it.
10796         (redeclare_class_template): Adjust for new calling convention.
10797         (comp_template_args): Give it external linkage.
10798         (instantiate_class_type): Use tsubst_friend_class to deal
10799         with friend templates.
10800         * typeck.c (comptypes): Use comp_template_args, rather than
10801         expanding it inline.
10802         * parse.y (component_decl): Handle a nested template type
10803         like other component type declarations.
10804
10805         * pt.c (check_explicit_specialization): Handle overloaded
10806         constructors correctly.
10807
10808         * pt.c (mabybe_get_template_decl_from_type_decl): New function.
10809         (lookup_template_class): Use it.
10810
10811 Thu Apr 23 21:19:06 1998  Jason Merrill  <jason@yorick.cygnus.com>
10812
10813         * cp-tree.def: Add WRAPPER.  USER_CONV now only has two ops.
10814         * cp-tree.h: Add WRAPPER support.
10815         * call.c (add_candidate): Split out from add_*_candidate fns.
10816         (build_over_call): Take the candidate instead of function and args.
10817         Enforce access control here.  Emit overload warnings here.
10818         (add_warning): New fn.
10819         (joust): Add WARN parm.  If not set, call add_warning instead of
10820         printing a warning.  Re-enable some warnings.
10821         (tourney): Pass it.
10822         (convert_like): Adjust.
10823         (build_new_op): Adjust.
10824         (build_new_function_call): Adjust.
10825         (build_user_type_conversion_1): Adjust.
10826         (USER_CONV_FN): Adjust.
10827         * tree.c (build_expr_wrapper, build_expr_ptr_wrapper,
10828         build_int_wrapper): New fns.
10829
10830 Thu Apr 23 18:27:53 1998  Mark P. Mitchell  <mmitchell@usa.net>
10831
10832         * pt.c (unify): Fix typo in previous change.
10833
10834 Thu Apr 23 09:32:58 1998  Jason Merrill  <jason@yorick.cygnus.com>
10835
10836         * error.c (dump_type_real): Declare canonical_name.
10837
10838         * typeck.c (comp_target_types): Fix PMFs.
10839
10840 Wed Apr 22 13:24:48 1998  Mark Mitchell  <mmitchell@usa.net>
10841
10842         * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for
10843         the DECL_RESULTs of a member TEMPLATE_DECL, not just the
10844         TEMPLATE_DECL.
10845
10846         * pt.c (tsubst): Decrease the template-level of
10847         TEMPLATE_TEMPLATE_PARMS.  Likewise for the DECL_INITIAL of a
10848         TEMPLATE_PARM_INDEX.
10849         (template_decl_level): New function.
10850         (unify): Make sure to record unifications for template
10851         parameters, even when the parameters exactly match the arguments.
10852         Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
10853         TEMPLATE_TYPE_PARMS.  Don't try to unify template parameters that
10854         aren't from the level we're currently working on.
10855
10856 Tue Apr 21 22:00:04 1998  Mark Mitchell  <mmitchell@usa.net>
10857
10858         * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
10859
10860         * decl2.c (check_member_template): Set DECL_IGNORED for member
10861         class templates, too.
10862
10863         * decl2.c (grokfield): Remangle the name of a member TYPE_DECL.
10864
10865 Tue Apr 21 18:59:11 1998  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
10866
10867         * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
10868
10869 Tue Apr 21 14:22:00 1998  Jeffrey A Law  (law@cygnus.com)
10870
10871         * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare.
10872         * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
10873         (init_decl_processing): Handle TI types.
10874         * typeck.c (unsigned_type, signed_type): Handle TI types.
10875
10876 Sat Apr 18 15:25:21 1998  Jim Wilson  <wilson@cygnus.com>
10877
10878         * g++spec.c (lang_specific_driver): New argument in_added_libraries.
10879         New local added_libraries.  Increment count when add library to
10880         arglist.
10881
10882 Fri Apr 17 21:25:00 1998  Mark Mitchell  <mmitchell@usa.net>
10883
10884         * cp-tree.h (type_as_string_real): New function.
10885         * pt.c (mangle_class_name_for_template): Use it.
10886         * error.c (dump_aggr_type): Change prototype.
10887         (dump_type_prefix): Likewise.
10888         (dump_type_suffix): Likewise.
10889         (dump_type_real): Convert from dump_type.  If desired, the
10890         "canonica" name of a typedef, i.e., the name of the underlying
10891         type, can be printed.
10892         (dump_type): Call dump_type_real.
10893
10894 Fri Apr 17 14:30:45 1998  Jason Merrill  <jason@yorick.cygnus.com>
10895
10896         * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks.
10897
10898         * typeck.c (comp_target_types): Tweak pedantic case.
10899         (comp_target_parms): Tweak pedantic case.  Clean up somewhat.
10900         Return -1 or 1 instead of 1 or 2.
10901         (compparms): Remove STRICT handling.
10902         (convert_for_assignment): Fix handling of pmfs.
10903
10904 Fri Apr 17 14:04:16 1998  Mark Mitchell  <mmitchell@usa.net>
10905
10906         * typeck.c (comp_target_types): Handle references like pointers.
10907         (comp_target_parms): Note that return code from comp_target_types
10908         can be negative to indicate failure.
10909
10910 Fri Apr 17 09:10:52 1998  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
10911
10912         * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG),
10913         which requires a working target compiler to build.
10914
10915 Fri Apr 17 08:57:35 1998  Jeffrey A Law  (law@cygnus.com)
10916
10917         * tree.c (avoid_overlap): Add prototype.
10918
10919         * spew.c (num_tokens): Add prototype.
10920         (nth_noken, add_token, consume_token, debug_yychar): Likewise.
10921
10922         * search.c (dfs_check_overlap): Add prototype.
10923         (dfs_no_overlap_yet): Likewise.
10924
10925         * pt.c (original_template): Add prototype.
10926         (inline_needs_template_parms): Likewise.
10927         (push_inline_template_parms_recursive): Likewise.
10928         (retrieve_specialization, register_specialization): Likewise.
10929         (print_candidates, reduce_template_parm_level): Likewise.
10930         (build_template_decl, mark_template_parm): Likewise.
10931         (tsubst_friend_function, get_bindings_real): Likewise.
10932
10933         * method.c (start_squangling): Add prototype.
10934         (end_squangling, check_ktype, issue_ktype): Likewise.
10935         (build_overloaded_scope_ref, check_btype): Likewise.
10936         (build_mangled_template_parm_index): Likewise.
10937
10938         * lex.c (init_cpp_parse): Add prototype.
10939         (handle_cp_pragma, handle_sysv_pragma): Likewise.
10940         (reduce_cmp, token_cmp): Likewise.
10941
10942         * except.c (call_eh_info): Add prototype.
10943         (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise.
10944         (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise.
10945
10946         * decl2.c (is_namespace_ancestor): Add prototype.
10947         (namespace_ancestor, add_using_namespace): Likewise.
10948         (ambiguous_decl): Likewise.
10949
10950         * decl.c (indent): Add prototype.
10951
10952         * call.c (add_template_candidate_real): Add prototype.
10953
10954 Fri Apr 17 01:57:12 1998  Jason Merrill  <jason@yorick.cygnus.com>
10955
10956         * decl2.c (build_expr_from_tree): Just return a PMF.
10957
10958 Fri Apr 17 00:45:12 1998  Mark Mitchell  <mmitchell@usa.net>
10959
10960         * typeck2.c (process_init_constructor): Don't strip cv-qualifiers
10961         when doing initializations.
10962
10963         * pt.c (unify): Use comptypes to compare type args.
10964
10965 Fri Apr 17 00:24:22 1998  Jason Merrill  <jason@yorick.cygnus.com>
10966
10967         * decl.c (duplicate_decls): Fix check for when it's safe to free
10968         the new decl.
10969
10970         * pt.c (mangle_class_name_for_template): Don't pass a typedef type
10971         to type_as_string.
10972
10973 Thu Apr 16 17:47:30 1998  Jeffrey A Law  (law@cygnus.com)
10974
10975         * pt.c (build_template_parm_index): Add prototype.
10976
10977         * search.c (my_tree_cons): Don't clear words outside the
10978         newly allocated node.
10979
10980 Wed Apr 15 15:34:44 1998  Dave Brolley  <brolley@cygnus.com>
10981
10982         * lex.c (init_parse): Now returns char* containing the filename.
10983
10984 Wed Apr 15 13:20:06 1998  John Carr  <jfc@mit.edu>
10985                           Jeff Law   <law@cygnus.com>
10986
10987         * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer
10988         than a pointer.
10989
10990 Sun Apr 12 22:31:19 1998  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
10991
10992         * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
10993
10994 Fri Apr 10 12:16:49 1998  Benjamin Kosnik  <bkoz@loony.cygnus.com>
10995
10996         * decl.c (duplicate_decls): Don't warn for redundant decls if
10997         friend: let add_friend take care of it.
10998
10999 Thu Apr  9 02:40:48 1998  Jason Merrill  <jason@yorick.cygnus.com>
11000
11001         * sig.c (build_signature_pointer_constructor): Don't set
11002         TREE_HAS_CONSTRUCTOR for a signature pointer.
11003         * cvt.c (ocp_convert): Don't force a temporary for internal structs.
11004         * init.c (resolve_offset_ref): Warn about implicit & on pmfs
11005         here, too.
11006         * typeck.c (build_unary_op): Only allow taking the address of a
11007         real constructor.
11008         * typeck2.c (digest_init): Simplify.
11009         (store_init_value): Don't pedwarn about using { } for pmfs.
11010
11011 Thu Apr  9 22:16:57 1998  Per Bothner  <bothner@cygnus.com>
11012
11013         * cp-tree.h (start_decl):  Update prototype.
11014         * decl.c (start_decl):  Like the C version, new parameters
11015         for the attributes.  Call cplus_decl_attributes here,
11016         (pushdecl):  Like C version, do build_type_copy if TYPE_DECL,
11017         (grokdeclarator):  Pass NULL for new start_decl arguments.
11018         * pt.c (tsubst_expr):  Likewise.
11019         * parse.y:  Merge cplus_decl_attribute calls into start_decl calls.
11020         * typeck.c (common_type): Check TYPE_MAIN_VARIANT.
11021         * lex.c (build_lang_decl): Add lang_name_java.
11022         * class.c (push_lang_context): Add lang_name_java.
11023         * method.c (build_mangled_name): Check for is_java_type.
11024
11025 Thu Apr  9 22:16:57 1998  Benjamin Kosnik  <bkoz@loony.cygnus.com>
11026
11027         * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
11028         * call.c (build_scoped_method_call): Check for TREE_CODE for
11029         VOID_TYPE instead of type ==  void_type_node.
11030         (build_method_call): Likewise.
11031         * decl.c (lookup_name_real): Likewise.
11032         (grokdeclarator): Likewise.
11033         (start_decl): Likewise.
11034         (grokparms): Likewise.
11035         (start_function): Likewise.
11036         (finish_function): Likewise.
11037         (start_method): Likewise.
11038
11039 Thu Apr  9 00:18:44 1998  Dave Brolley  (brolley@cygnus.com)
11040
11041         * lex.c (finput): New variable.
11042         (init_cpp_parse):  Renamed from init_parse.
11043         (init_parse): Handle !USE_CPPLIB.  Call init_cpp_parse when finished.
11044         (finish_parse): New function.
11045         * cp-tree.h (init_lex, init_parse): Remove declarations.
11046
11047 Mon Apr  6 02:25:05 1998  Jason Merrill  <jason@yorick.cygnus.com>
11048
11049         * call.c (build_call): Still evaluate the actual argument.
11050         * class.c (is_empty_class): Update for -fnew-abi.
11051
11052         * decl2.c: -fnew-abi implies -fsquangle.
11053
11054         * method.c (do_build_assign_ref): Don't do anything to copy
11055         an empty class.
11056         (do_build_copy_constructor): Likewise.
11057         * call.c (build_over_call): Likewise.
11058
11059 Sat Apr  4 18:43:58 1998  Jason Merrill  <jason@yorick.cygnus.com>
11060
11061         * tree.c (avoid_overlap): Return a value.
11062
11063 Sat Apr  4 12:52:35 1998  Jeffrey A Law  (law@cygnus.com)
11064
11065         * method.c (check_btype): Add missing argument to xrealloc.
11066         (check_ktype): Likewise.
11067
11068 Fri Apr  3 02:22:59 1998  Jason Merrill  <jason@yorick.cygnus.com>
11069
11070         Implement empty base optimization.
11071         * class.c (finish_struct_1): Add vbase fields earlier.  Set
11072         CLASSTYPE_SIZE of an empty base to 0.  Types with bases can be empty.
11073         * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns.
11074         (types_overlap_p): New fn.
11075         * tree.c (avoid_overlap): New fn.
11076         (build_base_fields): Use it to avoid overlapping empty bases.
11077         * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi.
11078
11079         * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
11080
11081         Re-implement allocation of base class subobjects.
11082         * tree.c (unshare_base_binfos): New fn.
11083         (layout_basetypes): Use it.  Now handles offsets of both virtual and
11084         non-virtual bases, after layout_type.
11085         (layout_vbasetypes): Remove.
11086         (build_base_fields): Generate FIELD_DECLs for each non-virtual base.
11087         (build_vbase_pointer_fields): Split out from old layout_basetypes.
11088         * class.c (finish_base_struct): Lose offset handling code.
11089         Move nonvdtor warning here.  Don't mess with t_binfo anymore.
11090         (finish_struct_1): Don't mess with t_binfo anymore.  Use fns above.
11091         * cp-tree.h: Adjust.
11092
11093 Thu Apr  2 14:25:13 1998  Jason Merrill  <jason@yorick.cygnus.com>
11094
11095         * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff.
11096         * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise.
11097         * class.c (duplicate_tag_error): Likewise.
11098         (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN.
11099         * tree.c (layout_vbasetypes): Update from layout_record, remove
11100         var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE.
11101         (layout_basetypes): Likewise.
11102
11103 Wed Apr  1 18:22:25 1998  Jeffrey A Law  (law@cygnus.com)
11104
11105         * class.c, Make sure system.h is included just after config.h.
11106         Delete lingering stdio and errno references too.
11107         * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise.
11108
11109 Wed Apr  1 15:38:36 1998  Jason Merrill  <jason@yorick.cygnus.com>
11110
11111         * friend.c (is_friend): Fix access control for local classes.
11112
11113         * class.c (is_empty_class): New fn.
11114         * call.c (build_call): Don't pass empty class objects to a function.
11115
11116 Wed Apr  1 14:58:35 1998  Mark Mitchell  <mmitchell@usa.net>
11117
11118         * call.c (build_over_call): Do name resolution for default
11119         arguments of function templates in the scope of the templates.
11120
11121 Tue Mar 31 13:43:57 1998  Jeffrey A Law  (law@cygnus.com)
11122
11123         * call.c: Include system.h.  Remove includes, declarations and
11124         defines provided by system.h.
11125         * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
11126         * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
11127         * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
11128         * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
11129         * typeck2.c, xref.c: Likewise.
11130         * Makefile.in: Dependencies updated as appropriate.
11131         * Make-lang.in: Likewise.
11132
11133 Mon Mar 30 12:15:00 1998  Mark Mitchell  <mmitchell@usa.net>
11134
11135         * pt.c (fn_type_unification): Allow incomplete unification without
11136         an immediate error message.
11137
11138 Mon Mar 30 08:55:42 1998  Jason Merrill  <jason@yorick.cygnus.com>
11139
11140         * tree.c (member_p): New fn.
11141         * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for
11142         initializing class members.
11143
11144         * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'.
11145         * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX.
11146
11147         * call.c (build_method_call): Handle non-scoped destructors, too.
11148         * pt.c (tsubst_copy): Likewise.
11149
11150         * pt.c (print_template_context): Split out...
11151         (push_tinst_level): ...from here.
11152
11153         * friend.c (is_friend): Don't pass a type to decl_function_context.
11154
11155         * typeck.c (convert_for_initialization): Always hand off
11156         conversions to class type.
11157
11158 Sun Mar 29 20:01:59 1998  Jason Merrill  <jason@yorick.cygnus.com>
11159
11160         * friend.c (is_friend): Local classes have the same access as the
11161         enclosing function.
11162
11163 Sun Mar 29 00:47:32 1998  Jeffrey A Law  (law@cygnus.com)
11164
11165         * typeck.c (expand_target_expr): Delete dead function.
11166
11167         * search.c: Put various prototypes inside #ifdef MI_MATRIX.
11168
11169         * repo.c (save_string): Delete dead function.
11170
11171         * method.c (thunk_printable_name): Delete dead function.
11172
11173         * lex.c (yynextch): Delete dead function.
11174
11175         * expr.c (tree_extract_aggr_init): #if 0 out.
11176
11177         * except.c (do_unwind): Delete dead function.
11178         (easy_expand_asm): Likewise.
11179
11180         * cvt.c (build_conversion_type_1): Delete dead function.
11181
11182         * cp-tree.h (push_expression_obstack): Declare.
11183
11184         * call.c (source_type): #if 0 out.
11185
11186         * class.c (alter_access): Remove unused label.  Add braces
11187         around empty else clause.
11188
11189         * lex.c (yyprint): Fix argument to printf.
11190
11191 Sat Mar 28 17:43:52 1998  Mark Mitchell  <mmitchell@usa.net>
11192
11193         * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
11194
11195         * pt.c (instantiate_class_template): Make sure template
11196         arguments are permanent.
11197         * init.c (resolve_offset_ref): Don't go looking around in
11198         template types.
11199
11200         * semantics.c: Add routines to handle expressions, and some
11201         declaration processing.
11202         * parse.y: Use them.
11203         (current_class_depth): Move declaration to cp-tree.h.
11204         * parse.c: Regenerated.
11205         * cp-tree.h: Use them.
11206         (current_class_depth): Declare.
11207         * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr.
11208
11209 Fri Mar 27 20:23:18 1998  Mark Mitchell  <mmitchell@usa.net>
11210
11211         * error.c (dump_decl): Be a bit more explicit with template
11212         type arguments, when verbose.
11213
11214 Fri Mar 27 18:16:40 1998  Jason Merrill  <jason@yorick.cygnus.com>
11215
11216         * inc/exception: Reorder closing braces.
11217
11218 Fri Mar 27 13:22:18 1998  Mark Mitchell  <mmitchell@usa.net>
11219
11220         * pt.c (redeclare_class_template): New function.
11221         * cp_tree.h (redeclare_class_template): Declare it.
11222         * decl.c (xref_tag): Use it.
11223
11224 Thu Mar 26 11:16:30 1998  Jason Merrill  <jason@yorick.cygnus.com>
11225
11226         * call.c (build_over_call): Check IS_AGGR_TYPE, not
11227         TYPE_LANG_SPECIFIC.
11228         * typeck.c (convert_arguments): Likewise.
11229
11230         * decl.c (grokdeclarator): Remove const and volatile from type after
11231         setting constp and volatilep.
11232
11233         * class.c (finish_struct_1): Don't warn about bool bitfield larger
11234         than one bit.
11235
11236 Thu Mar 26 10:25:52 1998  Mark Mitchell  <mmitchell@usa.net>
11237
11238         * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
11239
11240 Thu Mar 26 10:24:05 1998  Mark Mitchell  <mmitchell@usa.net>
11241
11242         * call.c (build_object_call): Complain about ambiguous operator(),
11243         rather that crashing.
11244         (build_new_op): Likewise.
11245         (build_op_delete_call): Likewise.
11246
11247 Thu Mar 26 10:23:24 1998  Mark Mitchell  <mmitchell@usa.net>
11248
11249         * cvt.c (perform_qualification_conversions): Use comp_target_types
11250         instead of comp_ptr_ttypes.
11251
11252 Wed Mar 25 16:10:50 1998  Mark Mitchell  <mmitchell@usa.net>
11253
11254         * cp-tree.h (enforce_access): Declare.
11255         * call.c (enforce_access): Make it extern, not static.
11256         * class.c (alter_access): Use enforce_access; modify code for ISO
11257         compliance, rather than ARM rules.
11258
11259 Wed Mar 25 12:10:45 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
11260
11261         * cp-tree.h: Fix typo.
11262
11263 Wed Mar 25 02:01:02 1998  Jason Merrill  <jason@yorick.cygnus.com>
11264
11265         * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
11266         if (aggregate_value_p (type)).
11267
11268         * decl2.c (constructor_name_full): Handle TYPENAME_TYPE.
11269
11270 Tue Mar 24 16:12:01 1998  Mark Mitchell  <mmitchell@usa.net>
11271
11272         * tree.c (mapcar): When dealing with a DECL, use it's constant
11273         value, if any.
11274         * pt.c (lookup_template_class): Don't mangle the names of template
11275         classes whose arguments are unknown.
11276
11277         * pt.c (tsubst_expr): Handle GOTO_STMT correctly.
11278
11279 Tue Mar 24 12:21:55 1998  Benjamin Kosnik  <bkoz@lisa.cygnus.com>
11280
11281         * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1.
11282
11283 Tue Mar 24 12:21:48 1998  Jim Wilson  <wilson@cygnus.com>
11284
11285         * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for
11286         boolean_type_node to 1.
11287
11288 Tue Mar 24 10:23:47 1998  Mark Mitchell  <mmitchell@usa.net>
11289
11290         * error.c (dump_expr): Remove unused variable `l'.
11291
11292         * pt.c (for_each_template_parm): New function, created by
11293         converting uses_template_parms.
11294         (tree_fn_t): New typedef.
11295         (uses_template_parms): Use it.
11296         (mark_template_parm): New function.
11297         (push_template_decl): Check that the argument list of a partial
11298         specialization uses all the template parameters.
11299
11300         * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
11301         with it; we might want it for debugging.
11302         * cp-tree.h (type_unification): Change interface.
11303         * class.c (finish_struct_1): Skip nested template types, just like
11304         ordinary nested types.
11305         (instantiate_type): Use new interface to type_unification.
11306         * lex.c (init_lex): Add __sz as opname for sizeof.
11307         * method.c (build_overload_scope_ref): New function.
11308         (build_overload_int): Handle complex expressions.  Set
11309         numeric_output_need_bar if necessary.
11310         (build_overload_value): Handle non-PARM_DECL nodes; this
11311         routine is now used by build_overload_int.  Remove some
11312         assignments to numeric_output_need_bar.  Use
11313         build_overload_scope_ref.
11314         (build_qualified_name): Note that some template mangled names end
11315         with digits, and set numeric_output_need_bar appropriately.  Use
11316         build_underscore_int.
11317         * pt.c (unify): Change interface.
11318         (type_unification_real): Likewise.
11319         (determine_specialization): Use new interfaces.
11320         (tsubst): Deal gracefully with situations in which the argument
11321         vector is not fully filled.
11322         (fn_type_unification): Use new interfaces.
11323         (type_unification): Likewise.  Remove NOP_EXPR hack.
11324         (type_unification_real): Likewise.
11325         (unify): Likewise.  Deal with unification of complex expressions.
11326
11327 Mon Mar 23 12:24:37 1998  Jason Merrill  <jason@yorick.cygnus.com>
11328
11329         * pt.c (complete_template_args): Initialize skip properly.
11330
11331         * decl.c (make_typename_type): Revert.
11332         (make_implicit_typename): Remove.
11333         (lookup_name_real): Don't call it.  Call lookup_field if we see a
11334         TYPE_DECL from a template base.
11335         * search.c (lookup_field): Do implicit typename stuff.
11336
11337 Sun Mar 22 00:50:42 1998  Nick Clifton  <nickc@cygnus.com>
11338                           Geoff Noer    <noer@cygnus.com>
11339
11340         * Makefile.in: Various fixes for building cygwin32 native toolchains.
11341         * Make-lang.in: Likewise.
11342
11343 Fri Mar 20 18:07:39 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
11344
11345         * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify.
11346
11347 Fri Mar 20 10:42:07 1998  Jason Merrill  <jason@yorick.cygnus.com>
11348
11349         * decl.c (make_implicit_typename): Rewrite removed code.
11350         (make_typename_type): Call it if the type we look up comes from
11351         a base that uses template parms.
11352
11353         * pt.c (complete_template_args): Rewrite.
11354         (tsubst, FUNCTION_DECL): Use it.
11355
11356 Fri Mar 20 08:12:43 1998  H.J. Lu  (hjl@gnu.org)
11357
11358         * semantics.c (finish_asm_stmt): Fix combine strings.  Call
11359         c_expand_asm_operands () if output_operands, input_operands or
11360         clobbers is not NULL_TREE.
11361
11362 Fri Mar 20 00:10:19 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
11363
11364         * pt.c (complete_template_args): New function.
11365         (get_bindings): Deal with specializations of function templates
11366         with return type containing parameters from outer class
11367         templates.
11368         (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level,
11369         substitute arguments and compose a new type.
11370
11371 Thu Mar 19 19:01:48 1998  Mark Mitchell  <mmitchell@usa.net>
11372
11373         * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new
11374         FUNCTION_DECLs.
11375
11376 Thu Mar 19 11:51:58 1998  Jason Merrill  <jason@yorick.cygnus.com>
11377
11378         * decl.c (make_implicit_typename): Lose useless code.
11379
11380         * call.c (standard_conversion): Handle A* -> const A* properly.
11381
11382         * pt.c (get_bindings_real): Rename from get_bindings.  Add
11383         check_rettype parm.
11384         (get_bindings): Pass 1.
11385         (get_bindings_overload): Pass 0.
11386
11387 Wed Mar 19 09:08:12 1998  Mark Mitchell  <mmitchell@usa.net>
11388
11389         * pt.c (check_explicit_specialization): When reverting a static
11390         member function, also remove the `this' parameter from
11391         last_function_parms.
11392
11393 Thu Mar 19 02:27:48 1998  Jason Merrill  <jason@yorick.cygnus.com>
11394
11395         * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
11396         a function context.
11397
11398         * decl.c (store_bindings): Use free_binding_vecs.
11399         (pop_from_top_level): Likewise.
11400
11401 Wed Mar 18 12:41:43 1998  Jason Merrill  <jason@yorick.cygnus.com>
11402
11403         * decl.c (make_implicit_typename): Only change the type of a
11404         TYPENAME_TYPE.
11405
11406 Wed Mar 18 10:09:51 1998  Mark Mitchell  <mmitchell@usa.net>
11407
11408         * semantics.c: New file, containing routines to perform the
11409         semantic phase of parsing.
11410         * parse.y: Use it.
11411         * pt.c (tsubst_expr): Likewise.
11412         * cp-tree.h: Declare the various functions in semantics.c.
11413         Provide macros to access _STMT tree nodes.
11414         * cp-tree.def: Add ASM_STMT tree node.
11415         * Makefile.in, Make-lang.in: Add dependencies on and for
11416         semantics.c.
11417
11418 Wed Mar 18 00:24:10 1998  Jason Merrill  <jason@yorick.cygnus.com>
11419
11420         * pt.c (push_template_decl): Only check primary templates.
11421
11422         * pt.c (check_explicit_specialization): Complain about default args
11423         in explicit specialization.
11424
11425         * parse.y (nomods_initdcl0): Also call cp_finish_decl for a
11426         constructor_declarator.
11427
11428 Tue Mar 17 14:44:54 1998  Mark Mitchell  <mmitchell@usa.net>
11429
11430         * typeck2.c (build_x_arrow): Don't crash when an aggregate type
11431         has no overloaded operator ->.
11432
11433         * call.c (build_field_call): Don't crash when presented with a
11434         field that is actually a nested type.
11435
11436         * decl.c (pushtag): Deal with friend class injection in local
11437         classes.
11438
11439         * call.c (build_object_call): Don't crash if OBJ is a
11440         pointer-to-member-function.
11441
11442 Tue Mar 17 11:40:26 1998  Jason Merrill  <jason@yorick.cygnus.com>
11443
11444         * pt.c (push_template_decl): Complain about template with C linkage,
11445         anonymous template class.
11446
11447 Mon Mar 16 12:10:39 1998  Jason Merrill  <jason@yorick.cygnus.com>
11448
11449         * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
11450         * search.c: Likewise.
11451
11452         * lex.c (do_pending_defargs): Only call
11453         maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
11454
11455         * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
11456
11457 Mon Mar 16 10:47:22 1998  Mark Mitchell  <mmitchell@usa.net>
11458
11459         * parse.y: Deal with CONSTRUCTORS in new_initializers.
11460
11461 Mon Mar 16 10:54:21 1998  Mark Mitchell  <mmitchell@usa.net>
11462
11463         * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
11464         closely mimics the behavior in parse.y.
11465         (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing
11466         into a compound statement.
11467
11468 Sun Mar 15 02:07:26 1998  Jason Merrill  <jason@yorick.cygnus.com>
11469
11470         * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro.
11471         * pt.c (inline_needs_template_parms): New fn.
11472         (original_template): New fn.
11473         (push_inline_template_parms_recursive): New fn.
11474         (maybe_begin_member_template_processing): Use them.
11475         (maybe_end_member_template_processing): Likewise.
11476         (is_member_or_friend_template): Rename to is_member_template.
11477         Member functions of local classes are never member templates.
11478
11479 Sun Mar 15 01:14:22 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
11480
11481         * lex.c (do_identifier): Handle TEMPLATE_DECL that was
11482         added in the class scope to catch redefinition error.
11483
11484         * pt.c (reduce_template_parm_level): Also copy
11485         the DECL_TEMPLATE_PARMS field.
11486
11487 Sun Mar 15 10:54:08 1998  Mark Mitchell  <mmitchell@usa.net>
11488
11489         * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a
11490         reduced-level template type parameter.
11491
11492 Sun Mar 15 12:26:02 1998  Manfred Hollstein  <manfred@s-direktnet.de>
11493
11494         * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider.
11495         (DECL_NEEDS_FINAL_OVERRIDER_P): New macro.
11496         * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P.
11497         * decl.c (duplicate_decls): Propagate it.
11498         * typeck2.c (abstract_virtuals_error): Use two loops to emit
11499         abstract virtual functions and virtual functions which need a
11500         final overrider separately.
11501
11502 Thu Mar 12 09:39:40 1998  Manfred Hollstein  <manfred@s-direktnet.de>
11503
11504         * lang-specs.h: Properly put brackets around array elements in
11505         initializer.
11506
11507         * typeck.c (build_binary_op_nodefault): Correctly place parens around
11508         && and || in expression.
11509
11510 Thu Mar 12 09:26:04 1998  Manfred Hollstein  <manfred@s-direktnet.de>
11511
11512         * call.c (default_parm_conversions): Remove prototype definition.
11513         (build_method_call): Remove unused variable result.
11514
11515         * cvt.c (ocp_convert): Remove unused variable conversion.
11516
11517         * decl2.c (ambiguous_decl): Add explicit parameter definition for name.
11518
11519         * except.c (do_unwind): #if 0 definition of unused variables fcall
11520         and next_pc.
11521
11522         * expr.c (extract_scalar_init): #if 0 prototype and function
11523         definition.
11524
11525         * init.c (expand_aggr_init_1): Remove unused variable init_type.
11526         (build_new_1): Remove unused variable t.
11527
11528         * pt.c (instantiate_class_template): Remove unused variable newtag;
11529         cast called function return value to void.
11530         (do_decl_instantiation): Remove unused variables name and fn.
11531
11532         * tree.c (get_type_decl): Add default return to shut up compiler from
11533         complaining control reaches end of non-void function.
11534
11535         * typeck.c (build_x_conditional_expr): Remove unused variable rval.
11536
11537 Thu Mar 12 09:12:15 1998  Manfred Hollstein  <manfred@s-direktnet.de>
11538
11539         * call.c (default_parm_conversions): Remove prototype definition.
11540         (build_method_call): Remove unused variable result.
11541         (build_over_call): Add default case in enumeration switch.
11542
11543 Thu Mar 12 08:39:13 1998  Manfred Hollstein  <manfred@s-direktnet.de>
11544
11545         * decl2.c (lang_decode_option): Change j's type to size_t.
11546
11547         * tree.c (layout_vbasetypes): record_align and desired_align are of
11548         type unsigned int; const_size and nonvirtual_const_size likewise.
11549
11550 Wed Mar 11 07:25:20 1998  Mark Mitchell  <mmitchell@usa.net>
11551
11552         * parse.y (new_initializer): Make sure all initializers are
11553         lists.
11554
11555 Tue Mar 10 07:32:36 1998  Mark Mitchell  <mmitchell@usa.net>
11556
11557         * decl2.c (import_export_decl): Mark tinfo functions for
11558         cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN.
11559
11560 Fri Mar  6 23:27:35 1998  Jeffrey A Law  (law@cygnus.com)
11561
11562         * method.c: Fix typo.
11563
11564 Fri Mar  6 10:06:59 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
11565
11566         * method.c: Include "system.h" to get stdlib.h, stdio.h,
11567         ctype.h, string.h, etc.
11568         (issue_nrepeats): Add default case in enumeration switch.
11569         (check_btype): Likewise.
11570         (process_overload_item): Likewise.
11571
11572         * Makefile.in (method.o): Depend on system.h.
11573
11574 Wed Mar  4 22:26:53 1998  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
11575
11576         * lex.c (do_scoped_id): Fix parenthesizing.
11577
11578 Wed Mar  4 12:11:53 1998  Michael Tiemann  <tiemann@axon.cygnus.com>
11579
11580         * rtti.c (get_tinfo_fn_dynamic): If this function is called an
11581         FLAG_RTTI is unset, initialize type info machinery and continue
11582         with FLAG_RTTI enabled.
11583         (get_typeid): Likewise.
11584
11585 Wed Mar  4 11:47:55 1998  Jason Merrill  <jason@yorick.cygnus.com>
11586
11587         * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
11588         from B.
11589
11590 Wed Mar  4 11:28:08 1998  Mark Mitchell  <mmitchell@usa.net>
11591
11592         * pt.c (finish_member_template_decl): Deal more gracefully with
11593         invalid declarations.
11594
11595 Tue Mar  3 01:38:17 1998  Jason Merrill  <jason@yorick.cygnus.com>
11596
11597         * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c,
11598         cp-tree.h: Clean up more old overloading code, old RTTI code, and
11599         some formatting quirks.
11600
11601         * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
11602         method.c, pt.c, ptree.c, typeck.c: Remove support for
11603         -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
11604         * class.h: Remove.
11605         * Makefile.in: Adjust.
11606
11607         * pt.c (unify): Don't allow reduced cv-quals when strict.
11608
11609         * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from
11610         *type_unification* and unify.
11611
11612 Mon Mar  2 12:11:06 1998  Jason Merrill  <jason@yorick.cygnus.com>
11613
11614         * parse.y (explicit_template_type): Remove TEMPLATE keyword.
11615         (nested_name_specifier): And add it before this use.
11616         (typename_sub0): And this use.  Also add use without the keyword.
11617         (typename_sub1): Likewise.
11618         * pt.c (instantiate_class_template): Don't actually instantiate
11619         anything if our type uses template parms.
11620
11621 Mon Mar  2 11:04:59 1998  Jim Wilson  <wilson@cygnus.com>
11622
11623         * decl.c (start_function): Don't call temporary_allocation for a
11624         nested function.
11625
11626 Sun Mar  1 21:06:37 1998  Jason Merrill  <jason@yorick.cygnus.com>
11627
11628         * pt.c (instantiate_class_template): Don't mess with friends if
11629         our type uses template parms.
11630
11631 Sat Feb 28 12:06:44 1998  Jason Merrill  <jason@yorick.cygnus.com>
11632
11633         * parse.y (nested_name_specifier): Use explicit_template_type.
11634         (typename_sub): Allow a template_type, an explicit_template_type,
11635         or an implicit template type at the end.
11636         * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL.
11637         * decl.c (make_typename_type): Handle template-id where the name
11638         is a TEMPLATE_DECL.
11639         * call.c (build_scoped_method_call): Handle member template
11640         destructor call.
11641         * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member
11642         destructor is represented by the type.
11643
11644         * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro.
11645         * parse.y (nested_name_specifier): Add 'template' case.
11646         (explicit_template_type): New rule.
11647         (typename_sub): Use it.
11648         * decl.c (make_typename_type): Handle getting a template-id for NAME.
11649         * pt.c (tsubst): Likewise.
11650
11651 Fri Feb 27 11:17:50 1998  Jason Merrill  <jason@yorick.cygnus.com>
11652
11653         * pt.c (add_to_template_args): Fix thinko.
11654         (instantiate_class_template): Call it later.
11655
11656         * pt.c (get_class_bindings): Add outer_args parm.
11657         (most_specialized_class): Likewise.
11658         (instantiate_class_template): Pass it.
11659         (more_specialized_class): Likewise.
11660         (lookup_template_class): Get context from template if none
11661         was specified.
11662         (finish_member_template_decl): Don't do anything with a
11663         partial specialization.
11664         * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of
11665         AGGREGATE_TYPE_P.
11666         * class.c (finish_struct): Member class templates have already been
11667         checked for name clashes.
11668         * decl.c (pushdecl_with_scope): Handle pushing at class level.
11669
11670 Fri Feb 27 02:25:16 1998  Jason Merrill  <jason@yorick.cygnus.com>
11671
11672         * pt.c (tsubst, TEMPLATE_DECL): Support member class templates.
11673         (tsubst, *_PARM): Support multiple levels of template classes.
11674         (instantiate_class_template): Look up the pattern from the
11675         original template.
11676         (lookup_template_class): Handle getting a template for d1.
11677         (push_template_decl): Correct setting of 'primary'.
11678         (reduce_template_parm_level): Add 'levels' parm.
11679         (finish_member_template_decl): Support member class templates.
11680         (template_class_depth): Handle multiple levels.
11681         * parse.y (component_decl_1, fn.def2): Remove member template case.
11682         (component_decl): Add member template cases.
11683         * decl2.c (check_member_template): We now handle member template
11684         classes.
11685         * decl.c (pushtag): Handle member templates.
11686         * method.c (do_inline_function_hair): Don't touch
11687         IDENTIFIER_GLOBAL_VALUE.
11688         * init.c (build_offset_ref): If name isn't an identifier, just
11689         return it.
11690         * spew.c (yylex): Handle PTYPENAME like TYPENAME.
11691
11692         * typeck.c (get_delta_difference): Do adjust for conversions to
11693         and from virtual base.
11694
11695 Wed Feb 25 09:51:29 1998  Jason Merrill  <jason@yorick.cygnus.com>
11696
11697         * typeck.c (get_delta_difference): Give hard error for conversion
11698         from virtual base.
11699
11700         * cp-tree.h: Tweak formatting.
11701
11702 Wed Feb 25 00:35:33 1998  Jason Merrill  <jason@yorick.cygnus.com>
11703
11704         * decl.c (push_namespace): Handle redeclaration error.
11705
11706         * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro.
11707         (IDENTIFIER_NAMESPACE_BINDINGS): New macro.
11708         (NAMESPACE_BINDING): New macro.
11709         (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING.
11710         * *.c: Use them.
11711
11712         * pt.c (push_template_decl): Use innermost_args.
11713
11714         * decl.c (get_unique_name): Tweak from earlier in the name.
11715
11716 Tue Feb 24 22:15:04 1998  Martin von Loewis  <loewis@informatik.hu-berlin.de>
11717
11718         * cp-tree.def: Add CPLUS_BINDING node.
11719         * cp-tree.h (tree_binding): New struct.
11720         (BINDING_SCOPE, BINDING_VALUE): New macros.
11721         (current_namespace, global_namespace): Declare extern.
11722         (struct lang_decl_flags): New field in_namespace.
11723         (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros.
11724         (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros.
11725         (TREE_INDIRECT_USING): New macro.
11726         * decl2.c (current_namespace, global_namespace): Declare.  The
11727         value is a NAMESPACE_DECL now, not a TREE_LIST.
11728         (is_namespace_ancestor, namespace_ancestor): New static functions.
11729         (add_using_namespace, ambiguous_decl): Likewise.
11730         (lookup_using_namespace): New support function for lookup_name.
11731         (qualified_lookup_using_namespace): New support function for
11732         do_scoped_id and lookup_namespace_name.
11733         (get_namespace_id): Mark as obsolete.
11734         (current_namespace_id): Likewise.
11735         (do_namespace_alias): Implement.
11736         (do_using_directive): Implement as call to add_using_namespace.
11737         * decl.c (binding_for_name): New function.
11738         (push_namespace, pop_namespace): Implement.
11739         (push_decl): Don't install a FUNCTION_DECL in the global branch.
11740         (lookup_namespace_name): Implement using qualified lookup.
11741         (lookup_name_real): For global scoping, lookup in
11742         global_namespace.  For namespace scoping, lookup in given
11743         namespace.  For unscoped lookup, iterate over namespace,
11744         considering using directives.
11745         (init_decl_processing): Initialize global_namespace.
11746         (grokvardecl): Build assembler name as static name for globals.
11747         (grokdeclarator): Remove old namespace mangling.
11748         (xref_tag): When installing a global binding for the
11749         tag, make sure we have an identifier.
11750         * method.c (build_overload_nested_name): Mangle namespaces.
11751         (build_qualified_name): Likewise.
11752         (build_decl_overload_real): Likewise.
11753         * lex.c (build_lang_decl): Set namespace for new declaration to
11754         current_namespace.
11755         (do_scoped_id): Find global names in global or current
11756         namespace, or using qualified namespace lookup, depending on
11757         context.
11758         * init.c (build_member_call): When scope is namespace, use
11759         build_x_function_call instead.
11760         (build_offset_ref): When scope is namespace, collapse processing
11761         to lookup_namespace_name instead.
11762         * error.c (dump_decl): Support NAMESPACE_DECL.
11763         * decl.c (pushdecl): Bind globals to current namespace.
11764         (push_overloaded_decl): Likewise.
11765         (lookup_tag): Likewise.
11766         (lookup_name_current_level): Likewise.
11767         (xref_tag): Likewise.
11768         (start_function): Likewise.
11769         * lex.c (do_identifier): Likewise.
11770         (identifier_typedecl_value): Likewise.
11771         (real_yylex): Likewise.
11772         * method.c (do_inline_function_hair): Likewise.
11773         * parse.y (unscoped): Likewise.
11774         * pt.c (check_explicit_specialization): Likewise.
11775         (lookup_template_class): Likewise.
11776         * rtti.c (call_void_fn): Likewise.
11777         * sig.c (build_sigtable): Likewise.
11778         * ptree.c (lang_print_xnode): New function.
11779
11780 Tue Feb 24 01:40:24 1998  Jason Merrill  <jason@yorick.cygnus.com>
11781
11782         * pt.c (instantiate_class_template): Don't instantiate if pedantic
11783         and the args use template parms.
11784
11785         * pt.c (push_tinst_level): If the instantiation uses template parms,
11786         fail silently.
11787         * decl.c (xref_basetypes): Do call complete_type for basetypes
11788         that involve template parameters.
11789
11790 Tue Feb 24 00:36:43 1998  Jason Merrill  <jason@yorick.cygnus.com>
11791
11792         * typeck2.c (process_init_constructor): Fix labeled init check.
11793
11794 Mon Feb 23 05:08:55 1998  Jason Merrill  <jason@yorick.cygnus.com>
11795
11796         * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS
11797         argument to tsubst and friends.
11798
11799         * pt.c (tsubst, FUNCTION_DECL): Tidy.
11800
11801         * typeck.c (build_x_function_call): Handle static member function
11802         templates like non-templates.  Handle friend templates like normal
11803         function templates.
11804         * pt.c (tsubst, *_PARM): Don't use orig_level.
11805         (get_bindings): Don't call add_to_template_args.
11806         (instantiate_template): Likewise.
11807         (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
11808         * ptree.c (print_lang_type): Print index/level for template parms.
11809
11810 Mon Feb 23 02:52:29 1998  Mark Mitchell  <mmitchell@usa.net>
11811
11812         * Make-lang.in (cc1plus): Note that cc1plus depends on
11813         cp/cp-tree.h and cp/cp-tree.def.
11814
11815         * cp-tree.def (TEMPLATE_CONST_PARM): Remove.
11816         (TEMPLATE_PARM_INDEX): New tree code, used to indicate a
11817         position in a template parameter list.
11818         * cp-tree.h (template_parm_index): New structure, used as the tree
11819         structure for a TEMPLATE_PARM_INDEX.
11820         (TEMPLATE_PARM_IDX): New macro.
11821         (TEMPLATE_PARM_LEVEL): Likewise.
11822         (TEMPLATE_PARM_DESCENDANTS): Likewise.
11823         (TEMPLATE_PARM_ORIG_LEVEL): Likewise.
11824         (TEMPLATE_PARM_DECL): Likewise.
11825         (TEMPLATE_TYPE_PARM_INDEX): Likewise.
11826         (TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
11827         (TEMPLATE_TYPE_DECL): Likewise.
11828         (TEMPLATE_CONST_IDX): Remove.
11829         (TEMPLATE_CONST_LEVEL): Likewise.
11830         (TEMPLATE_CONST_SET_INFO): Likewise.
11831         (TEMPLATE_TYPE_SET_INFO): Likewise.
11832         (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
11833         node.
11834         (TEMPLATE_TYPE_LEVEL): Likewise.
11835         * decl.c (decls_match): Call comp_template_parms, rather than
11836         expanding it inline.
11837         (duplicate_decls): If two template declarations are being merged,
11838         then their TEMPLATE_INFOs should be merged as well.
11839         (grokfndecl): Save template-id information when declaring a friend
11840         with explicit template arguments.  Pass arguments to
11841         check_explicit_specialization via correct convention; at some
11842         point check_explicit_specialization changed, but these call-sites
11843         did not.
11844         (grokdeclarator): Tidy up slightly.
11845         * decl2.c (check_classfn): Tidy up slightly.  Don't assume that
11846         two template functions with the same DECL_ASSEMBLER_NAME the same,
11847         since the names are not yet mangled.
11848         * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
11849         TEMPLATE_CONST_PARM.
11850         (dump_expr): Likewise.  Use the TEMPLATE_PARM_DECL to get at the
11851         decl for a non-type parameter, rather than printing `<tparm ...>'.
11852         * friend.c (is_friend): Handle TEMPLATE_DECL friends.
11853         (do_friend): Deal with template friends.
11854         * lex.c (do_pending_inlines): Call
11855         maybe_begin_member_template_processing, rather than
11856         conditionally calling begin_member_template_processing.
11857         (process_next_inline): Likewise.  Call
11858         maybe_end_member_template_processing, rather than
11859         conditionally calling end_member_template_processing.
11860         (do_pending_defargs): Likewise.
11861         (do_identifier): Use TEMPLATE_PARM_INDEX instead of
11862         TEMPLATE_CONST_PARM.
11863         * method.c (build_mangled_template_parm_index): New function.
11864         (build_overload_value): Use it.
11865         (build_overload_name): Likewise.
11866         * pt.c (finish_member_template_decl): Allow friend declarations.
11867         (template_class_depth): New function.
11868         (is_member_template): Rename, and modify, to become...
11869         (is_member_or_friend_template): New function.
11870         (end_member_template_processing): Rename, and modify, to become...
11871         (maybe_end_member_template_processing).
11872         (build_template_parm_index): New function.
11873         (reduce_template_parm_level): New function.
11874         (process_template_parm): Modify to use build_template_parm_index.
11875         (push_template_decl): Deal with friend templates.
11876         (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
11877         TEMPLATE_CONST_PARM.
11878         (tsubst_friend_function): New function.
11879         (instantiate_class_template): Generate the DECL_FRIENDLIST
11880         for a new instantiation by using tsubst_friend_function rather
11881         than just tsubst.
11882         (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
11883         Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
11884         appropriate new macros.  Use reduce_template_parm_level to
11885         generate lower-level template parameters.  Handle tsubst'ing into
11886         TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS.  Don't forget
11887         to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
11888         templates.  Similarly for the template parameters for a new
11889         template.
11890         (tsubst_copy): Tidy up slightly.  Use TEMPLATE_PARM_INDEX instead
11891         of TEMPLATE_CONST_PARM.  Handle TYPE_DECLs by tsubsting into them.
11892         (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
11893         (get_bindings): Call add_to_template_args if necessary.
11894         (instantiate_decl): Handle instantiations of friend templates.
11895         * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
11896         TEMPLATE_TYPE_PARM as a list of fields; it's not!
11897         * spew.c (yylex): Do a little manual constant propagation to
11898         clarify the code.
11899
11900 Sun Feb 22 19:53:29 1998  Jeffrey A Law  (law@cygnus.com)
11901
11902         * error.c: Include sys/types.h.
11903
11904 Thu Feb 19 14:49:09 1998  Jeffrey A Law  (law@cygnus.com)
11905
11906         * method.c (build_mangled_name): Start CPP directives in column zero.
11907
11908 Thu Feb 19 10:36:48 1998  Jason Merrill  <jason@yorick.cygnus.com>
11909
11910         * typeck2.c (process_init_constructor): Sorry about non-trivial
11911         labeled initializers.
11912         * parse.y (initlist): Re-enable labeled initializers.
11913
11914 Thu Feb 19 10:15:55 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
11915
11916         * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm,
11917         all callers changed.  Rely on the new parameter instead of arg
11918         being a TREE_LIST when determine whether we are working inside
11919         template template parameter.  Clean up is_type test.
11920
11921 Thu Feb 19 10:04:12 1998  Jason Merrill  <jason@yorick.cygnus.com>
11922
11923         * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT.
11924         * typeck2.c (initializer_constant_valid_p): Allow conversions
11925         between pointers and references.
11926
11927 1998-02-19  Brendan Kehoe  <brendan@cygnus.com>
11928
11929         * typeck.c (build_unary_op): Only warn about incr/decr a pointer
11930         if pedantic || warn_pointer_arith.
11931
11932 Thu Feb 19 09:37:21 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
11933
11934         * pt.c (unify): Handle TEMPLATE_DECL.
11935
11936 1998-02-18  Brendan Kehoe  <brendan@cygnus.com>
11937
11938         * cp-tree.h (strip_attrs): Remove decl.
11939
11940 1998-02-18  Doug Evans  <devans@cygnus.com>
11941
11942         * decl.c (duplicate_decls): Call merge_machine_decl_attributes.
11943         Update olddecl's attributes too.
11944         (strip_attrs): Remove function.
11945         * typeck.c (common_type): Call merge_machine_type_attributes.
11946
11947 Tue Feb 17 14:07:52 1998  Mark Mitchell  <mmitchell@usa.net>
11948
11949         * parse.y (initdcl0_innards): New grammar symbol.
11950         (nomods_initdecls, nomods_initdcl0): Change type from itype to
11951         none, since the resulting value is never used.
11952         (parse_decl): New function.
11953         (datadef): Remove redundant actions.
11954         (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards.
11955         * parse.c: Regenerated.
11956
11957 Tue Feb 17 11:54:16 1998  Jason Merrill  <jason@yorick.cygnus.com>
11958
11959         * parse.y (simple_stmt): Use getdecls() to check for decl.
11960
11961 Sat Feb 14 11:50:51 1998  Manfred Hollstein  <manfred@s-direktnet.de>
11962
11963         * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
11964         macros.
11965         (c++.install-common): Install c++filt properly as native or as cross
11966         variant.
11967         (c++.uninstall): Add c++filt.
11968
11969 Fri Feb 13 14:55:37 1998  Jason Merrill  <jason@yorick.cygnus.com>
11970
11971         * call.c (standard_conversion): Fix multi-level ptr conversions.
11972
11973 Fri Feb 13 14:06:22 1998  Mike Stump  <mrs@wrs.com>
11974
11975         * init.c (build_new): Propagate error_mark_node up.
11976
11977 Fri Feb 13 13:24:32 1998  Jason Merrill  <jason@yorick.cygnus.com>
11978
11979         * parse.y (simple_stmt): If the condition isn't a declaration,
11980         start the controlled block after the test.
11981
11982 Fri Feb 13 02:26:10 1998  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
11983
11984         * call.c (build_over_call): Convert builtin abs, labs and fabs to
11985         tree-codes.
11986         * decl.c (init_decl_processing): Re-enable abs, labs and fabs as
11987         builtins.
11988
11989 Fri Feb 13 01:36:42 1998  Jason Merrill  <jason@yorick.cygnus.com>
11990
11991         * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV.
11992
11993 Fri Feb 13 00:21:59 1998  Jason Merrill  <jason@yorick.cygnus.com>
11994
11995         * cp-tree.h: Add access_protected_virtual_node.
11996         * class.c (init_class_processing): Initialize it.
11997         * decl.c (xref_basetypes): Use it.
11998         * parse.y (base_class_access_list): Likewise.
11999
12000         * Make-lang.in (DEMANGLER_PROG): Add $(exeext).
12001         (c++.install-common): Install c++filt.
12002
12003 Thu Feb 12 12:46:51 1998  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
12004
12005         * decl.c (shadow_tag): Give error for typedef-ing built-in types.
12006
12007 Wed Feb 11 23:28:05 1998  Mark Mitchell  <mmitchell@usa.net>
12008
12009         * call.c (reference_binding): Use comptypes when comparing
12010         TYPE_MAIN_VARIANTS to handle non-canonical array/index types.
12011
12012 Wed Feb 11 16:42:04 1998  Mark Mitchell  <mmitchell@usa.net>
12013
12014         * tree.c (is_overloaded_fn): Use really_overloaded_fn.
12015         (really_overloaded_fn): Move check here from is_overloaded_fn.
12016         (get_first_fn): Use really_overloaded_fn and is_overloaded_fn.
12017
12018 Wed Feb 11 15:54:18 1998  Mark Mitchell  <mmitchell@usa.net>
12019
12020         * typeck.c (build_ptrmemfunc): Type-check pointer-to-member
12021         conversions.
12022
12023 Mon Feb  9 22:23:31 1998  Mark Mitchell  <mmitchell@usa.net>
12024
12025         * cp-tree.h (push_template_decl): Return the decl passed in, or an
12026         equivalent duplicate.
12027         * decl.c (pushtag): Use the return value from push_template_decl.
12028         (duplicate_decls): When duplicating a template declaration, merge
12029         the DECL_TEMPLATE_RESULTs as well.
12030         (make_implicit_typename): Don't try to dive into typename types to
12031         find a context for making a new implicit typename.
12032         (start_decl): Use the return value from push_template_decl.
12033         (grokdeclarator): Complain about declarations list `const operator
12034         int'.  Since we don't correctly handle in-class initializations of
12035         non-static data members, complain about this (now illegal)
12036         practice.  Issue an error for initializations of non-const statics
12037         since that is illegal as well, and since we don't handle that case
12038         correctly either.
12039         (start_function): Use the return value from push_template_decl.
12040         (start_method): Likewise.
12041         * decl2.c (grokfield): Likewise.  Since the change to
12042         grokdeclarator ensures that all initialized fields are in fact
12043         static, remove a redundant test for TREE_PUBLIC.
12044         * parse.y (initlist): Disable labeled initializers since they do
12045         not work as per the documentation, and since they do not use the
12046         same syntax as the C front end.
12047         * pt.c (push_template_decl): Return the decl passed in, or an
12048         equivalent duplicate.
12049         (lookup_template_class): When searching in a nested context,
12050         use the right arguments.
12051         (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL.
12052         * typeck.c (build_component_ref): Assign the correct type to the
12053         result of build_vfn_ref.
12054
12055 Tue Feb 10 23:56:46 1998  Jason Merrill  <jason@yorick.cygnus.com>
12056
12057         * pt.c (convert_nontype_argument): Fix typo.
12058         (check_explicit_specialization): Allow old-style specialization
12059         of class template members.
12060
12061 Tue Feb 10 20:36:52 1998  Jason Merrill  <jason@yorick.cygnus.com>
12062                           Manfred Hollstein  <manfred@s-direktnet.de>
12063
12064         * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead
12065         when deciding to override DECL_ASSEMBLER_NAME.
12066
12067 Tue Feb 10 15:30:55 1998  Andrew MacLeod  <amacleod@torpedo.to.cygnus.com>
12068
12069         * decl2.c (lang_f_options): Add -fsquangle to option processing list.
12070         * cp-tree.h (flag_do_squangling): Add declaration.
12071         * lang-options.h: Add -fsquangle and -fno-squangle.
12072         * method.c: Add macros and static variables for squangling.
12073         (build_overload_name): Rename to build_mangled_name, add logic for B
12074         compression, and split into process_modifiers and
12075         process_overload_item.
12076         (process_modifiers): New function, to handle constant, reference,
12077         and pointer types.
12078         (process_overload_item): New function, handles issue of type codes.
12079         (build_overload_name): New function, start squangling and call
12080         build_mangled_name.
12081         (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline.
12082         (start_squangling): New function to initialize squangling structs.
12083         (end_squangling): New function to destroy squangling structs.
12084         (nrepeats): Rename variable to Nrepeats.
12085         (issue_nrepeats): New function for issuing 'n' type repeats.
12086         (check_ktype): New function to check for type K name compression.
12087         (build_overload_nested_name): Add a check for K name compression.
12088         (build_qualified_name): Add a check for K name compression and don't
12089         use DECL_ASSEMBLER_NAME when squangling is on.
12090         (check_btype): New function, checks for B type compression.
12091         (build_static_name, build_decl_overload_real): Initiate squangling.
12092         (build_typename_overload, build_overload_with_type): Initiate
12093         squangling
12094
12095 Sun Feb  8 23:47:38 1998  scott snyder  <sss@d0linux01.fnal.gov>
12096
12097         * method.c (make_thunk): Avoid name buffer overflow.
12098
12099 Sat Feb  7 16:48:54 1998  Jason Merrill  <jason@yorick.cygnus.com>
12100
12101         * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we
12102         don't define them yet.
12103
12104         * parse.y (nomods_initdcl0): Add constructor_declarator case.
12105
12106 Fri Feb  6 21:32:25 1998  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
12107
12108         * config-lang.in (diff_excludes): Use basename only.
12109
12110 Thu Feb  5 19:10:40 1998  Jason Merrill  <jason@yorick.cygnus.com>
12111
12112         * tinfo2.cc: Add tinfo for signed char.
12113
12114 Thu Feb  5 14:38:23 1998  Mike Stump  <mrs@wrs.com>
12115
12116         * search.c (compute_access): Handle protected constructors in derived
12117         classes as accessible.
12118
12119 Wed Feb  4 01:26:49 1998  Jason Merrill  <jason@yorick.cygnus.com>
12120
12121         * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
12122         Call convert_from_reference sooner.
12123
12124 Tue Feb  3 23:50:52 1998  Mark Mitchell  <mmitchell@usa.net>
12125
12126         * cvt.c (ocp_convert): Obtain the constant values from constant
12127         decls even if the destination type is the same as the type of the
12128         decl.
12129
12130         * decl2.c (finish_file): Make sure that static inlines with
12131         definitions are not marked DECL_EXTERNAL before returning.
12132
12133 Tue Feb  3 22:43:42 1998  Jason Merrill  <jason@yorick.cygnus.com>
12134
12135         * decl.c: Lose arg_looking_for_template.
12136         (lookup_name_real): Likewise.
12137         * parse.y: Lose processing_template_arg, template_arg1.
12138         (primary): Likewise.
12139         * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
12140
12141 Tue Feb  3 22:04:01 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
12142
12143         * error.c (dump_decl): Fix type of default arguments for template
12144         template parameters and nontype template parameters.
12145         * parse.y (template_parm): Handle invalid default template
12146         template arguments here.
12147
12148         * parse.y (template_parm): Use template_arg instead of PTYPENAME
12149         for default template template argument.
12150         * pt.c (coerce_template_parms): Merge default template argument
12151         codes.  Can treat RECORD_TYPE as template name if it is implicitly
12152         created.  Fix argument index in error message.
12153         * typeck.c (comptypes): Merge template argument comparison codes in
12154         TEMPLATE_TEMPLATE_PARM and RECORD_TYPE.
12155
12156 Tue Jan  6 01:42:44 1998  Mumit Khan  <khan@xraylith.wisc.edu>
12157
12158         * lex.c (file_name_nondirectory): Also check for '/'.
12159
12160 Mon Feb  2 11:24:22 1998  Mark Mitchell  <mmitchell@usa.net>
12161
12162         * parse.y (primary): Deal with statement-expressions in
12163         templates.
12164         * pt.c (tsubst_copy): Handle BIND_EXPR.
12165         * tree.c (mapcar): Likewise.
12166
12167         * call.c (add_template_candidate_real): Pass extra parameter to
12168         fn_type_unification.
12169         * cp-tree.h (fn_type_unification): Add parameter.
12170         * pt.c (fn_type_unification): Add additional parameter to deal with
12171         static member functions.
12172         (get_bindings): Deal with static member functions.
12173
12174         * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro.
12175         (revert_static_member_fn): Declare.
12176         * decl.c (revert_static_member_fn): Remove declaration.  Change
12177         linkage from internal to external.
12178         (cp_finish_decl): Deal with virtual functions in classes local to
12179         template functions.
12180         * decl2.c (finish_file): Don't forget to emit increment/decrement
12181         expressions in initializers for file-scope variables.
12182         * parse.y (typename_sub2): If the typename doesn't names a
12183         template, rather than a type, issue an error message.
12184         * pt.c (check_explicit_specialization): Handle specializations of
12185         static member functions.
12186         (coerce_template_parms): Handle offset references to lists of
12187         member functions.
12188         * search.c (note_debug_info_needed): Don't crash when handed a
12189         type which is being defined.
12190         * typeck.c (complete_type): Don't crash when handed NULL_TREE;
12191         that can happen with some illegal code.
12192
12193 Mon Feb  2 00:57:38 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12194
12195         * call.c (user_harshness): Initialize `code' to 0.
12196         (build_method_call): Initialize `candidates', `cp' and `len' to 0.
12197         (null_ptr_cst_p): Add parentheses around && within ||.
12198         (standard_conversion): Likewise.
12199         (z_candidate): Likewise.
12200         (build_user_type_conversion_1): Initialize `args' to NULL_TREE.
12201         (build_object_call): Likewise for `mem_args'.
12202         (build_new_op): Likewise for `mem_arglist'.  Add `return' from
12203         default case in enumeration switch.
12204
12205         * class.c (build_vtable_entry): Add explicit braces to avoid
12206         ambiguous `else'.
12207         (build_class_init_list): Likewise.
12208         (finish_struct_1): Initialize `width' to 0.
12209         (instantiate_type): Initialize `name' to NULL_TREE.  Add
12210         explicit braces to avoid ambiguous `else'.
12211
12212         * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous
12213         `else'.
12214
12215         * decl.c (grok_reference_init): Eliminate unused parameter, all
12216         callers changed.
12217         (record_builtin_type): Initialize `tdecl' to NULL_TREE.
12218         (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE.
12219         (cp_finish_decl): Initialize `ttype' to NULL_TREE.
12220         (grokdeclarator): Add parentheses around && within ||.  Add
12221         explicit braces to avoid ambiguous `else'.
12222         (grokparms): Initialize `type' to NULL_TREE.
12223         (xref_tag): Remove unused label `just_return'.
12224         (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE.
12225         (finish_function): Initialize `cond' and `thenclause' to NULL_TREE.
12226         (hack_incomplete_structures): Add parentheses around assignment
12227         used as truth value.
12228
12229         * decl2.c (coerce_delete_type): Hide definition of `e3'.
12230
12231         * error.c: Include <stdlib.h>.
12232         (dump_expr): Change the type of `i' to size_t.  Remove unused
12233         label `error'.
12234
12235         * except.c (init_exception_processing): Remove unused variable `d'.
12236         (expand_throw): Likewise for `label'.
12237
12238         * friend.c (add_friends): Add explicit braces to avoid ambiguous
12239         `else'.
12240
12241         * init.c (sort_member_init): Initialize `last_field' to NULL_TREE.
12242         (sort_base_init): Likewise for `binfo'.
12243         (expand_member_init): Likewise for `rval'.
12244         (build_member_call): Add parentheses around assignment used as
12245         truth value.
12246         (build_offset_ref): Add explicit braces to avoid ambiguous `else'.
12247         (build_new): Initialize `nelts' to NULL_TREE.  Initialize
12248         `old_immediate_size_expand' to 0.
12249         (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE.
12250         (build_vec_delete_1): Remove unused variable `block'.
12251         (expand_vec_init): Initialize `itype' to NULL_TREE.
12252
12253         * lex.c: Include <strings.h> if we don't have <string.h>.  Protect
12254         declaration of `index' and `rindex' with autoconf macros.
12255         (reinit_parse_for_expr): Remove unused variables
12256         `look_for_semicolon' and `look_for_lbrac'.
12257         (cons_up_default_function): Initialize `args' to NULL_TREE.
12258         (readescape): Initialize `firstdig' to 0.
12259         (real_yylex): Add parentheses around assignment used as truth value.
12260
12261         * method.c: Include <strings.h> if we don't have <string.h>.
12262         Protect declaration of `index' with autoconf macro.
12263
12264         * parse.y (primary): Add explicit braces to avoid ambiguous `else'.
12265         Initialize `type' to NULL_TREE.
12266         (structsp): Remove unused variable `id'.
12267
12268         * pt.c (coerce_template_parms): Add explicit braces to avoid
12269         ambiguous `else'.
12270         (lookup_template_class): Initialize `template' to NULL_TREE.
12271         (instantiate_class_template): Remove unused variable `name' and `e'.
12272         (tsubst): Likewise for `i'.  Initialize `last' to NULL_TREE.
12273         (do_poplevel): Initialize `saved_warn_unused' to 0.
12274         (type_unification): Remove unused varable `parm'.
12275         (unify): Likewise for `j'.
12276
12277         * repo.c (init_repo): Add parentheses around assignment used as
12278         truth value.
12279         (finish_repo): Remove unused varable `p'.
12280
12281         * search.c (get_binfo): Initialize `type' to NULL_TREE.
12282         (get_base_distance): Likewise.
12283         (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path'
12284         and `new_v' to NULL_TREE.
12285         (lookup_fnfields): Likewise for `rval_binfo_h'.
12286         (breadth_first_search): Add parentheses around assignment used as
12287         truth value.
12288         (get_template_base): Initialize `type' to NULL_TREE.
12289
12290         * sig.c (append_signature_fields): Initialize `last_mfptr' to
12291         NULL_TREE.
12292         (build_signature_table_constructor): Likewise for
12293         `last_rhs_field', `pfn' and `vt_off'.
12294         (build_sigtable): Likewise for `init'.
12295
12296         * tree.c (break_out_calls): Initialize `t2' to NULL_TREE.
12297         (propagate_binfo_offsets): Likewise for `delta'.
12298         (hash_tree_cons): Initialize hashcode to 0.
12299         (can_free): Likewise for `size'.
12300         (cp_tree_equal): Add explicit braces to avoid ambiguous `else'.
12301
12302         * typeck.c (convert_sequence): Hide prototype.
12303         (common_type): Add explicit braces to avoid ambiguous `else'.
12304         (comp_target_types): Likewise.
12305         (build_x_function_call): Initialize `ctypeptr' to NULL_TREE.
12306         (build_function_call_real): Add explicit braces to avoid ambiguous
12307         `else'.
12308         (convert_arguments): Initialize `called_thing' to 0.
12309         (convert_for_initialization): Initialize `savew' and `savee' to 0.
12310
12311         * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0.
12312         (digest_init): Initialize `old_tail_contents' to NULL_TREE.
12313         (build_x_arrow): Likewise for `last_rval'.
12314
12315         * xref.c (GNU_xref_decl): Initialize `cls' to 0.
12316
12317 Sun Feb  1 12:45:34 1998  J"orn Rennecke  <amylaar@cygnus.co.uk>
12318
12319         * decl.c (init_decl_processing): Use set_sizetype.
12320         * decl2.c (sizetype): Don't declare.
12321         * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype.
12322         (c_sizeof_nowarn, build_binary_op_nodefault): Likewise.
12323         (build_component_addr, unary_complex_lvalue): Likewise.
12324         * rtti.c (expand_class_desc): Likewise.
12325         * class.c (get_vfield_offset): Likewise.
12326
12327 Thu Jan 29 10:39:30 1998  Mark Mitchell  <mmitchell@usa.net>
12328
12329         * pt.c (convert_nontype_argument): Move check for is_overloaded_fn
12330         early to avoid bogus error.  Handle overloaded function
12331         names provided as template arguments correctly.
12332         (coerce_template_parms): Don't mishandle overloaded functions when
12333         dealing with template template parameters.
12334         (lookup_template_class): Issue an error message, rather than
12335         crashing, when the TYPE_DECL provided is not a template type.
12336
12337 Wed Jan 28 23:14:44 1998  Jason Merrill  <jason@yorick.cygnus.com>
12338
12339         * class.c (instantiate_type): Don't just return a known type if
12340         it's wrong.
12341
12342 Wed Jan 28 11:04:07 1998  Mark Mitchell  <mmitchell@usa.net>
12343
12344         * class.c (instantiate_type): Remove handling of FUNCTION_DECL
12345         since that code could never be reached.
12346
12347         * error.c (dump_decl): Avoid aborting in the midst of printing an
12348         error message about an illegal template declaration.
12349
12350         * parse.y (structsp): Print an error message, rather than crashing,
12351         when a class-head does not name a class.
12352
12353         * pt.c (convert_nontype_argument):  Allow REAL_TYPE and COMPLEX_TYPE
12354         template arguments as a g++ extension.
12355
12356         * cp-tree.def (ALIGNOF_EXPR): New tree code.
12357         * decl2.c (grok_alignof): If processing_template_decl, just store
12358         the expression.
12359         * typeck.c (c_alignof): Likewise.
12360         * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR.
12361         * error.c (dump_expr): Likewise.
12362         * pt.c (tsubst_copy): Likewise.
12363         * tree.c (cp_tree_equal): Likewise.
12364         * pt.c (uses_template_parms): Correctly determine whether or not a
12365         SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant
12366         folding can be done.
12367
12368         * cp-tree.h (grok_enum_decls): Remove type parameter.
12369         * decl.c (grok_enum_decls): Likewise.
12370         * decl2.c (grok_x_components): Call grok_enum_decls
12371         unconditionally, since it will do nothing if there is no
12372         current_local_enum.  Use the new calling sequence.
12373         * pt.c (tsubst_enum): Use the new calling sequence for
12374         grok_enum_decls.
12375
12376         * decl.c (start_function): Make member functions of local classes
12377         in extern inline functions have comdat linkage here...
12378         (grokdeclarator): Rather than here.
12379
12380 Wed Jan 28 10:55:47 1998  Jason Merrill  <jason@yorick.cygnus.com>
12381
12382         * pt.c (convert_nontype_argument): Use decl_constant_value.
12383
12384 Tue Jan 27 16:42:21 1998  Mark Mitchell  <mmitchell@usa.net>
12385
12386         * call.c (add_template_candidate_real): New function.
12387         (add_template_candidate): Use it.
12388         (add_template_conv_candidate): Likewise.
12389         (joust): Pass extra argument to more_specialized.
12390         * class.c (instantiate_type): Handle a single FUNCTION_DECL.
12391         (is_local_class): Remove.
12392         (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
12393         * cp-tree.h (is_local_class): Remove.
12394         (perform_array_to_pointer_conversion): Likewise.
12395         (finish_member_template_decl): Add.
12396         (check_explicit_specialization): Return a tree, not an int.
12397         (more_specialized): Take additional argument.
12398         (get_bindings): Likewise.
12399         (TI_PENDING_SPECIALIZATION_FLAG): New macro.
12400         * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
12401         (perform_array_to_pointer_conversion): Remove.
12402         * decl.c (saved_scope): Add processing_specialization,
12403         processing_explicit_instantiation fields.
12404         (maybe_push_to_top_level): Save them.
12405         (pop_from_top_level): Restore them.
12406         (grokfndecl): Use new return value from
12407         check_explicit_specialization.
12408         (start_decl): Don't check flag_guiding_decls before pushing
12409         decls.
12410         (cp_finish_decl): Remove previous (bogus) change.
12411         (grok_declarator): Use decl_function_context rather than
12412         is_local_class.
12413         * decl2.c (finish_file): Pass extra argument to get_bindings.
12414         (build_expr_from_tree): Let build_x_component_ref check
12415         validity of arguments rather than doing it here.
12416         * lex.c (cons_up_default_function): Remove code fooling with
12417         processing_specialization, processing_explicit_instantiation
12418         flags, as that is now done in {maybe_push_top,pop_from}_top_level.
12419         * method.c (build_overload_identifier): Mangle local classes in
12420         template functions correctly.
12421         * parse.y (finish_member_template_decl): Move to pt.c.
12422         * pt.c (finish_member_template_decl): Moved here from parse.y.
12423         (print_candidates): New function.
12424         (determine_specialization): Change interface.  Properly look for
12425         most specialized versions of template candidates.
12426         (check_explicit_specialization): Fully process explicit
12427         instantiations.
12428         (push_template_decl): Avoid looking at CLASSTYPE fields in
12429         FUNCTION_DECLS.
12430         (determine_overloaded_function): Remove.
12431         (convert_nontype_argument): Change name from
12432         convert_nontype_parameter.  Use determine_overloaded_function
12433         instead of instantiate_type.
12434         (mangle_class_name_for_template): Handle type contexts as well as
12435         function contexts.
12436         (classtype_mangled_name): Likewise.
12437         (lookup_template_class): Likewise.
12438         (tsubst): Likewise.
12439         (more_specialized): Take explict template arguments as a
12440         parameter.
12441         (most_specialized): Likewise.
12442         (get_bindings): Likewise.  Check that return types match before
12443         proclaiming a function a match.
12444         (do_decl_instantiation): Remove code searching for function to
12445         instantiate; that is now done in check_explicit_specialization.
12446         (add_maybe_template): Pass extra argument to get_bindings.
12447         * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
12448         implementation.
12449         * typeck.c (build_component_ref): Check for invalid arguments.
12450
12451 Tue Jan 27 01:44:02 1998  Jason Merrill  <jason@yorick.cygnus.com>
12452
12453         * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
12454         return_target and call_target are equivalent.
12455
12456         * pt.c (type_unification_real): Just accept function parms that
12457         don't use any template parms.
12458
12459 Sun Jan 25 03:30:00 1998  Jason Merrill  <jason@yorick.cygnus.com>
12460
12461         * decl.c (cp_finish_decl): When bailing on a comdat variable, also
12462         unset DECL_NOT_REALLY_EXTERN.
12463
12464         * parse.y (typename_sub*): Fix std::.
12465
12466 Sat Jan 24 12:13:54 1998  Jason Merrill  <jason@yorick.cygnus.com>
12467
12468         * error.c (dump_decl): Fix type default template args.
12469         (dump_type): Hand TEMPLATE_DECL off to dump_decl.
12470
12471 Fri Jan 23 18:34:37 1998  Mumit Khan  <khan@xraylith.wisc.edu>
12472
12473         * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
12474         (file_name_nondirectory): Use.
12475
12476 Wed Jan 21 10:29:57 1998  Kriang Lerdsuwanakij  <lerdsuwa@scf.usc.edu>
12477
12478         * pt.c (coerce_template_parms): Don't access elements of ARGLIST
12479         that are not really present.  Substitute default arguments in
12480         template template arguments.  Correctly convert TEMPLATE_DECL to
12481         TEMPLATE_TEMPLATE_PARM.
12482         (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM
12483         are no longer treated specially here.
12484         * parse.y (template_template_parm): Fix copy error.
12485         * decl.c (grokdeclarator): Warn about missing `typename' for nested
12486         type created from template template parameters.
12487         * parse.y (bad_parm): Likewise
12488
12489         * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM.
12490         (push_nested_class): Likewise.
12491         * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code.
12492         * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro.
12493         (copy_template_template_parm): Declare.
12494         * decl.c (arg_looking_for_template): New variable.
12495         (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM.
12496         Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM
12497         node if arg_looking_for_template is nonzero.
12498         (pushdecl): Handle TEMPLATE_TEMPLATE_PARM.
12499         (grok_op_properties, xref_tag, xref_basetypes): Likewise.
12500         (grokdeclarator): Handle TEMPLATE_DECL.
12501         * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM.
12502         * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM.
12503         (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM.
12504         (dump_decl): Handle unnamed template type parameters.
12505         Handle template template parameters.
12506         (dump_function_name): Handle template template parameters.
12507         * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef):
12508         Handle TEMPLATE_TEMPLATE_PARM.
12509         * method.c (build_template_template_parm_names): New function.
12510         (build_template_parm_names): Handle TEMPLATE_DECL.
12511         (build_overload_nested_name, build_overload_name):
12512         Handle TEMPLATE_TEMPLATE_PARM.
12513         * parse.y (maybe_identifier): New nonterminal.
12514         (template_type_parm): Use it.
12515         (template_template_parm, template_arg1): New nonterminal.
12516         (template_parm): Add template_template_parm rules.
12517         (template_arg): Set processing_template_arg.
12518         (template_arg1): Rules moved from template_arg.
12519         (primary, nonnested_type): Set arg_looking_for_template if we are
12520         processing template arguments.
12521         * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL.
12522         (process_template_parm): Handle template template parameters.
12523         (coerce_template_parms, comp_template_args): Likewise.
12524         (mangle_class_name_for_template, lookup_template_class): Likewise.
12525         (uses_template_parms): Handle TEMPLATE_DECL and
12526         TEMPLATE_TEMPLATE_PARM.
12527         (current_template_args): Handle TEMPLATE_DECL.
12528         (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM.
12529         * search.c (dfs_walk, dfs_record_inheritance):
12530         Handle TEMPLATE_TEMPLATE_PARM.
12531         * tree.c (copy_template_template_parm): New function.
12532         (mapcar): Handle TEMPLATE_TEMPLATE_PARM.
12533         * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM.
12534
12535 Mon Jan 19 22:40:03 1998  Mark Mitchell  <mmitchell@usa.net>
12536
12537         * decl.c (start_decl): Don't allow duplicate definitions of static
12538         data members.
12539
12540         * call.c (build_user_type_conversion_1): Handle user-defined
12541         template conversion operators correctly.
12542
12543         * decl2.c (build_expr_from_tree): Issue an error message if the
12544         object in a COMPONENT_REF is a TEMPLATE_DECL.
12545
12546         * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs.
12547
12548         * class.c (is_local_class): New function.
12549         * cp-tree.h (is_local_class): Declare it.
12550         (last_tree): Likewise.
12551         (begin_tree): Likewise.
12552         (end_tree): Likewise.
12553         (lookup_template_class): Change prototype.
12554         * decl.c (cp_finish_decl): Check for NULL where necessary.
12555         Consider FUNCTION_DECLS to declare objects with top-level binding,
12556         when calling make_decl_rtl.
12557         (grokdeclarator): Give members of local classes internal linkage.
12558         (start_function): Remove declaration of last_tree.
12559         (finish_function): Set flag_keep_inline_functions around call to
12560         rest_of_compilation if we are processing a member function in a
12561         local class.
12562         (start_method): Call push_template_decl for member functions of
12563         local classes in template functions.
12564         * decl2.c (import_export_decl): Don't give external linkage to
12565         instantiations of templates with internal linkage.
12566         * parse.y (last_tree): Remove declaration.
12567         (template_type): Pass extra parameter to lookup_template_class.
12568         (self_template_type): Likewise.
12569         (structsp): Move call to reset_specialization into left_curly.
12570         (left_curly): Call reset_specialization, and begin_tree.
12571         * pt.c (saved_trees): New variable.
12572         (mangle_class_name_for_template): Change prototype.  Use
12573         additional function context to name local classes in templates
12574         correctly.
12575         (classtype_mangled_name): Pass the context.
12576         (push_template_decl): Handle local classes and templates, and
12577         member functions for such classes.
12578         (convert_nontype_parameter): Fix handling of pointer-to-member
12579         constants.
12580         (lookup_template_class): Handle local classes in templates.
12581         (tsubst): Likewise.  Don't assume that template instantiations
12582         have external linkage; pay attention to the template declaration.
12583         (mark_decl_instantiated): Likewise.
12584         (begin_tree): New function.
12585         (end_tree): Likewise.
12586
12587         * decl.c (xref_basetypes): Don't call complete_type for basetypes
12588         that involve template parameters; that can lead to infinite
12589         recursion unnecessarily.
12590
12591         * pt.c (register_specialization): Do not register specializations
12592         that aren't ready to be registered yet.
12593         (check_explicit_specialization): Handle explicit specialization of
12594         constructors and destructors.
12595         (build_template_decl): New function.
12596         (push_template_delc): Handle out-of-class specializations of
12597         member templates.
12598
12599         * pt.c (check_explicit_specialization): Set up the template
12600         information before registering the specialization.
12601         (coerce_template_parms): Fix thinko.
12602         (tsubst): Handle specializations of member templates correctly.
12603
12604         * class.c (finish_struct_methods): Remove calls to
12605         check_explicit_specialization from here.
12606         (finish_struct): And insert them here.
12607         * cp-tree.h (perform_qualification_conversions): New function.
12608         (perform_array_to_pointer_conversion): Likewise.
12609         (begin_explicit_instantiation): Likewise.
12610         (end_explicit_instantiation): Likewise.
12611         (determine_specialization): Renamed from
12612         determine_explicit_specialization.
12613         (comp_template_parms): New function.
12614         (processing_explicit_instantiation): New variable.
12615         * cvt.c (perform_qualification_conversions): New function.
12616         (perform_array_to_pointer_conversion): Likewise.
12617         * decl.c (duplicate_decls): Don't consider template functions
12618         alike unless they have the same parameters.  Refine handling of
12619         instantiation/specialization mismatches.
12620         (start_decl): Don't call pushdecl for template specializations,
12621         since they don't affect overloading.
12622         (start_function): Likewise.
12623         (grokfndecl): Call check_explicit_specialization a little later.
12624         Don't call duplicate_decls for memberm template specializations.
12625         (grokdeclarator): Don't update template_count for classes that are
12626         themselves specializations.  Remove use of `2' as parameter to
12627         grokfndecl since that value isn't used.
12628         * lex.c (cons_up_default_function): Save and restore
12629         processing_explicit_instantiation around calls to grokfield.
12630         * parse.y (finish_member_template_decl): New function.
12631         (component_decl_1): Use it.
12632         (fn.def2): Likewise.
12633         (template_arg_list_opt): New nonterminal.
12634         (template_type): Use it.
12635         (self_template_type): Likewise.
12636         (template_id): Likewise.
12637         (object_template_id): Likewise.
12638         (notype_template_declarator): Likwise.
12639         (begin_explicit_instantiation): Likewise.
12640         (end_explicit_instantiation): Likewise.
12641         (explicit_instantiation): Use them.
12642         * pt.c (coerce_template_parms): Add parameters.
12643         (processing_explicit_instantiation): New variable.
12644         (convert_nontype_parameter): New function.
12645         (determine_overloaded_function): Likewise.
12646         (begin_explicit_instantiation): Likewise.
12647         (end_explicit_instantiation): Likewise.
12648         (retrieve_specialization): Likewise.
12649         (register_specialization): Likewise.
12650         (processing_explicit_specialization): Removed.
12651         (determine_specialization): Handle specializations of member
12652         functions of template class instantiations.
12653         (check_explicit_specialization): Refine to conform to standard.
12654         (comp_template_parms): New function.
12655         (coerce_template_parms): Call convert_nontype_parameter.
12656         (tsubst): Refine handling of member templates.  Use
12657         register_specialization.
12658         (instantiate_template): Use retrieve_specialization.
12659         (do_decl_instantiation): Likewise.
12660         (instantiate_decl): Likewise.
12661         (type_unification): Improve handling of explict template
12662         arguments.
12663         * tree.c (mapcar): Return error_mark_node, rather than aborting,
12664         on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
12665         * typeck.c (build_unary_op): Call determine_specialization, rather
12666         than determine_explicit_specialization.
12667
12668 Mon Jan 19 13:18:51 1998  Jason Merrill  <jason@yorick.cygnus.com>
12669
12670         * cvt.c (build_up_reference): A TARGET_EXPR has side effects.
12671
12672 Fri Jan 16 11:40:50 1998  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
12673
12674         * error.c (dump_decl): For enum tags, output the tag, not its value.
12675
12676 1998-01-13  Brendan Kehoe  <brendan@cygnus.com>
12677
12678         * decl.c (init_decl_processing): Only call init_rtti_processing
12679         FLAG_RTTI is set.
12680
12681 Mon Jan 12 01:35:18 1998  Jason Merrill  <jason@yorick.cygnus.com>
12682
12683         * init.c (build_new_1): Split out from build_new.
12684         (build_new): Just return a NEW_EXPR.
12685         * expr.c (cplus_expand_expr): Handle NEW_EXPR.
12686
12687         * decl2.c (get_temp_regvar): Tweak.
12688
12689         * cp-tree.h (TREE_CALLS_NEW): Comment out.
12690         * class.c (resolves_to_fixed_type_p): Remove use.
12691         * method.c (build_opfncall): Likewise.
12692         * call.c (build_new_op): Likewise.
12693
12694 Wed Jan  7 23:47:13 1998  Jason Merrill  <jason@yorick.cygnus.com>
12695
12696         * exception.cc (__eh_alloc, __eh_free): New fns.
12697         (__cp_push_exception, __cp_pop_exception): Use them.
12698         (__uncatch_exception): Call terminate here if no exception.
12699         * except.c (build_terminate_handler): New fn.
12700         (expand_start_catch_block): Use it.
12701         (expand_exception_blocks): Likewise.
12702         (alloc_eh_object): New fn.
12703         (expand_throw): Use it.  Protect exception init with terminate.
12704         * typeck.c (build_modify_expr): Remove code that ignores trivial
12705         methods.
12706
12707 Mon Dec 22 11:36:27 1997  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12708
12709         * call.c (add_builtin_candidate): Add default case in enumeration
12710         switch.
12711         (build_new_op): Likewise.
12712         (convert_like): Likewise.
12713         * cvt.c (build_expr_type_conversion): Likewise.
12714         * tree.c (real_lvalue_p): Likewise.
12715         (lvalue_p): Likewise.
12716         (cp_tree_equal): Likewise.
12717         * typeck.c (comptypes): Likewise.
12718         (build_component_ref): Likewise.
12719         (build_function_call_real): Likewise.
12720         (build_binary_op_nodefault): Likewise.
12721         (build_unary_op): Likewise.
12722         (build_modify_expr): Likewise.
12723         * typeck2.c (initializer_constant_valid_p): Likewise.
12724
12725 Sun Dec 21 15:59:00 1997  Nick Clifton  <nickc@cygnus.com>
12726
12727         * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas.
12728
12729 Thu Dec 18 14:51:50 1997  Mark Mitchell  <mmitchell@usa.net>
12730
12731         * pt.c (coerce_template_parms): Make sure to digest_init if
12732         possible.
12733
12734         * decl.c (duplicate_decls): Make the newdecl virtual if the
12735         olddecl was, just as is done with other attributes of olddecl.
12736
12737 Thu Dec 18 14:43:19 1997  Jason Merrill  <jason@yorick.cygnus.com>
12738
12739         * typeck.c (unary_complex_lvalue): Ignore op0 when taking the
12740         address of an OFFSET_REF.
12741
12742         * cp-tree.def: Add AGGR_INIT_EXPR.
12743         * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
12744         AGGR_INIT_EXPR where appropriate.
12745         * expr.c (cplus_expand_expr): Likewise.  Simplify.
12746
12747         * decl2.c (finish_file): Remove call to register_exception_table.
12748
12749 Wed Dec 17 17:08:52 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
12750
12751         * pt.c (instantiate_class_template): Don't do injection when
12752         processing_template_decl is true, as pollutes current_binding_level
12753         for base classes.
12754
12755 Wed Dec 17 21:17:39 1997  Peter Schmid  <schmid@ltoi.iap.physik.tu-darmstadt.de>
12756
12757         * pt.c (maybe_fold_nontype_arg): Add prototype.
12758
12759 Tue Dec 16 10:31:20 1997  Jason Merrill  <jason@yorick.cygnus.com>
12760
12761         * tree.c (mapcar): Handle TRY_CATCH_EXPR et al.
12762         * error.c (dump_expr): Likewise.
12763
12764 Mon Dec 15 12:22:04 1997  Jason Merrill  <jason@yorick.cygnus.com>
12765
12766         * typeck.c (build_function_call_real): Remove "inline called before
12767         definition" pedwarn.
12768
12769         * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg.
12770
12771 Sun Dec 14 22:34:20 1997  Jason Merrill  <jason@yorick.cygnus.com>
12772
12773         * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
12774
12775         * pt.c (type_unification_real): Change __null to type void* with
12776         a warning.
12777
12778 Sun Dec 14 20:38:35 1997  Mark Mitchell  <mmitchell@usa.net>
12779
12780         * call.c (implicit_conversion): Don't call
12781         build_user_type_conversion_1 with a NULL expr, since it will
12782         crash.
12783
12784         * pt.c (unify): Don't try to unify array bounds if either array is
12785         unbounded.
12786
12787 Fri Dec 12 16:09:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
12788
12789         * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at):
12790         Replace extern decls with casts.
12791
12792         * decl.c (expand_start_early_try_stmts): Don't mess with a sequence.
12793         Update last_parm_cleanup_insn.
12794         (store_after_parms): Remove.
12795         * cp-tree.h: Adjust.
12796
12797 Thu Dec 11 22:18:37 1997  Jason Merrill  <jason@yorick.cygnus.com>
12798
12799         * decl2.c (comdat_linkage): Also set DECL_COMDAT.
12800         (finish_file): Check DECL_COMDAT instead of weak|one_only.
12801         (import_export_vtable): Use make_decl_one_only instead of
12802         comdat_linkage for win32 tweak.
12803         (import_export_decl): Likewise.
12804         * pt.c (mark_decl_instantiated): Likewise.
12805
12806         * decl2.c (finish_file): Lose handling of templates in pending_statics.
12807
12808 Thu Dec 11 21:12:09 1997  Jason Merrill  <jason@yorick.cygnus.com>
12809
12810         * decl2.c (finish_file): Lose call to expand_builtin_throw.
12811         * except.c (expand_builtin_throw): Remove.
12812         * cp-tree.h: Remove ptr_ptr_type_node.
12813         * decl.c: Likewise.
12814
12815 Thu Dec 11 20:43:33 1997  Teemu Torma  <tot@trema.com>
12816
12817         * decl.c (ptr_ptr_type_node): Define.
12818         (init_decl_processing): Initialize it.
12819         * cp-tree.h: Declare it.
12820         * exception.cc (__cp_exception_info): Use __get_eh_info.
12821         (__cp_push_exception): Likewise.
12822         (__cp_pop_exception): Likewise.
12823
12824         From Scott Snyder <snyder@d0sgif.fnal.gov>:
12825         * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
12826         saved_pc.
12827         (init_exception_processing): Removed saved_pc initialization.
12828
12829 Wed Dec 10 11:04:45 1997  Jason Merrill  <jason@yorick.cygnus.com>
12830
12831         * pt.c (instantiate_decl): Defer all templates but inline functions.
12832
12833 Mon Dec  8 23:17:13 1997  Jason Merrill  <jason@yorick.cygnus.com>
12834
12835         * init.c (expand_vec_init): Don't fold a list of parameters.
12836
12837         * decl.c (copy_args_p): Handle copy elision for types with virtual
12838         bases.
12839         * call.c (build_over_call): Likewise.
12840
12841 Sun Dec  7 22:38:12 1997  Mark Mitchell  <mmitchell@usa.net>
12842
12843         * pt.c (lookup_template_function): Copy the template arguments,
12844         not just the list containing them, to the permanent obstack.
12845
12846 Sun Dec  7 15:53:06 1997  Jason Merrill  <jason@yorick.cygnus.com>
12847
12848         * except.c (expand_start_catch_block): suspend_momentary for the
12849         terminate handler.
12850
12851         * error.c (dump_decl): Handle LOOKUP_EXPR.
12852
12853 Sun Dec  7 15:45:07 1997  Mark Mitchell  <mmitchell@usa.net>
12854
12855         * rtti.c (build_dynamic_cast): Copy the cast-to type to the
12856         permanent obstack if we are processing a template decl.
12857         * typeck.c (build_static_cast): Likewise.
12858         (build_const_cast): Likewise.
12859         (build_reinterpret_cast): Likewise.
12860
12861         * pt.c (coerce_template_parms): Coerce some expressions, even
12862         when processing_template_decl.
12863
12864 Sun Dec  7 01:46:33 1997  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
12865
12866         * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
12867         handling of pointer difference expressions.
12868
12869         * typeck.c (comp_target_types): Comparison of function/method types
12870         is independent of nptrs.
12871
12872 Sun Dec  7 01:40:27 1997  Mark Mitchell  <mmitchell@usa.net>
12873
12874         * pt.c (tsubst): Avoid creating pointer to reference and
12875         reference to reference types.
12876
12877 Sat Dec  6 01:29:37 1997  Jason Merrill  <jason@yorick.cygnus.com>
12878
12879         * parse.y (do_id): New nonterminal.
12880         (template_id): Use it.
12881
12882 Fri Dec  5 01:17:34 1997  Jason Merrill  <jason@yorick.cygnus.com>
12883
12884         * parse.y (template_id): do_identifier for PFUNCNAMEs, too.
12885         * spew.c (yylex): Don't do_identifier here.
12886         * decl2.c (build_expr_from_tree): Revert last change.
12887
12888         * decl2.c (build_expr_from_tree): Expand the name for a method call.
12889         * parse.y (object_template_id): Don't try to take the DECL_NAME.
12890
12891 Wed Dec  3 20:02:39 1997  Jason Merrill  <jason@yorick.cygnus.com>
12892
12893         * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for
12894         alloc_expr.
12895         * call.c (build_op_delete_call): Adjust.
12896
12897         * except.c (expand_end_catch_block): Lose rethrow region.
12898         (expand_start_catch_block): Likewise.
12899         (expand_end_catch_block): Don't expand_leftover_cleanups.
12900
12901 Wed Dec  3 13:24:04 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
12902
12903         * pt.c (tsubst): Remove tree_cons call (places redundant info into
12904         DECL_TEMPLATE_INSTANTIATION).
12905
12906 Wed Dec  3 11:44:52 1997  Jason Merrill  <jason@yorick.cygnus.com>
12907
12908         * tree.c (is_overloaded_fn): Handle getting a fn template.
12909         (really_overloaded_fn): Likewise.
12910         * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better.
12911         * pt.c (check_explicit_specialization): Tweak.
12912         (determine_explicit_specialization): Tweak.
12913
12914         * tree.c, cp-tree.h (get_target_expr): New fn.
12915
12916 Wed Dec  3 08:47:27 1997  Paul Eggert  <eggert@twinsun.com>
12917
12918         * pt.c (check_explicit_specialization): Fix misspelling in
12919         diagnostic: `preceeded'.
12920         * typeck.c (get_delta_difference): Fix misspelling in diagnostic:
12921         `conversiona'.
12922
12923 1997-12-02  Mark Mitchell  <mmitchell@usa.net>
12924
12925         * pt.c (determine_explicit_specialization): Avoid an internal
12926         error for bad specializations.
12927
12928         * method.c (build_overload_value): Handle SCOPE_REF.
12929
12930 Tue Dec  2 19:18:50 1997  Mike Stump  <mrs@wrs.com>
12931
12932         * class.c (prepare_fresh_vtable): Enable even more complex MI
12933         vtable names.
12934
12935 Tue Dec  2 01:37:19 1997  Jason Merrill  <jason@yorick.cygnus.com>
12936
12937         * exception.cc (__check_eh_spec): Optimize a bit.
12938
12939         * exception.cc (__cp_pop_exception): Lose handler arg.
12940         * except.c (do_pop_exception): Likewise.
12941         (push_eh_cleanup): Let the cleanup mechanism supply the handler.
12942         (expand_end_catch_block): Likewise.
12943
12944 Fri Nov 28 01:58:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
12945
12946         * pt.c (check_explicit_specialization): Complain about using a
12947         template-id for a non-specialization.
12948
12949 Fri Nov 28 12:35:19 1997  Scott Christley  <scottc@net-community.com>
12950
12951         * repo.c: Prototype rindex only if needed.
12952         * xref.c: Likewise.
12953
12954 Fri Nov 28 01:56:35 1997  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
12955
12956         * error.c (dump_decl): Handle TEMPLATE_ID_EXPR.
12957
12958 Thu Nov 27 00:59:46 1997  Jason Merrill  <jason@yorick.cygnus.com>
12959
12960         * typeck.c (build_const_cast): Handle references here instead of
12961         handing off to convert_to_reference.
12962
12963         * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
12964         TerminateFunctionCall.
12965         (init_exception_processing): Likewise.  Terminate et al are now
12966         the fns, not ADDR_EXPRs.
12967         (various): Lose redundant assemble_external calls.
12968         (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/.
12969
12970         * cp-tree.h (struct lang_decl_flags): Add comdat.
12971         (DECL_COMDAT): New macro.
12972         * decl.c (duplicate_decls): Propagate it.
12973         (cp_finish_decl): Handle it.
12974         * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs.
12975
12976         * class.c: Remove static pending_hard_virtuals.
12977         (add_virtual_function): Take pointers to pending_virtuals
12978         and pending_hard_virtuals.
12979         (finish_struct_1): Pass them.  Declare pending_hard_virtuals.
12980
12981 Wed Nov 26 20:28:49 1997  Jason Merrill  <jason@yorick.cygnus.com>
12982
12983         * decl2.c (import_export_vtable): If we support one_only but not
12984         weak symbols, mark instantiated template vtables one_only.
12985         (import_export_decl): Likewise for tinfo functions.
12986         (finish_vtable_vardecl): Also write out vtables from explicitly
12987         instantiated template classes.
12988         * pt.c (mark_class_instantiated): Revert last change.
12989
12990         * except.c (expand_throw): Call mark_used on the destructor.
12991
12992 Wed Nov 26 15:13:48 1997  Jeffrey A Law  (law@cygnus.com)
12993
12994         * lex.c (lang_init): Enable flag_exceptions by default if no
12995         command line switch was specified.
12996
12997 1997-11-26  Mark Mitchell  <mmitchell@usa.net>
12998
12999         * pt.c (unify): Handle `void' template parameters in
13000         specializations.
13001
13002 Wed Nov 26 01:11:24 1997  Jason Merrill  <jason@yorick.cygnus.com>
13003
13004         * rtti.c (build_dynamic_cast): Handle template case here.
13005         (build_dynamic_cast_1): Not here.
13006
13007         * typeck2.c (digest_init): Make copies where appropriate.
13008
13009         * decl2.c (delete_sanity): resolve_offset_ref.
13010
13011         * except.c: Call terminate without caching so many bits.
13012
13013         * except.c (expand_start_catch_block): Fix catching a reference
13014         to pointer.
13015
13016 Tue Nov 25 11:28:21 1997  Jason Merrill  <jason@yorick.cygnus.com>
13017
13018         * init.c (build_new): Copy size to the saveable obstack.
13019
13020         * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the
13021         TRY_CATCH_EXPR for now.
13022
13023 Mon Nov 24 12:15:55 1997  Jason Merrill  <jason@yorick.cygnus.com>
13024
13025         * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
13026         has DECL_LANG_SPECIFIC.
13027
13028         * exception.cc (struct cp_eh_info): Add handlers field.
13029         (__cp_push_exception): Initialize it.
13030         (__cp_pop_exception): Decrement it.  Don't pop unless it's 0.
13031         (__throw_bad_exception): Remove.
13032         * except.c (call_eh_info): Add handlers field.
13033         (get_eh_handlers): New fn.
13034         (push_eh_cleanup): Increment handlers.
13035
13036 Fri Nov 21 12:22:07 1997  Jason Merrill  <jason@yorick.cygnus.com>
13037
13038         * except.c (expand_start_eh_spec): Use the try/catch code.
13039         (expand_end_eh_spec): Likewise.  Call __check_eh_spec instead of
13040         doing everything inline.
13041         (init_exception_processing): throw_type_match now takes
13042         const void pointers.
13043         * exception.cc (__check_eh_spec): New fn.
13044         * inc/exception: Neither terminate nor unexpected return.
13045         * decl.c: Make const_ptr_type_node public.
13046         * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly.
13047
13048         * except.c (expand_start_catch_block): We only need the rethrow
13049         region for non-sjlj exceptions.
13050         (expand_end_catch_block): Likewise.  Use outer_context_label_stack.
13051
13052 Thu Nov 20 14:40:17 1997  Jason Merrill  <jason@yorick.cygnus.com>
13053
13054         * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
13055         (various.o): Likewise.
13056         * inc/new: Add placement deletes.  Add throw specs for default new.
13057         * new.cc (set_new_handler): Move here from libgcc2.
13058         * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
13059         (new): Move from libgcc2.  Throw bad_alloc.
13060         * new2.cc: Move the rest of the op news and op deletes from libgcc2.
13061         * decl.c (init_decl_processing): Update exception specs on new and
13062         delete.
13063
13064         * method.c (build_decl_overload_real): Don't mess with global
13065         placement delete.
13066
13067         * init.c (build_new): Check for null throw spec, not nothrow_t.
13068
13069         * decl.c (duplicate_decls): Don't complain about different exceptions
13070         from an internal declaration.
13071
13072         * call.c (build_op_delete_call): Fix check for member fns again.
13073
13074         * decl2.c (import_export_decl): Interface hackery affects
13075         virtual synthesized methods.
13076
13077 Wed Nov 19 18:24:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
13078
13079         * decl.c (start_decl): Don't just complain about a mismatched
13080         scope, fix it.
13081
13082         * decl.c (make_implicit_typename): Handle case where t is not
13083         actually from context.
13084         * tree.c (get_type_decl): Lose identifier case.
13085         * spew.c (yylex): Lose useless call to identifier_typedecl_value.
13086         * parse.y (nonnested_type): Just use lookup_name.
13087         (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
13088
13089 Wed Nov 19 11:45:07 1997  Michael Tiemann  <tiemann@axon.cygnus.com>
13090
13091         * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
13092         T was built in C language context (for example, by
13093         output_func_start_profiler).
13094
13095 Wed Nov 19 10:39:27 1997  Jason Merrill  <jason@yorick.cygnus.com>
13096
13097         * decl.c (make_implicit_typename): New fn.
13098         (lookup_name_real): Use it.  Use current_class_type as the context.
13099
13100 Mon Nov 17 23:42:03 1997  Bruno Haible  <haible@ilog.fr>
13101
13102         * pt.c (do_poplevel): Don't prohibit jumps into this contour.
13103
13104 Mon Nov 17 02:01:28 1997  Jason Merrill  <jason@yorick.cygnus.com>
13105
13106         * friend.c (do_friend): Warn about non-template friends in templates.
13107
13108         * call.c (build_op_delete_call): Fix handling of inherited delete.
13109
13110         * search.c (dfs_record_inheritance): Ignore template type parms.
13111
13112 Sat Nov 15 00:30:51 1997  Jason Merrill  <jason@yorick.cygnus.com>
13113
13114         * call.c (build_new_op): Fix copy error.
13115         (build_op_new_call): New fn.
13116         (build_op_delete_call): New fn.
13117         * cp-tree.h: Declare them.
13118         * init.c (build_new): Use them.  Support placement delete.
13119         (build_x_delete): Use build_op_delete_call.
13120         (build_delete): Likewise.
13121         * decl2.c (delete_sanity): Likewise.
13122         (coerce_delete_type): Don't complain about placement delete.
13123
13124 Thu Nov 13 01:52:36 1997  Jason Merrill  <jason@yorick.cygnus.com>
13125
13126         * call.c (build_new_function_call): Remove unused 'obj' parm.
13127         * cp-tree.h, typeck.c: Adjust.
13128
13129         * init.c (build_new): Make the cleanup last longer.
13130         (expand_vec_init): Call do_pending_stack_adjust.
13131
13132 Wed Nov 12 11:04:33 1997  Jason Merrill  <jason@yorick.cygnus.com>
13133
13134         * pt.c (do_type_instantiation): Fix typo.
13135         (mark_class_instantiated): If we support one_only but not weak
13136         symbols, don't mark this as known.
13137
13138         * init.c (build_new): Handle vec delete in EH cleanup.
13139
13140 Wed Nov 12 08:11:55 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
13141
13142         * call.c (build_method_call): Call complete_type before checking
13143         for destructor.
13144
13145 Sun Nov  9 01:29:55 1997  Jim Wilson  (wilson@cygnus.com)
13146
13147         * decl.c (add_block_current_level): Delete.
13148         * init.c (build_vec_delete_1): Delete build_block and
13149         add_block_current_level calls.
13150
13151 Wed Nov 12 00:48:16 1997  Jason Merrill  <jason@yorick.cygnus.com>
13152
13153         * init.c (build_new): Handle freeing allocated memory when the
13154         constructor throws.
13155
13156         * call.c (build_new_method_call): Fix flags arg.
13157
13158         * pt.c (do_type_instantiation): Don't try to instantiate
13159         member templates.
13160         (mark_decl_instantiated): If we support one_only but not
13161         weak symbols, mark this one_only.
13162         * decl2.c (import_export_vtable): Don't defer handling of vtables
13163         if MULTIPLE_SYMBOL_SPACES.
13164
13165 Tue Nov 11 12:02:12 1997  Jason Merrill  <jason@yorick.cygnus.com>
13166
13167         * except.c (expand_end_catch_block): Lose call to __sjpopnthrow.
13168
13169 Tue Nov 11 02:53:44 1997  Jason Merrill  <jason@lasher.cygnus.com>
13170
13171         * except.c (do_pop_exception): Return a value.
13172
13173 Mon Nov 10 20:25:31 1997  Jason Merrill  <jason@yorick.cygnus.com>
13174
13175         * call.c (build_new_method_call): Handle getting a
13176         TEMPLATE_ID_EXPR around a TEMPLATE_DECL.  Don't look for a field
13177         if we got template parms.
13178         * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR,
13179         not just the args.
13180         * decl2.c (build_expr_from_tree): Tweak last change.
13181         * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE.
13182         (maybe_fold_nontype_arg): Split out from tsubst_copy.
13183         * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR.
13184
13185 Mon Nov 10 20:08:38 1997  Kriang Lerdsuwanakij  <lerdsuwa@scf-fs.usc.edu>
13186
13187         * pt.c (tsubst_copy): Handle explicit template arguments in
13188         function calls.
13189         * typeck.c (build_x_function_call): Likewise.
13190         * decl2.c (build_expr_from_tree): Lookup function name if it
13191         hasn't been done.
13192
13193         * pt.c (tsubst): Instantiate template functions properly when
13194         template parameter does not appear in function arguments and return
13195         type.
13196         (comp_template_args): Handle member templates required by tsubst.
13197
13198 Mon Nov 10 20:08:38 1997  Jason Merrill  <jason@yorick.cygnus.com>
13199
13200         * decl.c (grokdeclarator): Tweak conditions for pedwarn in
13201         previous change.
13202
13203 Mon Nov 10 20:08:29 1997  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
13204
13205         * pt.c (coerce_template_parms): Tweak error message.
13206
13207         * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
13208         return type defaults to `int', even if there are storage-class
13209         specifiers.
13210
13211 Mon Nov 10 03:04:20 1997  Jason Merrill  <jason@yorick.cygnus.com>
13212
13213         Complete nested exception support.
13214         * except.c (do_pop_exception): Split out...
13215         (push_eh_cleanup): From here.  Handle the EH region by hand.
13216         (expand_start_catch_block): Add a new level for the catch parm.
13217         Move the rethrow region outside the two cleanup regions.
13218         Protect the initializer for the catch parm with terminate.
13219         (expand_end_catch_block): Likewise.  End the region for the eh_cleanup.
13220         * exception.cc (__cp_pop_exception): Now takes two parms.  Handle
13221         popping off the middle of the stack.
13222         * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
13223         WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
13224         (build_cplus_new): Only wrap CALL_EXPRs.
13225         * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
13226         the constructor call.
13227
13228 Sun Nov  9 18:00:26 1997  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
13229
13230         * Make-lang.in (c++.distdir): Make inc subdirectory.
13231
13232 Fri Nov  7 11:57:28 1997  Jason Merrill  <jason@yorick.cygnus.com>
13233
13234         * decl2.c (finish_file): Put back some code.
13235
13236 Thu Nov  6 11:28:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
13237
13238         * decl2.c (finish_file): Remove redundant code.
13239         * method.c (emit_thunk): Don't let the backend defer generic thunks.
13240
13241 Wed Nov  5 23:52:50 1997  Jason Merrill  <jason@yorick.cygnus.com>
13242
13243         * except.c (call_eh_info): Split out...
13244         (push_eh_info): From here.
13245         (expand_builtin_throw): Use it.
13246         (expand_start_catch_block): Move region start back.
13247
13248 Tue Nov  4 13:45:10 1997  Doug Evans  <devans@canuck.cygnus.com>
13249
13250         * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
13251         (real_yylex): Record wide strings using target endianness, not host.
13252
13253 1997-11-03  Brendan Kehoe  <brendan@lisa.cygnus.com>
13254
13255         * repo.c (rindex): Add decl unconditionally.
13256         (get_base_filename, open_repo_file): Don't cast rindex.
13257         * xref.c (rindex): Add decl unconditionally.
13258         (index): Remove unused decl.
13259         (open_xref_file): Don't cast rindex.
13260
13261 Sun Nov  2 15:04:12 1997  Jason Merrill  <jason@yorick.cygnus.com>
13262
13263         * class.c (build_vbase_path): Propagate the result type properly.
13264
13265 1997-11-01  Brendan Kehoe  <brendan@lisa.cygnus.com>
13266
13267         * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
13268         remaining use of saved_throw_type with a call to get_eh_type.
13269
13270 1997-10-31  Brendan Kehoe  <brendan@lisa.cygnus.com>
13271
13272         * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
13273         (file_name_nondirectory): New function, doing the same as the macro.
13274         (set_typedecl_interface_info): Use it instead of the macro.
13275         (check_newline): Likewise.
13276         (handle_cp_pragma): Likewise.
13277
13278         * repo.c (get_base_filename): Cast result of rindex to char*.
13279         (open_repo_file): Likewise.
13280         * xref.c (open_xref_file): Likewise.
13281         * error.c (dump_char): Make its arg int, not char.
13282
13283         * except.c (push_eh_info): Pass the number of fields - 1 down, not
13284         the exact number of fields.
13285
13286 Fri Oct 31 01:47:57 1997  Jason Merrill  <jason@yorick.cygnus.com>
13287
13288         Support for nested exceptions.
13289         * tinfo2.cc (__is_pointer): New fn.
13290         * exception.cc (struct cp_eh_info): Define.
13291         (__cp_exception_info, __uncatch_exception): New fns.
13292         (__cp_push_exception, __cp_pop_exception): New fns.
13293         * except.c: Lose saved_throw_{type,value,cleanup,in_catch}.
13294         Lose empty_fndecl.
13295         (init_exception_processing): Likewise.  __eh_pc is now external.
13296         (push_eh_info): New fn.
13297         (get_eh_{info,value,type,caught}): New fns.
13298         (push_eh_cleanup): Just call __cp_pop_exception.
13299         (expand_start_catch_block): Use push_eh_info.  Start the eh region
13300         sooner.
13301         (expand_end_eh_spec): Use push_eh_info.
13302         (expand_throw): Call __cp_push_exception to set up the exception info.
13303         Just pass the destructor or 0 as the cleanup.  Call __uncatch_exception
13304         when we rethrow.
13305         (expand_builtin_throw): Don't refer to empty_fndecl.
13306
13307 Thu Oct 23 02:01:30 1997  Jason Merrill  <jason@yorick.cygnus.com>
13308
13309         * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl.
13310
13311 1997-10-22  Brendan Kehoe  <brendan@cygnus.com>
13312
13313         * method.c (build_template_parm_names, build_decl_overload_real):
13314         Add static to definitions.
13315         * pt.c (add_to_template_args, note_template_header,
13316         processing_explicit_specialization, type_unification_real): Likewise.
13317         ({determine,check}_explicit_specialization): Use a single string for
13318         error messages.
13319
13320 Mon Oct 20 12:06:34 1997  Jason Merrill  <jason@yorick.cygnus.com>
13321
13322         * except.c (expand_exception_blocks): Call do_pending_stack_adjust.
13323         (expand_end_catch_block): Likewise.
13324         (expand_end_eh_spec): Likewise.
13325
13326 Mon Oct 20 11:44:20 1997  Mark Mitchell  <mmitchell@usa.net>
13327
13328         * decl.c (duplicate_decls): Handle template specializations
13329         correctly.
13330         * error.c (dump_function_name): Fix printing of specializations of
13331         member functions that are not member templates.
13332         * cp-tree.h (processing_specialization): Make global.
13333         * pt.c (processing_specialization): Likewise.
13334         * lex.c (cons_up_default_function): Save and restore
13335         processing_specialization to avoid confusion.
13336
13337 Mon Oct 20 10:52:22 1997  Jason Merrill  <jason@yorick.cygnus.com>
13338
13339         * decl.c (init_decl_processing): Give null_node unknown* type.
13340         * typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
13341         (common_type): Likewise.
13342         * error.c (args_as_string): Recognize null_node.
13343
13344 Sun Oct 19 09:13:01 1997  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
13345
13346         * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
13347         (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
13348
13349         * decl.c (init_decl_processing): Call using_eh_for_cleanups.
13350
13351         * Make-lang.in (g++): Include prefix.o.
13352
13353 Thu Oct 16 15:31:09 1997  Judy Goldberg  <judygold@sanwafp.com>
13354
13355         * pt.c (determine_explicit_specialization): Initialize "dummy"
13356         to keep Purify quiet.
13357
13358 Thu Oct 16 00:14:48 1997  Jason Merrill  <jason@yorick.cygnus.com>
13359
13360         * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here.
13361         (build_overload_int): Not here.
13362
13363 Wed Oct 15 00:35:28 1997  Mike Stump  <mrs@wrs.com>
13364
13365         * class.c (build_type_pathname): Remove.
13366         (prepare_fresh_vtable): Fix problem with complex MI vtable names.
13367
13368 1997-10-14  Brendan Kehoe  <brendan@lisa.cygnus.com>
13369
13370         * parse.y (unary_expr): Give a pedwarn if someone tries to use the
13371         &&label GNU extension.
13372
13373 Tue Oct 14 12:01:00 1997  Mark Mitchell  <mmitchell@usa.net>
13374
13375         * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it,
13376         so as to avoid incorrect manglings.
13377         * method.c (build_decl_overload_real): Don't mangle return types
13378         for constructors.
13379
13380 Tue Oct 14 11:46:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
13381
13382         * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
13383         scratch_tree_cons): Define as macros for now.
13384         * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
13385         lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
13386         typeck2.c: Use them and the expression_obstack variants.
13387
13388 Mon Oct 13 17:41:26 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
13389
13390         * decl.c (store_return_init): Allow classes with explicit ctors to
13391         be used with the named return values extension.
13392
13393 Fri Oct 10 12:21:11 1997  Jason Merrill  <jason@yorick.cygnus.com>
13394
13395         * pt.c (instantiate_decl): Fix previous change.
13396
13397 Thu Oct  9 12:08:21 1997  Jason Merrill  <jason@yorick.cygnus.com>
13398
13399         * pt.c (tsubst): Fix thinko.
13400         (instantiate_decl): Really use the original template.
13401
13402         * call.c (build_new_method_call): Use simple constructor_name for
13403         error messages.
13404
13405 Wed Oct  8 22:44:42 1997  Jeffrey A Law  <law@cygnus.com>
13406
13407         * method.c (build_underscore_int): Don't use ANSI specific
13408         features.
13409
13410 Wed Oct  8 00:18:22 1997  Jason Merrill  <jason@yorick.cygnus.com>
13411
13412         * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN
13413         for our key method; it might have been inlined by -O3.
13414
13415 Tue Oct  7 23:00:12 1997  Mark Mitchell  <mmitchell@usa.net>
13416
13417         * decl.c (make_typename_type): Do not try to call lookup_field for
13418         non-aggregate types.
13419
13420 Tue Oct  7 22:52:10 1997  Jason Merrill  <jason@yorick.cygnus.com>
13421
13422         * typeck.c (build_reinterpret_cast): Tweak.
13423
13424 Tue Oct  7 22:45:31 1997  Alexandre Oliva  <oliva@dcc.unicamp.br>
13425
13426         * typeck.c (build_reinterpret_cast): Converting a void pointer
13427         to function pointer with a reinterpret_cast produces a warning
13428         if -pedantic is issued.
13429
13430 Tue Oct  7 22:43:43 1997  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>
13431
13432         * typeck.c (c_expand_return): Don't warn about returning a
13433         reference-type variable as a reference.
13434
13435 Tue Oct  7 21:11:22 1997  Jason Merrill  <jason@yorick.cygnus.com>
13436
13437         * method.c (build_static_name): Fix typo.
13438
13439 1997-10-07  Brendan Kehoe  <brendan@lisa.cygnus.com>
13440
13441         * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on
13442         OLDDECL before we try to do DECL_USE_TEMPLATE.
13443
13444 Tue Oct  7 00:48:36 1997  Jason Merrill  <jason@yorick.cygnus.com>
13445
13446         * decl.c (duplicate_decls): Don't warn about template instances.
13447
13448         * typeck.c (mark_addressable): Lose ancient code that unsets
13449         DECL_EXTERNAL.
13450
13451         * pt.c (do_decl_instantiation): Lose support for instantiating
13452         non-templates.
13453
13454         * call.c (build_new_function_call): Fix handling of null explicit
13455         template args.
13456         (build_new_method_call): Likewise.
13457
13458 Mon Oct  6 23:44:34 1997  Mark Mitchell  <mmitchell@usa.net>
13459
13460         * method.c (build_underscore_int): Fix typo.
13461
13462 1997-10-06  Brendan Kehoe  <brendan@lisa.cygnus.com>
13463
13464         * tree.c (print_lang_statistics): #if 0 call to
13465         print_inline_obstack_statistics until its definition is checked in.
13466
13467 Mon Oct  6 09:27:29 1997  Jason Merrill  <jason@yorick.cygnus.com>
13468
13469         * decl2.c (finish_file): Move dump_tree_statistics to end.
13470
13471         * pt.c (instantiate_decl): Look for the original template.
13472         (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
13473         of member templates.
13474
13475 Wed Oct  1 08:41:38 1997  Jason Merrill  <jason@yorick.cygnus.com>
13476
13477         * Makefile.in (g++FAQ.*): New rules.
13478         (CONFLICTS): Update.
13479         * g++FAQ.texi: Moved from libg++.
13480
13481         * parse.y (PFUNCNAME): Only specify the type once.
13482
13483 1997-10-01  Brendan Kehoe  <brendan@lasher.cygnus.com>
13484
13485         * lex.c (real_yylex): Clean up the code to fully behave the way
13486         the c-lex.c parser does for complex and real numbers.
13487
13488 Tue Sep 30 08:51:36 1997  Jason Merrill  <jason@yorick.cygnus.com>
13489
13490         * method.c (build_decl_overload_real): Reformat.
13491
13492 Tue Sep 30 00:18:26 1997  Jason Merrill  <jason@yorick.cygnus.com>
13493
13494         * method.c (synthesize_method): If at_eof, determine our linkage.
13495
13496 1997-09-29  Paul Eggert  <eggert@twinsun.com>
13497
13498         * lex.c (real_yylex): Treat `$' just like `_', except issue a
13499         diagnostic if !dollars_in_ident or if pedantic.
13500
13501         * lang-specs.h (@c++): -ansi no longer implies -$.
13502
13503         * decl2.c (lang_decode_option):
13504         -traditional and -ansi now do not mess with
13505         dollars_in_ident.
13506
13507 Mon Sep 29 19:57:51 1997  H.J. Lu  <hjl@gnu.ai.mit.edu>
13508
13509         * Makefile.in (parse.o, decl.o): Also depend on
13510         $(srcdir)/../except.h $(srcdir)/../output.h.
13511         (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
13512         $(srcdir)/../except.h $(srcdir)/../output.h.
13513         (typeck.o, init.o): Also depend on $(srcdir)/../expr.h
13514         ../insn-codes.h.
13515
13516         * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.
13517
13518         * expr.c (cplus_expand_expr): Make it static.
13519
13520         * decl2.c, init.c, typeck.c: Include "expr.h".
13521         (expand_expr): Use proper values when calling the function.
13522
13523 Mon Sep 29 11:05:54 1997  Alexandre Oliva  <oliva@dcc.unicamp.br>
13524
13525         * lang-options.h: New -Wold-style-cast flag.
13526         * cp-tree.h (warn_old_style_cast): New variable.
13527         * decl2.c (warn_old_style_cast): Likewise.
13528         (lang_decode_option): Support -Wold-style-cast.
13529         (reparse_absdcl_as_casts): Produce old-style-cast warning.
13530
13531 Mon Sep 29 09:20:53 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
13532
13533         * decl.c (cp_finish_decl): Allow expand_aggr_init to set
13534         TREE_USED, reset value based on already_used.
13535
13536         * init.c (expand_member_init): Revert change.
13537
13538 Mon Sep 29 08:57:53 1997  Jason Merrill  <jason@yorick.cygnus.com>
13539
13540         * cp-tree.h, decl.c, decl2.c, pt.c:
13541         Lose DECL_C_STATIC and DECL_PUBLIC.  Don't pretend statics are public.
13542
13543         * decl2.c (lang_decode_option): Add missing ;.
13544
13545 Sat Sep 27 16:22:48 1997  Jason Merrill  <jason@yorick.cygnus.com>
13546
13547         * friend.c (do_friend): Disable injection for all template-derived
13548         decls.
13549         * decl2.c (lang_decode_option): Handle -fguiding-decls.
13550         * parse.y (notype_template_declarator): New nonterminal.
13551         (direct_notype_declarator): Use it.
13552         (complex_direct_notype_declarator): Likewise.
13553         (object_template_id): Accept any kind of identifier after TEMPLATE.
13554         (notype_qualified_id): Don't add template declarators here.
13555
13556 Sat Sep 27 16:21:58 1997  Mark Mitchell  <mmitchell@usa.net>
13557
13558         * call.c (add_template_candidate): Add explicit_targs parameter.
13559         (build_scoped_method_call): Use it.
13560         (build_overload_call_real): Likewise.
13561         (build_user_type_conversion_1): Likewise.
13562         (build_new_function_call): Likewise.
13563         (build_object_call): Likewise.
13564         (build_new_op): Likewise.
13565         (build_new_method_call): Likewise.
13566         (build_new_function_call): Handle TEMPLATE_ID_EXPR.
13567         (build_new_method_call): Likewise.
13568
13569         * class.c (finish_struct_methods): Add specialization pass to
13570         determine which methods were specializing which other methods.
13571         (instantiate_type): Handle TEMPLATE_ID_EXPR.
13572
13573         * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.
13574
13575         * cp-tree.h (name_mangling_version): New variable.
13576         (flag_guiding_decls): Likewise.
13577         (build_template_decl_overload): New function.
13578         (begin_specialization): Likewise.
13579         (reset_specialization): Likewise.
13580         (end_specialization): Likewise.
13581         (determine_explicit_specialization): Likewise.
13582         (check_explicit_specialization): Likewise.
13583         (lookup_template_function): Likewise.
13584         (fn_type_unification): Add explicit_targs parameter.
13585         (type_unification): Likewise.
13586
13587         * decl.c (duplicate_decls): Add smarts for explicit
13588         specializations.
13589         (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
13590         specializations.
13591         (grokfndecl): Call check_explicit_specialization.
13592
13593         * decl2.c (lang_decode_option): Handle -fname-mangling-version.
13594         (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
13595         (check_classfn): Handle specializations.
13596
13597         * error.c (dump_function_name): Print specialization arguments.
13598
13599         * friend.c (do_friend): Don't call pushdecl for template
13600         instantiations.
13601
13602         * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.
13603
13604         * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
13605         and -fno-guiding-decls.
13606
13607         * lex.c (identifier_type): Return PFUNCNAME for template function
13608         names.
13609
13610         * method.c (build_decl_overload_real): New function.
13611         (build_template_parm_names): New function.
13612         (build_overload_identifier): Use it.
13613         (build_underscore_int): New function.
13614         (build_overload_int): Use it.  Add levels for template
13615         parameters.
13616         (build_overload_name): Likewise.  Also, handle TYPENAME_TYPEs.
13617         (build_overload_nested_names): Handle template type parameters.
13618         (build_template_decl_overload): New function.
13619
13620         * parse.y (YYSTYPE): New ntype member.
13621         (nested_name_specifier): Use it.
13622         (nested_name_specifier_1): Likewise.
13623         (PFUNCNAME): New token.
13624         (template_id, object_template_id): New non-terminals.
13625         (template_parm_list): Note specializations.
13626         (template_def): Likewise.
13627         (structsp): Likewise.
13628         (fn.def2): Handle member template specializations.
13629         (component_decl_1): Likewise.
13630         (direct_notype_declarator): Handle template-ids.
13631         (component_decl_1): Likewise.
13632         (direct_notype_declarator): Handle template-ids.
13633         (primary): Handle TEMPLATE_ID_EXPR, and template-ids.
13634
13635         * pt.c (processing_specializations): New variable.
13636         (template_header_count): Likewise.
13637         (type_unification_real): New function.
13638         (processing_explicit_specialization): Likewise.
13639         (note_template_header): Likewise.
13640         (is_member_template): Handle specializations.
13641         (end_template_decl): Call reset_specialization.
13642         (push_template_decl): Handle member template specializations.
13643         (tsubst): Likewise.
13644         (tsubst_copy): Handle TEMPLATE_ID_EXPR.
13645         (instantiate_template): Handle specializations.
13646         (instantiate_decl): Likewise.
13647         (fn_type_unification): Handle explicit_targs.
13648         (type_unification): Likewise.  Allow incomplete unification
13649         without an error message, if allow_incomplete.
13650         (get_bindings): Use new calling sequence for fn_type_unification.
13651
13652         * spew.c (yylex): Handle PFUNCNAME.
13653
13654         * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
13655         (really_overloaded_fn): Likewise.
13656         (get_first_fn): Handle function templates.
13657
13658         * typeck.c (build_x_function_call): Use really_overloaded_fn.
13659         Handle TEMPLATE_ID_EXPR.
13660         (build_x_unary_op): Likewise.
13661         (build_unary_op): Likewise.
13662         (mark_addressable): Templates whose address is taken are marked
13663         as used.
13664
13665 1997-09-25  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
13666
13667         * decl.c (init_decl_processing): Declare __builtin_constant_p as
13668         accepting any kind of type, not only int.
13669
13670 Fri Sep 26 00:22:56 1997  Jason Merrill  <jason@yorick.cygnus.com>
13671
13672         * search.c (get_matching_virtual): Notice virtual bases when sorrying
13673         about covariant returns.
13674
13675         * parse.y (member_init): Also imply typename here.  Remove ancient
13676         extension for initializing base members.
13677
13678 Thu Sep 25 11:11:13 1997  Jason Merrill  <jason@yorick.cygnus.com>
13679
13680         Handle multi-level typenames and implicit typename in base list.
13681         * parse.y (typename_sub{,[0-2]}): New rules.
13682         (structsp, rule TYPENAME_KEYWORD): Use typename_sub.
13683         (nonnested_type): New rule.
13684         (complete_type_name): Use it.
13685         (base_class.1): Use typename_sub and nonnested_type.
13686         (nested_name_specifier): Don't elide std:: here.
13687         * decl.c (make_typename_type): Handle getting a type for NAME.
13688         (lookup_name_real): Turn std:: into :: here.
13689
13690         Rvalue conversions were removed in London.
13691         * call.c (is_subseq): Don't consider lvalue transformations.
13692         (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK.
13693         (joust): Re-enable ?: kludge.
13694
13695 1997-09-22  Brendan Kehoe  <brendan@lisa.cygnus.com>
13696
13697         * decl.c (start_function): Up warning of no return type to be a
13698         pedwarn.
13699
13700 Mon Sep 22 14:15:34 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
13701
13702         * init.c (expand_member_init): Don't set TREE_USED.
13703         * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
13704         set,don't clear TREE_USED wholesale.
13705
13706 Sat Sep 20 15:31:00 1997  Jason Merrill  <jason@yorick.cygnus.com>
13707
13708         * call.c (build_over_call): Do require_complete_type before
13709         build_cplus_new.
13710
13711 Thu Sep 18 16:47:52 1997  Jason Merrill  <jason@yorick.cygnus.com>
13712
13713         * search.c (lookup_field): Call complete_type in all cases.
13714
13715         * decl.c (finish_function): Just warn about flowing off the end.
13716
13717 Wed Sep 17 10:31:25 1997  Jason Merrill  <jason@yorick.cygnus.com>
13718
13719         * decl.c (grokparms): Don't bash a permanent list node if we're
13720         in a function.
13721
13722 1997-09-17  Brendan Kehoe  <brendan@lisa.cygnus.com>
13723
13724         * Makefile.in (CONFLICTS): Fix s/r conflict count to 18.
13725
13726 Tue Sep 16 14:06:56 1997  Jason Merrill  <jason@yorick.cygnus.com>
13727
13728         * call.c (build_new_op): Give better error for syntactically
13729         correct, but semantically invalid, use of undeclared template.
13730
13731         * call.c (compare_qual): Handle pmfs.
13732
13733         * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
13734         after the exception spec.
13735
13736 Mon Sep 15 11:52:13 1997  Jason Merrill  <jason@yorick.cygnus.com>
13737
13738         * call.c (null_ptr_cst_p): Integer type, not integral type.
13739
13740         * call.c (joust): Disable warnings until they can be moved to the
13741         right place.
13742
13743 Fri Sep 12 16:11:13 1997  Per Bothner  <bothner@cygnus.com>
13744
13745         * Makefile.in, config-lang.in:  Convert to autoconf.
13746
13747 Thu Sep 11 17:14:55 1997  Jason Merrill  <jason@yorick.cygnus.com>
13748
13749         * decl.c (lookup_name_real): Add implicit 'typename' to types from
13750         base classes.
13751
13752         * pt.c (most_specialized_class): Fix typo.
13753         (tsubst): Move constant folding to TREE_VEC case.
13754
13755 Thu Sep 11 10:08:45 1997  Mark Mitchell  <mmitchell@usa.net>
13756
13757         * pt.c (do_poplevel): Don't warn about unused local variables
13758         while processing_template_decl since we don't always know whether
13759         or not they will need constructing/destructing.
13760
13761         * pt.c (uses_template_parms): Check the values of an enumeration
13762         type to make sure they don't depend on template parms.
13763
13764         * decl.c (make_typename_type): Don't lookup the field if the
13765         context uses template parms, even if we're not
13766         processing_template_decl at the moment.
13767
13768         * pt.c (coerce_template_parms): Avoid looking at the
13769         TYPE_LANG_DECL portion of a typename type, since there won't be
13770         one.
13771         (tsubst): Do constant folding as necessary to make sure that
13772         arguments passed to lookup_template_class really are constants.
13773
13774 Wed Sep 10 11:21:55 1997  Jason Merrill  <jason@yorick.cygnus.com>
13775
13776         * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO.
13777         * decl2.c (finish_file): Only register exception tables if we
13778         need to.
13779
13780         * decl.c (init_decl_processing): Add __builtin_[fs]p.
13781
13782 Tue Sep  9 19:49:38 1997  Jason Merrill  <jason@yorick.cygnus.com>
13783
13784         * pt.c (unify): Just return 0 for a TYPENAME_TYPE.
13785
13786 Tue Sep  9 17:57:25 1997  Mark Mitchell  <mmitchell@usa.net>
13787
13788         * error.c (dump_decl): Avoid crashing when presented with a
13789         uninitialized constant, as can occur with a template parameter.
13790         (dump_expr): Make sure that there are enough levels of
13791         current_template_parms before we start diving through them.
13792
13793 1997-09-09  Brendan Kehoe  <brendan@lisa.cygnus.com>
13794
13795         * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to
13796         c-typeck.c.
13797
13798 Tue Sep  9 09:36:39 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
13799
13800         * except.c (expand_throw): Call build_delete for all
13801         exception types, not just objects with destructors.
13802
13803 Mon Sep  8 02:33:20 1997  Jody Goldberg  <jodyg@idt.net>
13804
13805         * decl.c (current_local_enum): Remove static.
13806         * pt.c (tsubst_enum): Save and restore value of current_local_enum
13807         in case template is expanded in enum decl.
13808         (instantiate_class_template): Use new tsubst_enum signature.
13809         (tsubst_expr): Likewise.
13810
13811 Mon Sep  8 01:21:43 1997  Mark Mitchell  <mmitchell@usa.net>
13812
13813         * pt.c (begin_member_template_processing): Take a function as
13814         argument, not a set of template arguments.  Use the template
13815         parameters, rather than the arguments.  Handle non-type parameters
13816         correctly.  Push a binding level for the parameters so that multiple
13817         member templates using the same parameter names can be declared.
13818         (end_member_template_processing): Pop the binding level.
13819         (push_template_decl): Mark member templates as static when
13820         appropriate.
13821
13822         * lex.c (do_pending_inlines): Pass the function, not its template
13823         arguments, to begin_member_template_processing.
13824         (process_next_inline): Likewise.
13825         (do_pending_defargs): Likewise.
13826
13827         * error.c (dump_expr): Obtain the correct declaration for a
13828         TEMPLATE_CONST_PARM.
13829
13830         * call.c (add_template_conv_candidate): New function.
13831         (build_object_call): Handle member templates, as done in the other
13832         build_ functions.
13833
13834 Sat Sep  6 10:20:27 1997  Mark Mitchell  <mmitchell@usa.net>
13835
13836         * decl.c (replace_defag): Undo previous change.
13837         * lex.c (do_pending_defargs): Deal with member templates.
13838
13839         * pt.c (is_member_template): Avoid crashing when passed a
13840         non-function argument.
13841
13842 Fri Sep  5 17:27:38 1997  Jason Merrill  <jason@yorick.cygnus.com>
13843
13844         * class.c (grow_method): Remove check for redeclaration.
13845
13846 Fri Sep  5 01:37:17 1997  Mark Mitchell  <mmitchell@usa.net>
13847
13848         * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
13849         (DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
13850         (PRIMARY_TEMPLATE_P): Use it.
13851         * call.c (build_overload_call_real): Use it.
13852         * class.c (instantiate_type): Likewise.
13853         * decl.c (decls_match): Likewise.
13854         * method.c (build_overload_identifier): Likewise.
13855         * pt.c (push_template_decl): Likewise.
13856         (classtype_mangled_name): Likewise.
13857         (lookup_template_class): Likewise.
13858
13859         * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
13860         DECL_NTPARMS to conform to usage elsewhere.
13861         * call.c (add_template_candidate): Likewise.
13862         * class.c (instantiate_type): Likewise.
13863         * pt.c (instantiate_template): Likewise.
13864         (get_bindings): Likewise.
13865
13866         * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
13867         is_member_template.
13868
13869         * pt.c (unify): Undo changes to allow multiple levels of template
13870         parameters.
13871         (type_unification): Likewise.
13872         (fn_type_unification): Likewise.
13873         (get_class_bindings): Likewise.
13874         * cp-tree.h (Likewise).
13875
13876         * decl.c (replace_defarg): Check that the type of the default
13877         parameter does not invlove a template type before complaining
13878         about the initialization.
13879
13880         * error.c (dump_expr): Deal with template constant parameters in
13881         member templates correctly.
13882
13883         * pt.c (is_member_template): Deal with class specializations
13884         correctly.
13885         (tsubst): Handle "partial instantiation" of member templates
13886         correctly.
13887
13888 Wed Sep  3 12:30:24 1997  Mark Mitchell  <mmitchell@usa.net>
13889
13890         * pt.c (type_unification): Change calling sequence to allow for
13891         multiple levels of template parameters.
13892         (tsubst_expr): Likewise.
13893         (tsubst): Likewise.
13894         (tsubst_copy): Likewise.
13895         (instantiate_template): Likewise.
13896         (unify): Likewise.
13897         * call.c (build_overload_call_real): Use it.
13898         (add_builtin_candidate): Use it.
13899         (build_new_method_call): Use it.
13900         * class.c (instantiate_type): Use it.
13901         * decl.c (grokdeclarator): Use it.
13902         * decl2.c (finish_file): Use it.
13903         * method.c (build_overload_identifier): Use it.
13904
13905         * call.c (add_template_candidate):  Add additional parameter for
13906         the function return type.  Call fn_type_unification istead of
13907         type_unification.
13908         (build_user_type_conversion_1): Handle member templates.
13909         (build_new_function_call): Likewise.
13910         (build_new_op): Likewise.
13911         (build_new_method_call): Likewise.
13912
13913         * class.c (grow_method): Don't give an error message indicating
13914         that two member templates with the same name are ambiguous.
13915         (finish_struct): Treat member template functions just like member
13916         functions.
13917
13918         * cp-tree.h (check_member_template): Add declaration.
13919         (begin_member_template_processing): Likewise.
13920         (end_member_template_processing): Likewise.
13921         (fn_type_unification): Likewise.
13922         (is_member_template): Likewise.
13923         (tsubst): Change prototype.
13924         (tsubst_expr): Likewise.
13925         (tsubst_copy): Likewise.
13926         (instantiate_template): Likewise.
13927         (get_bindings): Likewise.
13928
13929         * decl.c (decls_match): Handle multiple levels of template
13930         parameters.
13931         (pushdecl): Handle template type params just like other type
13932         declarations.
13933         (push_class_level_binding): Return immediately if the
13934         class_binding_level is NULL.
13935         (grokfndecl): If check_classfn() returns a member_template, use
13936         the result of the template, not the template itself.
13937
13938         * decl2.c (check_member_template): New function.  Check to see
13939         that the entity declared to be a member template can be one.
13940         (check_classfn): Allow redeclaration of member template functions
13941         with different types; the new functions can be specializations or
13942         explicit instantiations.
13943
13944         * error.c (dump_decl): Handle multiple levels of template
13945         parameters.
13946         (dump_function_decl): Update to handle function templates.
13947
13948         * lex.c (do_pending_inlines): Set up template parameter context
13949         for member templates.
13950         (process_next_inline): Likewise.
13951
13952         * method.c (build_overload_identifier): Adjust for multiple levels
13953         of template parameters.
13954
13955         * parse.y (fn.def2): Add member templates.
13956         (component_decl_1): Likewise.
13957
13958         * pt.c (begin_member_template_processing): New function.
13959         (end_member_template_processing): Likewise.
13960         (is_member_template): Likewise.
13961         (fn_type_unification): Likewise.
13962         (current_template_parms): Return a vector of all the template
13963         parms, not just the innermost level of parms.
13964         (push_template_decl): Deal with the possibility of member
13965         templates.
13966         (lookup_template_class): Likewise.
13967         (uses_template_parms): Likewise.
13968         (tsubst): Modify processing to TEMPLATE_TYPE_PARM and
13969         TEMPLATE_CONST_PARM to deal with multiple levels of template
13970         arguments.   Add processing of TEMPLATE_DECL to produce new
13971         TEMPLATE_DECLs from old ones.
13972         (do_decl_instantiation): Handle member templates.
13973
13974         * search.c (lookup_fnfields_1): Handle member template conversion
13975         operators.
13976
13977         * tree.c (cp_tree_equal): Check the levels, as well as the
13978         indices, of TEMPLATE_CONST_PARMs.
13979
13980         * typeck.c (comptypes): Check the levels, as well as the indices,
13981         fo TEMPLATE_TYPE_PARMs.
13982         (build_x_function_call): Treat member templates like member
13983         functions.
13984
13985 Wed Sep  3 11:09:25 1997  Jason Merrill  <jason@yorick.cygnus.com>
13986
13987         * typeck.c (c_expand_return): Always convert_for_initialization
13988         before checking for returning a pointer to local.
13989
13990         * pt.c (type_unification): If strict and the function parm doesn't
13991         use template parms, just compare types.
13992
13993 Wed Sep  3 10:35:49 1997  Klaus Espenlaub  <kespenla@student.informatik.uni-ulm.de>
13994
13995         * method.c (build_overloaded_value): Replace direct call
13996         to the floating point emulator with REAL_VALUE_TO_DECIMAL macro.
13997
13998 Wed Sep  3 00:02:53 1997  Jason Merrill  <jason@yorick.cygnus.com>
13999
14000         * typeck.c (convert_arguments): Don't arbitrarily choose the first
14001         of a set of overloaded functions.
14002
14003 Tue Sep  2 12:09:13 1997  Jason Merrill  <jason@yorick.cygnus.com>
14004
14005         * lex.c (real_yylex): Don't elide __FUNCTION__.
14006
14007         * method.c (build_overload_value): Add in_template parm.
14008         (build_overload_int): Likewise.
14009         (build_overload_identifier): Pass it.
14010
14011         * decl.c (duplicate_decls): Don't bash a previous template
14012         definition with a redeclaration.
14013
14014         * pt.c (unify): float doesn't match double.
14015
14016         * pt.c (do_type_instantiation): Handle getting a _TYPE or a
14017         TYPE_DECL.  Handle getting non-template types.
14018         * parse.y (explicit_instantiation): Use typespec instead of
14019         aggr template_type.
14020
14021 Tue Sep  2 10:27:08 1997  Richard Henderson  <rth@cygnus.com>
14022
14023         * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
14024
14025 Mon Sep  1 13:19:04 1997  Eugene Mamchits  <eugin@ips.ras.ru>
14026
14027         * call.c (add_builtin_candidate): Add missing TREE_TYPE.
14028         (compare_ics): Likewise.
14029
14030 Mon Sep  1 13:19:04 1997  Jason Merrill  <jason@yorick.cygnus.com>
14031
14032         * call.c (joust): Warn about choosing one conversion op over
14033         another because of 'this' argument when the other return type is
14034         better.
14035         (source_type): New fn.
14036
14037         * call.c (build_new_op): Strip leading REF_BIND from first operand
14038         to builtin operator.
14039
14040         * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
14041         use its RTL.
14042
14043 Thu Aug 28 09:45:23 1997  Jason Merrill  <jason@yorick.cygnus.com>
14044
14045         * call.c (null_ptr_cst_p): Remove support for (void*)0.
14046
14047 Wed Aug 27 02:03:34 1997  Jeffrey A Law  <law@cygnus.com>
14048
14049         * typeck.c (expand_target_expr): Make definition match declaration.
14050
14051         * class.c (get_basefndecls): Make definition match declaration.
14052
14053 Mon Aug 25 14:30:02 1997  Jason Merrill  <jason@yorick.cygnus.com>
14054
14055         * input.c (sub_getch): Eventually give up and release the input file.
14056
14057         * decl.c (cp_finish_decl): If #p i/i, put inline statics in the
14058         right place.
14059
14060         * call.c (joust): Tweak message.
14061
14062 Sat Aug 23 18:02:59 1997  Mark Mitchell  <mmitchell@usa.net>
14063
14064         * error.c (type_as_string): Put const/volatile on template type
14065         parameters where appropriate.
14066
14067 Sat Aug 23 17:47:22 1997  Jeffrey A Law  <law@cygnus.com>
14068
14069         * call.c (strictly_better): Make arguments unsigned ints.
14070
14071 Thu Aug 21 18:48:44 1997  Jason Merrill  <jason@yorick.cygnus.com>
14072
14073         * lex.c (real_yylex): Refer to __complex instead of complex.
14074
14075 Thu Aug 21 22:25:46 1997  J"orn Rennecke  <amylaar@cygnus.co.uk>
14076
14077         * lex.c (real_yylex): Don't use getc directly.
14078
14079 Wed Aug 20 17:25:08 1997  Jason Merrill  <jason@yorick.cygnus.com>
14080
14081         * call.c (is_subseq): Don't try to be clever.
14082
14083 Wed Aug 20 03:13:36 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)
14084
14085         * parse.y, pt.c: Include "except.h".
14086         * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
14087         error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
14088         lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
14089         sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
14090         prototyping.
14091
14092 Wed Aug 20 01:34:40 1997  Jason Merrill  <jason@yorick.cygnus.com>
14093
14094         * decl2.c (mark_vtable_entries): Instead of replacing pure
14095         virtuals with a reference to __pure_virtual, copy the decl and
14096         change the RTL.
14097
14098 Tue Aug 19 02:26:07 1997  Jason Merrill  <jason@yorick.cygnus.com>
14099
14100         * pt.c (lookup_nested_type_by_name): Handle typedef wierdness.
14101
14102         * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com.
14103
14104         * pt.c (instantiate_class_template): Call repo_template_used
14105         before finish_prevtable_vardecl.
14106
14107         * call.c (is_subseq): New fn.
14108         (compare_ics): Use it.
14109
14110         * repo.c (finish_repo): Don't crash on no args.
14111
14112         * parse.y (named_complex_class_head_sans_basetype): Handle
14113         explicit global scope.
14114         * decl2.c (handle_class_head): New fn.
14115
14116         * pt.c (unify): Add CONST_DECL case.
14117
14118 Thu Aug 14 10:05:13 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14119
14120         * rtti.c (permanent_obstack): Fix decl to not be a pointer.
14121
14122         * cp-tree.h (report_type_mismatch): Add prototype.
14123         * call.c (build_overload_call_real): Remove erroneous fourth
14124         argument to report_type_mismatch.
14125         (build_user_type_conversion_1): Remove erroneous second arg to
14126         tourney.
14127         (build_new_function_call): Likewise.
14128         (build_object_call): Likewise.
14129         (build_new_op): Likewise.
14130         (build_new_method_call): Likewise.
14131
14132 Wed Aug 13 19:19:25 1997  Jason Merrill  <jason@yorick.cygnus.com>
14133
14134         * error.c (dump_decl): Don't bother processing a function with no
14135         DECL_LANG_SPECIFIC.
14136
14137         * method.c (emit_thunk): Call init_function_start in the macro case.
14138
14139 Wed Aug 13 10:46:19 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)
14140
14141         * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
14142         defined and used to set flag_vtable_thunks.
14143
14144 Tue Aug 12 20:13:57 1997  Jason Merrill  <jason@yorick.cygnus.com>
14145
14146         * parse.y: Don't clear the inlines from their obstack until they've
14147         all been processed.
14148
14149         * decl.c (duplicate_decls): Don't complain about exception
14150         specification mismatch if flag_exceptions is off.
14151
14152 Mon Aug 11 15:01:56 1997  Marc Lehmann  <pcg@goof.com>
14153
14154         * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
14155
14156 Sun Aug 10 12:06:09 1997  Paul Eggert  <eggert@twinsun.com>
14157
14158         * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
14159         * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
14160         Include <stdio.h> before include files that formerly used STDIO_PROTO.
14161
14162         * decl.c, g++spec.c, lex.c, method.c, repo.c:
14163         Include "config.h" first, as per autoconf manual.
14164
14165 Fri Aug  8 11:47:48 1997  Jason Merrill  <jason@yorick.cygnus.com>
14166
14167         * decl.c (duplicate_decls): Tweak wording.
14168         * lex.c (do_pending_defargs): Don't die if we see a default arg
14169         that isn't a DEFAULT_ARG.
14170         * error.c (dump_expr): Handle DEFAULT_ARG.
14171
14172         * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
14173         * lang-options.h: Add -fhandle-exceptions.
14174
14175         * class.c (build_vtable): Vtables are artificial.
14176         (prepare_fresh_vtable): Likewise.
14177
14178 Wed Aug  6 11:02:36 1997  Jason Merrill  <jason@yorick.cygnus.com>
14179
14180         * cvt.c (ocp_convert): After converting to the target type, set
14181         LOOKUP_NO_CONVERSION.
14182
14183         * call.c (joust): Warn about potentially confusing promotion rules
14184         with -Wsign-promo.
14185         * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
14186
14187 Tue Aug  5 15:15:07 1997  Michael Meissner  <meissner@cygnus.com>
14188
14189         * exception.cc: Declare __terminate_func with noreturn attribute.
14190
14191 Fri Aug  1 03:18:15 1997  Jason Merrill  <jason@yorick.cygnus.com>
14192
14193         * parse.y: Break out eat_saved_input, handle errors.
14194         (function_try_block): Use compstmt instead of compstmt_or_error.
14195
14196 Thu Jul 31 17:14:04 1997  Jason Merrill  <jason@yorick.cygnus.com>
14197
14198         * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
14199
14200 Fri Jul  4 01:45:16 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
14201
14202         * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
14203         existence of cc1plus check whether $(LANGUAGES) contains C++.
14204
14205 Wed Jul 30 13:04:21 1997  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
14206
14207         * method.c (do_build_copy_constructor): When copying an anonymous
14208         union member loop around to handle nested anonymous unions.  Use
14209         the offset of the member relative to the outer structure, not the
14210         union.
14211
14212 Tue Jul 29 21:17:29 1997  Jason Merrill  <jason@yorick.cygnus.com>
14213
14214         * call.c (resolve_args): New fn.
14215         (build_new_function_call): Use it.
14216         (build_object_call): Likewise.
14217         (build_new_method_call): Likewise.
14218
14219 Mon Jul 28 16:02:36 1997  Jason Merrill  <jason@yorick.cygnus.com>
14220
14221         * call.c (build_over_call): tsubst all default parms from templates.
14222
14223 Wed Jul 23 13:36:25 1997  Jason Merrill  <jason@yorick.cygnus.com>
14224
14225         * decl.c (struct cp_function): Add static_labelno.
14226         (push_cp_function_context): Save it.
14227         (pop_cp_function_context): Restore it.
14228
14229 Tue Jul 22 14:43:29 1997  Jason Merrill  <jason@yorick.cygnus.com>
14230
14231         * typeck.c (build_component_ref_1): Convert from reference.
14232
14233 Tue Jul 22 11:06:23 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14234
14235         * parse.y (current_declspecs, prefix_attributes): Initialize to
14236         NULL_TREE.
14237
14238         * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil
14239         before we try to force it to be a TREE_LIST.
14240         (decl): Make sure $1.t is non-nil.
14241
14242 Sun Jul 20 11:53:07 1997  Jason Merrill  <jason@yorick.cygnus.com>
14243
14244         * pt.c (uses_template_parms): Handle template first-parse codes.
14245
14246         * decl.c (cp_finish_decl): Only warn about user-defined statics.
14247
14248 Fri Jul 18 17:56:08 1997  Jason Merrill  <jason@yorick.cygnus.com>
14249
14250         * pt.c (unify): Handle BOOLEAN_TYPE.
14251
14252         * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE.
14253         * pt.c (tsubst): Don't set it.
14254         * call.c (build_over_call): Use uses_template_parms.
14255
14256 Thu Jul 17 18:06:30 1997  Jason Merrill  <jason@yorick.cygnus.com>
14257
14258         * method.c (build_overload_nested_name): Use static_labelno
14259         instead of var_labelno.
14260         (build_qualified_name): New fn.
14261         (build_overload_name): Split out from here.
14262         (build_static_name): Use build_qualified_name.
14263         * decl.c (cp_finish_decl): Statics in extern inline functions
14264         have comdat linkage.
14265         (start_function): Initialize static_labelno.
14266
14267 Thu Jul 17 11:20:17 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
14268
14269         * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy
14270         before "all member functions in class [] are private".
14271
14272 Wed Jul 16 23:47:08 1997  Jason Merrill  <jason@yorick.cygnus.com>
14273
14274         * lex.c (do_scoped_id): convert_from_reference.
14275         * init.c (build_offset_ref): Likewise.
14276
14277 Wed Jul 16 12:34:29 1997  Benjamin Kosnik  <bkoz@lisa.cygnus.com>
14278
14279         * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list.
14280
14281 Mon Jul 14 03:23:46 1997  Jason Merrill  <jason@yorick.cygnus.com>
14282
14283         * typeck.c (get_member_function_from_ptrfunc): Promote index
14284         before saving it.
14285
14286 Sun Jul 13 00:11:52 1997  Jason Merrill  <jason@yorick.cygnus.com>
14287
14288         * tree.c (layout_basetypes): Move non-virtual destructor warning.
14289         * decl.c (xref_basetypes): Remove non-virtual destructor warning.
14290
14291 Sat Jul 12 12:47:12 1997  Jason Merrill  <jason@yorick.cygnus.com>
14292
14293         * decl.c (grokdeclarator): Call add_defarg_fn for the function
14294         type, too.
14295         * lex.c (add_defarg_fn): Adjust.
14296         (do_pending_defargs): Adjust.  Don't skip the first parm.
14297
14298 Fri Jul 11 01:39:50 1997  Jason Merrill  <jason@yorick.cygnus.com>
14299
14300         * decl.c (build_enumerator): Global enumerators are also readonly.
14301
14302         * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast.
14303         (build_dynamic_cast): Call it and convert_from_reference.
14304
14305         * lex.c (add_defarg_fn): New fn.
14306         (snarf_defarg): Don't add to defarg_types.
14307         (do_pending_defargs): Lose defarg_types.  All fns we process now
14308         have defargs.
14309         * decl.c (grokfndecl): Call add_defarg_fn.
14310
14311         * Makefile.in (CONFLICTS): Expect 18 s/r conflicts.
14312         * cp-tree.def: Add DEFAULT_ARG.
14313         * spew.c (yylex): Call snarf_defarg as appropriate.
14314         * parse.y: New tokens DEFARG and DEFARG_MARKER.
14315         (defarg_again, pending_defargs, defarg, defarg1): New rules.
14316         (structsp): Use pending_defargs.
14317         (parms, full_parm): Use defarg.
14318         * lex.c (init_lex): Initialize inline_text_firstobj.
14319         (do_pending_inlines): Never pass the obstack to feed_input.
14320         (process_next_inline): Call end_input instead of restore_pending_input.
14321         (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs,
14322         finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns.
14323         * input.c (end_input): New fn.
14324         (sub_getch): At the end of some fed input, just keep returning EOF
14325         until someone calls end_input.
14326         Remove 'obstack' field from struct input_source.
14327         * decl.c (grokparms): Handle DEFAULT_ARG.
14328         (replace_defarg): New fn.
14329         * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros.
14330
14331 Wed Jul  9 13:44:12 1997  Jason Merrill  <jason@yorick.cygnus.com>
14332
14333         * call.c (implicit_conversion): If nothing else works, try binding
14334         an rvalue to a reference.
14335
14336 Wed Jul  9 13:04:38 1997  Geoffrey Noer  <noer@cygnus.com>
14337
14338         * decl.c (init_decl_processing): Fix Jun 30 patch -- move
14339         ifndef for Cygwin32 to include SIGSEGV.
14340
14341 Thu Jul  3 01:44:05 1997  Jason Merrill  <jason@yorick.cygnus.com>
14342
14343         * class.c (finish_struct_1): Only complain about pointers without
14344         copy stuff if there are any constructors.
14345
14346         * rtti.c (build_dynamic_cast): Call complete_type on the types.
14347
14348         * decl.c (grokfndecl): If the function we chose doesn't actually
14349         match, die.
14350
14351         * decl2.c (grokclassfn): Don't specify 'const int' for the
14352         artificial destructor parm.
14353
14354         * pt.c (type_unification): If we are called recursively, nothing
14355         decays.
14356
14357 Mon Jun 30 17:53:21 1997  Geoffrey Noer  <noer@cygnus.com>
14358
14359         * decl.c (init_decl_processing): Stop trying to catch signals
14360         other than SIGABRT since the Cygwin32 library doesn't support
14361         them correctly yet.  This fixes a situation in which g++ causes
14362         a hang on SIGSEGVs and other such signals in our Win32-hosted
14363         tools.
14364
14365 Mon Jun 30 14:50:01 1997  Jason Merrill  <jason@yorick.cygnus.com>
14366
14367         * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
14368
14369 Fri Jun 27 15:18:49 1997  Jason Merrill  <jason@yorick.cygnus.com>
14370
14371         * typeck2.c (store_init_value): Always return the value if our
14372         type needs constructing.
14373
14374         * method.c (hack_identifier): Convert class statics from
14375         reference, too.
14376
14377 Thu Jun 26 11:44:46 1997  Jason Merrill  <jason@yorick.cygnus.com>
14378
14379         * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
14380
14381 Thu Jun 19 16:49:28 1997  Mike Stump  <mrs@cygnus.com>
14382
14383         * typeck.c (c_expand_return): Make sure we clean up temporaries at
14384         the end of return x;
14385
14386 Thu Jun 19 12:28:43 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14387
14388         * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER.
14389
14390 Tue Jun 17 18:35:57 1997  Mike Stump  <mrs@cygnus.com>
14391
14392         * except.c (expand_builtin_throw): Add support
14393         -fno-sjlj-exceptions -fPIC exception handling on the SPARC.
14394
14395 Mon Jun 16 01:24:37 1997  Jason Merrill  <jason@yorick.cygnus.com>
14396
14397         * repo.c (extract_string): Null-terminate.
14398
14399         * cp-tree.h (TI_SPEC_INFO): New macro.
14400         (CLASSTYPE_TI_SPEC_INFO): New macro.
14401         * pt.c (push_template_decl): Correctly determine # of template parms
14402         for partial specs.
14403
14404         * call.c (compare_ics): Really fix 'this' conversions.
14405
14406         * pt.c (do_decl_instantiation): Don't crash on explicit inst of
14407         non-template fn.
14408
14409         * pt.c (push_template_decl): Complain about mismatch in # of
14410         template parms between a class template and a member template.
14411
14412 Sun Jun 15 02:38:20 1997  Jason Merrill  <jason@yorick.cygnus.com>
14413
14414         * method.c (synthesize_method): You can't call
14415         function_cannot_inline_p after finish_function.
14416         * decl.c (finish_function): Turn on flag_inline_functions and turn
14417         off DECL_INLINE before handing a synthesized method to the
14418         backend.
14419
14420 Thu Jun 12 17:35:28 1997  Jason Merrill  <jason@yorick.cygnus.com>
14421
14422         * method.c (synthesize_method): Remove July 30 change to never set
14423         DECL_INLINE if at_eof.
14424
14425 Thu Jun 12 15:25:08 1997  Mike Stump  <mrs@cygnus.com>
14426
14427         * xref.c (GNU_xref_member): Ensure that the node has a
14428         decl_lang_specific part before checking DECL_FRIEND_P.
14429
14430 Thu Jun 12 12:36:05 1997  Jason Merrill  <jason@yorick.cygnus.com>
14431
14432         * pt.c (instantiate_class_template): Diagnose non-class types used
14433         as bases.
14434
14435 Wed Jun 11 17:33:40 1997  Jason Merrill  <jason@yorick.cygnus.com>
14436
14437         * typeck.c (build_conditional_expr): Use convert_for_initialization
14438         instead of convert_and_check.
14439
14440 Wed Jun 11 12:31:33 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14441
14442         * parse.y (typespec): Don't pedwarn for typeof.
14443
14444 Tue Jun 10 00:22:09 1997  Jason Merrill  <jason@yorick.cygnus.com>
14445
14446         * repo.c (finish_repo): Only check changes if we would write a
14447         repo file.
14448
14449         * call.c (compare_ics): Fix handling of 'this' conversions.
14450
14451         * pt.c (do_decl_instantiation): Support static data too.  Rename
14452         from do_function_instantiation.
14453         * cp-tree.h: Adjust.
14454         * parse.y: Adjust.
14455
14456         * repo.c (extract_string): New fn.
14457         (get_base_filename): Use it.
14458         (init_repo): Compare old args with current args.
14459
14460 Mon Jun  9 14:25:30 1997  Mike Stump  <mrs@cygnus.com>
14461
14462         * Makefile.in, Make-lang.in: Protect C-ls with a comment
14463         character, idea from Paul Eggert <eggert@twinsun.com>.
14464
14465 Mon Jun  9 01:52:03 1997  Jason Merrill  <jason@yorick.cygnus.com>
14466
14467         * typeck.c (c_expand_return): Be more persistent in looking for
14468         returned temps.
14469
14470         * cvt.c (build_up_reference): Use NOP_EXPR for switching from
14471         pointer to reference.
14472
14473         * class.c (build_vbase_path): Don't do anything if PATH has no steps.
14474
14475 Sun Jun  8 03:07:05 1997  Jason Merrill  <jason@yorick.cygnus.com>
14476
14477         * init.c (build_member_call, build_offset_ref):
14478         Use do_scoped_id instead of do_identifier.
14479
14480         * cvt.c (convert): Remove bogosity.
14481
14482 Sat Jun  7 20:50:17 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14483
14484         * cvt.c (build_up_reference): Do checks of ARGTYPE and
14485         TARGET_TYPE before trying to use get_binfo.
14486
14487 Fri Jun  6 17:36:39 1997  Jason Merrill  <jason@yorick.cygnus.com>
14488
14489         * cvt.c (build_up_reference): Call get_binfo to get access control.
14490
14491         * decl2.c (import_export_decl): If we don't support weaks, leave
14492         statics undefined.
14493
14494 Fri Jun  6 15:55:49 1997  Mike Stump  <mrs@cygnus.com>
14495
14496         * except.c (expand_builtin_throw): Add support for machines that
14497         cannot access globals after throw's epilogue when
14498         -fno-sjlj-exceptions is used.
14499
14500 Thu Jun  5 16:28:43 1997  Jason Merrill  <jason@yorick.cygnus.com>
14501
14502         * parse.y: 'std::' becomes '::'.
14503         * lex.c (real_yylex): Remove 'namespace' warning.
14504         * init.c (build_member_call): Ignore 'std::'.
14505         (build_offset_ref): Likewise.
14506         * decl2.c (do_using_directive): Ignore 'using namespace std;'.
14507         (do_toplevel_using_decl): Ignore 'using std::whatever'.
14508         * decl.c (push_namespace): Just sorry.
14509         (pop_namespace): Nop.
14510         (init_decl_processing): Declare std namespace.
14511
14512 Tue Jun  3 18:08:23 1997  Jason Merrill  <jason@yorick.cygnus.com>
14513
14514         * search.c (push_class_decls): A name which ambiguously refers to
14515         several instantiations of the same template just refers to the
14516         template.
14517
14518 Tue Jun  3 12:30:40 1997  Benjamin Kosnik  <bkoz@cirdan.cygnus.com>
14519
14520         * decl.c (build_enumerator): Fix problem with unsigned long
14521         enumerated values being smashed to ints, causing overflow
14522         when computing next enumerated value (for enum values around
14523         MAX_VAL).
14524
14525 Mon Jun  2 17:40:56 1997  Jason Merrill  <jason@yorick.cygnus.com>
14526
14527         * typeck.c (build_component_ref): Only call mark_used on a decl.
14528
14529 Thu May 29 15:54:17 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14530
14531         * typeck.c (build_c_cast): Make the check for a ptr to function
14532         more specific before possible default_conversion call.
14533
14534 Thu May 29 13:02:06 1997  Mike Stump  <mrs@cygnus.com>
14535
14536         * except.c (expand_exception_blocks): Simplify and fix and make
14537         sure we don't end a region in a sequence, as expand_end_bindings
14538         doesn't like it.
14539
14540 Wed May 28 17:08:03 1997  Mike Stump  <mrs@cygnus.com>
14541
14542         * except.c (init_exception_processing): Mark terminate as not
14543         returning so that the optimizer can optimize better.
14544
14545 Tue May 27 19:49:19 1997  Mike Stump  <mrs@cygnus.com>
14546
14547         * cvt.c (convert): Don't do any extra work, if we can avoid it
14548         easily.
14549
14550 Tue May 27 18:21:47 1997  Mike Stump  <mrs@cygnus.com>
14551
14552         * *.[chy]: Change cp_convert to ocp_convert, change convert to
14553         cp_convert.  convert is now reserved for the backend, and doesn't
14554         have the semantics a frontend person should ever want.
14555
14556 Fri May 23 10:58:31 1997  Jason Merrill  <jason@yorick.cygnus.com>
14557
14558         * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled.
14559         Lose -traditional support.
14560
14561 Thu May 22 15:41:28 1997  Jason Merrill  <jason@yorick.cygnus.com>
14562
14563         * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype).
14564
14565         * parse.y (self_reference): Do it for templates, too.
14566         * class.c (pushclass): Don't overload_template_name; the alias
14567         generated by build_self_reference serves the same purpose.
14568
14569         * tree.c (list_hash): Make static, take more args.
14570         (list_hash_lookup): Likewise.
14571         (list_hash_add): Make static.
14572         (list_hash_canon): Lose.
14573         (hash_tree_cons): Only build a new node if one isn't already in the
14574         hashtable.
14575         (hash_tree_chain): Use hash_tree_cons.
14576         * cp-tree.h: Adjust.
14577         * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead
14578         of calling lookup_name.
14579
14580 Wed May 21 18:24:19 1997  Jason Merrill  <jason@yorick.cygnus.com>
14581
14582         * pt.c (instantiate_class_template): TYPE_VALUES for an enum
14583         doesn't refer to the CONST_DECLs.
14584
14585 Tue May 20 21:09:32 1997  Bob Manson  <manson@charmed.cygnus.com>
14586
14587         * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever
14588         is bigger.
14589         (expand_class_desc): Convert the last argument to a sizetype.
14590
14591 Tue May 20 13:55:57 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
14592
14593         * gxx.gperf (__complex, __complex__, __imag, __imag__, __real,
14594         __real__): Add reswords.
14595         * hash.h: Regenerate.
14596         * lex.h (rid): Add RID_COMPLEX.
14597         (RID_LAST_MODIFIER): Set to RID_COMPLEX.
14598         * lex.c (init_lex): Add building of RID_COMPLEX.
14599         (real_yylex): General cleanup in line with what c-lex.c also has,
14600         sans the cruft for traditional; add handling of SPEC_IMAG, complex
14601         types, and imaginary numeric constants.
14602         * parse.y (REALPART, IMAGPART): Add tokens.
14603         (unary_expr): Add REALPART and IMAGPART rules.
14604         * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare.
14605         * decl.c (complex_{integer,float,double,long}_type_node): Define
14606         types.
14607         (init_decl_processing): Set up the types.
14608         (grokdeclarator): Add handling of RID_COMPLEX.  Set and use
14609         DEFAULTED_INT instead of EXPLICIT_INT when we default to int type.
14610         * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
14611         * cvt.c (cp_convert): Handle COMPLEX_TYPE.
14612         * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add
14613         COMPLEX_TYPE case.
14614         * method.c (build_overload_name): Add handling of the different
14615         COMPLEX_TYPEs, prefixing them with `J'.
14616         * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE
14617         as a template parm.
14618         (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case.
14619         * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases.
14620         (mapcar): Handle COMPLEX_CST.
14621         * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE.
14622         (common_type): Add code for complex types.
14623         (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
14624         (convert_for_assignment): Likewise.
14625         (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases.
14626
14627 Mon May 19 12:26:27 1997  Jason Merrill  <jason@yorick.cygnus.com>
14628
14629         * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to
14630         tsubst_expr, as it might try to do overload resolution.
14631
14632 Sat May 17 10:48:31 1997  Jason Merrill  <jason@yorick.cygnus.com>
14633
14634         * pt.c (instantiate_class_template): Oops.
14635
14636 Fri May 16 14:23:57 1997  Jason Merrill  <jason@yorick.cygnus.com>
14637
14638         * cp-tree.def: Add TAG_DEFN.
14639         * pt.c (tsubst_enum): New fn.
14640         (instantiate_class_template): Use it.
14641         (tsubst_expr): Support TAG_DEFN.
14642         (tsubst): Support local enums.
14643         (tsubst_copy): Likewise.
14644         * decl.c (finish_enum): Likewise.
14645         (start_enum): If this is a local enum, switch to permanent_obstack.
14646
14647 Wed May 14 19:08:28 1997  Mike Stump  <mrs@cygnus.com>
14648
14649         * decl.c (store_parm_decls): Set last_parm_cleanup_insn here.
14650         (finish_function): Put the base init code for constructors just
14651         after the parm cleanup insns.
14652         (struct cp_function): Add last_parm_cleanup_insn.
14653         (pu