1 2000-01-12 Gabriel Dos Reis <gdr@codesourcery.com>
3 * decl2.c (lang_decode_option): Handle automatic line wrapping
6 2000-01-11 Mark Mitchell <mark@codesourcery.com>
8 * friend.c (do_friend): Don't resolve scopes when processing
9 template declarations, even if the qualifying scope doesn't
10 involve template parameters.
12 2000-01-10 Mark Mitchell <mitchell@dumbledore.codesourcery.com>
14 * class.c (dfs_modify_vtables_queue_p): Remove.
15 (modify_all_vtables): Use dfs_unmarked_real_bases_queue_p
16 and dfs_marked_real_bases_queue_p instead of
17 dfs_modify_vtables_queue_p.
19 * class.c (build_vbase_path): Simplify.
20 (dfs_propagate_binfo_offsets): New function.
21 (propagate_binfo_offsets): Use it.
22 (remove_base_field): Simplify.
23 (dfs_set_offset_for_vbases): Remove.
24 (dfs_set_offset_for_shared_vbases): New function.
25 (dfs_set_offset_for_unshared_vbases): Likewise.
26 (layout_virtual_bases): Use them.
27 (layout_basetypes): Don't call propagate_binfo_offsets.
28 * search.c (dfs_get_vbase_types): Clone completely fresh binfos
31 * class.c (build_base_field): New function, split out from ...
32 (build_base_fields): ... here. Use it. Allocate primary bases
33 first, under the new ABI.
34 (get_vtable_entry): Remove.
35 (remove_base_field): New function, split out from ...
36 (remove_base_fields): ... here. Adjust since primary bases come
37 first under the new ABI.
39 * cp-tree.h (expand_direct_vtbls_init): Remove declaration.
40 (initialize_vtbl_ptrs): New function.
41 (expand_indirect_vtbls_init): Change prototype.
42 (convert_pointer_to_vbase): Declare.
43 * init.c (expand_direct_vtbls_init): Remove.
44 (dfs_initialize_vtbl_ptrs): New function.
45 (initialize_vtbl_ptrs): Likewise.
46 (emit_base_init): Use initialize_vtbl_ptrs.
47 * search.c (convert_pointer_to_vbase): Make it global.
48 (expand_indirect_vtbls_init): Remove vtable initialization code.
49 * semantics.c (setup_vtbl_ptr): Use initialize_vtbl_ptrs.
51 * class.c (dfs_finish_vtbls): New function.
52 (finish_vtbls): Use it.
53 (dump_class_hierarchy): New function.
55 * cp-tree.h (BINFO_PRIMARY_MARKED_P): Change definition.
56 (BINFO_VBASE_PRIMARY_P): New macro.
57 (BINFO_VIRTUALS): Add to documentation.
58 (SET_BINFO_PRIMARY_MARKED_P): Remove.
59 (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise.
60 (dfs_mark_primary_bases_queue_p): Likewise.
61 (dfs_unmarked_real_bases_queue_p): New function.
62 (dfs_marked_real_bases_queue_p): Likewise.
63 * search.c (dfs_mark_primary_bases): Adjust.
64 (mark_primary_bases): Likewise.
65 (get_shared_vbase_if_not_primary): New function.
66 (dfs_unmarked_real_bases_queue_p): Likewise.
67 (dfs_marked_real_bases_queue_p): Likewise.
68 (dfs_get_pure_virtuals): Simplify.
69 (get_pure_virtuals): Likewise.
71 2000-01-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
73 * lex.c: Include tm_p.h.
75 2000-01-07 Nathan Sidwell <sidwell@codesourcery.com>
77 * lang-specs.h (__GXX_ABI_VERSION): New preprocessor macro.
79 2000-01-06 Jason Merrill <jason@casey.cygnus.com>
81 * decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT.
82 * pt.c (instantiate_decl): Defer comdat templates that might not be
85 * cp-tree.h (DECL_NEEDED_P): Also true if !DECL_COMDAT.
86 * decl2.c (finish_vtable_vardecl): Don't check !DECL_COMDAT.
87 (finish_file): Likewise.
89 * decl2.c (import_export_class): Undo 12/14 change.
91 * error.c (dump_decl): operator new, not operatornew.
93 * class.c (field_decl_cmp): A nontype is "greater" than a type.
94 * search.c (lookup_field_1): Look for the last field with the
97 2000-01-05 Nathan Sidwell <nathan@acm.org>
99 * decl2.c (lookup_arg_dependent): Deal with FNS not being a
102 2000-01-05 Nathan Sidwell <nathan@acm.org>
104 * typeck.c (build_static_cast): Don't strip target qualifiers
105 when casting from a class.
107 2000-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
109 * class.c (warn_hidden): Initialize variable `fndecl'.
111 2000-01-03 Ulrich Drepper <drepper@cygnus.com>
113 * decl.c (flag_isoc9x): New variable to be able to use code in
114 c-common.c. For now always zero.
116 2000-01-03 Mark Mitchell <mark@codesourcery.com>
118 * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation.
119 * class.c (layout_basetypes): Don't set BINFO_INHERITANCE_CHAIN
120 or unshare_base_binfos for virtual bases here.
121 * search.c (dfs_get_vbase_types): Do it here.
122 (get_vbase_types): Adjust.
124 2000-01-02 Mark Mitchell <mark@codesourcery.com>
126 * cp-tree.h (CLASSTYPE_VFIELDS): Move definition.
127 (BINFO_PRIMARY_MARKED_P): Use flag 5.
128 (SET_BINFO_PRIMARY_MARKED_P): Likewise.
129 (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise.
130 (unmark_primary_bases): Remove declaration.
131 (unmarkedp): Declare.
132 (dfs_vbase_unmark): Likewise.
133 * class.c (determine_primary_base): Return immediately if there
134 are no base classes. Call mark_primary_bases here.
135 (modify_all_direct_vtables): Remove.
136 (modify_all_indirect_vtables): Remove.
137 (dfs_modify_vtables_queue_p): New function.
138 (dfs_modify_vtables): New function.
139 (modify_all_vtables): Use them.
140 (build_base_fields): Build FIELD_DECLs for primary virtual base
142 (create_vtable_ptr): Don't call determine_primary_base here.
143 (dfs_mark_primary_bases_and_set_vbase_offsets): Rename to ...
144 (dfs_set_offset_for_vbases): ... this.
145 (layout_virtual_bases): Use it.
146 (layout_class_type): Call determine_primary_base here.
147 * search.c (unmarkedp): Make it global.
148 (shared_marked_p): Simplify.
149 (shared_unmarked_p): Likewise.
150 (dfs_primary_bases_queue_p): Remove.
151 (dfs_unmark_primary_bases): Likewise.
152 (unmark_primary_bases): Likewise.
153 (mark_primary_bases): Simplify.
154 (get_pure_virtuals): Don't call mark_primary_bases here.
155 (dfs_vbase_unmark): New function.
156 (get_vbase_types): Simplify.
158 * class.c (struct base_info): Remove.
159 (determine_primary_base): Take has_virtual_p rather than a
160 base_info as input. Don't calculate max_has_virtual.
161 (finish_struct_bits): Remove max_has_virtual argument.
162 (create_vtable_ptr): Remove max_has_virtual_p argument.
163 (layout_virtual_bases): Remove max argument.
164 (layout_basetypes): Likewise.
165 (layout_class_type): Remove max_has_virtual_p argument.
166 (finish_struct_1): Remove max_has_virtual.
168 * cp-tree.h (dfs_mark_primary_bases_queue_p): New function.
169 (layout_basetypes): Remove.
170 * class.c (propagate_binfo_offsets): Moved here from tree.c.
171 Update to handle primary virtual bases.
172 (remove_base_fields): New function, split out from
174 (dfs_mark_primary_bases_and_set_vbase_offsets): New function.
175 (layout_virtual_bases): New function, split out from
176 layout_basetypes. Update to handle primary virtual bases.
177 (layout_basetypes): Moved here from tree.c. Use
178 remove_base_fields and layout_virtual_bases.
179 * search.c (dfs_mark_primary_bases_queue_p): New function.
180 (mark_primary_bases): Use it.
181 * tree.c (CEIL): Remove.
182 (propagate_binfo_offsets): Remove.
183 (layout_basetypes): Remove.
185 2000-01-01 Mark Mitchell <mark@codesourcery.com>
187 * cp-tree.h (CLASSTYPE_N_BASECLASSES): Use BINFO_N_BASETYPES.
188 (BINFO_PRIMARY_MARKED_P): New macro.
189 (SET_BINFO_PRIMARY_MARKED_P): Likewise.
190 (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise.
191 (mark_primary_bases): New function.
192 (unmark_primary_bases): Likewise.
193 * search.c (get_abstract_virtuals_1): Remove.
194 (dfs_mark_primary_bases): New function.
195 (mark_primary_bases): Likewise.
196 (dfs_unmark_primary_bases): Likewise.
197 (unmark_primary_bases): Likewise.
198 (dfs_get_pure_virtuals): Likewise.
200 2000-01-01 Mark Mitchell <mark@codesourcery.com>
202 * cp-tree.h (skip_rtti_stuff): Adjust prototype.
203 * class.c (skip_rtti_stuff): Reorganize parameters and return value.
204 (modify_one_vtable): Adjust.
205 (fixup_vtable_deltas1): Likewise.
206 (override_one_vtable): Likewise.
207 * search.c (get_abstract_virtuals_1): Likewise.
208 (get_pure_virtuals): Likewise.
209 (expand_upcast_fixups): Likewise.
210 * tree.c (debug_binfo): Likewise.
212 * class.c (build_vtable): Don't return a value. Don't rebuild
213 vtables for bases that have already been handled.
214 (prepare_fresh_vtable): Don't rebuild vtables for bases that have
215 already been handled.
216 (modify_one_vtable): Adjust accordingly.
217 (fixup_vtable_deltas1): Likewise.
218 (finish_struct_1): Likewise.
220 2000-01-01 Martin v. Löwis <loewis@informatik.hu-berlin.de>
222 * call.c (build_new_method_call): Also check destructors.
224 1999-12-31 Mark Mitchell <mark@codesourcery.com>
226 * cp-tree.h (VF_NORMAL_VALUE): Remove.
227 * class.c (struct base_info): Remove vfield, vfields, and rtti.
228 (set_primary_base): New function, split out from ...
229 (finish_base_struct): ... here. Rename to ...
230 (determine_primary_base): ... this. Simplify.
231 (create_vtable_ptr): Tweak accordingly.
232 (finish_struct_1): Simplify.
234 * cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation.
235 (CLASSTYPE_N_BASECLASSES): Likewise.
236 (BINFO_FOR_VBASE): New macro.
237 (get_vbase_types): Change prototype.
238 * class.c (build_vbase_path): Use BINFO_FOR_VBASE.
239 (prepare_fresh_vtable): Likewise.
240 (finish_vtbls): Likewise.
241 (get_class_offset_1): Likewise.
242 (modify_all_indirect_vtables): Likewise.
243 (build_vbase_pointer_fields): Likewise.
244 * decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here.
245 * init.c (sort_base_init): Use BINFO_FOR_VBASE.
246 (expand_member_init): Likewise.
247 * search.c (get_base_distance): Likewise.
248 (lookup_field_queue_p): Likewise.
249 (virtual_context): Likewise.
250 (get_vbase_types): Don't return a value. Set
251 CLASSTYPE_VBASECLASSES here.
252 * typeck.c (get_delta_difference): Use BINFO_FOR_VBASE.
254 1999-12-30 Mark Mitchell <mark@codesourcery.com>
256 * class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS.
258 1999-12-29 Mark Mitchell <mark@codesourcery.com>
260 * class.c (create_vtable_ptr): Put the vtable at the beginning of
261 the class, not the end, in the new ABI.
262 * tree.c (propagate_binfo_offsets): Do the right thing for the new
265 1999-12-29 Mark Mitchell <mark@codesourcery.com>
267 * cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy.
268 (CLASSTYPE_NEARLY_EMPTY_P): New macro.
269 * class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P.
270 (check_field_decls): Likewise.
271 (check_bases_and_members): Likewise.
273 1999-12-28 Mark Mitchell <mark@codesourcery.com>
275 * cp-tree.h (do_inline_function_hair): Remove.
276 * class.c (layout_class_type): New function, split out from
278 (fixup_pending_inline): Likewise.
279 (fixup_inline_methods): New function.
280 * method.c (fixup_pending_inline): Remove.
281 (do_inline_function_hair): Likewise.
283 * decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the
286 * cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals.
287 (CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ...
288 (CLASSTYPE_PURE_VIRTUALS): ... this.
289 (lang_decl_flags): Replace abstract_virtual with pure_virtual.
290 (DECL_ABSTRACT_VIRTUAL_P): Rename to ...
291 (DECL_PURE_VIRTUAL_P): ... this.
292 (get_abstract_virtuals): Rename to ...
293 (get_pure_virtuals): ... this.
294 * call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with
295 DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with
296 CLASSTYPE_PURE_VIRTUALS.
297 * class.c (build_vtable_entry): Likewise.
298 (finish_struct_bits): Likewise. Call get_pure_virtuals, not
299 get_abstract_virtuals.
300 (build_vtbl_initializer): Likewise.
301 (override_one_vtable): Likewise.
302 (check_methods): Likewise.
303 * decl.c (duplicate_decls): Likewise.
304 (redeclaration_error_message): Likewise.
305 (lang_mark_tree): Likewise.
306 * decl2.c (grok_function_init): Likewise.
307 (import_export_vtable): Likewise.
308 (import_expor_class): Likewise.
309 * typeck2.c (abstract_virtuals_error): Likewise.
310 * xref.c (GNU_xref_member): Likewise.
311 * search.c (get_abstract_virtuals): Rename to get_pure_virtuals.
313 1999-12-26 Zack Weinberg <zack@wolery.cumb.org>
315 * cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING
318 1999-12-26 Mark Mitchell <mark@codesourcery.com>
320 * decl.c (store_return_init): Use mode of old RTL generated for
321 DECL_RESULT, not the mode of DECL_RESULT itself.
322 * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE
323 for functions that used named return values.
325 1999-12-24 Mark Mitchell <mark@codesourcery.com>
327 * semantics.c (expand_body): Use
328 note_deferral_of_defined_inline_function.
330 1999-12-22 Mark Mitchell <mark@codesourcery.com>
332 * dump.c (dequeue_and_dump): Handle CTOR_STMTs.
334 1999-12-22 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
336 * error.c (dump_decl): Support named return values.
338 1999-12-20 Mark Mitchell <mark@codesourcery.com>
340 * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments.
341 (CLASSTYPE_HAS_PRIMARY_BASE_P): New macro.
342 (CLASSTYPE_PRIMARY_BINFO): Likewise.
343 * class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF,
344 TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here.
345 (check_bases_and_members): Set them here instead.
346 (create_vtable_ptr): New function, split out from ...
347 (finish_struct_1): ... here. Use it. Tidy. Use
348 CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO.
349 * search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as
350 the first field in the class.
351 * tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle
352 seeing TYPE_VFIELD as the first field in the class.
354 * cp-tree.h (TYPE_VIRTUAL_P): Rename to ...
355 (TYPE_POLYMORPHIC_P): ... this.
356 (TYPE_USES_COMPLEX_INHERITANCE): Rename to ...
357 (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this.
358 (TREE_CALLS_NEW): Remove.
359 (TREE_MANGLED): Likewise.
360 * call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P,
361 and TYPE_POLYMORPHIC_P.
362 * class.c (check_bases): Likewise.
363 (finish_base_struct): Likewise.
364 (finish_struct_bits): Likewise.
365 (check_for_override): Likewise.
366 (finish_struct_1): Likewise.
367 (get_vfield_name): Likewise.
368 * decl.c (xref_basetypes): Likewise.
369 * decl2.c (import_export_class): Likewise.
370 (import_export_decl): Likewise.
371 * error.c (dump_function_decl): Likewise.
372 * pt.c (instantiate_class_template): Likewise.
373 * repo.c (repo_inline_used): Likewise.
374 * rtti.c (build_headof): Likewise.
375 (get_tinfo_fn_dynamic): Likewise.
376 (build_x_typeid): Likewise.
377 (get_tinfo_var): Likewise.
378 (build_dynamic_cast_1): Likewise.
379 (synthesize_tinfo_fn): Likewise.
380 * search.c (lookup_field_1): Likewise.
381 (dfs_debug_mark): Likewise.
382 (maybe_suppress_debug_info): Likewise.
383 * typeck.c (build_component_ref): Likewise.
384 (build_component_addr): Likewise.
385 * typeck2.c (process_init_constructor): Likewise.
387 1999-12-20 Nathan Sidwell <nathan@acm.org>
389 * typeck.c (strip_all_pointer_quals): New static function.
390 (build_static_cast): Use it. Don't use at_least_as_qualified_p.
392 1999-12-16 Mark Mitchell <mark@codesourcery.com>
394 * cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE.
395 (dso_handle_node): New macro.
396 (flag_use_cxa_atexit): New variable.
397 (declare_global_var): New function.
398 (start_anon_func): Remove declaration.
399 (end_anon_func): Likewise.
400 * decl.c (get_atexit_node): New function, split out from
401 destroy_local_static. Handle flag_use_cxa_atexit.
402 (get_dso_handle_node): Likewise.
403 (start_cleanup_fn): Renamed from start_anon_func. Moved here from
404 except.c. Handle flag_use_cxa_atexit.
405 (end_cleanup_fn): Renamed from end_anon_func. Moved here from
407 (declare_global_var): New variable.
408 (destroy_local_static): Handle flag_use_cxa_atexit.
409 * decl2.c (flag_use_cxa_atexit): New variable.
410 (lang_f_options): Likewise.
411 * except.c (start_anon_func): Remove.
412 (end_anon_func): Liekwise.
413 * lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit.
414 * rtti.c (get_tinfo_var): Use declare_global_var.
416 1999-12-16 Mark Mitchell <mark@codesourcery.com>
418 * class.c (check_field_decls): Don't return a value.
419 (avoid_overlap): Moved here from tree.c.
420 (build_base_fields): Likewise.
421 (check_bases): New function, split out from finish_base_struct.
422 (check_bases_and_members): New function, split out from
424 (struct base_info): Remove cant_have_default_ctor,
425 cant_have_const_ctor, cant_have_asn_ref.
426 (finish_base_struct): Split semantic analysis into check_bases.
427 (finish_struct_methods): Fix bogus assertion.
428 (check_field_decls): Call finish_struct_anon here.
429 (build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES.
430 (finish_struct_1): Use check_bases_and_members. Reorganize.
431 * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation.
432 (build_base_fields): Don't declare.
433 * tree.c (avoid_overlap): Remove.
434 (build_base_fields): Likewise.
436 * optimize.c (struct inline_data): Remove scope_stmt.
437 (remap_block): Don't use insert_block_after_note. Don't update
439 (expand_call_inline): Don't update scope_stmt.
440 (optimize_function): Don't initialize scope_stmt.
441 * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted
442 NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes.
444 1999-12-15 Mark Mitchell <mark@codesourcery.com>
446 * class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS
447 out of the class, rather than taking them as parameters.
448 (build_vbase_pointer_fields): Move here from tree.c.
449 (build_vtbl_or_vbase_field): New function.
450 (check_methods): Likewise.
451 (remove_zero_width_bitfields): Likewise.
452 (add_virtual_function): Use tree_cons instead of temp_tree_cons.
453 (delete_duplicate_fields_1): Tidy. Don't delete duplicate
455 (finish_struct_methods): Handle the case where there are no
457 (get_basefndecls): Use tree_cons instead of temp_tree_cons.
458 (check_field_decls): Call delete_duplicate_fields here.
459 (finish_struct_1): Tidy. Use check_methods and
460 remove_zero_width_bitfields.
461 * cp-tree.h (build_vbase_pointer_fields): Remove.
462 * decl.c (grokdeclarator): Use tree_cons instead of
464 * decl2.c (qualified_lookup_using_namespace): Use tree_cons
465 instead of temp_tree_cons.
466 * lex.c (cons_up_default_function): Remove dead code.
467 * method.c (fixup_pending_inline): New function, split out from ...
468 (do_inline_function_hair): ... here.
469 * tree.c (build_vbase_pointer_fields): Remove.
471 1999-12-15 Jason Merrill <jason@casey.cygnus.com>
473 * tree.c (walk_tree): Walk operand subtrees in forward order.
474 * optimize.c (expand_call_inline): Likewise.
475 (optimize_function): Initialize id->scope_stmt to something useful.
476 (remap_block): Assume id->scope_stmt has a useful value.
478 1999-12-15 Nathan Sidwell <nathan@acm.org>
480 * typeck.c (build_c_cast): Expand warning message. Move pointer
481 alignment warning to after the cast. Don't warn about pointer
482 alignment when given a pointer to incomplete.
484 1999-12-15 Richard Henderson <rth@cygnus.com>
486 * cp-tree.h (make_aggr_type): Declare.
487 * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE.
488 (make_aggr_type): New.
490 * decl.c (build_typename_type, init_decl_processing): Use it.
491 (build_ptrmemfunc_type, xref_tag): Likewise.
492 * except.c (call_eh_info): Likewise.
493 * init.c (init_init_processing): Likewise.
494 * pt.c (process_template_parm, lookup_template_class): Likewise.
495 * rtti.c (expand_class_desc): Likewise.
496 * semantics.c (begin_class_definition, finish_typeof): Likewise.
497 * tree.c (copy_template_template_parm): Likewise.
499 1999-12-15 Jason Merrill <jason@yorick.cygnus.com>
501 * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using
502 sizeof (struct tree_common).
504 1999-12-14 Jason Merrill <jason@casey.cygnus.com>
506 * optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the
507 outermost block to point to the inlined function decl.
509 * error.c (dump_decl): operator==, not operator ==.
510 (op_to_string): Likewise.
512 * decl.c (compute_array_index_type): Handle null name.
514 * decl2.c (ambiguous_decl): Fix to match comment.
515 (lookup_using_namespace): Adjust.
517 * decl2.c (import_export_class): Don't ignore dllimport.
519 1999-12-14 Mark Mitchell <mark@codesourcery.com>
521 * class.c (check_field_decls): Split out from ...
522 (finish_struct_1): ... here. Use it. Tidy.
524 * cp-tree.h (remap_save_expr): Add walk_subtrees parameter.
525 * optimize.c (copy_body_r): Pass it.
526 * tree.c (remap_save_expr): Clear walk_subtrees for an
527 already-handled SAVE_EXPR.
528 (cp_unsave_r): Pass walk_subtrees to remap_save_expr.
530 * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
531 * ir.texi (DECL_NAMESPACE_ALIAS): Document it.
533 * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.
535 1999-12-14 Mumit Khan <khan@xraylith.wisc.edu>
537 * class.c (finish_base_struct): Allow multiple COM base classes
538 as well as non-COM bases as long as it's not the leftmost.
540 1999-12-13 Mumit Khan <khan@xraylith.wisc.edu>
542 * lex.c (saving_parse_to_obstack): New global.
543 (reinit_parse_for_block): Use.
544 (reinit_parse_for_expr): Use.
545 (check_newline): Use.
547 1999-12-13 Mark Mitchell <mark@codesourcery.com>
549 * optimize.c (initialize_inlined_parameters): Take FN to which the
550 parameters belong as an argument.
551 (expand_call_inline): Expand calls into the parameter
552 initializations before pushing the function onto the list of
553 functions we are presently expanding.
555 1999-12-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
557 * class.c (get_vtable_name): Use a literal format string and
558 VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT.
559 (prepare_fresh_vtable): Likewise.
561 * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of
564 * decl.c (make_rtl_for_local_static): Remove unused variable `type'.
566 * init.c (build_vec_init): Initialize variable `try_body'.
568 * lex.c (yyerror): Don't call a variadic function with a
569 non-literal format string.
571 * optimize.c (optimize_function): Call memset, not bzero.
573 * pt.c (for_each_template_parm_r): Add static prototype.
575 1999-12-09 Andreas Jaeger <aj@suse.de>
577 * except.c (expand_throw): Add static attribute to match
580 * Makefile.in (semantics.o): Add dependency on output.h.
581 * semantics.c: Include output.h for declaration of
584 1999-12-09 Mark Mitchell <mark@codesourcery.com>
586 * decl.c (init_decl_processing): Reenable inlining on trees.
587 (finish_function): Likewise.
588 * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here.
589 * semantics.c (simplify_aggr_init_exprs): New function.
590 (expand_body): Use it.
591 * tree.c (walk_tree): Special-case TARGET_EXPRs since they
592 sometimes present the same sub-tree twice.
594 * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
597 * semantics.c (finish_switch_cond): Do conversions here, not ...
598 * typeck.c (c_expand_start_case): Here.
600 * semantics.c (do_poplevel): Remove unused variable.
602 1999-12-06 Mark Mitchell <mark@codesourcery.com>
604 * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE
605 unless we're declaring the variable in question.
607 1999-12-06 Mark Mitchell <mark@codesourcery.com>
609 * decl.c (init_decl_processing): #if 0 last patch.
610 (finish_function): Likewise.
612 1999-12-05 Mark Mitchell <mark@codesourcery.com>
614 * decl.c (init_decl_processing): Set flag_inline_trees if
617 * cp-tree.h (calls_setjmp_p): Declare.
618 * decl.c (finish_function): Mark functions that call setjmp as
620 * optimize.c (calls_setjmp_r): New function.
621 (calls_setjmp_p): Likewise.
623 1999-12-04 Mark Mitchell <mark@codesourcery.com>
625 * optimize.c (expand_call_inline): Wrap the expanded call in an
626 EXPR_WITH_FILE_LOCATION node to get correct line numbers for
629 * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add
631 (remap_decl): New function.
632 (remap_block): Likewise.
633 (copy_scope_stmt): Likewise.
634 (copy_body_r): Use remap_decl and copy_scope_stmt.
635 (copy_body): Use VARRAY_TOP_TREE.
636 (initialize_inlined_parameters): Likewise.
637 (declare_return_variable): Likewise.
638 (inlinable_function_p): Check flag_inline_trees.
639 (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs
640 specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the
641 parameters of the inlined function.
642 (optimize_function): Prevent recursion into partially complete
645 * cp-tree.def (SCOPE_STMT): Take one operand.
646 * cp-tree.h (SCOPE_STMT_BLOCK): New macro.
647 (SCOPE_NULLIFIED_P): Redefine.
648 (SCOPE_NO_CLEANUPS_P): New macro.
649 (add_scope_stmt): Change prototype.
650 * decl.c (poplevel): Tidy. Warn about unused variables here.
651 Record SCOPE_STMT_BLOCKs.
652 (finish_function): Keep DECL_INITIAL for functions that might be
654 * ir.texi: Document SCOPE_NO_CLEANUPS_P.
655 * semantics.c: Include rtl.h.
656 (add_scope_stmt): Return the new scope statement and, for an
657 end-of-scope statement, its matching begin statement. Don't set
659 (do_pushlevel): Simplify, now that we are always
661 (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs.
662 (expand_stmt): Don't call expand_start_bindings or
663 expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
664 * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
666 * Makefile.in (semantics.o): Depend on RTL_H.
668 * decl2.c (pending_statics_used): Make it a macro.
669 (saved_inlines_used): Likewise.
670 (finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
671 (mark_inline_for_output): Likewise.
672 (ssdf_decls_used): Remove.
673 (start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
674 (generate_ctor_or_dtor_function): Adjust accordingly.
676 1999-11-24 Geoffrey Keating <geoffk@cygnus.com>
677 Greg McGary <gkm@gnu.org>
679 * decl.c (duplicate_decls): Merge
680 DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
681 DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
683 1999-12-02 Mike Stump <mrs@wrs.com>
685 * init.c (perform_member_init): Handle parse errors better.
687 1999-12-01 Mark Mitchell <mark@codesourcery.com>
689 * cp-tree.h (min_tree_cons): Remove.
690 (scratch_ovl_cons): Likewise.
691 * decl.c (saveable_obstack): Don't declare.
692 (duplicate_decls): Tweak error-message.
693 (initialize_local_var): Explicitly mark the definition as static.
694 (finish_function): Call permanent_allocation, just so
695 that the middle-end sees the obstacks it expects.
696 (mark_cp_function_context): Likewise.
697 * init.c (build_new): Don't use min_tree_cons.
698 * lex.c (permanent_obstack): Don't declare.
699 (current_obstack, saveable_obstack): Likewise.
700 * spew.c (current_obstack, saveable_obstack): Likewise.
701 * tree.c (current_obstack, saveable_obstack): Likewise.
702 (scratch_ovl_cons): Remove.
703 (build_min_nt): Don't mess with obstacks.
704 (build_min): Likewise.
705 (min_tree_cons): Remove
706 * typeck.c (build_component_ref): Don't use scratch_ovl_cons.
707 (build_x_function_call): Likewise.
708 (build_c_cast): Don't use min_tree_cons.
710 1999-11-29 Mark Mitchell <mark@codesourcery.com>
712 * pt.c (tsubst_decl): Robustify.
714 1999-11-27 Mark Mitchell <mark@codesourcery.com>
716 * decl2.c (finish_file): Call expand_body for inline functions
717 that will be written out but that do not yet have RTL.
718 * semantics.c (expand_body): Do not generate RTL For inline
719 functions that do not yet need to be written out.
721 1999-11-25 Mark Mitchell <mark@codesourcery.com>
723 * Make-lang.in (CXX_SRCS): Add optimize.c.
724 * Makefile.in (CXX_OBJS): Add optimize.o.
725 (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
726 (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
727 (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
728 (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
729 (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
731 (optimize.o): New target.
732 * class.c: Don't include splay-tree.h.
733 * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
734 * cp-tree.h: Include splay-tree.h.
735 (DECL_UNINLINABLE): New macro.
736 (CTOR_BEGIN_P, CTOR_END_P): New macros.
737 (flag_inline_trees): New variable.
738 (local_variable_p): New function.
739 (nonstatic_local_decl_p): Likewise.
740 (optimize_function): Likewise.
741 (cplus_unsave_expr_now): Remove.
742 (copy_tree_r): Declare.
743 (remap_save_expr): Likewise.
744 * decl.c (local_variable_p): Don't
746 (local_variable_p_walkfn): New function.
747 (make_rtl_for_local_static): Remove code to try to avoid writing
748 out static constants.
749 (emit_local_var): Fix indentation.
750 (nonstatic_local_decl_p): New function.
751 (check_default_argument): Use local_variable_p_walkfn, not
752 local_variable_p, when walking the tree.
753 (start_function): Set the DECL_CONTEXT for automatically generated
755 (finish_constructor_body): Use CTOR_STMT to mark the end of a
757 * decl2.c: Don't include splay-tree.h.
758 (flag_inline_trees): Define.
759 * dump.c: Don't include
761 * except.c (expand_end_catch_block): Fix comment formatting.
762 (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
763 (expand_throw): Tidy comment.
764 * init.c (build_vec_delete_1): Use create_temporary_var.
765 * lex.c (cplus_tree_code_type): Make it static.
766 (cplus_tree_code_length): Likewise.
767 (cplus_tree_code_name): Likewise.
768 * optimize.c: New file.
769 * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
771 (setup_vtbl_ptr): Mark the beginnings of constructors with
773 (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
774 (expand_body): Call optimize_function. Save bodies if we're doing
776 * tree.c: Don't include splay-tree.h. Include insn-config.h and
778 (copy_tree_r): Make it public.
779 (statement_code_p): New function.
780 (mark_local_for_remap_r): Likewise.
781 (cp_usave_r): Likewise.
782 (cp_unsave): Likewise.
783 (build_cplus_new): Set DECL_CONTEXT for temporary variables.
784 (walk_tree): Walk into `s' class nodes. Walk statement chains.
785 (copy_tree_r): Handle 's' class nodes. Restore chains for
786 statements. Nullify scopes. Don't copy types.
787 (init_tree): Set lang_unsave to cp_unsave.
788 (remap_save_expr): Define.
789 * ir.texi: Document CTOR_STMT.
791 1999-11-24 Jason Merrill <jason@casey.cygnus.com>
793 * search.c (note_debug_info_needed): Do perform this optimization
795 (maybe_suppress_debug_info): Likewise. Start by clearing
796 TYPE_DECL_SUPPRESS_DEBUG.
798 1999-11-24 Mark Mitchell <mark@codesourcery.com>
800 * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
802 * decl2.c (finish_vtable_vardecl): Don't prune vtables here.
804 1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
806 * decl.c (pushdecl, grokdeclarator): Don't call a variadic
807 function with a non-literal format string.
809 * lex.c (do_identifier): Likewise.
811 * typeck.c (build_unary_op): Likewise.
813 1999-11-23 Mark Mitchell <mark@codesourcery.com>
815 * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
817 1999-11-22 Mark Mitchell <mark@codesourcery.com>
819 * cp-tree.def (CTOR_COMPLETE): New tree node.
820 * decl.c (finish_constructor_body): Add it, to mark the end of the
822 (finish_function): Don't call end_protect_partials here.
823 * ir.texi (CTOR_COMPLETE): Document it.
824 * semantics.c (expand_stmt): Handle it.
826 * cp-tree.def (FUNCTION_NAME): New tree node.
827 * cp-tree.h (current_function_name_declared): Tweak documentation.
828 (lang_decl_flags): Add pretty_function_p, adjust dummy.
829 (DECL_PRETTY_FUNCTION_P): New macro.
830 * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
831 etc., in a template function. Use at_function_scope_p instead of
833 * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
835 (tsubst): Handle FUNCTION_NAME.
836 (tsubst_copy): Likewise.
837 (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
838 etc. in instantiation.
839 * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
840 even in template functions.
841 (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
842 conditional scope at the top of a destructor.
844 * error.c (dump_function_decl): Use `[ with ... ]' syntax for
847 1999-11-22 Nathan Sidwell <nathan@acm.org>
849 * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
850 when actually negative.
852 * typeck.c (convert_for_assignment): Expand comment about
853 strange NULL check, moved from ...
854 (convert_for_initialization): ... here. Remove unneeded
857 1999-11-21 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
859 * cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
860 * init.c (build_vec_delete, build_vec_delete_1): Likewise.
861 Always destruct virtual bases of array components, but never
863 (build_vec_init): Adjust invocations.
864 (build_delete): Likewise.
865 * decl2.c (delete_sanity): Likewise.
867 1999-11-19 Nathan Sidwell <nathan@acm.org>
869 * cp-tree.h (grok_method_quals): Return this pointer qualifiers.
870 * decl.c (grokdeclarator): Adjust calls to grok_method_quals.
871 * decl2.c (grok_method_quals): Accept `restrict' as applying to
872 the object pointer. Return such qualifiers.
873 (grokclassfn): Apply this pointer qualifiers. Cleanup unused
876 1999-11-18 Mark Mitchell <mark@codesourcery.com>
878 * except.c (expand_end_catch_block): Fix typo.
879 (expand_exception_blocks): Simplify. Don't call
880 expand_leftover_cleanups.
882 1999-11-15 Jason Merrill <jason@casey.cygnus.com>
884 * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
885 * pt.c (tsubst, case INTEGER_TYPE): Call it.
886 Check uses_template_parms.
888 * class.c (finish_struct): If we're a local class in a template
889 function, add a TAG_DEFN.
890 * pt.c (lookup_template_class): If this is a local class in a
891 template function, call pushtag.
892 (tsubst_expr, case TAG_DEFN): Handle classes, too.
894 Emit debug info with the vtable.
895 * search.c (maybe_suppress_debug_info): New function...
896 * class.c (finish_struct_1): ...split out from here.
897 * cp-tree.h: Declare it.
898 * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
899 if we're writing out the vtable.
900 * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
901 note_debug_info_needed): #if 0 out.
903 1999-11-14 Mark Mitchell <mark@codesourcery.com>
905 * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
906 * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
908 * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
909 * decl2.c (lookup_arg_dependent): Use it.
911 * cp-tree.h (cp_finish_decl): Change prototype.
912 (finish_static_data_member_decl): Likewise.
913 (push_permanent_obstack): Remove declaration.
914 (push_expression_obstack): Likewise.
915 (push_scratch_obstack): Likewise.
916 (DECL_TEMPLATE_PARM_P): Robustify.
917 (SET_DECL_TEMPLATE_PARM_P): New macro.
918 * class.c (add_method): Don't manipulate obstacks.
919 (finish_vtbls): Likewise.
920 * cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
921 * decl.c (binding_for_name): Don't manipulate obstacks.
922 (maybe_push_to_top_level): Likewise.
923 (pop_from_top_level): Likewise.
924 (duplicate_decls): Likewise.
925 (pushdecl): Likewise.
926 (implicitly_declare): Likewise.
927 (build_typename_type): Likewise.
928 (start_decl): Likewise.
929 (cp_finish_decl): Likewise.
930 (finish_decl): Likewise.
931 (destroy_local_static): Likewise.
932 (expand_static_init): Likewise.
933 (complete_array_type): Likewise.
934 (grokvardecl): Likewise.
935 (build_ptrmemfnc_type): Likewise.
936 (grokdeclarator): Likewise.
937 (xref_tag): Likewise.
938 (xref_basetypes): Likewise.
939 (start_enum): Likewise.
940 (finish_enum): Likewise.
941 (start_function): Likewise.
942 (finish_function): Likewise.
943 (start_method): Adjust call to cp_finish_decl.
944 * decl2.c (finish_static_data_member_decl): Don't manipulate
946 (grokfield): Likewise.
947 (grokbitfield): Likewise.
948 (get_temp_name): Likewise.
949 (get_sentry): Likewise.
950 (fnish_file): Likewise.
951 (lookup_arg_dependent): Likewise.
952 * except.c (call_eh_info): Likewise.
953 (push_eh_info): Likewise.
954 (do_pop_exception): Likewise.
955 (initialize_handler_parm): Likewise.
956 (expand_end_eh_spec): Likewise.
957 (alloc_eh_object): Likewise.
958 (expand_throw): Likewise.
959 * expr.c (extract_scalar_init): Likewise.
960 * init.c (build_java_class_ref): Likewise.
961 * lex.c (get_time_identifier): Likewise.
962 (snarf_defarg): Likewise.
963 (add_defarg_fn): Likewise.
964 (is_global): Simplify.
965 (do_identifier): Don't check TREE_PERMANENT.
966 * method.c (emit_thunk): Don't manipulate obstacks.
967 * parse.y (condition): Adjust call to cp_finish_decl.
970 (initdcl0_innards): Likewise.
971 (nomods_initdcl0): Likewise.
972 * pt.c (push_inline_template_parms_recursive): Use
973 SET_DECL_TEMPLATE_PARM_P.
974 (process_template_parm): Likewise.
975 (lookup_template_class): Don't manipulate obstacks.
976 (instantiate_class_template): Adjust call to
977 finish_static_data_member_decl.
978 (tsubst_decl): Don't manipulate obstacks.
979 (tsubst_expr): Likewise.
980 (instantiate_template): Likewise.
981 (instantiate_decl): Adjust calls to cp_finish_decl.
982 * rtti.c (call_void_fn): Don't manipulate obstacks.
983 (get_tinfo_var): Likewise.
984 (get_tinfo_fn_unused): Likewise.
985 (build_dynamic_cast_1): Likewise.
986 (expand_si_desc): Likewise.
987 (expand_class_desc): Likewise.
988 (expand_ptr_desc): Likewise.
989 (expand_attr_desc): Likewise.
990 (expand_generic_desc): Likewise.
991 (synthesize_tinfo_fn): Likewise.
992 * search.c (expand_upcast_fixups): Likewise.
993 * semantics.c (finish_asm_stmt): Likewise.
994 (finish_named_return_value): Likewise.
995 (begin_class_definition): Likewise.
996 (finish_class_definition): Likewise.
997 (finish_typeof): Likewise.
998 * tree.c (build_cplus_method_type): Likewise.
999 (reverse_path): Likewise.
1000 (copy_template_template_parm): Likewise.
1001 (build_expr_ptr_wrapper): Likewise.
1002 (push_expression_obstack): Remove.
1003 (push_permanent_obstack): Likewise.
1004 * typeck.c (mark_addressable): Likewise.
1006 1999-11-13 Mark Mitchell <mark@codesourcery.com>
1008 * call.c (build_conditional_expr): Use build_target_expr_with_type.
1009 (convert_like): Likewise.
1010 (build_over_call): Likewise.
1011 * cp-tree.h (build_target_expr): Remove.
1012 (build_target_expr_with_type): New function.
1013 * cvt.c (build_up_reference): Use get_target_expr.
1014 * decl.c (build_target_expr): Move to ...
1015 * tree.c (build_target_expr): Here. Make it static.
1016 (build_target_expr_with_type): New function. Set DECL_CONTEXT on
1017 the temporary VAR_DECLs.
1018 (get_target_expr): Use it.
1020 1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
1022 * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
1023 * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
1024 * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
1025 * class.c (set_rtti_entry): Use it.
1027 1999-11-12 Mark Mitchell <mark@codesourcery.com>
1029 * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
1031 * semantics.c (finish_expr_stmt): Call it here instead. Move
1032 default_conversion logic to semantic-analysis time.
1034 1999-11-12 Jason Merrill <jason@yorick.cygnus.com>
1036 * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
1038 Fri Nov 12 12:56:32 MST 1999 Diego Novillo <dnovillo@cygnus.com>
1040 * init.c (init_init_processing): Re-instated Nov 11 patch after
1043 Fri Nov 12 10:42:02 MST 1999 Diego Novillo <dnovillo@cygnus.com>
1045 * init.c (init_init_processing): Undo patch from Nov 11, 1999.
1046 Patch had not been approved yet.
1048 1999-11-12 Mark Mitchell <mark@codesourcery.com>
1050 * decl.c (compute_array_index_type): New function, split out from
1052 (create_array_type_for_decl): Likewise.
1053 (grokdeclarator): Use them.
1055 * semantics.c (expand_stmt): Don't suspend_momentary or
1058 Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com>
1060 * init.c (init_init_processing): Header information for
1061 arrays allocated via `new' should have the same alignment used by
1064 1999-11-10 Mark Mitchell <mark@codesourcery.com>
1066 * error.c (dump_function_name): Don't crash if given a friend
1067 pseudo-instantiation.
1069 * cp-tree.h (build_enumerator): Change prototype.
1070 * decl.c (enum_next_value): Remove.
1071 (enum_overflow): Likewise.
1072 (init_decl_processing): Don't register enum_next_value as a root.
1073 (start_enum): Clear TYPE_VALUES for a redefined enum.
1074 (finish_enum): Reset the type of enumeration constants.
1075 (build_enumerator): Fix indentation. Don't copy CONST_DECLs when
1076 we don't need to. Maintain the TYPE_VALUES list and look there
1077 for the previously defined enumeration constant. Let enumeration
1078 constants have the type of their values until the enumeration type
1080 * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
1082 * parse.c: Regenerated.
1083 * pt.c (tsubst_enum): Adjust according to build_enumerator changes.
1085 Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
1086 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1088 * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
1090 1999-11-09 Mark Mitchell <mark@codesourcery.com>
1092 * cp-tree.h (language_function): Remove x_last_dtor_insn and
1093 x_last_parm_cleanup_insn.
1094 * decl.c (last_dtor_insn): Remove.
1095 (last_parm_cleanup_insn): Likewise.
1096 (expand_start_early_try_stmts): Don't set them.
1097 (store_parm_decls): Likewise.
1098 (save_function_data): Or save them.
1099 (mark_lang_function): Or mark them.
1101 1999-11-08 Mark Mitchell <mark@codesourcery.com>
1103 * decl.c (store_parm_decls): Generate cleanup code at
1104 semantic-analysis time. Destroy objects in the correct order.
1106 1999-11-07 Mark Mitchell <mark@codesourcery.com>
1108 * cp-tree.h (begin_new_placement): Remove.
1109 (finish_new_placement): Likewise.
1110 * class.c (finish_struct_1): Don't suspend_momentary or
1112 * decl.c (grokdeclarator): Likewise.
1113 (maybe_build_cleanup_1): Likewise.
1114 * except.c (push_eh_cleanup): Likewise.
1115 (build_terminate_handler): Likewise.
1116 * init.c (build_new_1): Likewise.
1117 * parse.y (parse_decl): Change prototype.
1118 (initdecls, notype_initdecls, initdcl): Don't return int.
1119 (initdcl0, notype_initdcl0, initdcl0_innards): Likewise.
1120 (.begin_new_placement): Remove.
1121 (.finish_new_placement): Likewise.
1122 (nonmomentary_expr): Likewise.
1123 (suspend_mom): Likewise.
1124 (condition): Don't suspend_momentary, resume_momentary, or keep
1125 track of need to resume.
1126 (unary_expr): Likewise.
1127 (new_placement): Likewise.
1129 (structsp): Likewise.
1130 (new_type_id): Likewise.
1131 (maybe_parmlist): Likewise.
1132 (direct_after_type_declaration): Likewise.
1133 (direct_new_declarator): Likewise.
1134 (direct_abstract_declaration): Likewise.
1135 * parse.c: Regenerated.
1136 * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary.
1137 * semantics.c (begin_new_placement): Remove.
1138 (finish_new_placement): Likewise.
1140 1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1142 * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
1143 (DECL_TEMPLATE_INFO): Use it.
1144 * decl.c (warn_extern_redeclared_static): Do nothing for
1146 * decl2.c (mark_used): Explicitly check for function or variable.
1147 * semantics.c (finish_unary_op_expr): Check whether result is also
1150 1999-11-05 Mark Mitchell <mark@codesourcery.com>
1152 * Makefile.in (typeck2.o): Depend on output.h.
1153 * typeck2.c: Include output.h.
1155 * decl.c (flag_ansi): Remove declaration.
1157 * pt.c (tinst_level_tick): Make it static.
1158 (last_template_error_tick): Likewise.
1160 * cp-tree.h (mapcar): Remove declaration.
1161 (search_tree): Likewise.
1162 (walk_tree_fn): New typedef.
1163 (walk_tree): New function.
1164 * tree.c (bot_manip): Change prototype. Adjust to be called via
1166 (bot_replace): Likewise.
1167 (no_linkage_helper): Likewise.
1168 (copy_tree_r): New function.
1169 (search_tree): Rename, and adjust, to become ...
1170 (walk_tree): New function.
1172 (target_remap): Remove.
1173 (target_remap_count): Likewise.
1174 (break_out_target_exprs): Use walk_tree.
1175 * decl.c (local_variable_p): Change prototype.
1176 (check_default_argument): Use walk_tree.
1177 * pt.c (for_each_template_parm_r): New function, split out from ...
1178 (for_each_template_parm): Here. Use it, via walk_tree.
1180 1999-11-03 Mark Mitchell <mark@codesourcery.com>
1182 * class.c (check_bitfield_decl): New function, split out from
1184 (check_field_decl): Likewise. Recursively examine members of
1186 (finish_struct_1): Use them.
1187 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
1189 1999-11-02 Mark Mitchell <mark@codesourcery.com>
1191 * decl.c (grokfndecl): Remove dead code.
1193 * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
1195 1999-11-02 Scott Snyder <snyder@fnal.gov>
1197 * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
1199 * pt.c (tsubst_copy): Likewise.
1201 1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
1203 * decl2.c (maybe_make_one_only): Always make things comdat on
1206 1999-10-31 Mark Mitchell <mark@codesourcery.com>
1208 * decl.c (finish_function): Call free_after_parsing for functions
1209 we are not immediately turning into RTL.
1211 1999-10-31 Brendan Kehoe <brendan@cygnus.com>
1213 * cp-tree.h (flag_dump_translation_unit): Add decl.
1215 Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
1217 * lex.c (yylex): Accept 'f' in mantissa of hex float constant.
1219 1999-10-30 Mark Mitchell <mark@codesourcery.com>
1221 * decl.c (pop_cp_function_context): Don't call free on a NULL
1223 * semantics.c: Include ggc.h.
1224 (expand_body): Do garbage-collection after processing a template
1225 function. Clear DECL_SAVED_TREE after generating RTL for a
1227 * Makefile.in (semantics.o): Depend on ggc.h.
1229 1999-10-29 Mark Mitchell <mark@codesourcery.com>
1231 * cp-tree.h (make_typename_type): Change prototype.
1232 * decl.c (make_typename_type): Only complain if so requested.
1233 * parse.y (nested_name_specifier): Adjust calls.
1234 (typename_sub0): Likewise.
1235 (typename_sub1): Likewise.
1236 * parse.c: Regenerated.
1237 * pt.c (convert_template_argument): Pass complain to
1241 1999-10-28 Mark Mitchell <mark@codesourcery.com>
1243 * semantics.c (finish_handler): End the scope of the handler
1244 before attaching it to the statement-tree.
1246 1999-10-28 Ian Lance Taylor <ian@zembu.com>
1248 * rtti.c (build_dynamic_cast_1): Give a better error message for
1249 an attempt to dynamic_cast from a non-polymorphic type.
1251 1999-10-27 Mark Mitchell <mark@codesourcery.com>
1253 * cp-tree.h (make_temp_vec): Remove.
1254 (make_scratch_vec): Likewise.
1255 * call.c (add_function_candidate): Use make_tree_vec.
1256 (add_conv_candidate): Likewise.
1257 (build_builtin_candidate): Likewise.
1258 (add_template_candidate_real): Likewise.
1259 * class.c (resolve_address_of_overloaded_function): Likewise.
1260 * decl.c (start_function): Don't fool with the momentary obstack.
1261 (finish_function): Likewise.
1262 * init.c (expand_direct_vtbls_init): Likewise.
1263 (begin_init_stmts): Likewise.
1264 (finish_init_stmts): Likewise.
1265 * pt.c (add_to_template_args): Use make_tree_vec.
1266 (check_explicit_specialization): Likewise.
1267 (coerce_template_parms): Likewise.
1268 (lookup_template_class): Don't fool with the momentary obstack.
1269 (instantiate_class_template): Likewise.
1270 (tsubst_template_arg_vector): Use make_tree_vec.
1271 (tsubst_aggr_type): Don't fool with the momentary obstack.
1272 (tsubst_decl): Likewise. Use make_tree_vec.
1273 (try_one_overload): Likewise.
1274 (try_class_unification): Don't fool with the momentary obstack.
1275 (get_bindings_real): Use make_tree_vec.
1276 (set_mangled_name_for_template_decl): Likewise.
1277 * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
1278 * semantics.c (finish_expr_stmt): Likewise.
1279 (finish_do_stmt): Likewise.
1280 (finish_for_expr): Likewise.
1281 (finish_switch_cond): Likewise.
1282 (do_pushlevel): Likewise.
1283 (do_poplevel): Likewise.
1284 * tree.c (make_temp_vec): Remove.
1286 * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump
1287 CLEANUP_P for a TRY_BLOCK.
1288 * ir.texi: Document SAVE_EXPR.
1290 Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
1292 * call.c (build_over_call): Check that the built-in function is
1293 of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
1294 * typeck.c (build_function_call_real): Similarly.
1296 1999-10-26 Mark Mitchell <mark@codesourcery.com>
1298 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
1301 1999-10-24 Mark Mitchell <mark@codesourcery.com>
1303 * decl.c (push_overloaded_decl_1): Use pushdecl.
1305 * decl.c (auto_function): Replace #ifdef'd __inline with just
1307 * lex.c (my_get_run_time): Likeise.
1308 (yyprint): Likewise.
1309 (identifier_type): Likewise.
1310 * method.c (start_squangling): Likewise.
1311 (end_squangling): Likewise.
1313 (old_backref_index): Likewise.
1314 (flush_repeats): Likewise.
1315 (issue_ktype): Likewise.
1316 * parse.y (empty_parms): Likewise.
1317 * parse.c: Regenerated.
1319 1999-10-21 Mark Mitchell <mark@codesourcery.com>
1321 * dump.c (dequeue_and_dump): Replace several uses of
1322 queue_and_dump_index with dump_child.
1324 1999-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1326 * expr.c: Include tm_p.h.
1328 1999-10-21 Mark Mitchell <mark@codesourcery.com>
1330 * cp-tree.h (SCOPE_PARTIAL_P): New macro.
1331 (pushlevel_temporary): Remove.
1332 (add_scope_stmt): New function.
1333 * decl.c (pushlevel_temporary): Remove.
1334 (poplevel): Use add_scope_stmt.
1335 (start_decl_1): Likewise.
1336 * semantics.c (add_scope_stmt): New function.
1337 (do_pushlevel): Use it.
1338 (do_poplevel): Use it.
1339 (expand_stmt): Check SCOPE_PARTIAL_P.
1341 * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
1342 * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
1343 * expr.c (cplus_expand_expr): Expand it.
1344 * ir.texi: Document EMPTY_CLASS_EXPR.
1346 1999-10-20 Mark Mitchell <mark@codesourcery.com>
1348 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
1349 parameters as having namespace scope.
1351 1999-10-19 Mark Mitchell <mark@codesourcery.com>
1353 * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
1354 (mangling_flags): New type.
1355 (build_overload_int): Change prototype.
1356 (build_overload_value): Likewise.
1357 (numeric_output_need_bar): Improve comment.
1358 (mangle_expression): New function, broken out from ...
1359 (build_overload_int): Here.
1360 (build_overload_value): Adjust for use of mangling flags. Don't
1361 warn about real-valued template parameters here. Do handle
1362 complex expressions involving real-valued template parameters.
1363 (build_template_parm_names): Encase non-type template parameters
1364 in underscores, if necessary.
1365 (process_overload_item): Remove conditional on
1366 PARM_CAN_BE_ARRAY_TYPE.
1368 1999-10-17 Mark Mitchell <mark@codesourcery.com>
1370 * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
1372 * ir.texi: Clean up documentation of RETURN_INIT.
1374 1999-10-15 Greg McGary <gkm@gnu.org>
1376 * lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
1377 (lang_init): Set default for flag_bounds_check if still "unspecified".
1379 1999-10-13 Andrew Haley <aph@cygnus.com>
1381 * class.c (finish_struct_1): Force alignment of non-bitfields to
1384 Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
1386 * typeck2.c (process_init_constructor): Handle empty constructors.
1388 1999-10-13 Jason Merrill <jason@yorick.cygnus.com>
1390 * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
1392 * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
1395 1999-10-13 Mark Mitchell <mark@codesourcery.com>
1397 * decl.c (make_rtl_for_local_static): Don't create register RTL
1398 for addressable constants.
1400 1999-10-13 Nathan Sidwell <nathan@acm.org>
1402 * cp-tree.h (build_x_va_arg): Prototype new function.
1403 * call.c (build_x_va_arg): Define it.
1404 * parse.y (unary_expr): Call build_x_va_arg.
1406 * cp-tree.h (convert_type_from_ellipsis): Prototype new function.
1407 * call.c (convert_type_from_ellipsis): Define it.
1408 * decl.c (init_decl_processing): Set lang_type_promotes_to.
1410 * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
1412 1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
1414 * class.c (fixed_type_or_null): Always set *nonnull.
1416 1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1418 * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
1419 __GNUC__ and __GNUC_MINOR__.
1421 1999-10-09 Mark Mitchell <mark@codesourcery.com>
1423 * cp-tree.h (make_rtl_for_local_static): New function.
1424 * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
1426 (make_rtl_for_local_static): Here.
1427 * semantics.c (expand_stmt): Use make_rtl_for_local_static.
1429 1999-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1431 * method.c: Include tm_p.h.
1433 1999-10-7 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
1435 * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
1436 * lex.c (cp_make_lake_type): Likewise.
1437 * tree.c (init_tree): Init make_lang_type_fn.
1439 1999-10-07 Mark Mitchell <mark@codesourcery.com>
1441 * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
1444 * semantics.c (expand_stmt): Don't pretend to have asmspecs for
1445 local statics if we don't really have them.
1447 * ir.texi: Improve documentation for STMT_EXPR. Describe
1450 1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
1452 * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
1454 1999-10-07 Greg McGary <gkm@gnu.org>
1456 * class.c (finish_struct_1): Use simpler method of
1457 removing elements of a singly-linked list which doesn't
1458 lose for classes without data members.
1460 1999-10-07 Mark Mitchell <mark@codesourcery.com>
1462 * friend.c (make_friend_class): Robustify.
1464 * semantics.c (finish_object_call_expr): Reject calls to template
1467 1999-10-06 Mark Mitchell <mark@codesourcery.com>
1469 * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
1471 * cp-tree.h (CLASSTYPE_VFIELD): Remove.
1472 * call.c (build_vfield_ref): Use TYPE_VFIELD, not
1474 * class.c (get_vfield_offset): Likewise.
1475 (finish_base_struct): Likewise.
1476 (modify_one_vtable): Likewise.
1477 (fixup_vtable_deltas): Likewise.
1478 (finish_struct_1): Likewise.
1479 * init.c (expand_virtual_init): Likewise.
1480 * search.c (lookup_field_1): Likewise.
1481 (expand_upcast_fixups): Likewise.
1482 * typeck.c (build_component_ref): Likewise.
1483 (build_binary_op_nodefault): Likewise.
1485 * dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
1486 * ir.texi: Document TYPE_VFIELD.
1488 1999-10-06 Brendan Kehoe <brendan@cygnus.com>
1490 * decl.c (grokdeclarator): Only warn about non-zero arrays if
1491 !in_system_header (linux socketbits.h can give this for
1492 __cmsg_data, which is using a GNU extension).
1494 1999-10-05 Mark Mitchell <mark@codesourcery.com>
1496 * decl2.c (start_static_storage_duration_function): Push the
1497 function declaration so it ends up in namespace scope.
1499 * dump.c (DUMP_CHILDREN): Remove.
1500 (DUMP_BINFO): Adjust.
1501 (struct dump_node_info): Remove dump_children_p.
1502 (queue_and_dump_type): Remove dump_children_p parameter.
1503 (queue): Don't set dump_children_p.
1504 (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
1505 queue_and_dump_index.
1506 (dequeue_and_dump): Unconditionally print children. Adjust calls
1507 to functions mentioned above.
1508 (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
1510 * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
1511 * dump.c (dequeue_and_dump): Dump them.
1513 * method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
1515 * decl.c (start_function): Set current_in_charge_parm for
1516 constructors, too, where appropriate.
1517 * search.c (fixup_all_virtual_upcast_offsets): New function.
1518 (expand_indirect_vtbls_init): Use it.
1520 1999-10-04 Nathan Sidwell <nathan@acm.org>
1522 * decl2.c (grok_alignof): Don't decay lvalues.
1524 * init.c (build_new): Remove unused variable.
1526 1999-10-04 Mark Mitchell <mark@codesourcery.com>
1528 * cp-tree.h (struct language_function): Remove static_labelno.
1529 (static_labelno): Remove macro.
1530 * method.c (build_overload_nested_name): Make static_labelno
1533 * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
1534 to decide whether or not a function is defined.
1536 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
1537 situations where make_node will do it automatically.
1538 * decl.c (grok_reference_init): Likewise.
1539 (expand_static_init): Likewise.
1540 (do_static_initialization): Likewise.
1541 * init.c (perform_member_init): Likewise.
1542 (expand_aggr_init_1): Likewise.
1543 (build_new_1): Likewise.
1544 * method.c (do_build_copy_constructor): Likewise.
1545 (do_build_assign_ref): Likewise.
1546 * search.c (expand_upcast_fixups): Likewise.
1547 * semantics.c (finish_stmt_expr): Likewise.
1548 * typeck.c (build_unary_op): Likewise.
1549 (check_return_expr): Likewise.
1551 1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
1553 * init.c (build_vec_delete_1): Fold COND_EXPRs.
1555 1999-10-03 Mark Mitchell <mark@codesourcery.com>
1557 * cp-tree.def (VEC_INIT_EXPR): Remove.
1558 * cp-tree.h (struct stmt_tree): New type.
1559 (struct saved_scope): Remove firstobj. Add x_saved_tree,
1561 (class_cache_firstobj): Remove.
1562 (struct language_function): Remove stmts_are_full_exprs_p,
1563 x_last_tree, and x_last_expr_type. Add x_stmt_tree.
1564 (current_stmt_tree): New macro.
1565 (last_tree): Adjust.
1566 (last_expr_type): Likewise.
1567 (doing_semantic_analysis_p): Simplify.
1568 (stmts_are_full_exprs_p): Adjust.
1569 (begin_tree): Remove prototype.
1570 (end_tree): Likewise.
1571 (begin_stmt_tree): Change prototype.
1572 (finish_stmt_tree): Likewise.
1573 (building_stmt_tree): Simplify.
1574 * decl.c (mark_stmt_tree): New function.
1575 (mark_saved_scope): Use it.
1576 (start_function): Rearrange slightly to call begin_stmt_tree
1578 (save_function_data): Tweak.
1579 (finish_function): Adjust call to finish_stmt_tree.
1580 (mark_lang_function): Use mark_stmt_tree.
1581 * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
1582 * init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
1583 (build_vec_init): Remove creation of stand-in intializer.
1584 * pt.c (begin_tree): Remove.
1585 (end_tree): Likewise.
1586 * semantics.c (SET_LAST_STMT): New macro. Use it throughout.
1587 (begin_compound_stmt): Handle a compound-statement outside of a
1589 (begin_stmt_expr): Handle a statement-expression outsidef of a
1591 (finish_stmt_expr): Likewise.
1592 (begin_class_definition): Don't call begin_tree.
1593 (finish_inline_definitions): Don't call end_tree.
1594 (begin_stmt_tree): Take a pointer to tree, not a function as input.
1595 (finish_stmt_tree): Likewise.
1596 * tree.c (search_tree): Don't handle VEC_INIT_EXPR.
1599 * parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
1600 * parse.c: Regenerated.
1602 * dump.c (dqueue_and_dump): Dump bitfieldness.
1604 * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
1605 bitfields, rather than DECL_BIT_FIELD.
1606 * ir.texi: Document how to tell whether or not a field is a
1609 * lex.c (make_lang_type): Fix typo in comment.
1611 1999-10-01 Jason Merrill <jason@yorick.cygnus.com>
1613 * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
1615 1999-10-01 Mark Mitchell <mark@codesourcery.com>
1617 * pt.c (tsubst_decl): If the type of a template instantiation is
1618 bogus, so is the whole instantiation.
1620 1999-09-30 Mark Mitchell <mark@codesourcery.com>
1622 * decl.c (initialize_local_var): Handle static variables here.
1623 (cp_finish_decl): Tweak handling of function-scope static
1625 * semantics.c (expand_stmt): Handle DECL_STMTs for static
1628 * method.c (emit_thunk): Don't crash when -fsyntax-only.
1630 * cp-tree.h (lang_decl_flags): Add global_ctor_p and
1631 global_dtor_p. Add init_priority.
1632 (DECL_ACCESS): Adjust accordingly.
1633 (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
1634 (GLOBAL_INIT_PRIORITY): Likewise.
1635 * decl.c (lang_mark_tree): Adjust accordingly.
1636 (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
1637 and GLOBAL_INIT_PRIORITY.
1638 * dump.c (dequeue_and_dump): Print them.
1639 * ir.texi: Document them.
1641 * decl2.c (struct priority_info_s): Remove initialization_sequence
1642 and destruction_sequence.
1643 (start_static_storage_duration_function): Return the body of the
1644 function. Convert for function-at-a-time mode.
1645 (generate_inits_for_priority): Remove.
1646 (finish_static_storage_duration_function): Change prototype.
1647 Adjust for function-at-a-time mode.
1648 (do_static_initialization): Likewise.
1649 (do_static_destruction): Likewise.
1650 (do_static_initialization_and_destruction): Remove.
1651 (start_static_initialization_or_destruction): New function.
1652 (finish_static_initialization_or_destruction): Likewise.
1653 (get_priority_info): Don't manipulation initialization_sequence or
1654 destruction_sequence.
1655 (prune_vars_needing_no_initialization): New function.
1656 (write_out_vars): Likewise.
1657 (finish_file): Use the various new functions instead of the old.
1659 Thu Sep 30 00:13:27 1999 Dirk Zoller <duz@rtsffm.com>
1661 * cp-tree.h (warn_float_equal): Declare.
1662 * decl2.c (warn_float_equal): Define.
1663 (lang_decode_option): Recognize -W[no-]float-equal.
1664 * typeck.c (build_binary_op_nodefault): Conditionally warn
1665 about equality tests of floating point types.
1667 1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
1669 Support normal type_info-based EH mechanisms with -fno-rtti.
1670 * except.c (build_eh_type_type): Remove special -fno-rtti handling.
1671 (build_eh_type_type_ref): Likewise.
1672 (build_eh_type): Remove.
1673 (expand_throw): Call build_eh_type_type, not build_eh_type.
1674 * decl2.c (import_export_decl): Don't associate the tinfo fn with
1675 the vtable if -fno-rtti.
1676 * decl.c (init_decl_processing): Always init_rtti_processing.
1678 * rtti.c (get_typeid): Don't complain about -fno-rtti.
1680 * class.c (class_cache_obstack, class_obstack): Remove.
1681 (init_class_processing): Don't initialize class_obstack.
1682 (push_cache_obstack): Remove.
1683 (pushclass): Don't call it.
1684 * cp-tree.h: Remove prototype for push_cache_obstack.
1685 * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
1686 (pushlevel_class): Don't push_decl_level.
1687 (poplevel_class): Don't pop_stack_level.
1688 (push_class_level_binding): Don't push_cache_obstack.
1689 (init_decl_processing): Don't intialize decl_obstack.
1690 * search.c (push_class_decls): Don't push_cache_obstack.
1691 * tree.c (list_hash_add): Put hash node on permanent_obstack.
1692 (hash_tree_cons): Don't mess with obstacks.
1693 (print_lang_statistics): Don't print stats for class_obstack and
1696 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1698 * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
1699 * ir.texi: Document DECL_EXTERNAL.
1701 * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
1702 * ir.texi: Document THUNK_DECLs.
1704 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
1705 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1706 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1707 * error.c (dump_template_bindings): Remove unused parameter.
1708 Handle multiple levels of template parameters.
1709 (dump_template_decl): Use `parms', not `args', for template
1710 parameters. Fix thinko.
1711 (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass
1712 flags to dump_template_bindings.
1713 * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
1714 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1715 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1716 (tsubst_copy): Clarify variable name.
1717 (most_general_template): Robustify.
1719 1999-09-29 Nathan Sidwell <nathan@acm.org>
1721 * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
1722 to change primary template rendering.
1724 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1726 * cp-tree.h (UPT_TEMPLATE): Remove.
1727 (UPT_PARMS): Likewise.
1728 (DECL_NEEDED_P): New macro.
1729 * decl2.c (finish_vtable_vardecl): Use it.
1730 (finish_objects): Don't crash with -fsyntax-only.
1731 (finish_file): Use DECL_NEEDED_P. Don't prune vtables when
1733 * pt.c (tsubst_friend_function): Remove FIXME that talks about
1735 (tsubst_expr): Correct handling of function try-blocks.
1736 * semantics.c: Include flags.h.
1737 (expand_body): Don't do RTL generation if -fsyntax-only.
1738 * Makefile.in (semantics.o): Depends on flags.h.
1740 1999-09-28 Gabriel Dos Reis <gdr@codesourcery.com>
1742 * pt.c (most_general_template): Adjust declaration.
1744 * cp-tree.h: (most_general_template): Declare.
1746 * error.c (dump_template_value): Rename to ...
1747 (dump_template_argument): This.
1748 (dump_template_argument_list): New function.
1749 (dump_type): Use it.
1750 (dump_template_parameter): New function.
1751 (dump_template_decl): Use it.
1752 (dump_template_bindings): New function.
1753 (dump_function_decl): Use it. Pretty print function template
1756 1999-09-28 Nathan Sidwell <nathan@acm.org>
1758 * decl.c (grokdeclarator): Distinguish parameter context for
1759 diagnostics. Tidy up missing type diagnostic.
1760 Diagnose `explicit' in one place. Diagnose `mutable' in one place.
1762 1999-09-28 Mark Mitchell <mark@codesourcery.com>
1764 * ir.texi: Improve documentation for TARGET_EXPR.
1766 1999-09-27 Nathan Sidwell <nathan@acm.org>
1768 Augment stringification of trees.
1769 * cp-tree.h (tree_string_flags): New error stringifying enumeration.
1770 (fndecl_as_string, type_as_string_real, args_as_string,
1771 code_as_string, language_as_string, parm_as_string,
1772 op_as_string, assop_as_string, cv_as_string): Remove.
1773 (type_as_string, decl_as_string, expr_as_string): Adjust prototype.
1774 (context_as_string): Declare new function.
1775 * error.c (cp_printers): Move definition.
1777 (OB_END_TEMPLATE_ID): Adjust.
1778 (interesting_scope_p): Remove.
1779 (dump_scope): New static function.
1780 (dump_qualifiers): Adjust prototype, reimplement.
1781 (dump_template_value): Use tree_string_flags.
1782 (dump_type_real): Move back to dump_type.
1783 (dump_type): Adjust prototype. Use tree_string_flags.
1784 (dump_aggr_type): Likewise. Use dump_template_parms.
1785 (dump_type_prefix): Adjust prototype. Use tree_string_flags.
1787 (dump_type_suffix): Adjust prototype. Use tree_string_flags.
1788 (dump_simple_decl): Likewise.
1789 (dump_decl): Likewise. Use dump_template_decl.
1790 (dump_template_decl): New static function broken out of dump_decl.
1791 (dump_function_decl): Adjust prototype. Use tree_string_flags.
1792 (dump_parameters): Likewise. Prefix space.
1793 (dump_exception_spec): Adjust prototype. Use tree_string_flags.
1794 (dump_function_name): Likewise. Use dump_template_parms.
1795 (dump_template_parms): New static function broken out of
1797 (dump_expr_list): Adjust prototype. Use tree_string_flags.
1798 (dump_expr): Likewise.
1799 (fndecl_as_string): Removed
1800 (type_as_string_real): Removed
1801 (dump_binary_op): Adjust prototype. Use tree_string_flags.
1802 (dump_unary_op): Likewise.
1803 (type_as_string): Likewise.
1804 (expr_as_string): Likewise.
1805 (decl_as_string): Likewise.
1806 (context_as_string): New function.
1807 (lang_decl_name): Adjust.
1808 (decl_to_string): New static print callback.
1809 (expr_to_string): Likewise.
1810 (fndecl_to_string): Likewise.
1811 (code_as_string): Renamed to ...
1812 (code_to_string): ... here. Adjust.
1813 (language_as_string): Renamed to ...
1814 (language_to_string): ... here. Adjust.
1815 (parm_as_string): Renamed to ...
1816 (parm_to_string): ... here.
1817 (op_as_string): Renamed to ...
1818 (op_to_string): ... here.
1819 (assop_as_string): Renamed to ...
1820 (assop_to_string): ... here.
1821 (type_to_string): New static print callback.
1822 (args_as_string): Renamed to ...
1823 (args_to_string): ... here. Adjust.
1824 (cv_as_string): Renamed to ...
1825 (cv_to_string): ... here. Adjust.
1826 * pt.c (mangle_class_name_for_template): Use tree_string_flags.
1827 (print_template_context): Likewise.
1829 1999-09-26 Mark Mitchell <mark@codesourcery.com>
1831 * cp-tree.h (expand_throw): Remove prototype.
1832 * except.c (expand_throw): Make it static. Use tree-generation
1833 functions, rather than RTL-generation functions.
1834 (build_throw): Use it.
1835 * expr.c: Include except.h.
1836 (cplus_expand_expr): Don't call expand_throw here.
1837 * Makefile.in (expr.o): Depend on except.h.
1838 * ir.texi: Update documentation for THROW_EXPR.
1840 * decl.c (start_function): Set x_dont_save_pending_sizes rather
1841 than calling get_pending_sizes.
1842 * init.c (build_new): Don't save and restore
1843 immediate_size_expand; instead, assert that it has the expected
1846 1999-09-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1848 * lex.c (compiler_error): Add missing call to va_end().
1850 1999-09-25 Mark Mitchell <mark@codesourcery.com>
1852 * dump.c (dequeue_and_dump): Handle RESULT_DECL.
1853 * ir.texi: Document RESULT_DECL and DECL_RESULT.
1855 * cp-tree.h (check_return_expr): New function.
1856 * decl.c (finish_constructor_body): New function.
1857 (pushdecl): Put global friend functions in namespace binding
1858 level, not the class binding level.
1859 (finish_destructor_body): Make sure the dtor_label is always
1860 defined. Fix typo in comment.
1861 (finish_function): Move generation of constructor-termination code
1862 to semantic-analysis time. Move generation of implicit `main'
1863 return value to semantic-analysis time.
1864 * semantics.c (finish_return_stmt): Generate goto's to
1865 ctor_label/dtor_label here. Use check_return_expr to do semantic
1866 analysis on the returned expression.
1867 * typeck.c (maybe_warn_about_returning_address_of_local): New
1868 function split out from c_expand_return.
1869 (check_return_expr): Likewise.
1870 (c_expand_return): Just generate the RTL for the return.
1872 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1874 * cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
1875 (cleanup_type): Likewise.
1876 (search_tree): Change prototype.
1877 * decl.c (local_variable_p): Adjust for new interface to
1879 (check_default_argument): Likewise.
1880 * error.c (dump_expr): Handle INIT_EXPR.
1881 * except.c (expand_throw): Don't make cleanup_type a local static.
1882 * expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
1883 * init.c (build_new): Call build_new_1 directly, rather than
1884 building a NEW_EXPR.
1885 (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when
1886 processing file-scope initializers.
1887 * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
1888 * tree.c: Include splay-tree.h
1889 (no_linkage_helper): Adjust for new interface to search_tree.
1890 (search_tree): Pass around pointers to tree nodes, rather than the
1891 nodes themselves. Handle VEC_INIT_EXPR.
1892 (no_linkage_check): Adjust for new interface to search_tree.
1893 (mapcar): Handle VEC_INIT_EXPR.
1894 (target_remap): New variable.
1895 (bot_manip): Use it.
1896 (bot_replace): New function.
1897 (break_out_target_exprs): Use it to remap all variables used in a
1898 default argument expression.
1899 * typeck.c (build_modify_expr): Don't crash when outside a
1900 function and presented with an INIT_EXPR assignment
1901 * Makefile.in (tree.o): Depend on splay-tree.h.
1903 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1905 * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
1907 (builtin_function): New arg CLASS. Arg CODE now of type int. All
1909 Set the builtin's DECL_BUILT_IN_CLASS.
1911 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1913 * decl.c (pushdecl): Don't make local declarations of extern
1914 variables give the variable a DECL_CONTEXT for the function.
1915 (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify.
1916 Don't accidentally make RTL for local declarations.
1917 (emit_local_var): Handle declarations with asm-specifiers here.
1919 1999-09-23 Mark Mitchell <mark@codesourcery.com>
1921 * ir.texi: Improve documentation for TARGET_EXPRs. Discuss
1922 STMT_IS_FULL_EXPR_P.
1924 * cp-tree.h (language_function): Add cannot_inline.
1925 * decl.c (start_function): Restore current_function_cannot_inline
1926 from the saved value.
1927 (save_function_data): Save current_function_cannot_inline.
1928 * decl2.c (start_objects): Change prototype. Build the function
1929 in function-at-a-time mode.
1930 (finish_objects): Likewise.
1931 (generate_ctor_or_dtor_function): Adjust accordingly.
1933 * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
1934 * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
1935 Don't call expand_anon_union_decl here
1936 * semantics.c (exapnd_stmt): Call it here, instead.
1937 * typeck.c (mark_addressable): Addressed variables are implicitly
1940 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1942 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
1943 (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
1944 (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
1945 * cp-tree.h: Add tree checking macros to various tree access
1947 * ptree.c (print_lang_decl): Test for function or variable
1948 before accessing template info.
1950 1999-09-23 Jason Merrill <jason@yorick.cygnus.com>
1952 * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
1953 * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
1954 * decl2.c (lang_f_options): Add -fshort-wchar.
1955 * cp-tree.h: Declare flag_short_wchar.
1956 * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned
1959 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1961 * ir.texi: Fix formatting errors and typos.
1963 1999-09-22 Mark Mitchell <mark@codesourcery.com>
1965 * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
1967 * decl.c (pushdecl): Do create a binding for extern "C" functions,
1968 but not for their DECL_ASSEMBLER_NAMEs.
1969 (lookup_name_current_level): Fix formatting.
1970 (xref_tag): Likewise.
1971 * decl2.c (start_objects): Mark static constructors and
1972 destructors as used.
1974 1999-09-22 Jason Merrill <jason@yorick.cygnus.com>
1976 * decl.c (define_case_label): Don't crash if we're not in a switch.
1978 * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
1979 * lang-options.h: Restore -fthis-is-variable. Remove help strings
1980 for unsupported flags.
1982 1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
1984 * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
1985 Accept and warn about -fthis-is-variable.
1987 1999-09-21 Mark Mitchell <mark@codesourcery.com>
1989 * dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
1990 CLEANUP_STMT, and SCOPE_STMT.
1992 * decl2.c (lang_decode_option): Adjust, in the wake of recent
1993 changes to option processing.
1995 1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1997 * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
1998 function pointer from pmfs with no object given.
1999 (convert_for_assignment): Do not return error when converting
2002 1999-09-21 Alex Samuel <samuel@codesourcery.com>
2004 * lex.c (internal_filename): New variable.
2005 (INTERNAL_FILENAME): New macro.
2006 (init_parse): Allocate internal_filename and mark as root. Use it
2007 instead of a string constant.
2009 1999-09-21 Nathan Sidwell <nathan@acm.org>
2011 Reimplement dynamic cast and catch matching.
2012 * cp-tree.h (get_dynamic_cast_base_type): Prototype new function
2013 * search.c (dynamic_cast_base_recurse): New function.
2014 (get_dynamic_cast_base_type): New function for dynamic cast.
2015 * rtti.c (build_dynamic_cast_1): Determine source and target
2016 class relationship. Call __dynamic_cast_2.
2017 * tinfo.h (__user_type_info::upcast): New catch dispatcher.
2018 (__user_type_info::dyncast): New dynamic cast dispatcher.
2019 (__user_type_info::sub_kind): New nested enumeration.
2020 (__user_type_info::contained_p): sub_kind predicate.
2021 (__user_type_info::contained_public_p): Likewise.
2022 (__user_type_info::contained_nonpublic_p): Likewise.
2023 (__user_type_info::contained_nonvirtual_p: Likewise.
2024 (__user_type_info::upcast_result): New nested struct.
2025 (__user_type_info::dyncast_result): New nested struct.
2026 (*::do_upcast): New catch function.
2027 (*::do_dyncast): New dynamic cast function.
2028 (__user_type_info::find_public_subobj): New dynamic cast
2030 (*::do_find_public_subobj): New dynamic cast helper function.
2031 * tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
2032 (__user_type_info::dyncast): Define dynamic cast dispatcher.
2033 (*::do_upcast): Define catch function.
2034 (*::do_dyncast): Define dynamic cast function.
2035 (*::do_find_public_subobj): Define dynamic cast helper function.
2036 * tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
2037 (__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
2038 (__dynamic_cast_2): New dynamic cast runtime.
2040 1999-09-20 Mark Mitchell <mark@codesourcery.com>
2042 * cp-tree.h (finish_stmt_expr): Change prototype.
2043 * expr.c (cplus_expand_expr): Adjust call accordingly.
2044 * init.c (finish_init_stmts): Likewise.
2045 * parse.y (primary): Likewise.
2046 * pt.c (tsubst_copy): Likewise.
2047 * semantics.c (finish_stmt_expr): Don't take two parameters.
2048 Don't remove generated BLOCKs from the block-tree.
2050 Remove support for assigning to `this'.
2051 * NEWS: Note that fact.
2052 * class.c (build_vbase_path): Don't check flag_this_is_variable.
2053 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
2054 (language_function): Remove assigns_this, just_assigned_this, and
2055 x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p.
2056 (base_init_expr): Remove.
2057 (current_vcalls_possible_p): New macro.
2058 (vtbls_set_up_p): Likewise.
2059 (emit_base_init): Change prototype.
2060 * decl.c (finish_destructor_body): New function, split out from
2062 (current_function_assigns_this): Remove.
2063 (current_function_just_assigned_this): Likewise.
2064 (start_function): Don't set them.
2065 (finish_function): Don't check them. Don't emit
2066 base-initialization code here. Generate code for destructors when
2067 doing semantic analysis.
2068 (finish_stmt): Don't check current_function_just_assigned_this.
2069 * decl2.c (lang_f_options): Remove this-is-variable.
2070 (lang_decode_option): Likewise.
2071 (grokclassfn): Don't check flag_this_is_variable.
2072 * init.c (emit_base_init): Return the expression generated.
2073 (construct_virtual_bases): Don't push/pop obstacks. Fix
2075 (build_new_1): Don't check flag_this_is_variable.
2076 (get_temp_regvar): Don't set DECL_REGISTER.
2077 (build_vec_init): Don't call use_variable.
2078 * lang-options.h: Remove "-fthis-is-variable" and
2079 "-fno-this-is-variable".
2080 * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
2081 * search.c (expand_upcast_fixups): Use finish_expr_stmt, not
2083 * semantics.c (finish_expr_stmt_real): Rename to ...
2084 (finish_expr_stmt): This. Remove assigned_this parameter.
2085 (begin_if_stmt): Call do_pushlevel before starting the statement.
2086 (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
2088 (setup_vtbl_ptr): Emit initialization code for bases and members
2089 at semantic-analysis time. Emit code to initialize vtables in
2091 (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
2092 Don't handle CTOR_INITIALIZER any more.
2093 * typeck.c (build_modify_expr): Don't check for assignments to
2095 (c_expand_return): Don't suggest assigning to `this'.
2097 * Makefile.in (decl.o): Depend on RTL_H.
2098 (decl2.o): Likewise.
2099 (class.o): Likewise.
2101 (method.o): Likewise.
2102 (search.o): Likewise.
2106 * decl.c (duplicate_decls): When a builtin function is redeclared
2107 as static, make sure it is mangled correctly.
2109 * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add
2110 detail about the statement-tree.
2112 1999-09-20 Nathan Sidwell <nathan@acm.org>
2114 * parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
2116 1999-09-20 Nick Clifton <nickc@cygnus.com>
2118 * decl2.c (lang_decode_option): Extend comment.
2120 Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk>
2122 * typeck.c: Include "tm_p.h".
2124 1999-09-19 Mark Mitchell <mark@codesourcery.com>
2126 * ir.texi: New file.
2128 1999-09-19 Paul Burchard <burchard@pobox.com>
2130 * semantics.c (expand_stmt): Initialize return value.
2132 1999-09-18 Paul Burchard <burchard@pobox.com>
2134 * gxxint.texi: G++ now implements namespaces.
2136 1999-09-18 Mark Mitchell <mark@codesourcery.com>
2138 * decl.c (pop_label): Don't warn about unused labels more than
2140 * semantics.c (finish_goto_stmt): Always marked used labels as
2143 * decl.c (layout_var_decl): Change prototype. Call layout_decl
2144 even when the declaration is external.
2145 (cp_finish_decl): Adjust call to layout_var_decl.
2146 * pt.c (tsubst_expr): Make sure to initialize stmt before using it.
2148 1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
2150 * typeck.c (get_member_function_from_ptrfunc): Always consider
2151 virtuality inside member pointer.
2153 1999-09-17 Mark Mitchell <mark@codesourcery.com>
2155 Turn on function-at-a-time processing.
2156 * cp-tree.h (doing_semantic_analysis_p): New macro.
2157 (SF_DEFAULT): Define to zero, not SF_EXPAND.
2158 (start_handler_parms): Change prototype.
2159 (expand_start_catch_block): Likewise.
2160 (expand_end_catch_block): Likewise.
2161 (expand_start_eh_spec): Likewise.
2162 (expand_end_eh_spec): Declare.
2163 (finish_handler_parms): Change prototype.
2164 (begin_catch_block): Declare.
2165 (finish_handler): Change prototype.
2166 (do_pushlevel): Declare.
2167 (do_poplevel): Likewise.
2168 * decl.c (pushlevel): Don't create
2169 binding levels when not doing semantic analysis.
2170 (poplevel): Don't pop them.
2171 (pushdecl): Assert that we are never called when not doing
2173 (pushdecl_top_level): Use push_to_top_level.
2174 (make_label_decl): Don't fiddle with obstacks. Make RTL For the
2175 label when expanding.
2176 (cp_finish_decl): Only inject for-scope variables when doing
2177 semantic analysis. Add comments.
2178 (start_handler_parms): Return the handler parm.
2179 (start_function): Reorganize. Don't clear DECL_INITIAL if it is
2180 already set. Reinitialize from saved function data if available.
2181 Don't pushlevel when not doing semantic analysis.
2182 (store_parm_decls): Only generate RTL when expanding. Only
2183 pushdecl when doing semantic analysis. Set
2184 current_eh_spec_try_block if appropriate.
2185 (finish_function): Simplify. Use do_pushlevel and do_poplevel.
2186 Combine common code. Don't poplevel when not doing semantic
2188 (push_cp_function_context): Don't expand functions without an
2189 explicit call to expand_body.
2190 (mark_lang_function): Make eh_spec_try_block and
2192 * except.c (expand_end_eh_spec): Don't
2194 (process_start_catch_block): Likewise.
2195 (push_eh_cleanup): Use finish_decl_cleanup.
2196 (initialize_handler_parm): New function.
2197 (expand_start_catch_block): Use it.
2198 (expand_end_catch_block): Use tree-generation functions, not
2199 RTL-generation functions.
2200 (expand_start_eh_spec): Likewise.
2201 (expand_end_eh_spec): Likewise.
2202 (expand_exception_blocks): Simplify.
2203 (start_anon_func): Use do_pushlevel.
2204 (end_anon_func): Use do_poplvel. Call expand_body for the
2206 * expr.c (do_case): Don't call define_case_label.
2207 * init.c (create_temporary_var): Set DECL_CONTEXT for local
2209 * method.c (emit_thunk): Call expand_body for the
2211 (sythesize_method): Likewise.
2212 * parse.y (handler_args): Give it ttype.
2213 (eat_saved_input): Call expand_body.
2214 (base_init): Use do_pushlevel.
2215 (pending_inline): Call expand_body.
2216 (handler): Adjust calls to finish_handler_parms and
2218 (handler_args): Don't call expand_start_catch_block. Return the
2219 catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling.
2220 * parse.c: Regenerated.
2221 * rtti.c (synthesize_tinfo_fn): Call finish_function.
2222 * semantics.c (do_pushlevel): Give it external linkage. Build
2224 (do_poplevel): Likewise.
2225 (finish_case_label): Call define_case_label when doing semantic
2227 (finish_goto_stmt): Create RTL for labels.
2228 (finish_function_try_block): Set in_function_try_handler
2230 (finish_function_handler_sequence): Unset it.
2231 (finish_handler_parms): Use expand_start_catch_block even when
2232 building a statement-tree.
2233 (begin_catch_block): New function.
2234 (finish_handler): Move a little RTL-generation logic here.
2235 (finish_decl_cleanup): Allow cleanups for empty declarations.
2236 (finish_named_return_value): Don't pushdecl when not doing
2238 (expand_stmt): Don't do semantic analysis for variable
2239 declarations. Handle START_CATCH_STMT. Call expand_label
2240 directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust
2241 HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
2242 (expand_body): Let expand_stmt handle CTOR_INITIALIZER,
2243 RETURN_INIT and function try blocks.
2245 * cp-tree.h (language_function): Add x_eh_spec_try_block. Add
2246 x_scope_stmt_stack. Add x_in_charge_parm.
2247 (current_eh_spec_try_block): New macro.
2248 (current_scope_stmt_stack): Likewise.
2249 (current_in_charge_parm): Likewise.
2250 * decl.c (start_function): Initialize current_in_charge_parm.
2251 (finish_function): Use current_in_charge_parm rather than looking
2253 * search.c (expand_indirect_vtbls_init): Likewise.
2255 * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
2256 (TRY_BLOCK): Likewise.
2257 (HANDLER): Likewise.
2258 (START_CATCH_STMT): New tree node.
2259 (SCOPE_STMT): Likewise.
2260 * cp-tree.h (SCOPE_BEGIN_P): New macro.
2261 (SCOPE_NULLIFIED_P): Likewise.
2262 (struct lang_decl_flags): Add pending_inline_p. Adjust dummy.
2263 (struct lang_decl): Add saved_language_function.
2264 (DECL_PENDING_INLINE_INFO): Adjust documentation.
2265 (DECL_PENDING_INLINE_P): New macro.
2266 (TYPE_TI_ARGS): Fix typo in comment.
2267 (DECL_SAVED_TREE): Add to documentation.
2268 (DECL_SAVED_FUNCTION_DATA): New macro.
2269 (START_CATCH_TYPE): Likewise.
2270 (SCOPE_END_P): New macro.
2271 (declare_parm_level): Don't declare.
2272 * decl.c (mark_lang_function): New function, split out from
2273 mark_cp_function_context.
2274 (save_function_data): New function.
2275 (declare_parm_level): Remove.
2276 (finish_function): Use save_function_data to squirrel away
2277 important stuff for later use.
2278 (mark_cp_function_context): Use mark_function_data.
2279 (lang_mark_tree): Likewise.
2280 * lex.c (begin_definition_of_inclass_inline): Set
2281 DECL_PENDING_INLINE_P.
2282 (store_pending_inline): Clear it.
2283 * pt.c (tsubst_decl): Likewise.
2285 1999-09-17 Nathan Sidwell <nathan@acm.org>
2287 * call.c (perform_implicit_conversion): Deal with error_mark_node.
2289 1999-09-17 Mark Mitchell <mark@codesourcery.com>
2291 * decl.c (warn_extern_redeclared_static): Don't get confused by
2292 static member functions.
2293 (duplicate_decls): Merge DECL_THIS_STATIC.
2295 * decl.c (expand_static_init): Make sure assignments to local
2296 statics actually occur.
2298 1999-09-17 Mark Mitchell <mark@codesourcery.com>
2300 * cp-tree.h (poplevel_class): Declare.
2301 * class.c (popclass): Use poplevel_class, not poplevel.
2302 * decl.c (poplevel_class): Don't make it static. Don't return a
2304 (poplevel): Don't call poplevel_class; abort in a class
2305 binding level is seen.
2306 * semantics.c (finish_translation_unit): Use pop_everything.
2307 * parse.y (member_init): Allow errors.
2308 (pending_inline): Call finish_function.
2309 * parse.c: Regenerated.
2310 * Makefile.in (CONFLICTS): Adjust.
2312 1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
2314 * error.c: Reduce code duplication.
2315 (dump_template_value): New function.
2316 (dump_type_real): Use it.
2317 (dump_decl): Likewise.
2318 (dump_function_name): Likewise.
2319 (dump_function_decl): Don't be too talkative about function return
2322 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2324 * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
2326 * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
2328 1999-09-16 Jason Merrill <jason@yorick.cygnus.com>
2330 * decl2.c (finish_file): Also call check_global_declarations for
2331 the pending_statics list.
2333 1999-09-15 Jason Merrill <jason@yorick.cygnus.com>
2335 * lex.c (cp_pragma_implementation): Allow #pragma implementation
2338 1999-09-15 Richard Henderson <rth@cygnus.com>
2340 * lex.c (mark_impl_file_chain): Follow the next chain.
2342 1999-09-15 Mark Mitchell <mark@codesourcery.com>
2344 * decl.c (warn_extern_redeclared_static): Simplify. Catch
2345 problems with extern "C" functions redeclared as static.
2346 (duplicate_decls): When a builtin is redeclared static, make the
2347 new function have internal linkage.
2349 1999-09-15 Mark Mitchell <mark@codesourcery.com>
2351 * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
2352 * pt.c (tsubst_copy): Likewise.
2353 * tree.c (search_tree): Likewise.
2356 1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2358 * typeck2.c (ack): Don't declare progname.
2360 1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
2362 * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
2363 filenames with ggc_alloc_string.
2365 1999-09-14 Mark Mitchell <mark@codesourcery.com>
2367 * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
2369 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
2371 * cvt.c (build_up_reference): Likewise.
2372 * tree.c (build_cplus_new): Likewise.
2373 (get_target_expr): Likewise.
2375 Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org>
2377 * Makefile.in: Prepend $(SHELL) to move-if-change calls.
2379 1999-09-13 Mark Mitchell <mark@codesourcery.com>
2381 * cp-tree.h (build_target_expr): New function.
2382 * call.c (build_conditional_expr): Use build_target_expr.
2383 (convert_like): Likewise.
2384 (build_over_call): Likewise.
2385 * cvt.c (build_up_reference): Likewise.
2386 * decl.c (build_cleanup_on_safe_obstack): Fold into ...
2387 (destroy_local_var): Here.
2388 (build_target_expr): New function.
2389 * tree.c (build_cplus_new): Use it.
2390 (get_target_expr): Likewise.
2392 1999-09-13 Nathan Sidwell <nathan@acm.org>
2394 * typeck.c (expr_sizeof): Don't decay arrays and functions.
2395 Remove misleading comment.
2396 (build_compound_expr): Don't decay arrays.
2398 1999-09-13 Jason Merrill <jason@yorick.cygnus.com>
2400 * call.c (build_conditional_expr): Always use a TARGET_EXPR for
2401 class rvalues again.
2403 Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2405 * Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
2407 * g++spec.c: Include gcc.h.
2408 (lang_specific_driver): Constify a char*. Call xcalloc, not
2409 xmalloc/bzero. All calls to the function pointer parameter now
2410 explicitly call `fatal'.
2412 1999-09-12 Mark Mitchell <mark@codesourcery.com>
2414 * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
2415 * cvt.c (ocp_convert): Complete the from and destination types.
2416 Adjust warning about functions always being `true' in conditionals.
2417 * decl.c (duplicate_decls): Don't play funny games with abort.
2418 * error.c (dump_expr): Handle OVERLOADs.
2419 * spew.c (probe_obstack): Remove.
2420 * typeck.c (condition_conversion): Use perform_implicit_conversion.
2422 1999-09-12 Bernd Schmidt <bernds@cygnus.co.uk>
2424 * cp-tree.h (auto_function, define_function): Adjust prototypes.
2425 * decl.c (define_function): Lose FUNCTION_CODE arg. All callers
2427 (auto_function): Likewise, for CODE arg.
2428 Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
2429 (builtin_function): ... here.
2431 1999-09-11 Mark Mitchell <mark@codesourcery.com>
2433 * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
2434 (init_decl_processing): Don't set TREE_PERMANENT for the
2436 (start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
2437 (grokdeclarator): Likewise.
2438 (grokparms): Don't check TREE_PERMANENT when building up lists.
2439 * decl2.c (grokfield): Don't assert TREE_PERMANENT.
2440 (mark_inline_for_output): Likewise.
2441 * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
2442 * init.c (build_offset_ref): Don't check TREE_PERMANENT.
2443 * lex.c (check_newline): Don't check ggc_p; it is always one.
2444 * pt.c (process_template_parm): Don't check TREE_PERMANENT.
2445 * spew.c (yylex): Don't copy_node or probe_obstacks for
2446 non-permanent CONSTANTs and STRINGs.
2447 * tree.c (build_cplus_array_type_1): Don't fuss with
2448 TREE_PERMANENT on ARRAY_TYPEs.
2450 * cp-tree.def (CLEANUP_STMT): New node.
2451 * cp-tree.h (language_function): Add name_declared.
2452 (current_function_name_declared): New macro.
2453 (CLEANUP_DECL): New macro.
2454 (CLEANUP_EXPR): Likewise.
2455 (emit_local_var): Likewise.
2456 (finish_decl_cleanup): New function.
2457 * cvt.c (build_up_reference): Simplify.
2458 (ocp_convert): Remove dead code.
2459 * decl.c (start_decl): Remove call to add_decl_stmt.
2460 (grok_reference_init): Adjust, to handle bindings temporaries to
2461 references. Remove dead code.
2462 (initialize_local_var): Don't generate RTL for
2463 declarations here, or build cleanups here. Don't fuss with
2464 obstacks. Replace expand_start_target_temps calls with explicit
2465 setting of stms_are_full_exprs_p.
2466 (destroy_local_var): New function.
2467 (emit_local_var): Likewise.
2468 (cp_finish_decl): Use them, as appropriate.
2469 (start_function): Announce template functions.
2470 (store_parm_decls): Don't call declare_function_name here.
2471 (finish_stmt): Don't start emit base-initialization code when just
2472 building the statement-tree.
2473 * init.c (create_temporary_var): Move add_decl_stmt call ...
2474 (get_temp_regvar): Here.
2475 * pt.c (tsubst_expr): Make DECL_INITIAL look like what
2476 cp_finish_decl would expect. Don't call add_decl_stmt.
2477 * semantics.c (begin_compound_stmt): Call declare_function_name,
2479 (finish_decl_cleanup): New function.
2480 (expand_stmt): Use emit_local_var to output variables.
2481 (expand_body): Set current_funtion_name_declared.
2483 1999-09-10 Mark Mitchell <mark@codesourcery.com>
2485 * cp-tree.h (finish_cleanup_try_block): New function.
2486 * semantics.c (finish_cleanup_try_block): Add comment.
2488 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
2490 * cp-tree.h: Delete declarations for all tree nodes now moved to
2492 * decl.c: Delete their definitions.
2493 (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
2494 FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
2496 (init_decl_processing): Call build_common_tree_nodes and
2497 build_common_tree_nodes_2 instead of building their nodes here.
2498 Don't add gc roots for them.
2500 1999-09-10 Mark Mitchell <mark@codesourcery.com>
2502 * cp-tree.h (language_function): Rename expanding_p to
2503 x_expanding_p. Rename named_label_uses to x_named_label_uses.
2504 (expanding_p): Adjust accordingly.
2505 (TREE_VIA_PRIVATE): Fix typo in comment.
2506 (DECL_REFERENCE_SLOT): Remove.
2507 (SET_DECL_REFERENCE_SLOT): Likewise.
2508 * decl.c (named_label_uses): Adjust. Remove chicken comment.
2509 (push_overloaded_decl): Don't truncate the chain of bindings when
2510 adding an overloaded function.
2511 (grok_reference_init): Don't use DECL_REFERENCE_SLOT.
2512 (initialize_local_var): Fix typo in comment.
2513 (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
2514 * decl2.c (start_objects): Make the fact that we are expanding
2515 the generated function right away explicit.
2516 (start_static_storage_duration_function): Likewise.
2517 (finish_file): Fix typo in comment.
2518 * init.c (build_vec_init): Correct bugs in handling cleanups.
2519 * semantics.c (maybe_convert_cond): New function.
2520 (FINISH_COND): Always store the condition, even if there's
2522 (finish_if_stmt_cond): Use maybe_convert_cond.
2523 (finish_while_stmt_cond): Likewise.
2524 (finish_do_stmt): Likewise.
2525 (finish_for_cond): Likewise.
2526 (expand_cond): Adjust.
2528 * cp-tree.h (FN_TRY_BLOCK_P): New macro.
2529 * init.c (perform_member_init): Remove obstack machinations.
2530 (expand_cleanup_for_base): Likewise.
2531 (finish_init_stmts): Mark the statement-expression as used.
2532 * method.c (emit_thunk): Use tree-generating functions, not
2534 (do_build_copy_constructor): Likewise.
2535 (do_build_assign_ref): Likewise.
2536 (synthesize_method): Likewise. Keep track of line numbers.
2537 * pt.c (tsubst_expr): Handle various kinds of try blocks.
2538 * semantics.c (expand_stmts): Remove.
2539 (begin_function_try_block): Set FN_TRY_BLOCK_P.
2540 (finish_function_try_block): Be careful rechaining
2541 function try blocks.
2542 (expand_stmt): Loop through all the statements at a given level.
2543 (exapnd_body): Be careful with line-numbers here too. Prepare for
2544 being called directly from the parser.
2546 * cp-tree.h (finish_function): Adjust prototype.
2547 * decl.c (finish_function): Return the function compiled.
2548 * pt.c (instantiate_decl): Don't play games with obstacks.
2549 * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
2550 (search_tree): Likewise.
2551 * typeck.c: Fix typo in comment.
2552 * typeck2.c (store_init_value): Add comment.
2554 * cp-tree.h (CPTI_ATEXIT): New macro.
2555 (atexit_node): Likewise.
2556 * decl.c (destroy_local_static): New function, broken out from ...
2557 (expand_static_init): Here.
2559 * rtti.c (get_tinfo_var): These should always be global
2560 (expand_si_desc): Use tree, not RTL, functions to generate code.
2561 (expand_class_desc): Likewise.
2562 (expand_ptr_desc): Likewise.
2563 (expand_attr_desc): Likewise.
2564 (expand_generic_desc): Likewise.
2565 (synthesize_tinfo_fn): Likewise.
2567 1999-09-09 Mark Mitchell <mark@codesourcery.com>
2569 * semantics.c (RECHAIN_STMTS): Remove `last' parameter.
2570 (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
2572 (RECHAIN_STMST_FROM_CHAIN): Likewise.
2574 * parse.y (simple_stmt): Fix typo in last change.
2576 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
2577 (STMT_IS_FULL_EXPR_P): Likewise.
2578 (STMT_LINENO_FOR_FN_P): Likewise.
2579 (prep_stmt): New function.
2580 (building_stmt_tree): Tweak for safety.
2581 * pt.c (tsubst_expr): Use prep_stmt throughout.
2582 (add_tree): Move it to semantics.c
2583 * semantics.c (add_tree): Move it here.
2584 (finish_expr_stmt_real): New function.
2585 (finish_expr_stmt): Use it.
2586 (finish_if_stmt_cond): Use FINISH_COND.
2587 (finish_while_stmt_cond): Likewise.
2588 (finish_for_cond): Likewise.
2589 (finish_stmt_tree): Tweak line-number handling.
2590 (prep_stmt): New function.
2591 (expand_stmt): Use it.
2593 * cp-tree.h (begin_switch_stmt): Adjust prototype.
2594 (finish_switch_cond): Likewise.
2595 * parse.y (simple_stmt): Adjust accordingly.
2596 * parse.c: Regenerated.
2597 * pt.c (tsubst_expr): Adjust accordingly.
2598 * semantics.c (expand_cond): New function.
2599 (FINISH_COND): New macro.
2600 (begin_switch_stmt): Build the SWITCH_STMT here.
2601 (finish_switch_stmt_cond): Not here.
2602 (expand_stmt): Adjust calls to begin_switch_stmt and
2603 finish_switch_cond. Use expand_cond throughout.
2605 * dump.c (dequeue_and_dump): Dump types for constants.
2606 Describe DECL_ARG_TYPE more intuitively.
2609 * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
2610 (lang_cleanup_tree): Remove.
2611 * lex.c (make_lang_type): Use ggc_alloc to allocate
2614 Reorganize per-function data.
2615 * cp-tree.h (saved_scope): Add function_decl, bindings.
2616 (language_function): Rename binding_level to bindings.
2617 (cp_function_chain): Use the current_function, not the
2618 outer_function_chain.
2619 (current_class_ptr): Make it work, even when there's no
2621 (current_class_ref): Likewise.
2622 (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
2624 (clear_temp_name): Remove.
2625 * decl.c (check_function_type): New function, broken out from
2627 (current_binding_level): Adjust definition.
2628 (pushlevel): Simplify.
2629 (poplevel): Don't use named_label_uses when we're outside
2631 (mark_saved_scope): Mark function_decl and bindings.
2632 (maybe_push_to_top_level): Don't unconditionally push a new
2633 function context. Save bindings and the current_function_decl.
2634 Don't clear named_labels.
2635 (pop_from_top_level): Pop function context if appropriate.
2636 (init_decl_processing): Set init_lang_status and free_lang_status,
2637 rather than save_lang_status and restore_lang_status.
2638 (start_function): Take SF_* flags. Don't clear per-function data.
2639 Reorder and simplify to use new per-function data code. Add
2641 (store_parm_decls): Don't call init_function_start here.
2642 (finish_function): Adjust for new handling of per-function data.
2643 (push_cp_function_context): Simplify.
2644 (mark_cp_function_context): Change binding_level to bindings.
2645 * decl2.c (clear_temp_name): Remove.
2646 (start_objects): Use SF flags to start_function.
2647 (start_static_storage_duration_function): Likewise.
2648 * except.c (start_anon_func): Remove redundant calls to
2649 push_function_context_to. Use SF flags to start function.
2650 (end_anon_func): Remove redundant call to pop_function_context
2652 * lex.c (reinit_parse_for_function): Don't initialize per-function
2654 * method.c (emit_thunk): Clear current_function after calling
2655 assemble_end_function. Use SF flags for start_function.
2656 (synthesize_method): Use SF flags for start_function.
2657 * parse.c: Regenerated.
2658 * parse.y (fn.defpen): Likewise.
2659 (pending_inline): Clear current_function, even if something goes
2661 * pt.c (instantiate_decl): Use SF flags to start_function.
2662 Don't save and restore expanding_p.
2663 (add_tree): Handle the case where we are outside any function.
2664 (end_tree): Likewise.
2665 * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
2666 * semantics.c (begin_function_definition): Likewise.
2667 (expand_body): Likewise.
2669 1999-09-09 Nathan Sidwell <nathan@acm.org>
2671 * cp-tree.h (convert_to_void): Prototype new function.
2672 (require_complete_type_in_void): Remove prototype.
2673 * cvt.c (convert_to_void): New function.
2674 (ocp_convert): Use convert_to_void.
2675 * decl.c (cplus_expand_expr_stmt): Likewise, for complete
2677 * typeck.c (require_complete_type_in_void): Remove function.
2678 (build_compound_expr): Use convert_to_void.
2679 (build_static_cast): Likewise.
2680 (build_c_cast): Likewise.
2681 * semantics.c (finish_expr_stmt): Do not decay full expressions.
2683 * typeck.c (build_x_compound_expr): Add FIXME.
2685 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2687 * cp-tree.h (scratch_tree_cons): Remove.
2688 * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
2689 and perm_tree_cons with plain tree_cons.
2690 * class.c: Likewise.
2692 * decl2.c: Likewise.
2693 * except.c: Likewise.
2697 * method.c: Likewise.
2698 * parse.y: Likewise.
2702 * search.c: Likewise.
2703 * typeck.c: Likewise.
2704 * parse.c: Regenerated.
2705 * tree.c (build_srcloc): Simplify.
2707 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2709 * cp-tree.h (lang_decl_flags): Remove permanent_attr.
2711 (LANG_DECL_PERMANENT): Remove.
2712 * decl.c (duplicate_decls): Don't mess about with obstacks trying
2714 (lang_mark_tree): Mark DECL_LANG_SPECIFIC.
2715 * lex.c (free_lang_decl_chain): Remove.
2716 (build_lang_decl): Don't use obstacks.
2717 (retrofit_lang_decl): Likewise.
2718 (copy_lang_decl): Likewise.
2720 * cp-tree.h (saved_scope): Remove old_binding_level and
2721 function_decl. Tidy up.
2722 * decl.c (mark_saved_scope): Don't set them.
2723 (maybe_push_to_top_level): Clear memory.
2725 * decl.c (layout_var_decl): Change prototype. Don't complete
2726 types for external objects.
2727 (check_initializer): Likewise. Tidy.
2728 (initialize_local_var): Complete types here.
2729 (cp_finish_decl): Not here. Reorganize a little.
2730 (grokvardecl): Don't complete types here.
2732 * decl.c (start_function): Clear last_dtor_insn and
2733 last_parm_cleanup_insn.
2734 (push_cp_function_context): Just copy over a little of
2735 the old context, not all of it.
2737 * cp-tree.h (copy_to_permanent): Remove.
2738 (permanent_p): Likewise.
2739 * decl.c (building_typename_type): Don't use copy_to_permanent.
2740 (start_decl): Likewise.
2741 (grok_reference_init): Likewise.
2742 (cp_finish_decl): Likewise.
2743 * init.c (build_new_1): Don't use mapcar.
2744 (build_vec_delete_1): Don't use copy_to_permanent.
2745 (build_vec_init): Likewise.
2746 * parse.y (primary): Likewise.
2747 * parse.c: Regenerated.
2748 * pt.c (push_template_decl_real): Don't use copy_to_permanent.
2749 (lookup_template_class): Likewise.
2750 (tsubst_friend_function): Likewise.
2751 (instantiate_class_template): Likewise.
2752 (tsubst_decl): Likewise.
2754 (instantiate_template): Likewise.
2756 * rtti.c (get_tinfo_fn): Likewise.
2757 (build_dynamic_cast): Likewise.
2758 * semantics.c (finish_if_stmt_cond): Likewise.
2759 (finish_while_stmt_cond): Likewise.
2760 (finish_do_stmt): Likewise.
2761 (finish_for_cond): Likewise.
2762 (finish_for_expr): Likewise.
2763 (finish_cleanup): Likewise.
2764 (add_decl_stmt): Likewise.
2765 (finish_named_return_value): Likewise.
2766 (finish_qualified_call_expr): Likewise.
2767 * tree.c (perm_manip): Remove.
2768 (build_exception_variant): Don't use copy_to_permanent.
2769 (permanent_p): Remove.
2770 (copy_to_permament): Remove.
2771 (build_min_nt): Don't use copy_to_permanent.
2772 (build_min): Likewise.
2773 (min_tree_cons): Likewise.
2774 * typeckc.c (build_static_cast): Likewise.
2775 (build_reinterpret_cast): Likewise.
2776 (build_const_cast): Likewise.
2778 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2780 * decl.c (ggc_p): Set it to 1.
2781 (mark_saved_scope): Add prototype.
2783 1999-09-07 Richard Henderson <rth@cygnus.com>
2785 * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
2786 * typeck.c (self_promoting_args_p): Delete.
2788 1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
2790 * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
2791 (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
2793 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2795 * Makefile.in (tree.o): Depend on ggc.h.
2796 * class.c (make_method_vec): Remove.
2797 (free_method_vec): Likewise.
2798 (free_method_vecs): Remove.
2799 (add_method): Don't use them.
2800 * cp-tree.def (PTRMEM_CST): Make it longer.
2801 (TEMPLATE_PARM_INDEX): Make it shorter.
2802 * cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
2803 (template_parm_index): Remove RTL field.
2804 (ptrmem_cst): Add RTL field.
2805 (finish_function): Removed parameter.
2806 (process_next_inline): Change prototype.
2807 (init_cplus_unsave): Rename to init_tree.
2808 (binding_init): Remove.
2809 * decl.c (free_binding_nodes): Remove.
2810 (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P.
2811 (pop_binding): Don't use free_binding_nodes.
2812 (free_binding_vecs): Remove.
2813 (store_bindings): Don't use them.
2814 (pop_from_top_level): Likewise.
2815 (lookup_namespace_name): Simplify.
2816 (build_typename_type): Don't use obstack_free.
2817 (unqualified_namespace_lookup): Simplify.
2818 (lookup_name_real): Simplify.
2819 (start_function): Remove comment about leaks.
2820 (finish_function): Removed nested parameter. Call
2821 expand_end_bindings even when building_stmt_tree.
2822 Call ggc_push_context and ggc_pop_context around
2823 rest_of_compilation, if necessary.
2824 (mark_cp_function_context): Handle a NULL language-context.
2825 (lang_mark_false_label_stack): Fix typo.
2826 (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
2827 TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on
2828 pointer to method types.
2829 (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
2830 * decl2.c (finish_objects): Adjust call to finish_function.
2831 (finish_static_store_duration_function): Likewise.
2832 (do_nonmember_using_decl): Remove call to binding_init.
2833 * except.c (end_anon_func): Adjust call to finish_function.
2834 * lex.c (mark_impl_file_chain): New function.
2835 (init_parse): Call init_tree, not init_cplus_unsave.
2837 (cp_pramga_interface): Use xmalloc, not permalloc.
2838 (cp_pragma_implementation): Likewise.
2839 (begin_definition_of_inclass_inline): Simplify.
2840 (process_next_inline): Adjust prototype.
2841 (do_scoped_id): Don't call binding_init.
2842 (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
2843 * method.c (emit_thunk): Adjust call to finish_function.
2844 (synthesize_method): Likewise.
2845 * parse.y (%union): Add a new `pi' variant.
2846 (PRE_PARSED_FUNCTION_DECL): Use it.
2847 (fn.defpen): Likewise.
2848 (fndef): Adjust call to finish_function.
2849 * pt.c (instantiate_decl): Likewise.
2850 * rtti.c (syntheisze_tinfo_fn): Likewise.
2851 * semantics.c (expand_body): Likewise.
2852 * tree.c: Include ggc.h.
2853 (mark_list_hash): New function.
2854 (binding_init): Remove.
2855 (init_cplus_unsave): Rename to ...
2856 (init_tree): This. Add GC roots.
2858 1999-09-05 Mark Mitchell <mark@codesourcery.com>
2860 Get ready for garbage collection.
2861 * Makefile.in (CXX_TREE_H): Add varray.h
2862 (lex.o): Depend on ggc.h.
2864 (decl2.o): Likewise.
2865 (method.o): Likewise.
2866 (search.o): Likewise.
2869 * class.c: Include ggc.h.
2870 (current_class_name): Remove.
2871 (current_class_type): Likewise.
2872 (current_access_specifier): Likewise.
2873 (previous_class_type): Likewise.
2874 (previous_class_values): Likewise.
2875 (class_cache_firstobj): Likewise.
2876 (current_lang_base): Likewise.
2877 (current_lang_stack): Likewise.
2878 (current_lang_stacksize): Likewise.
2879 (lang_name_c): Likewise.
2880 (lang_name_cplusplus): Likewise.
2881 (lang_name_java): Likewise.
2882 (current_lang_name): Likewise.
2883 (base_layout_decl): Likewise.
2884 (access_default_node): Likewise.
2885 (access_public_node): Likewise.
2886 (access_protected_node): Likewise.
2887 (access_private_node): Likewise.
2888 (access_default_virtual_node): Likewise.
2889 (access_public_virtual_node): Likewise.
2890 (access_protected_virtual_node): Likewise.
2891 (access_private_virtual_node): Likewise.
2892 (signed_zero_node): Likewise.
2893 (init_class_processing): Don't build base_layout_decl.
2894 (push_lang_context): Adjust now that current_lang_base is a varray.
2895 (pop_lang_context): Likewise.
2896 * cp-tree.h: Include varray.h.
2897 (cp_global_trees): Add access_default, access_public,
2898 access_protected, access_private, access_default_virtual,
2899 access_public_virtual, access_protected_virtual,
2900 access_private_virtual, ctor_identifier, delta2_identifier,
2901 delta_identifier, dtor_identifier, in_charge_identifier,
2902 index_identifier, nelts_identifier, this_identifier,
2903 pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
2904 lang_name_c, lang_name_cplusplus, lang_name_java,
2905 empty_except_spec, null, jclass, minus_one, terminate.
2906 (saved_scope): Move here from decl.c. Define globals in terms of
2907 saved_scope: current_namespace, current_class_name,
2908 current_class_type, current_access_specifier, current_lang_stack,
2909 current_lang_base, current_lang_name, current_function_parms,
2910 current_template_parms, processing_template_decl,
2911 processing_specialization, processing_explicit_instantiation,
2912 previous_class_type, previous_class_values, class_cache_firstobj.
2913 (scope_chain): New variable.
2914 (init_pt): New function.
2915 * decl.c (current_namespace): Remove.
2916 (this_identifier, in_charge_identifier, ctor_identifier): Likewise.
2917 (dtor_identifier, pfn_identifier, index_identifier): Likewise.
2918 (delta_identifier, delta2_identifier): Likewise.
2919 (pfn_or_delta2_identifier, tag_identifier): Likewise
2920 (vt_off_identifier, empty_except_spec, null_node): Likewise.
2921 (current_function_parms, current_lang_base): Remove.
2922 (current_lang_stack, previous_class_values): Remove.
2923 (class_binding_level): Macroize.
2924 (saved_scope): Remove.
2925 (current_saved_scope): Rename to scope_chain.
2926 (mark_saved_scope): Adjust for new scope structure.
2927 (maybe_push_to_top_level): Likewise.
2928 (pop_from_top_level): Likewise.
2929 (duplicate_decls): Adjust now that current_lang_base is a varray.
2930 (build_typename_type): Call ggc_add_tree_hash_table_root.
2931 (init_decl_processing): Call init_pt. Call push_to_top_level to
2932 set up globals. Add GC roots.
2933 (xref_basetypes): Adjust now that current_lang_base is a varray.
2934 * decl.h (this_identifier): Remove.
2935 (in_charge_identifier): Likewise.
2936 * decl2.c: Don't include varray.h.
2937 (current_namespace): Remove.
2938 (init_decl2): Add GC roots.
2939 * except.c (Terminate): Remove.
2940 (init_exception_processing): Use terminate_node instead.
2941 (build_terminate_handler): Likewise.
2942 * init.c (nc_nelts_field_id): Remove.
2943 (minus_one): Likewise.
2944 (init_init_processing): Use minus_one_node and nelts_identifier
2945 instead. Add GC roots.
2946 (jclass_node): Remove.
2947 (build_new_1): Use nelts_identifier.
2948 (build_vec_init): Likewise.
2949 (build_vec_delete): Likewise.
2950 * lex.c: Include ggc.h.
2951 (defarg_fn): Move declaration early.
2952 (defarg_parms): Likewise.
2953 (init_parse): Add GC roots.
2954 (handle_cp_pragma): Remove redundant declaration of
2956 * method.c: Include ggc.h.
2957 (btypelist): Make it a varray. All uses changed.
2958 (ktypelist): Likewise.
2959 (init_method): Add GC roots.
2960 * pt.c: Don't include varray.h. Include ggc.h.
2961 (current_template_parms): Remove.
2962 (processing_template_decl): Likewise.
2963 (processing_specialization): Likewise.
2964 (processing_explicit_instantiation): Likewise.
2965 (init_pt): New function.
2966 * repo.c: Include ggc.h.
2967 (init_repo): Add GC roots.
2968 * search.c: Don't include varray.h.
2969 (_vptr_name): Remove.
2970 (lookup_field_1): Use vtpr_identifier instead.
2971 (expand_indirect_vtbls_init): Remove redundant declaration of
2972 in_charge_identifier.
2973 (init_search_processing): Use vptr_identifier.
2975 1999-09-05 Richard Henderson <rth@cygnus.com>
2976 Bernd Schmidt <bernds@cygnus.co.uk>
2977 Mark Mitchell <mark@codesourcery.com>
2979 * Makefile.in (parse.o): Depend on ggc.h.
2980 (decl2.o): Depend on ggc.h.
2981 (init.o): Depend on ggc.h.
2982 * cp-tree.h (init_decl2): Declare.
2983 (cp_parse_init): Likewise.
2984 * decl.c (ggc_p): Define to zero.
2985 (mark_saved_scope): New function.
2986 (init_decl_processing): Call cp_parse_init, and cp_decl2.
2988 (expand_static_init): Add GC roots.
2989 * decl2.c: Include ggc.h.
2990 (init_decl2): New function.
2991 * init.c: Include ggc.h.
2992 (init_init_processing): Add GC roots.
2993 * parse.y: Include ggc.h.
2994 (cp_parse_init): New function.
2996 1999-09-04 Mark Mitchell <mark@codesourcery.com>
2998 * decl.c (init_decl_processing): Set mark_lang_status.
2999 (lang_mark_false_label_stack): Adjust prototype.
3000 * decl2.c (grok_function_init): Remove extraneous declaration of
3003 * Make-lang.in (cc1plus): Remove dependency on GGC.
3004 * Makefile.in (OBJS): Don't mention ggc-simple.o.
3005 (OBJDEPS): Don't mention ggc-simple.o.
3007 * Make-lang.in (cc1plus): Depend on $(GGC).
3008 * Makefile.in (OBJS): Add ggc-simple.o.
3009 (OBJDEPS): Likewise.
3010 * cp-tree.h (language_function): Rename members to `x_' versions;
3011 we now have x_named_labels, x_ctor_label, x_dtor_label,
3012 x_base_init_list, x_member_init_list, x_base_init_expr,
3013 x_current_class_ptr, x_current_class_ref, x_last_tree,
3014 x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
3016 (dtor_label, ctor_label, current_base_init_list,
3017 current_member_init_list, base_init_expr, current_class_ptr,
3018 current_class_ref, last_tree, last_expr_type): Adjust accordingly.
3019 * decl.c: Include ggc.h.
3020 (last_dtor_insn): Adjust to use x_ names.
3021 (last_parm_cleanup_insn): Likewise.
3022 (original_result_rtx): Likewise.
3023 (named_labels): Likewise.
3024 (mark_binding_level): New function.
3025 (mark_cp_function_context): Likewise.
3026 (mark_false_label_stack): Likewise.
3027 (lang_mark_tree): Likewise.
3028 (lang_cleanup_tree): Likewise.
3030 1999-09-03 Mark Mitchell <mark@codesourcery.com>
3032 * Makefile.in (CXX_TREE_H): Include function.h.
3033 (decl.o): Don't depend on function.h.
3034 (decl2.o): Likewise.
3035 (typeck.o): Likewise.
3037 (method.o): Likewise.
3038 * cp-tree.h: Include function.h.
3039 (cp_function): Rename to language_function. Remove next.
3040 (cp_function_chain): Make it a macro, not a variable.
3041 (push_cp_function_context): Don't declare.
3042 (pop_cp_function_context): Likewise.
3043 * decl.c: Don't include function.h.
3044 (push_cp_function_context): Make it static. Make it suitable for
3045 a save_lang_status callback.
3046 (pop_cp_function_context): Likewise.
3047 (maybe_push_to_top_level): Call push_function_context_to, not
3048 push_cp_function_context.
3049 (pop_from_top_level): Call pop_function_context_from, not
3050 pop_cp_function_context.
3051 (init_decl_processing): Set save_lang_status and
3052 restore_lang_status. Call push_function_context_to, not
3053 push_cp_function_context.
3054 (cp_function_chain): Remove.
3055 * decl2.c: Don't include function.h.
3056 * except.c: Don't include function.h.
3057 (start_anon_func): Call push_function_context_to, not
3058 push_cp_function_context.
3059 (end_anon_func): Call pop_function_context_from, not
3060 pop_cp_function_context.
3061 * init.c: Don't include function.h.
3062 * lex.c (begin_definition_of_inclass_inline): Call
3063 push_function_context_to, not push_cp_function_context.
3064 (process_next_inline): Call pop_function_context_from, not
3065 pop_cp_function_context.
3066 * method.c: Don't include function.h.
3067 (synthesize_method): Call push_function_context_to, not
3068 push_cp_function_context. Call pop_function_context_from, not
3069 pop_cp_function_context.
3070 * typeck.c: Don't include function.h.
3072 * decl.c (expand_static_init): Tweak handling of static
3073 initializations for objects without constructors.
3075 1999-09-03 Nathan Sidwell <nathan@acm.org>
3077 * typeck.c (build_indirect_ref): Reject dereference of pointer to
3080 1999-09-02 Mark Mitchell <mark@codesourcery.com>
3082 * cp-tree.h (cp_function): Move here, from decl.c.
3083 (cp_function_chain): Declare.
3084 (dtor_label): New macro, instead of variable.
3085 (ctor_label): Likewise.
3086 (current_base_init_list): Likewise.
3087 (current_member_init_list): Likewise.
3088 (base_init_expr): Likewise.
3089 (current_class_ptr): Likewise.
3090 (current_class_ref): Likewise.
3091 (last_tree): Likewise.
3092 (last_expr_type): Likewise.
3093 (current_function_returns_value): Likewise.
3094 (current_function_returns_null): Likewise.
3095 (current_function_just_assigned_this): Likewise.
3096 (current_function_parms_stored): Likewise.
3097 (temp_name_counter): Likewise.
3098 (static_labelno): Likewise.
3099 (expanding_p): Likewise.
3100 (stmts_are_full_exprs_p): Likewise.
3101 (in_function_try_handler): Likewise.
3102 (lang_type): Remove nested type_flags. All uses changed.
3103 * call.c (ctor_label): Remove.
3104 (dtor_label): Likewise.
3105 * class.c (current_class_ptr): Remove.
3106 (current_class_ref): Likewise.
3107 * decl.c (static_labelno): Remove.
3108 (dtor_label): Likewise.
3109 (last_dtor_insn): New macro, instead of variable.
3110 (last_parm_cleanup_insn): Likewise.
3111 (original_result_rtx): Likewise.
3112 (in_function_try_handler): Remove.
3113 (named_label_uses): New macro, instead of variable.
3114 (named_labels): Likewise.
3115 (current_function_returns_value): Remove.
3116 (current_function_returns_null): Likewise.
3117 (current_function_assigns_this): New macro, instead of variable.
3118 (current_function_just_assigned_this): Likewise.
3119 (current_binding_level): Likewise.
3120 (init_decl_processing): Call push_cp_function_context.
3121 (cp_function): Move to cp-tree.h
3122 (cp_function_chain): Make it global.
3123 (temp_name_counter): Remove.
3124 (push_cp_function_context): Simplify.
3125 (pop_cp_function_context): Likewise.
3126 * decl2.c (temp_name_counter): Remove.
3127 * init_c (current_base_init_list): Likewise.
3128 (current_member_init_list): Likewise.
3129 (base_init_expr): Likewise.
3130 * method.c (static_labelno): Likewise.
3131 * pt.c (last_tree): Likewise.
3132 * semantics.c (expanding_p): Likewise.
3133 (stmts_are_full_exprs_p): Likewise.
3134 (last_expr_type): Likewise.
3135 * typeck.c (dtor_label): Likewise.
3136 (ctor_label): Likewise.
3138 1999-09-01 Alex Samuel <samuel@codesourcery.com>
3140 * decl2.c (arg_assoc_template_arg): New prototype. New function.
3141 (arg_assoc_class): Use arg_assoc_template_arg for template
3143 (arg_assoc): Likewise.
3144 * pt.c (mangle_class_name_for_template): Allow member template
3147 1999-09-02 Nathan Sidwell <nathan@acm.org>
3149 * call.c (build_conditional_expr): Warn on enum mismatches.
3150 (convert_arg_to_ellipsis): Move non-pod check to after
3153 1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3155 * gxx.gperf (hash, is_reserved_word): Add prototypes.
3157 * init.c (build_vec_init): Initialize variable `try_block'.
3159 * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
3160 Likewise for bzero/memset.
3161 (token_getch, token_put_back): Add static prototypes. Remove
3162 `inline' from the definitions.
3163 (retrofit_lang_decl): Call memset, not bzero, to avoid casts.
3165 1999-09-01 Mark Mitchell <mark@codesourcery.com>
3167 * cp-tree.h (lang_type): Move align into type_flags.
3168 (CLASSTYPE_ALIGN): Adjust accordingly.
3169 * call.c (direct_reference_binding): Remove misleading comment.
3171 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3173 * parse.y (language_string): Constify.
3175 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3177 * repo.c (getpwd): Don't prototype.
3178 * xref.c (getpwd): Likewise
3180 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3182 * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
3183 Remove hacks for stuff which now comes from libiberty.
3185 1999-08-30 Jason Merrill <jason@yorick.cygnus.com>
3187 * cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
3189 1999-08-30 Mark Mitchell <mark@codesourcery.com>
3191 * cp-tree.h (begin_init_stmts): Declare.
3192 (finish_init_stmts): Likewise.
3193 * cvt.c (build_up_reference): Wrap the declaration of a temporary
3194 in a statement-expression so that we will see it when expanding
3195 tree structure later.
3196 * init.c (begin_init_stmts): Don't make it static.
3197 (finish_init_stmts): Likewise.
3199 * cp-tree.h (start_handler_parms): New function.
3200 (expand_start_catch_block): Take only one parameter.
3201 (start_handler_parms): New function.
3202 * decl.c (start_handler_parms): Define it.
3203 * except.c (process_start_catch_block): Take only one parameter.
3204 Don't call grokdeclarator here.
3205 (expand_start_catch_block): Don't call grokdeclarator here,
3207 * parse.y (handler_args): Adjust call to
3208 expand_start_catch_block. Use start_handler_parms.
3209 * pt.c (push_template_decl_real): Make permanent lists have
3211 (tsubst_expr): Adjust calls to expand_start_catch_block
3213 * semantics.c (expand_stmt): Likewise.
3215 1999-08-29 Alex Samuel <samuel@codesourcery.com>
3217 * pt.c (push_template_decl_real): Use template declaration from
3218 class type if it exists.
3220 1999-08-29 Mark Mitchell <mark@codesourcery.com>
3222 * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
3223 (maybe_inject_for_scope_var): Declare it.
3224 (initialize_local_var): Likewise.
3225 * decl.c (maybe_inject_for_scope_var): Make it global.
3226 (initialize_local_var): Likewise. Move cleanup handling here,
3227 from cp_finish_decl.
3228 (make_rtl_for_nonlocal_decl): Use
3229 push_obstacks_nochange/pop_obstacks, rather than
3230 end_temporary_allocation/resume_temporary_allocation.
3231 (cp_finish_decl): Try to complete the type of a variable when it
3232 is declared. Move cleanup-handling to initialize_local_var.
3233 (expand_static_init): Use tree-building code, rather than
3235 * decl2.c (get_temp_name): Assert non-initializedness of
3237 * init.c (create_temporary_var): Move RTL-assigning code to ...
3238 (get_temp_regvar): Here.
3239 * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here.
3240 * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just
3241 call initialize_local_var to generate initialization code.
3243 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3245 * cp-tree.h (fndecl_as_string, type_as_string,
3246 type_as_string_real, args_as_string, decl_as_string,
3247 expr_as_string, code_as_string, language_as_string,
3248 parm_as_string, op_as_string, assop_as_string, cv_as_string,
3249 lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
3251 * errfn.c (cp_printer): Likewise.
3253 * error.c (cp_printer, fndecl_as_string, type_as_string_real,
3254 type_as_string, expr_as_string, decl_as_string, lang_decl_name,
3255 cp_file_of, code_as_string, language_as_string, parm_as_string,
3256 op_as_string, assop_as_string, args_as_string, cv_as_string):
3259 * tree.c (lang_printable_name): Likewise.
3261 1999-08-28 Richard Henderson <rth@cygnus.com>
3263 * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
3265 1999-08-28 Mark Mitchell <mark@codesourcery.com>
3267 * cp-tree.h (strip_array_types): New function.
3268 * decl.c (maybe_deduce_size_from_array_init): New function, split
3269 out from cp_finish_decl.
3270 (layout_var_decl): Likewise.
3271 (maybe_commonize_var): Likewise.
3272 (maybe_inject_for_scope_var): Likewise.
3273 (initialize_local_var): Likewise.
3274 (build_cleanup_on_safe_obstack): Likewise.
3275 (check_initializer): Likewise.
3276 (make_rtl_for_nonlocal_decl): Likewise.
3277 (cp_finish_decl): Use them.
3278 * typeck.c (strip_array_types): New function.
3280 * cp-tree.def (LABEL_STMT): New tree node.
3281 * cp-tree.h (LABEL_STMT_LABEL): New macro.
3282 (shadow_label): Remove.
3283 (declare_local_label): New function.
3284 (finish_label_decl): Likewise.
3285 * decl.c (make_label_decl): New function, split out from
3287 (shadowed_labels): Remove.
3288 (binding_level): Add shadowed_labels.
3289 (clear_binding_level): Remove.
3290 (push_binding_level): Just bzero the new binding level.
3291 (pushlevel): Fix indentation.
3292 (pop_label): New function.
3293 (pop_labels): Likewise, split out from poplevel.
3294 (poplevel): Pop local labels. Use pop_labels.
3295 (maybe_push_to_top_level): Don't clear shadowed_labels.
3296 (lookup_label): Use make_label_decl.
3297 (shadow_label): Remove.
3298 (declare_local_label): New function.
3299 (define_label): Simplify.
3300 (start_function): Don't clear shadowed_labels.
3301 (cp_function): Remove shadowed_labels.
3302 (push_cp_function_context): Don't save shadowed_labels.
3303 (pop_cp_function_context): Don't restore it.
3304 * dump.c (dequeue_and_dump): Handle LABEL_STMT.
3305 * parse.y (label_decl): Use finish_label_decl.
3306 * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
3308 * semantics.c (finish_label_stmt): Add a LABEL_STMT when
3310 (finish_label_decl): New function.
3311 (expand_stmt): Handle LABEL_STMTs and local label declarations.
3313 1999-08-26 Mark Mitchell <mark@codesourcery.com>
3315 * decl.c (lookup_label): Build labels on the permanent obstack
3316 when building statement trees. Don't build RTL for labels when
3317 building statement trees.
3318 * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
3319 building statement trees.
3320 (finish_label_stmt): Likewise.
3321 (expand_stmt): Adjust accordingly.
3322 * pt.c (tsubst_expr); Likewise.
3323 (do_decl_instantiation): Robustify.
3325 * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
3326 * tree.c (build_cplus_new): Set it.
3327 * expr.c (cplus_expand_expr): Use it.
3328 * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
3330 * decl.c (store_parm_decls): Reset immediate_size_expand.
3331 (finish_function): Likewise.
3333 * tree.c (cplus_unsave_expr_now): Don't return a value.
3335 * semantics.c (do_poplevel): Always initialize the return value.
3337 1999-08-26 Gavin Romig-Koch <gavin@cygnus.com>
3339 * cp-tree.h (cplus_unsave_expr_now) : Correct return type.
3340 * tree.h (cplus_unsave_expr_now) : Same.
3342 1999-08-25 Mark Mitchell <mark@codesourcery.com>
3344 * decl.c (grokdeclarator): Amend comment.
3345 * except.c (expand_start_catch_block): Call push_template_decl for
3346 catch-block parameters.
3347 * method.c (synthesize_method): Build an empty compound statement
3348 for the body of a constructor.
3350 1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
3352 * tree.c (cp_build_qualified_type_real): If we're asking for the
3353 same quals we already have, just return.
3355 1999-08-25 Mark Mitchell <mark@codesourcery.com>
3357 * cp-tree.def (SUBOBJECT): New tree node.
3358 * cp-tree.h (CLEANUP_P): New macro.
3359 (SUBOBJECT_CLEANUP): Likewise.
3360 (keep_next_level): Add parameter.
3361 (get_temp_regvar): Don't declare.
3362 (emit_base_init): Remove parameter.
3363 (expand_aggr_init): Rename to build_aggr_init.
3364 (expand_vec_init): Rename to build_vec_init.
3365 (do_pushlevel): Remove.
3366 (do_poplevel): Likewise.
3367 (finish_cleanup): New function.
3368 (finish_subobject): Likewise.
3369 (stmts_are_full_exprs_p): New variable.
3370 * decl.c (keep_next_level): Add parameter.
3371 (cp_finish_decl): Use build_aggr_init, not
3372 expand_aggr_init. Use finish_expr_stmt to expand the code.
3373 (expand_static_init): Use tree-generating, not RTL-generating,
3374 functions to handle the initialization.
3375 (start_function): Remove dead code. Always have a momentary
3376 obstack inside the function, even before hitting the first curly
3378 (cplus_expand_expr_stmt): Move calls to
3379 expand_{start,end}_target_temps into semantics.c.
3380 (cp_function): Add stmts_are_full_exprs_p.
3381 (push_cp_function_context): Save it.
3382 (pop_cp_function_context): Restore it.
3383 * decl2.c (get_temp_regvar): Move to init.c.
3384 (do_static_initialization): Use build_{aggr,vec}_init.
3385 (do_static_destruction): Fix typo in comment.
3386 * dump.c (dequeue_and_dump): Handle INIT_EXPR.
3387 * except.c (expand_throw): Use create_temporary_var.
3388 * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
3389 * init.c (expand_vec_init_try_block): Remove.
3390 (expand_vec_init_catch_clause): Likewise.
3391 (get_temp_regvar): New function.
3392 (begin_init_stmts): Likewise.
3393 (finish_init_stmts): Likewise.
3394 (perform_member_init): Use build_{aggr,vec}_init. Build up tree
3396 (emit_base_init): Likewise. Remove unused parameter.
3397 (expand_virtual_init): Likewise.
3398 (expand_cleanup_for_base): Use finish_subobject.
3399 (expand_aggr_vbase_init_1): Simplify.
3400 (construct_virtual_bases): Use tree-generating functions to build
3402 (expand_aggr_init): Likewise. Rename to build_aggr_init.
3403 (expand_default_init): Likewise.
3404 (expand_aggr_init_1): Likewise.
3405 (expand_vec_init): Rename to build_vec_init.
3406 * method.c (do_build_copy_constructor): Use tree-generating
3407 functions. Don't call clear_last_expr.
3408 (do_build_assign_ref): Likewise.
3409 (synthesize_method): Call clear_last_expr here.
3410 * parse.y (base_init): Don't call clear_last_expr here.
3411 (nodecls): Likewise.
3412 * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
3413 * semantics.c (do_pushlevel): Move to here.
3414 (do_poplevel): Likewise.
3415 (stmts_are_full_exprs_p): New variable.
3416 (finish_expr_stmt): Handle logic for temoprary cleanup here.
3417 (finish_for_stmt): Use finish_expr_stmt.
3418 (finish_cleanup): New function.
3419 (finish_function_try_block): Fix indentation.
3420 (finish_subobject): New function.
3421 (setup_vtbl_ptr): Call keep_next_level here.
3422 (finish_stmt_expr): Handle a block with no scope inside the
3423 statement-expression.
3424 (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle
3426 * tree.c (search_tree): Handle INIT_EXPR.
3428 * typeck.c (build_modify_expr): Don't build an RTL_EXPR.
3429 * typeck2.c (store_init_value): Change expand_aggr_init to
3430 build_aggr_init in comment.
3432 1999-08-25 Mark Mitchell <mark@codesourcery.com>
3434 * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
3436 1999-08-25 Nathan Sidwell <nathan@acm.org>
3438 * decl2.c (handle_class_head): Be graceful about additional
3439 scope qualifiers. Adjust comments to reflect reality.
3441 1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
3443 * call.c (build_conditional_expr): Fix typo.
3444 * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
3445 lvalue before trying to mess with the sides.
3447 * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
3449 Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
3451 * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
3453 1999-08-23 Jason Merrill <jason@yorick.cygnus.com>
3455 * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
3456 Return arbitrary pointer or NULL.
3457 (check_eh_spec): Call __throw_type_match_rtti_2.
3458 * tinfo.h (*::dcast): Return int. Add valp parm.
3459 * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers.
3460 * tinfo2.cc (__throw_type_match_rtti_2): Likewise.
3461 (__throw_type_match_rtti): Now just a wrapper.
3463 * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
3464 (init_exception_processing): Don't initialize them.
3466 1999-08-23 Paul Burchard <burchard@pobox.com>
3468 * decl.c (check_default_argument): Fix typo.
3470 1999-08-22 Mark Mitchell <mark@codesourcery.com>
3472 * cp-tree.def (STMT_EXPR): Fix typo in node name.
3474 * dump.c (dump_next_stmt): New function.
3475 (dequeue_and_dump): Use it.
3477 * pt.c (tsubst_copy): Make sure to initialize return value for a
3478 STMT_EXPR, even when processing_template_decl.
3479 * semantics.c (finish_stmt_expr): A statement-expression whose
3480 last statement is not an expression-statement has type `void'.
3482 1999-08-20 Mark Mitchell <mark@codesourcery.com>
3484 * semantics.c (finish_stmt_expr): Fix typo in comment.
3485 * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
3487 * init.c (build_vec_delete_1): Make the children of a permanent
3488 BIND_EXPR permanent.
3489 * pt.c (register_specialization): Don't register a specialization
3492 1999-08-18 Andrew Haley <aph@cygnus.com>
3494 * method.c (process_overload_item): Call build_mangled_C9x_name ()
3495 for all integer parameter types larger than long long.
3497 1999-08-19 Mark Mitchell <mark@codesourcery.com>
3499 * pt.c (redeclare_class_template): Merge default template
3500 arguments in both directions.
3502 * typeck.c (common_type): Undo 1999-08-18 change. Remove
3503 compiler_error message.
3505 1999-08-19 Jason Merrill <jason@yorick.cygnus.com>
3507 * cp-tree.h: Declare flag_use_repository.
3508 * pt.c (do_decl_instantiation): Don't complain about duplicate
3509 instantiation with -frepo.
3510 (do_type_instantiation): Likewise.
3512 * pt.c (push_template_decl_real): Complain about everything
3513 that isn't a valid template.
3515 * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
3518 1999-08-19 Mark Mitchell <mark@codesourcery.com>
3520 * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
3521 * decl2.c (build_expr_from_tree): Handle it.
3522 * error.c (dump_expr): Likewise.
3523 * pt.c (for_each_template_parm): Likewise.
3524 (tsubst_copy): Likewise.
3525 * tree.c (search_tree): Likewise.
3526 * semantics.c (finish_pseudo_destructor_call): Create it.
3528 1999-08-18 Mark Mitchell <mark@codesourcery.com>
3530 * search.c (setup_class_bindings): Robustify.
3531 * typeck.c (common_type): Use same_type_p, not pointer equality,
3534 * cp-tree.h (build_lang_field_decl): Remove.
3535 * class.c (build_vtable): Replace calls to build_lang_field_decl
3536 with build_lang_decl.
3537 (prepare_fresh_vtable): Likewise.
3538 (finish_struct_1): Likewise.
3539 (init_class_processing): Likewise.
3540 * decl.c (push_using_decl): Likewise.
3541 (init_decl_processsing): Likewise.
3542 (grokvardecl): Likewise.
3543 (build_ptrmemfunc_type): Likewise.
3544 (grokdeclarator): Likewise.
3545 (build_enumerator): Likewise.
3546 * decl2.c (grok_x_components): Likewise.
3547 (do_class_using_decl): Likewise.
3548 * except.c (call_eh_info): Likewise.
3549 * init.c (init_init_processing): Likewise.
3550 * rtti.c (expand_class_decl): Likewise.
3551 * tree.c (build_base_fields): Likewise.
3552 (build_vbase_pointer_fields): Likewise.
3553 * lex.c (build_lang_decl): Build declarations on the permanent
3554 obstack if we're building statmeent trees.
3555 (retrofit_lang_decl): Handle both the full lang_decl and also the
3556 smaller lang_decl_flags here.
3557 (build_lang_field_decl): Remove.
3558 * pt.c (push_template_decl_real): Issue errors for variable
3559 declarations that are not static members.
3561 1999-08-18 Richard Henderson <rth@cygnus.com>
3563 * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
3566 1999-08-17 Mark Mitchell <mark@codesourcery.com>
3568 * cp-tree.h (back_end_hook): New variable.
3569 * decl2.c (back_end_hook): Define it.
3570 (finish_file): If it's non-NULL, call it.
3572 * decl.c (add_decl_to_level): New function.
3573 (push_local_binding): Use it.
3574 (find_binding): Fix typo in comment.
3575 (pushdecl): Use add_decl_to_level. Put templates on the
3576 corresponding namespace-scope binding levels.
3577 * dump.c (dequeue_and_dump): Print the specializations of a
3579 * pt.c (push_template_decl_real): Don't push a template multiple
3582 1999-08-17 Mark Mitchell <mark@codesourcery.com>
3584 * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
3585 (CALL_DECLARATOR_QUALS): Likewise.
3586 (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
3587 * decl.c (grokdeclarator): Adjust to use them.
3588 * decl2.c (grokfield): Likewise.
3589 (reparse_absdcl_as_casts): Likewise.
3590 * lex.c (make_call_declarator): Likewise.
3591 (set_quals_and_spec): Likewise.
3592 * pt.c (tsubst): Likewise.
3593 * tree.c (mapcar): Remove special hack to handle third operand of
3596 1999-08-16 Mark Mitchell <mark@codesourcery.com>
3598 * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
3599 * class.c (build_vtable): Use build_lang_field_decl to build the
3600 VAR_DECLs for vtables.
3601 (prepare_fresh_vtable): Likewise.
3602 * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
3603 CAN_HAVE_FULL_LANG_DECL_P.
3604 (push_using_decl): Use build_lang_decl to build USING_DECLs.
3605 (grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
3606 * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
3607 (build_lang_field_decl): Likewise.
3608 (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
3611 * cp-tree.def (STMT_EXPR): New tree node.
3612 * cp-tree.h (STMT_EXPR_STMT): New macro.
3613 (store_return_init): Change prototype.
3614 (finish_named_return_value): New function.
3615 (expand_stmt): Likewise.
3616 (expand_body): Likewise.
3617 (begin_stmt_tree): Likewise.
3618 (finish_stmt_tree): Likewise.
3619 (expanding_p): New variable.
3620 (last_expr_type): Likewise.
3621 (building_stmt_tree): New macro.
3622 * decl.c (start_function): Use building_stmt_tree, not
3623 processing_template_decl, where appropriate.
3624 (store_parm_decls): Likewise.
3625 (store_return_init): Move most of the body to semantics.c.
3626 (finish_function): Use building_stmt_tree.
3627 (finish_stmt): Clear last_expr_type here.
3628 (cp_function): Add expanding_p, last_tree, last_expr_type.
3629 (push_cp_function_context): Save them.
3630 (pop_cp_function_context): Restore them.
3631 * decl2.c (setup_vtbl_ptr): Move to semantics.c.
3632 * error.c (dump_expr): Handle STMT_EXPR.
3633 * except.c (expand_start_catch_block): Use building_stmt_tree.
3635 * expr.c (cplus_expand_expr): Handle STMT_EXPR.
3636 (do_case): Move add_tree call to semantics.c.
3637 * parse.y (return_init): Use finish_named_return_value.
3638 (for.init.statement): Use finish_expr_stmt.
3639 * parse.c: Regenerated.
3640 * pt.c (do_pushlevel): Move to semantics.c.
3641 (do_poplevel): Likewise.
3642 (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
3643 (tsubst_expr): Don't expand all the way to RTL here. Handle
3644 RETURN_INIT and CTOR_INITIALIZER.
3645 (instantiate_decl): Call expand_body after tsubst'ing into
3647 * semantics.c (expand_stmts): New function.
3648 (expanding_p): New variable.
3649 (last_expr_type): Likewise.
3650 (finish_expr_stmt): Use building_stmt_tree.
3651 (begin_if_stmt): Likewise.
3652 (finish_if_stmt_cond): Likewise.
3653 (finish_then_clause): Likewise.
3654 (begin_else_clause): Likewise.
3655 (finish_else_clause): Likewise.
3656 (begin_while_stmt): Likewise.
3657 (finish_while_stmt_cond): Likewise.
3658 (finish_while_stmt): Likewise.
3659 (finish_do_body): Likewise.
3660 (finish_do_stmt): Likewise.
3661 (finish_return_stmt): Likewise.
3662 (begin_for_stmt): Likewise.
3663 (fnish_for_init_stmt): Likewise.
3664 (finish_for_cond): Likewise.
3665 (finish_for_expr): Likewise.
3666 (finish_for_stmt): Likewise.
3667 (finish_break_stmt): Likewise.
3668 (finish_continue_stmt): Likewise.
3669 (finish_switch_cond): Likewise.
3670 (finish_switch_stmt): Likewise.
3671 (finish_case_label): Call add_tree here if necessary.
3672 (finish_goto_statement): Use building_stmt_tree.
3673 (begin_try_block): Likewise.
3674 (begin_function_try_block): Likewise.
3675 (finish_try_block): Likewise.
3676 (finish_function_try_block): Likewise.
3677 (finish_handler_sequence): Likewise.
3678 (finish_function_handler_sequence): Likewise.
3679 (begin_handler): Likewise.
3680 (finish_handler_parms): Likewise.
3681 (finish_handler): Likewise.
3682 (begin_compound_stmt): Likewise.
3683 (finish_compound_stmt): Likewise.
3684 (finish_asm_stmt): Likewise.
3685 (finish_label_stmt): Likewise.
3686 (finish_named_return_value): New function.
3687 (setup_vtbl_ptr): Moved here from decl2.c.
3688 (do_pushlevel): Moved here from pt.c.
3689 (do_poplevel): Likewise.
3690 (begin_stmt_expr): Use building_stmt_tree.
3691 (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR,
3692 when building_stmt_tree.
3693 (begin_stmt_tree): New function.
3694 (finish_stmt_tree): Likewise.
3695 (expand_stmt): Likewise.
3696 (expand_body): Likewise.
3697 * tree.c (build_cplus_method_type): Make sure the argument types
3698 end up on the same obstack as the METHOD_TYPE.
3699 (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
3700 THROW_EXPR, STMT_EXPR.
3701 (mapcar): Break out common cases. Handle COMPOUND_EXPR,
3702 MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than
3703 sorry, if an unsupported node is encountered.
3704 * typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
3705 (c_expand_return): Don't call add_tree here.
3707 1999-08-15 Mark Mitchell <mark@codesourcery.com>
3709 * pt.c (check_default_tmpl_args): Don't check in local scopes.
3710 (tsubst_decl): Make sure the declaration is on a saveable
3711 obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
3713 (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
3715 1999-08-14 Jason Merrill <jason@yorick.cygnus.com>
3717 Speed up Koenig lookup.
3718 * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm
3719 to return namespaces we've looked at.
3720 * decl2.c (lookup_using_namespace): Likewise.
3721 (add_function): Don't call ovl_member.
3722 (lookup_arg_dependent): Initialize k.namespaces to the list of
3723 namespaces seen in unqualified lookup.
3724 * call.c (equal_functions): Move here from tree.c.
3725 (joust): Use it to handle duplicate candidates.
3726 * tree.c (ovl_member): Use ==.
3728 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3730 * cp-tree.def (DECL_STMT): Make it smaller.
3731 * cp-tree.h (lang_decl_flags): Move saved_tree to ...
3732 (lang_decl): ... here. Add next.
3733 (DECL_SAVED_TREE): Adjust accordingly.
3734 (DECL_IMPLICIT_TYPEDEF_P): New macro.
3735 (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
3736 (DECL_STMT_DECL): Likewise.
3737 (create_implicit_typedef): New function.
3738 (maybe_push_decl): Likewise.
3739 (tsubst_default_argument): New function.
3740 (at_function_scope_p): Likewise.
3741 (add_decl_stmt): Likewise.
3742 (push_permanent_obstack): Likewise.
3743 * call.c (convert_default_arg): Use tsubst_default_argument.
3744 * class.c (add_method): Use push_permanent_obstack.
3745 (build_self_reference): Create a TEMPLATE_DECL for the
3746 self-reference, if necessary.
3747 * decl.c (pseudo_global_level_p): Only look at the current binding
3749 (push_binding): Use push_permanent_obstack.
3750 (create_implicit_typedef): New function.
3752 (duplicate_decls): Use push_permanent_obstack.
3753 (maybe_push_decl): New function.
3754 (start_decl): Use it. Remove dead code. Use add_decl_stmt.
3755 (start_decl_1): Remove dead code.
3756 (cp_finish_decl): Remove DECL_STMT handling here. Don't use
3757 pseudo_global_level_p.
3758 (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
3760 (grokdeclarator): Likewise, for TYPE_DECLs. Don't use
3761 pseudo_global_level_p.
3762 * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
3764 (get_sentry): Use push_permanent_obstack.
3765 * dump.c (dequeue_and_dump): Enable DECL_STMT.
3766 * except.c (call_eh_info): Use push_permanent_obstack.
3767 (build_eh_type_ref): Likewise.
3768 (do_pop_exception): Likewise.
3769 (expand_eh_spec): Likewise.
3770 (alloc_eh_object): Likewise.
3771 (expand_throw): Likewise.
3772 * init.c (build_java_class_ref): Likewise.
3773 * lex.c (get_time_identifier): Likewise.
3774 (free_lang_decl_chain): Correct type.
3775 (retrofit_lang_decl): Adjust accordingly.
3776 (build_lang_field_decl): Likewise.
3777 * lex.h (free_lang_decl_chain): Likewise.
3778 * parse.y (lang_extdef): Don't use pseudo_global_level_p.
3779 * parse.c: Regenerated.
3780 * pt.c (tsubst_default_arguments): New function.
3781 (retrieve_local_specialization): Likewise.
3782 (register_local_specialization): Likewise.
3783 (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use
3784 pseudo_global_level_p to determine whether or not a template is
3786 (lookup_template_class): Likewise. Use create_implicit_typedef.
3787 (instantiate_class_template): Call tsubst_default_arguments for
3788 member functions, if appropriate.
3789 (tsubst_default_argument): New function.
3790 (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs.
3791 * search.c (at_function_scope_p): New function.
3792 * semantics.c (finish_asm_stmt): Use push_permanent_obstack.
3793 (finish_label_stmt): Likewise.
3794 (add_decl_stmt): New function.
3795 (begin_class_definition): Likewise.
3796 (finish_typeof): Likewise.
3797 * tree.c (copy_template_template_parm): Likewise.
3798 (copy_to_permanent): Likewise.
3799 (push_permanent_obstack): Define.
3800 (mark_addressable): Use it.
3801 * typeck.c (mark_addressable): Likewise.
3803 1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
3805 * cp-tree.h (init_cplus_unsave): New.
3806 (cplus_unsave_expr_now): New.
3807 * lex.c (init_parse): Call init_cplus_unsave.
3808 * tree.c (init_cplus_unsave): New.
3809 (cplus_unsave_expr_now): New.
3811 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3813 * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and
3814 decl_constant_value to simplify array bounds.
3816 1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
3818 * lang-options.h: Add -fms-extensions.
3819 * cp-tree.h: Declare flag_ms_extensions.
3820 * decl2.c: Define it.
3821 * class.c (instantiate_type): Don't complain about taking the address
3822 of a bound member function if -fms-extensions.
3823 * typeck.c (build_unary_op): Likewise.
3824 * decl.c (grokdeclarator): Or about implicit int.
3825 * init.c (resolve_offset_ref): Or about implicit '&'.
3827 1999-08-11 Mark Mitchell <mark@codesourcery.com>
3829 * cp-tree.h (minimal_parse_mode): Remove.
3830 (finish_label_stmt): New function.
3831 * decl.c (saved_scope): Remove minimal parse mode.
3832 (maybe_push_to_top_level): Don't save it.
3833 (pop_from_top_level): Don't restore it.
3834 (define_label): Split out template-handling code to semantics.c.
3835 (start_decl): Don't use minimal_parse_mode.
3836 (cp_finish_decl): Likewise.
3837 (start_function): Don't increment it.
3838 (store_return_init): Don't use it.
3839 (finish_function): Don't decrement it.
3840 * parse.y (label_colon): Use finish_label_stmt throughout.
3841 * parse.c: Regenerated.
3842 * pt.c (minimal_parse_mode): Don't define it.
3843 (tsubst_expr): Use finish_label_stmt.
3844 * semantics.c (finish_label_stmt): New function.
3846 * dump.c (queue): Be careful when computing bitmasks.
3847 (dequeue_and_dump): Describe binfos as binfos, not as
3850 * parse.y (pedantic): Give it itype. Adjust usage accordingly
3852 * parse.c: Regenerated.
3854 * Make-lang.in (CXX_SRCS): Remove sig.c.
3855 * Makefile.in (CXX_OBJS): Remove sig.o.
3857 * cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
3858 (CPTI_SIGNATURE_TYPE): Likewise.
3859 (CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
3860 (opaque_type_node): Likewise.
3861 (signature_type_node): Likewise.
3862 (sigtable_entry_type): Likewise.
3863 (flag_handle_signatures): Likewise.
3864 (lang_type): Remove is_signature, is_signature_pointer,
3865 is_signature_reference, has_opaque_typedecls,
3866 sigtables_has_been_generated. Adjust dummy. Remove signature,
3867 signature_pointer_to, signature_reference_to.
3868 (IS_SIGNATURE): Remove.
3869 (SET_SIGNATURE): Remove.
3870 (CLEAR_SIGNATURE): Remove.
3871 (IS_SIGNATURE_POINTER): Remove.
3872 (IS_SIGNATURE_REFERENCE): Remove.
3873 (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
3874 (SIGTABLE_HAS_BEEN_GENERATED): Remove.
3875 (CLASSTYPE_SIGNATURE): Remove.
3876 (SIGNATURE_TYPE): Remove.
3877 (SIGNATURE_METHOD_VEC): Remove.
3878 (SIGNATURE_POINTER_TO): Remove.
3879 (SIGNATURE_REFERENCE_TO): Remove.
3880 (lang_decl_flags): Remove is_default_implementation. Rename
3881 memfunc_pointer_to to saved_tree.
3882 (IS_DEFAULT_IMPLEMENTATION): Remove.
3883 (DECL_MEMFUNC_POINTER_TO): Remove.
3884 (DECL_MEMFUNC_POINTING_TO): Remove.
3885 (DECL_SAVED_TREE): Adjust definition.
3886 (tag_types): Remove signature_type_node.
3887 (SIGNATURE_FIELD_NAME): Remove.
3888 (SIGNATURE_FIELD_NAME_FORMAT): Likewise.
3889 (SIGNATURE_OPTR_NAME): Likewise.
3890 (SIGNATURE_SPTR_NAME): Likewise.
3891 (SIGNATURE_POINTER_NAME): Likewise.
3892 (SIGNATURE_POINTER_NAME_FORMAT): Likewise.
3893 (SIGNATURE_REFERENCE_NAME): Likewise.
3894 (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
3895 (SIGTABLE_PTR_TYPE): Likewise.
3896 (SIGTABLE_NAME_FORMAT): Likewise.
3897 (SIGTABLE_NAME_FORMAT_LONG): Likewise.
3898 (SIGTABLE_TAG_NAME): Likewise.
3899 (SIGTABLE_VB_OFF_NAME): Likewise.
3900 (SIGTABLE_VT_OFF_NAME): Likewise.
3901 (finish_base_specifiers): Change prototype.
3902 (build_signature_pointer_type): Remove.
3903 (build_signature_reference_type): Remove.
3904 (build_signature_pointer_constructor): Remove.
3905 (build_signature_method_call): Remove.
3906 (build_optr_ref): Likewise.
3907 (append_signature_fields): Likewise.
3908 (signature_error): Likewise.
3909 * call.c (build_this): Remove signature support.
3910 (build_over_call): Likewise.
3911 (build_new_method_call): Likewise.
3912 * class.c (add_implicitly_declared_members): Likewise.
3913 (finish_struct_1): Likewise.
3914 (finish_struct): Likewise.
3915 * cvt.c (cp_convert_to_pointer): Likewise.
3916 (convert_to_pointer_force): Likewise.
3917 (ocp_convert): Likewise.
3918 * decl.c (sigtable_decl_p): Remove.
3919 (init_decl_processing): Remove support for signatures.
3920 (cp_finish_decl): Likewise.
3921 (grokdeclarator): Likewise.
3922 (grokparms): Likewise.
3923 (xref_tag): Likewise.
3924 (start_function): Likewise.
3925 (start_method): Likewise.
3926 * decl2.c (finish_sigtable_vardecl): Remove.
3927 (flag_handle_signatures): Remove.
3928 (lang_f_options): Remove handle-signatures.
3929 (grokfield): Remove support for signatures.
3930 (grokbitfield): Likewise.
3931 (finish_file): Likewise.
3932 (reparse_absdcl_as_casts): Likewise.
3933 * error.c (dump_type_real): Likewise.
3934 (dump_function_decl): Likewise.
3935 * friend.c (make_friend_class): Likewise.
3936 * gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
3937 * hash.h: Regenerated.
3938 * init.c (build_new_1): Remove support for signatures.
3939 * lang-options.h: Remove -fhandle-signatures,
3940 -fno-handle-signatures.
3941 * lex.c (init_parse): Remove support for signatures.
3942 (yyprint): Likewise.
3943 * lex.h (rid): Remove RID_SIGNATURE.
3944 * method.c (build_decl_overload_real): Remove support for
3946 (hack_identifier): Likewise.
3947 * parse.y (base_class): Likewise.
3948 (base_class.1): Likewise.
3949 (access_specifier): Likewise.
3950 * search.c (lookup_member): Likewise.
3951 * semantics.c (finish_qualified_object_call_expr): Likewise.
3952 (finish_template_type_parm): Likewise.
3953 (begin_class_definition): Likewise.
3954 (finish_base_specifier): Likewise.
3956 * tree.c (build_cplus_method_type): Remove support for signatures.
3957 * typeck.c (require_complete_type): Likewise.
3958 (c_sizeof): Likewise.
3959 (c_alignof): Likewise.
3960 (build_object_ref): Likewise.
3961 (build_component_ref): Likewise.
3962 (build_indirect_ref): Likewise.
3963 (build_c_cast): Likewise.
3964 (build_modify_expr): Likewise.
3965 (convert_for_initialization): Likewise.
3966 * typeck2.c (signature_error): Remove.
3967 (store_init_value): Remove support for signatures.
3968 (digest_init): Likewise.
3969 (build_x_arrow): Likewise.
3970 (build_functional_cast): Likewise.
3971 * xref.c (GNU_xref_decl): Likewise.
3973 1999-08-10 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3975 * lex.c (do_identifier): Remove unnecessary lookup of class field.
3977 1999-08-09 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3979 * decl2.c (set_decl_namespace): Do not complain about non-matching
3980 decls if processing a template.
3982 1999-08-09 Mark Mitchell <mark@codesourcery.com>
3984 * decl.c (build_ptrmemfunc_type): Handle qualified
3985 pointer-to-member types here.
3986 * tree.c (cp_build_qualified_type_real): Simplify handling here.
3988 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3990 * lex.c (lang_identify): Likewise.
3992 1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
3994 * Makefile.in: Update dependencies.
3995 * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
3997 * decl.c: Include "function.h"
3998 (cleanup_label, return_label): Delete declarations.
3999 (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX.
4000 (finish_function): Rename last_parm_insn variable to
4001 fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX.
4002 * decl2.c: Include "function.h".
4003 (rtl_expr_chain): Delete declaration.
4004 * method.c: Include "function.h"
4005 * tree.c (build_vbase_pointer_fields): Don't initialize
4006 DECL_SAVED_INSNS with NULL_RTX.
4007 * typeck.c: Include "function.h"
4009 1999-08-09 Jason Merrill <jason@yorick.cygnus.com>
4011 * semantics.c (begin_function_try_block, finish_function_try_block,
4012 finish_function_handler_sequence): New fns.
4013 * parse.y (function_try_block): Use them.
4014 * pt.c (instantiate_decl): Likewise.
4016 * cp-tree.h: Declare in_function_try_handler.
4017 * decl.c: Define it.
4018 (start_function): Clear it.
4019 (struct cp_function, push_cp_function_context): Save it.
4020 (pop_cp_function_context): Restore it.
4021 * parse.y (function_try_block): Set and clear it.
4022 * except.c (expand_end_catch_block): Rethrow if we reach the end
4023 of a function-try-block handler in a ctor or dtor.
4024 * typeck.c (c_expand_return): Complain about returning from a
4025 function-try-block handler of a ctor.
4027 * parse.y (function_try_block): Call end_protect_partials
4028 before expand_start_all_catch.
4030 1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
4032 * decl.c (struct binding_level): Add eh_region field.
4033 (push_binding_level): Set it.
4034 (define_label): Complain about jumping into an EH block.
4036 * ptree.c (print_lang_type): Print the real type of a PMF.
4037 Print what exceptions a fn type throws.
4039 1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4041 * class.c (count_fields, add_fields_to_vec): Add static prototype.
4043 * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
4044 get_id_2, composite_pointer_type, dump_node_to_file): Constify a
4047 * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
4050 * decl2.c (finish_static_data_member_decl, grokfield): Constify a
4053 * dump.c (queue_and_dump_index, dump_int, dump_string,
4054 dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
4056 (dump_stmt): Add static prototype.
4058 * errfn.c (cp_thing): Constify a char*.
4060 * error.c (dump_unary_op, dump_binary_op, aggr_variety,
4061 dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
4062 dump_expr): Constify a char*.
4064 * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
4065 read_line_number): Add static prototype.
4066 (opname_tab, assignop_tab, operator_name_string): Constify a char*.
4067 (real_yylex): Move label `letter' into the scope where it is used.
4069 * method.c (build_mangled_template_parm_index, build_overload_int,
4070 build_decl_overload_real, get_id_2): Constify a char*.
4072 * search.c (check_final_overrider): Make static.
4074 * typeck.c (composite_pointer_type): Constify a char*.
4076 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
4078 * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
4079 we're looking at a class.
4081 * decl.c (lookup_name_real): Set the complain flag if we're
4082 looking for a namespace member.
4084 * lex.c (real_yylex): We can have a number with no digits.
4086 * cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
4088 * search.c (binfo_from_vbase): New fn.
4089 * cp-tree.h: Declare it.
4090 * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
4091 from pointer to member of virtual base.
4092 * typeck.c (get_delta_difference): Likewise.
4094 1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
4096 * pt.c (tsubst): Use build_index_type to build in-template array
4097 index type. Fixes g++.oliva/dwarf1.C.
4098 * decl.c (grokdeclarator): Likewise, just for consistency, as it
4099 doesn't seem to trigger the bug without it.
4101 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
4103 * typeck2.c (add_exception_specifier): Use complete_type.
4105 1999-08-06 Mark Mitchell <mark@codesourcery.com>
4107 * error.c (dump_expr): Handle EXACT_DIV_EXPR.
4108 (dump_binary_op): Bulletproof.
4109 * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
4110 * tree.c (search_tree): Don't enumerate all the nodes of classes
4111 `1', `2', and `<'; handle them generically. Don't be sorry about
4112 "unrecognized tree codes"; just abort.
4113 (no_linkage_check): Don't do linkage checks for templates.
4115 * tree.c (cp_build_qualified_type_real): Handle
4116 pointer-to-member-function types correctly.
4118 1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
4120 * decl.c (pushdecl): Only give an error for shadowing a parm
4121 from *this* function.
4123 Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
4125 * typeck2.c: Update URLs and mail addresses.
4127 1999-08-04 Nathan Sidwell <nathan@acm.org>
4129 * cp-tree.h (empty_except_spec): New global var.
4130 (compexcepttypes): Remove prototype.
4131 (comp_except_specs): Prototype new global function.
4132 (add_exception_specifier): Prototype new global function.
4133 * decl.c (empty_except_spec): Define new global var.
4134 (duplicate_decls): Use comp_except_specs, reword error message.
4135 (init_decl_processing): Initialize empty_except_spec.
4136 Adjust build_exception_variant calls.
4137 * parse.y (exception_specification_opt): Use empty_except_spec.
4138 (ansi_raise_identifier): Call check_for_new_type.
4139 (ansi_raise_identifiers): Use add_exception_specifier.
4140 * pt.c (tsubst): Use add_exception_specifier to build exception
4142 * search.c (check_final_overrider): New static function, broken
4143 out of get_matching_virtual. Check throw specifiers, reword
4145 (get_matching_virtual): Use check_final_overrider.
4146 * tree.c (build_exception_variant): Use comp_except_specs.
4147 * typeck.c (compexcepttypes): Remove.
4148 (comp_except_types): New static function, helper for
4149 comp_except_specs. Compare two types as exception specifiers.
4150 (comp_except_specs): New global function, compare two exception
4152 (comptypes): Adjust for comp_except_specs.
4153 * typeck2.c (add_exception_specifier): New global function.
4155 * class.c (check_for_override): Reword error message.
4157 1999-08-03 Nathan Sidwell <nathan@acm.org>
4159 * call.c (convert_arg_to_ellipsis): Use pod_type_p.
4160 * cp-tree.h (struct lang_type): Added non_pod_class flag.
4161 (CLASSTYPE_NON_POD_P): New macro to access it.
4162 * class.c (finish_struct_1): Determine non-PODness.
4163 Check for arrays of pointers (-Weffc++).
4164 Remove array inspection duplicated code.
4165 * tree.c (pod_type_p): Detect non-pod non-aggregate types.
4166 Use CLASSTYPE_NON_POD_P.
4168 1999-08-03 Nathan Sidwell <nathan@acm.org>
4170 * class.c (duplicate_tag_error): Preserve template information.
4172 1999-08-03 Nathan Sidwell <nathan@acm.org>
4174 * decl.c (start_enum): Show location of previous definition.
4175 * parse.y (enumlist_opt): New reduction.
4176 (structsp): Simplify enum rules to use enumlist_opt.
4178 1999-08-03 Jason Merrill <jason@yorick.cygnus.com>
4180 * lex.c (yyprint): Handle PFUNCNAME.
4182 * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
4183 build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
4185 1999-08-03 Mumit Khan <khan@xraylith.wisc.edu>
4187 * decl.c (start_decl): Set attributes before duplicate_decls call.
4189 1999-08-02 Mark Mitchell <mark@codesourcery.com>
4191 * Make-lang.in (CXX_SRCS): Add dump.c.
4192 * Makefile.in (CXX_OBJS): Add dump.o.
4193 (dump.o): New target.
4194 * cp-tree.h (DECL_CONV_FN_P): Document.
4195 (DECL_OVERLOADED_OPERATOR_P): New function.
4196 (TYPE_PTRMEM_CLASS_TYPE): New macro.
4197 (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
4198 (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
4199 (ASM_VOLATILE_P): New macro.
4200 (STMT_LINENO): Likewise.
4201 (cp_namespace_decls): New function.
4202 (dump_node_to_file): New function.
4203 * decl.c (cp_namespace_decls): New function.
4204 (walk_namespaces_r): Use it.
4205 (wrapup_globals_for_namespace): Likewise.
4206 * decl2.c (flag_dump_translation_unit): New variable.
4207 (lang_decode_option): Handle -fdump-translation-unit.
4208 (finish_file): If flag_dump_translation_unit is set, dump the
4211 * lang-options.h: Add -fdump-translation-unit.
4212 * pt.c (tsubst_template_parms): Robustify.
4213 (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
4214 (tsubst_expr): Use STMT_LINENO.
4215 * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
4216 for invalid cv-qualifiers even while building templates.
4218 1999-08-02 Richard Henderson <rth@cygnus.com>
4220 * call.c: Include defaults.h instead of expr.h.
4223 * typeck.c: Include defaults.h.
4225 1999-08-02 Mark Mitchell <mark@codesourcery.com>
4227 * lex.c (errorcount, sorrycount): Don't declare.
4228 * repo.c (errorcount, sorrycount): Likewise.
4229 * typeck2.c (errorcount, sorrycount): Likewise.
4231 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
4233 * call.c (convert_default_arg, build_over_call): Change all uses of
4234 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
4235 Ensure expr.h is included.
4236 * decl.c (grokparams): Ditto.
4237 * pt.c (tsubst_decl): Ditto.
4238 * typeck.c (convert_arguments): Ditto.
4240 1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
4242 * class.c (mark_overriders): Fix order of args to overrides.
4243 (warn_hidden): Likewise. Fix for having virtual and non-virtual
4244 functions with the same name.
4246 1999-08-02 Richard Henderson <rth@cygnus.com>
4248 * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
4250 1999-08-01 Mark Mitchell <mark@codesourcery.com>
4252 * call.c (build_conditional_expr): Fix typo in comment.
4254 1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
4256 * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
4257 case_stack; use in_control_zone_p.
4258 * typeck.c (c_expand_return): Likewise.
4260 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
4262 * except.c (catch_clauses): Delete declaration.
4264 1999-07-30 Mark Mitchell <mark@codesourcery.com>
4266 * call.c (build_conditional_expr): Call convert_from_reference to
4267 avoid reference/non-reference type confusion. Fix typo.
4269 1999-07-30 Richard Henderson <rth@cygnus.com>
4271 * typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
4272 * cp-tree.h (initializer_constant_valid_p): Remove.
4274 1999-07-28 Mark Mitchell <mark@codesourcery.com>
4276 * call.c (conditional_conversion): Don't build BASE_CONVs for
4277 conversions between things that have the same type.
4278 (build_conditional_expr): Tweak.
4279 (convert_like): Some BASE_CONVs really do require the generation
4282 * init.c (perform_member_init): Don't go through build_modify_expr
4283 for simple initializations.
4285 1999-07-27 Jason Merrill <jason@yorick.cygnus.com>
4287 * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
4288 * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
4289 virtual functions and MI. Simplify.
4291 * method.c: Remove prototype for largest_union_member.
4292 * pt.c (determine_specialization): Fix uninitialized warning.
4293 * lex.c (real_yylex): Likewise.
4295 1999-07-27 Mark Mitchell <mark@codesourcery.com>
4297 * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
4300 * cp-tree.h (BINFO_VIRTUALS): Document new format.
4301 * class.c (modify_one_vtable): Change prototype accordingly.
4302 (modify_all_vtables): Likewise.
4303 (modify_all_direct_vtables): Likewise.
4304 (modify_all_indirect_vtables): Likewise.
4305 (build_vtable_entry_for_fn): New function.
4306 (set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
4307 (modify_vtable_entry): Likewise.
4308 (add_virtual_function): Likewise.
4309 (build_vtbl_initializer): New function.
4310 (finish_vtbls): Simplify for new BINFO_VIRTUALS format.
4311 (fixup_vtable_deltas1): Likewise.
4312 (fixup_vtable_deltas): Likewise.
4313 (override_one_vtable): Likewise.
4314 (finish_struct_1): Likewise.
4316 * error.c (dump_expr): Likewise.
4317 * search.c (get_abstract_virtuals_1): Likewise.
4318 (get_abstract_virtuals): Likewise.
4319 (expand_upcast_fixups): Likewise.
4320 * tree.c (debug_binfo): Likewise.
4321 * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
4322 __pure_virtual here.
4324 1999-07-26 Mark Mitchell <mark@codesourcery.com>
4326 * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
4327 as per 1999-07-26 change.
4329 * typeck.c (c_sizeof): Don't allow non-static data members.
4330 (expr_sizeof): Likewise.
4332 1999-07-26 Jason Merrill <jason@yorick.cygnus.com>
4334 * input.c (feed_input): Only touch lineno and input_filename
4335 if !USE_CPPLIB. Save the old values before setting the new ones.
4337 * input.c (feed_input): Add file, line parms.
4338 * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
4339 (real_yylex): Check linemode before input_redirected().
4341 * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
4342 from op new to warning.
4344 1999-07-26 Mark Mitchell <mark@codesourcery.com>
4346 * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
4347 * call.c: All uses changed.
4348 * typeck.c: Likewise.
4350 1999-07-26 Nathan Sidwell <nathan@acm.org>
4352 * exception.cc (__cplus_type_matcher): Match __eh_matcher
4355 1999-07-26 Mark Mitchell <mark@codesourcery.com>
4357 * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
4358 (ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
4359 (strip_top_quals): Declare.
4360 (ncp_convert): Likewise.
4361 (type_after_usual_arithmetic_converions): Likewise.
4362 (composite_pointer_type): Likewise.
4363 * call.c (strip_top_quals): Don't make it static.
4364 (promoted_arithmetic_type_p): New function.
4365 (conditional_conversion): Likewise.
4366 (null_ptr_cst_p): Allow `false' as a NULL pointer constant.
4367 (standard_conversion): Use same_type_p. Don't build BASE_CONVs
4368 for converting a type to itself.
4369 (reference_binding): Honor LOOKUP_NO_TEMP_BIND.
4370 (implicit_conversion): Make sure the from and to types are
4372 (add_builtin_candidate): Correct handling of ?: operator.
4373 (add_builtin_candidates): Improve documentation.
4374 (build_conditional_expr): New function.
4375 (can_convert): Implement in terms of can_convert_arg.
4376 (ncp_convert): New function.
4377 * typeck.c (type_after_usual_arithmetic_conversions): New
4378 function, split out from common_type.
4379 (composite_pointer_type): New function, split out from
4380 build_conditional_expr.
4381 (common_type): Use type_after_usual_arithmetic_conversions.
4382 Remove redundant attribute merging.
4383 (comptypes): Tidy. Handle COMPLEX_TYPE.
4384 (build_binary_op_nodefault): Use null_ptr_cst_p.
4385 (build_conditional_expr): Remove.
4386 (convert_for_assignment): Use new conversion functions.
4388 * cp-tree.h (abstract_virtuals_error): Change declaration.
4389 * typeck2.c (abstract_virtuals_error): Check to see if an error
4390 ocurred, and return a boolean value accordingly.
4391 (build_functional_cast): Adjust accordingly.
4392 * class.c (finish_struct_1): Likewise.
4393 * cvt.c (ocp_convert): Likewise.
4394 * decl.c (cp_finish_decl): Likewise.
4395 (grokparams): Likewise.
4396 (grok_op_properties): Likewise.
4397 (start_function): Likewise.
4398 * init.c (build_new_1): Likewise.
4400 * pt.c (unify): Don't get confused by pointers-to-member functions.
4402 * search.c (build_cplus_new): Robustify.
4404 1999-07-24 Richard Henderson <rth@cygnus.com>
4406 * gxx.gperf (__builtin_va_arg): New.
4407 * parse.y (VA_ARG): New token.
4408 (unary_expr): Recognize it.
4410 Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com)
4412 * g++FAQ.texi: Deleted per Joe Buck's request.
4413 * Makefile.in: Corresponding changes.
4415 1999-07-23 Jason Merrill <jason@yorick.cygnus.com>
4417 * lex.c: Sync with C frontend.
4418 (whitespace_cr): New fn.
4419 (skip_white_space): Use it.
4420 (init_parse): Reorder.
4421 (yyprint): Support CONSTANT.
4422 (pragma_getc, pragma_ungetc): Bring back.
4423 (read_line_number): Change in_system_header directly.
4424 (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
4425 (parse_float): Update to C version.
4426 (yylex): Handle '$' under the letter case.
4427 Remove looking_for_typename handling.
4428 Support hex floating point constants.
4429 Follow C's lead for choosing type of integer constants.
4430 Rearrange stuff to match C frontend.
4431 (yyungetc, reinit_parse_for_block, yylex): Support indent_level.
4432 * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
4434 1999-07-23 Mark Mitchell <mark@codesourcery.com>
4436 * call.c (reference_binding): Tweak.
4437 (mayble_handle_implicit_object): Use direct_reference_binding to
4438 create the right implicit conversion sequence.
4440 1999-07-22 Mark Mitchell <mark@codesourcery.com>
4442 * pt.c (convert_nontype_argument): Don't call decl_constant_value
4443 if we're converting to a reference type.
4445 * call.c (NEED_TEMPORARY_P): New macro.
4446 (standard_conversion): Set it, for derived-to-base conversions.
4447 (reference_related_p): New function.
4448 (reference_compatible_p): Likewise.
4449 (convert_class_to_reference): Likewise.
4450 (direct_reference_binding): Likewise.
4451 (reference_binding): Rework for standards-compliance.
4452 (convert_like): Adjust accordingly.
4453 (maybe_handle_ref_bind): Simplify; the right conversion sequences
4454 are now built up in reference_binding.
4455 (initialize_reference): New function.
4456 * cp-tree.h (ICS_USER_FLAG): Document.
4457 (ICS_THIS_FLAG): Likewise.
4458 (ICS_BAD_FLAG): Likewise.
4459 (NEED_TEMPORARY_P): Likewise.
4460 (cp_lvalue_kind): New type.
4461 (real_lvalue_p): Return it.
4462 * error.c (dump_expr): Provide more accurate representation for
4464 * init.c (expand_default_init): Do not try to perform implicit
4465 conversions for a brace-enclosed initializer.
4466 * search.c (lookup_conversions): Document.
4467 * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate
4469 (real_lvalue_p): Adjust accordingly.
4470 (lvalue_p): Likewise.
4471 (build_cplus_new): Don't allow the creation of an abstract class.
4472 * typeck.c (convert_for_initialization): Use initialize_reference.
4474 1999-07-21 Gavin Romig-Koch <gavin@cygnus.com>
4476 * lex.c (real_yylex) : Correct the test for overflow when lexing
4479 1999-07-20 Jason Merrill <jason@yorick.cygnus.com>
4481 * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL,
4482 not DECL_BUILT_IN, to determine if a function is internally declared.
4483 (duplicate_decls): Likewise. Improve handling of builtins.
4484 (push_overloaded_decl): Remove special handling of builtins.
4486 * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P.
4488 * decl.c (grokdeclarator): Pull out decl_constant_value in
4491 * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm.
4492 * cp-tree.h, pt.c, semantics.c: Adjust.
4493 * method.c (largest_union_member): Remove.
4495 * lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
4497 * lex.c (token_getch, token_put_back): New fns.
4498 (real_yylex): Use them.
4500 * lex.c (lang_init): Generalize.
4501 (lang_init_options): Tell cpplib this is C++.
4502 (nextchar): Remove. Replace uses with put_back.
4503 (skip_white_space): Handle linemode here. Optimize for cpplib.
4504 (extend_token_buffer_to): New fn.
4505 (extend_token_buffer): Use it.
4506 (read_line_number, check_newline): Just deal with tokens.
4507 (real_yylex): More cpplib optimizations. Simplify. Don't produce
4508 EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here.
4509 * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING.
4510 * parse.y (PAREN_STAR_PAREN): Remove.
4511 * input.c: Don't use the putback machinery with cpplib.
4512 (sub_getch): Fold back into getch.
4513 (getch): Don't handle linemode here.
4514 (feed_input): Unget any text in the token buffer.
4516 * lex.c (set_typedecl_interface_info, set_vardecl_interface_info,
4517 nextyychar, nextyylval): Remove.
4519 1999-07-20 Michael Tiemann <tiemann@holodeck.cygnus.com>
4520 Jason Merrill <jason@yorick.cygnus.com>
4522 * lex.c (indent_level): New variable.
4523 (init_parse): Set cpp_token to CPP_DIRECTIVE.
4524 (consume_string): Make this smart about USE_CPPLIB.
4525 (yyungetc): Use put_back function.
4526 (pragma_getc, pragma_ungetc): Functions deleted.
4527 (check_newline): Rewrite to be intelligent about USE_CPPLIB.
4528 Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and
4530 (real_yylex): Rewrite to be intelligent about USE_CPPLIB.
4531 Also, clean up cases where we redundantly set token_buffer[0].
4532 (read_line_number): New fn.
4533 * input.c (feed_input): Use integrated cpplib if USE_CPPLIB.
4534 (end_input): Call cpp_pop_buffer if USE_CPPLIB.
4535 (sub_getch): Conditionalize out code that's not appropriate if
4537 (put_back): Rewrite in case USE_CPPLIB is defined.
4538 (input_redirected): Ditto.
4540 Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
4542 * cp-tree.h: Delete lots of declarations of tree nodes; replaced by
4543 c_global_trees and accessor macros defined in c-common.h.
4544 (cp_tree_index): New enumeration.
4545 (cp_global_trees): Declare new array. Add accessor macros for it, and
4546 delete declarations of tree nodes replaced by it.
4547 (builtin_function): Delete macro, add declaration for new function.
4549 * decl.c: Delete definitions for tree nodes that were replaced by
4550 cp_global_trees and c_global_trees.
4551 (init_decl_processing): Call c_common_nodes_and_builtins; delete code
4552 to generate the common builtins here.
4553 (builtin_function): New function.
4554 * decl2.c (abort_fndecl): Delete declaration.
4555 * except.c (expand_builtin_return_address): Delete declaration.
4556 (builtin_return_address_fndecl): Delete variable.
4557 (const_ptr_type_node): Delete declaration.
4558 * lex.c (cons_up_default_function): Delete declaration of
4560 * parse.y (void_list_node): Delete declaration.
4561 * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
4563 (const_string_type_node): Delete declaration.
4564 * search.c (abort_fndecl): Delete declaration.
4565 * Makefile.in: Update dependencies.
4567 1999-07-19 Mark Mitchell <mark@codesourcery.com>
4569 * pt.c (check_default_tmpl_args): Move test for missing default
4570 arguments here, from ...
4571 (end_template_parm_list): Here.
4573 1999-07-18 Mark Mitchell <mark@codesourcery.com>
4575 * decl.c (lookup_nested_type): Remove.
4576 (pushtag): Don't call it.
4578 Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com)
4580 * Makefile.in (INTERFACE): Bump to 2.
4582 1999-07-17 Alexandre Oliva <oliva@dcc.unicamp.br>
4584 * typeck2.c (my_friendly_abort): Updated URL with bug reporting
4585 instructions to gcc.gnu.org. Removed e-mail address.
4587 1999-07-17 Mark Mitchell <mark@codesourcery.com>
4589 * pt.c (determine_specialization): Tighten error-checking.
4590 (end_template_parm_list): Likewise.
4592 1999-07-14 Mark Mitchell <mark@codesourcery.com>
4594 * pt.c (check_default_tmpl_args): Handle friends defined in the
4595 class just like member functions defined in the class.
4597 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
4598 Jason Merrill <jason@yorick.cygnus.com>
4600 * cp-tree.h (struct lang_decl): Added field for storing sorted
4601 FIELD_DECLs (used in TYPE_DECLs).
4602 (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
4603 (DECL_SORTED_FIELDS): New macro.
4604 * class.c (method_name_cmp): New function.
4605 (finish_struct_methods): Modified to support sorting and searching
4607 (finish_struct_anon): Changed code in inner loop to use ELT rather
4608 than UELT (which required an extra indirection for every reference).
4609 (field_decl_cmp): New function to support sorting FIELD_DECLs.
4610 (finish_struct_1): Sort fields.
4611 * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
4612 (lookup_fnfields_1): Search sorted methods in METHOD_VEC.
4613 Also, switch to using array indexing rather than a changing pointer.
4614 * ptree.c (print_lang_decl): Handle TYPE_DECLs that have
4617 1999-07-09 Jason Merrill <jason@yorick.cygnus.com>
4619 * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
4620 casts in system headers or extern "C" blocks.
4622 * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
4625 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
4627 * decl2.c (write_virtuals): Deleted declaration.
4628 * cp-tree.h (write_virtuals): Deleted extern declaration.
4629 * class.c (finish_struct_1): Removed #if 0'd code that mentions
4631 * semantics.c (begin_class_definition): Rewrite code to not depend
4634 * lex.c (cp_pragma_interface): New function.
4635 (cp_pragma_implementation): Likewise.
4636 (handle_cp_pragma): Call them.
4638 * typeck.c (comptypes): Simplify C code in look_hard.
4640 * xref.c (PALLOC): Use xcalloc, not calloc.
4641 (SALLOC): Use xmalloc, not malloc.
4643 * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
4645 * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
4648 * decl.c (duplicate_decls): If a redeclaration doesn't match the
4649 initial declaration, then don't save the inline info and by all
4650 means don't mark the function as a builtin function.
4652 * decl.c (lookup_name_real): Set NONCLASS to 1 if
4653 CURRENT_CLASS_TYPE is 0.
4655 * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
4658 * ptree.c (print_lang_type): Added vtable-needs-writing.
4660 Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
4662 * decl2.c (mark_vtable_entries): Fix check for rtti offset.
4664 1999-07-06 Gavin Romig-Koch <gavin@cygnus.com>
4666 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4667 Merged into c-common.
4669 1999-07-05 Dave Brolley <brolley@cygnus.com>
4671 * lex.c (errorcount): Declare it.
4672 (finish_parse): Update errorcount for when using CPPLIB.
4674 1999-07-05 Mark Mitchell <mark@codesourcery.com>
4676 * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
4678 (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
4679 * decl.c (push_class_binding): Use it.
4680 (lookup_name_real): Likewise.
4682 1999-07-02 Gavin Romig-Koch <gavin@cygnus.com>
4684 * cp-tree.h (widest_integer_literal_type_node,
4685 widest_unsigned_literal_type) : New.
4686 * decl.c (widest_integer_literal_type_node,
4687 widest_unsigned_literal_type) : New.
4688 (init_decl_processing): Handle/use the two new types.
4689 * lex.c (real_yylex): Same.
4690 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4693 1999-07-01 Mark Mitchell <mark@codesourcery.com>
4695 * decl.c (grokdeclarator): Don't give names "for linkage purposes"
4696 to anonymous cv-qualified types.
4698 1999-07-01 Gavin Romig-Koch <gavin@cygnus.com>
4700 * lex.c (real_yylex) : Change integer literal overflow handling to
4703 * lex.c (real_yylex): Improve 'integer constant out of range' messages.
4705 1999-06-28 Richard Henderson <rth@cygnus.com>
4707 * decl.c (cp_finish_decl): Fix typo in cp_warning_at call.
4709 1999-06-28 Jason Merrill <jason@yorick.cygnus.com>
4711 * error.c (dump_type_real): Handle TREE_LIST again.
4713 * typeck.c (comp_target_parms): Don't complain about
4714 converting from () to (...) if !flag_strict_prototype.
4716 * decl.c (grokdeclarator): Update the names of all variants when
4719 1999-06-21 Mark Mitchell <mark@codesourcery.com>
4721 * init.c (expand_aggr_vbase_init): Rename to
4722 construct_virtual_bases. Conditionalize construction here,
4724 (emit_base_init): Here.
4726 1999-06-19 Mark Mitchell <mark@codesourcery.com>
4728 * semantics.c (finish_asm_statement): Apply decay conversions to
4731 * decl.c (expand_static_init): When building an anonymous function
4732 for use with atexit, compute its body before and after entering
4735 * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
4738 1999-06-18 Mark Mitchell <mark@codesourcery.com>
4740 * init.c (expand_aggr_vbase_init): Add flag parameter.
4741 (build_partial_cleanup_for): Remove, inlining into ..
4742 (expand_cleanup_for_base): ... here. Take flag parameter.
4743 (emit_base_init): Pass the in_chrg parameter to
4744 emit_aggr_vbase_init.
4745 (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.
4747 1999-06-16 Mark Mitchell <mark@codesourcery.com>
4749 * decl2.c (import_export_decl): Use same_type_p, rather than
4750 relying on pointer-equality for types.
4752 * method.c (do_build_copy_constructor): Simplify.
4754 * call.c (build_method_call): Remove bogus code for two-argument
4756 * init.c (build_new_1): Expand on comment, and remove dead code.
4758 * init.c (expand_cleanup_for_base): New function, split out
4760 (emit_base_init): Here.
4761 (expand_aggr_vbase_init): Use it.
4763 1999-06-15 Mark Mitchell <mark@codesourcery.com>
4765 * cp-tree.h (class_cache_firstobj): Declare.
4766 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4767 * class.c (permanent_obstack): Remove declaration.
4768 (class_cache_firstobj): Make it global.
4769 (add_method): Don't use permanent_obstack directly.
4770 (pushclass): Only free the class_cache_obstack if we know how far
4772 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4773 * decl.c: Remove dead comment.
4774 (saved_scope): Add class_cache_firstobj.
4775 (push_to_top_level): Save it.
4776 (pop_from_top_level): Restore it.
4777 (push_class_level_binding): Use push_cache_obstack, not
4778 maybe_push_cache_obstack.
4779 * search.c (push_class_decls): Likewise.
4781 1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
4783 * pt.c (tsubst_friend_function): Push into namespace of friend
4784 function before pushdecl'ing it.
4786 1999-06-14 Nathan Sidwell <nathan@acm.org>
4788 * call.c (build_new_op): Remove REF_BIND from all operands.
4790 1999-06-13 Alexandre Oliva <oliva@dcc.unicamp.br>
4792 * init.c (build_new_1): Look up operator delete even if there was
4793 no explicit new placement.
4795 1999-06-08 Nathan Sidwell <nathan@acm.org>
4797 * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
4799 (build_throw): ... here. Call it.
4800 (process_start_catch_block): Call it.
4802 1999-06-07 Mark Mitchell <mark@codesourcery.com>
4804 * search.c (convert_pointer_to_single_level): Reimplement without
4807 1999-06-06 Mark Mitchell <mark@codesourcery.com>
4809 * method.c (is_back_referenceable_type): Back-reference bools when
4812 1999-06-07 Dave Brolley <brolley@cygnus.com>
4814 * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
4815 * input.c (putback_buffer): New structure type.
4816 (putback): Replaces putback_char member.
4817 (putback): Replaces putback_char static variable.
4818 (feed_input): Use putback.
4819 (end_input): Use putback.
4820 (sub_getch): Use putback.
4821 (put_back): Use putback.
4823 1999-06-05 Mark Mitchell <mark@codesourcery.com>
4825 * decl.c (grokdeclarator): Fix typo in last change.
4827 1999-06-04 Jason Merrill <jason@yorick.cygnus.com>
4829 * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
4830 (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
4832 1999-06-04 Nathan Sidwell <nathan@acm.org>
4834 * except.c (build_throw): Check throw expression validity.
4836 1999-06-03 Mark Mitchell <mark@codesourcery.com>
4838 * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
4839 just because flag_signed_bitfields is false.
4841 1999-06-03 Nathan Sidwell <nathan@acm.org>
4843 * semantics.c (begin_class_definition): Update the struct's
4845 * class.c (finish_struct): ... rather than here.
4847 * decl.c (make_typename_type): Don't rely on uninitialized
4850 1999-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4852 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4854 1999-05-31 Mark Mitchell <mark@codesourcery.com>
4856 * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
4857 and friends rather than messing with current_obstack directly.
4858 (cp_build_qualified_type_real): Rework ARRAY_TYPE
4859 allocation to match practice throughout the rest of the
4862 1999-05-30 Mark Mitchell <mark@codesourcery.com>
4864 * lex.c (make_lang_type): Create TYPE_BINFO for
4865 TEMPLATE_TYPE_PARMs just like for non-template types.
4867 * decl.c (start_decl): Move checks on initialization to ...
4868 (cp_finish_decl): Here. Tidy formatting slightly.
4870 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4872 * decl.c (add_binding): Don't complain about a redeclaration of a
4873 semantically identical typedef in a local scope.
4875 1999-05-28 Nathan Sidwell <nathan@acm.org>
4877 * decl.c (complete_array_type): Allocate off same obstack. Fix
4878 DO_DEFAULT comment to match reality.
4880 * friend.c (make_friend_class): Fix diagnostic typo.
4882 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4884 * decl.c (lookup_namespace_name): Handle getting a
4886 (expand_static_init): Don't call pushdecl for implicitly declared
4887 `atexit' used to register destructors.
4889 1999-05-25 Mark Mitchell <mark@codesourcery.com>
4891 * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
4894 * cp-tree.h (NAMESPACE_LEVEL): Reformat.
4895 (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes
4896 by combining TEMPLATE_INFO and LEVEL into a single union.
4897 (DECL_TEMPLATE_INFO): Reformat.
4898 (DECL_SAVED_TREE): Document.
4899 (DECL_TEMPLATE_INJECT): Remove.
4900 * class.c (finish_struct): Remove code to deal with
4901 DECL_TEMPLATE_INJECT.
4903 * decl.c (maybe_process_template_type_declaration): Handle all new
4904 types in templates uniformly.
4905 * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
4907 * pt.c (lookup_template_class): Inject template instantiations of
4908 forward-declarations.
4909 (instantiate_class_template): Remove code processing
4910 DECL_TEMPLATE_INJECT.
4912 * pt.c (lookup_template_class): Tweak lookup to find member
4915 * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
4917 * semantics.c (finish_asm_stmt): Make strings permanent if they're
4920 1999-05-25 Jason Merrill <jason@yorick.cygnus.com>
4922 * typeck.c (casts_away_constness, casts_away_constness_r): Strip both
4923 parts of pointer to data member types.
4925 1999-05-24 Mark Mitchell <mark@codesourcery.com>
4927 * decl2.c (mark_vtable_entries): Don't make a copy of a function,
4928 and then make it look like `abort'. Just use `abort' instead.
4930 * typeck.c (build_static_cast): Don't allow static_casts that cast
4932 (casts_away_constness_r): New function.
4933 (casts_away_constness): Likewise.
4935 * decl.c (lookup_tag): Remove code no longer needed after
4936 name-lookup improvements.
4937 * decl2.c (handle_class_head): Make error-recovery more robust.
4938 * friend.c (make_friend_class): Reject templated typename types.
4939 * lex.c (is_global): A template parameter isn't global.
4940 * parse.y (class_head): Robustify.
4941 * parse.c: Regenerated.
4943 1999-05-22 Mark Mitchell <mark@codesourcery.com>
4945 * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
4946 INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs.
4948 * cp-tree.h (push_nested_namespace): Declare.
4949 (pop_nested_namespace): Likewise.
4950 * decl.c (push_nested_namespace): New function.
4951 (pop_nested_namespace): Likewise.
4952 * pt.c (instantiate_class_template): Use them.
4954 * tree.c (mapcar): Handle NON_LVALUE_EXPR.
4956 * cp-tree.h (cplus_expand_constant): Declare.
4957 * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
4958 converted from one pointer-to-object type to another.
4959 * expr.c (cplus_expand_constant): Don't make it static.
4960 * typeck.c (build_component_ref): Don't crash when presented with
4961 a component which is a TEMPLATE_DECL.
4962 (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a
4963 cast from a pointer-to-member constant to its own type does not
4964 result in a valid non-type template argument.
4966 1999-05-21 Mark Mitchell <mark@codesourcery.com>
4967 Nathan Sidwell <nathan@acm.org>
4969 * Make-lang.in (cc1plus): Make it depend on gxx.gperf.
4970 * cp-tree.h: Fix typo in documentation on pointers-to-members.
4971 (cp_build_qualified_type): Make it a macro.
4972 (cp_build_qualified_type_real): Declare.
4973 * decl.c (grokdeclarator): Remove misleading comment. Avoid
4974 problem with template parameters and restrict-qualification.
4975 * gxx.gperf: Replace NORID with RID_UNUSED throughout.
4976 * hash.h: Regenerated.
4977 * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
4979 (NORID): Remove definition.
4980 * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
4981 (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs.
4982 (fn_type_unification): Check that the function type resulting from
4983 the deduction is legal.
4984 (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
4985 (unify): Use cp_build_qualified_type_real.
4986 * tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
4987 (cp_build_qualified_type): Rename to ...
4988 (cp_build_qualified_type_real): Add additional COMPLAIN parameter
4989 and modify appropriately.
4991 * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
4992 reveal optimization opportunities.
4994 * pt.c (tsubst): Don't issue error messages when we're not
4995 complaining, even if we see a qualified function type.
4996 (check_cv_quals_for_unify): Don't allow a qualified function
4999 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
5001 * class.c (instantiate_type): Downgrade errors for object-dependent
5002 memfn refs to pedwarn.
5004 1999-05-20 Mark Mitchell <mark@codesourcery.com>
5006 * decl.c (grokdeclarator): Don't treat [] as indicating a
5007 zero-sized array in a typedef.
5009 * call.c (build_object_call): Don't look at DECL_NAME for a type.
5010 (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
5011 (typeck.c): Or TYPE_MAIN_VARIANT for a type.
5013 * pt.c (for_each_template_parm): Rework to match documentation.
5014 Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
5016 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
5018 * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
5020 * class.c (finish_base_struct): Allow non-COM bases for COM classes
5021 except at the leftmost position.
5022 (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
5023 Pass the binfo's class, not the most derived, to skip_rtti_stuff.
5024 * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
5026 * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
5027 (build_cplus_new): Make sure that what we return is of the right type.
5029 1999-05-20 Mark Mitchell <mark@codesourcery.com>
5031 * cp-tree.h (make_ptrmem_cst): New function.
5032 * expr.c (cplus_expand_constant): Split out from ...
5033 (cplus_expand_expr): Here. Use cplus_expand_constant.
5034 (init_cplus_expand): Set lang_expand_constant.
5035 * pt.c (convert_nontype_argument): Use make_ptrmem_cst.
5037 * tree.c (make_ptrmem_cst): Define.
5038 * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
5039 * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.
5041 1999-05-19 Mark Mitchell <mark@codesourcery.com>
5043 * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
5045 * decl2.c (start_static_storage_duration_function): Fix comment.
5046 (finish_file): Create static storage duration functions lazily.
5048 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
5050 Implement anonymous structs.
5051 * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
5052 * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
5053 * class.c (finish_struct_1): Remove redundant check for anon struct.
5054 * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
5055 (check_tag_decl): Check for anonymous struct here.
5056 * decl2.c (build_anon_union_vars): Catch anon struct at file scope.
5057 * init.c (sort_member_init, emit_base_init): Handle getting fields
5058 as well as names in current_member_init_list.
5059 (perform_member_init): Handle getting an anon aggr.
5060 * method.c (do_build_assign_ref): Don't descend into anon aggrs.
5061 (do_build_copy_constructor): Likewise.
5063 1999-05-19 Mark Mitchell <mark@codesourcery.com>
5065 * tree.c (cp_build_qualified_type): Don't allow qualified function
5068 Wed May 19 02:50:53 1999 Arvind Sankar <arvinds@mit.edu>
5070 * gxxint.texi: Fix typo.
5072 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
5074 * call.c (find_scoped_type, resolve_scope_to_name): Lose.
5075 * class.c (finish_struct_1): Use CLASS_TYPE_P.
5076 * ptree.c (print_lang_type): Likewise.
5077 * typeck.c (build_modify_expr, c_expand_asm_operands): Use
5079 * typeck2.c (digest_init): Likewise.
5081 1999-05-18 Jason Merrill <jason@yorick.cygnus.com>
5083 * call.c (joust): Compare the types of the conv ops, not the
5084 target types of the conversions.
5086 Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
5088 * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
5091 1999-05-17 Mark Mitchell <mark@codesourcery.com>
5093 * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation.
5094 * decl.c (grokfndecl): Don't allow inline declarations of friend
5095 template specializations, or friend template specializations with
5097 * pt.c (tsubst): Handle substitution into array types that does
5098 not yield a fixed upper bound, even when not processing a
5100 (tsubst_copy): Deal with the fact that the second operand to a
5101 TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC.
5102 * search.c (marked_pushdecls_p): Don't descend into
5103 TEMPLATE_TYPE_PARMs and the like.
5104 (unmarked_pushdecls_p): Likewise.
5106 * call.c (build_over_call): Don't throw away
5107 initializations/copies of empty classes; use MODIFY_EXPR and
5108 INIT_EXPR as for non-empty classes.
5109 * class.c (finish_struct_1): Put the padding byte for an empty
5110 class on the TYPE_NONCOPIED_PARTS list for the class.
5112 1999-05-16 Mark Mitchell <mark@codesourcery.com>
5114 * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
5115 indicate a reference to a field that is a qualified name.
5117 1999-05-16 Jason Merrill <jason@yorick.cygnus.com>
5119 * decl2.c (finish_objects): Don't use .?tors.* if we don't have
5120 ASM_OUTPUT_CONSTRUCTOR.
5122 * friend.c (do_friend): Add attrlist arg. Remove support for
5123 getting a non-decl as 'decl'.
5124 * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or
5126 (grokdeclarator): Adjust.
5127 * cp-tree.h: Adjust.
5129 1999-05-16 Mark Mitchell <mark@codesourcery.com>
5131 * cp-tree.h (permanent_p): New function.
5132 * init.c (build_new_1): Use mapcar, not copy_node, to copy a
5133 possibly complex tree node.
5134 * tree.c (mapcar): Adjust comments, and follow coding standards in
5136 (permanent_p): New function.
5138 1999-05-13 Per Bothner <bothner@cygnus.com>
5140 * class.c (push_lang_context): Turn off DECL_IGNORED_P for
5141 primitive Java types, if we actually see `extern "Java"'.
5143 1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
5145 * lang-specs.h: Pass -$ to the preprocessor.
5147 1999-05-10 Jason Merrill <jason@yorick.cygnus.com>
5149 * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too.
5150 Don't bother wrapping an OFFSET_TYPE around unknown_type_node.
5151 (resolve_offset_ref): Don't handle a raw baselink.
5152 * cvt.c (build_expr_type_conversion): Likewise.
5153 * typeck.c (decay_conversion, build_c_cast, convert_for_assignment,
5154 convert_for_initialization): Likewise.
5155 * class.c (instantiate_type): Handle seeing a baselink under an
5157 * error.c (dump_expr): Likewise.
5158 * pt.c (for_each_template_parm): Likewise.
5159 (resolve_overloaded_unification): Likewise.
5160 * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise.
5161 * typeck.c (expr_sizeof): Also complain about other permutations
5162 of overloaded functions.
5164 1999-05-07 Jason Merrill <jason@yorick.cygnus.com>
5166 * init.c (resolve_offset_ref): Don't return a raw method.
5168 * typeck.c (decay_conversion): Don't handle a raw method.
5169 Resolve all OFFSET_REFs.
5170 (get_member_function_from_ptrfunc): 0 is a valid vtable index.
5171 (build_binary_op_nodefault): Handle resolving overloaded fns. Use
5172 same_type_p for pmf bits. Don't use build_binary_op to compare
5173 raw pointers to methods.
5174 (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE,
5175 to decide when to call resolve_offset_ref.
5176 (build_c_cast, convert_for_initialization): Likewise.
5177 * cvt.c (build_expr_type_conversion): Likewise.
5179 1999-05-06 Nathan Sidwell <nathan@acm.org>
5181 * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class.
5183 1999-05-05 Mark Mitchell <mark@codesourcery.com>
5185 * decl2.c (start_objects): Don't let static constructors and
5186 destructors get inlined.
5188 * parse.y (nested_name_specifier): Make sure ordinary types are
5189 complete, just like template types.
5190 * parse.c: Regenerated.
5192 * pt.c (check_explicit_specialization): Improve error messages.
5194 1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
5196 * typeck.c (string_conv_p): Use same_type_p to check whether we
5197 try to convert between char and wchar_t.
5199 1999-05-03 Mark Mitchell <mark@codesourcery.com>
5201 * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous
5202 lookup to error_mark_node here.
5203 (lookup_member): Revise documentation. Add comments. Don't set
5204 the TREE_TYPE to error_mark_node here, and don't build up an extra
5205 TREE_LIST for ambiguous lookups.
5206 (setup_class_bindings): Adjust accordingly.
5207 (push_class_decls): Revise out-of-date comments.
5209 * typeck.c (build_const_cast): Tighten checks for legality.
5211 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
5213 * init.c (build_member_call): Lookup names coming from
5214 namespace-scoped LOOKUP_EXPR.
5216 1999-05-03 Jim Blandy <jimb@zwingli.cygnus.com>
5218 * gxxint.texi: Add documentation for 'I'.
5220 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
5222 * tinfo.cc (operator==): Qualify type_info with std::.
5224 1999-05-02 Mark Mitchell <mark@codesourcery.com>
5226 * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy.
5227 (DECL_COMDAT): Remove definition.
5229 1999-05-01 Mark Mitchell <mark@codesourcery.com>
5231 * decl.c (wrapup_globals_for_namespace): Fix thinko in previous
5234 1999-04-30 Mark Mitchell <mark@codesourcery.com>
5236 * class.c (build_vtable): Use build_lang_decl when building
5237 vtables, not just build_decl.
5238 (prepare_fresh_vtable): Likewise.
5239 * decl.c (wrapup_globals_for_namespace): Mark vtables as
5240 DECL_EXTERNAL when calling wrapup_global_declarations.
5241 * decl2.c (priority_info_s): Add initializations_p and
5242 destructions_p members.
5243 (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED,
5244 when deciding what vtables to write out.
5245 (ssdf_decls): New variable.
5246 (ssdf_decls_used): Likewise.
5247 (start_static_storage_duration_function): Deal with being called
5248 multiple times. Avoid inlining this function.
5249 (generate_inits_for_priority): Deal with reuse of priority map.
5250 (get_priority_info): Clear initializations_p and destructions_p.
5251 (do_static_initialization): Tweak comment.
5252 (do_static_destruction): Likewise. Fix condition on sentries for
5254 (generate_ctor_or_dtor_function): Call all of the static storage
5256 (generate_ctor_or_dtor_function_for_priority): Check
5257 initializations_p and destructions_p to see what priorities need
5258 initialization functions.
5259 (finish_file): Rework to generate multiple static storage duration
5260 functions, rather than just one.
5262 * typeck.c (build_const_cast): Tweak last change to handle
5263 templates correctly.
5265 * typeck.c (build_const_cast): Disallow use of const_cast to
5266 anything but a pointer or reference type.
5268 1999-04-30 Nathan Sidwell <nathan@acm.org>
5270 * decl.c (cp_finish_decl): Don't permit arrays of abstract or
5273 1999-04-29 Mark Mitchell <mark@codesourcery.com>
5275 * decl2.c (do_static_destruction): Remove obsolete FIXME comment.
5276 (finish_file): Indent comments properly.
5278 1999-04-29 Richard Henderson <rth@cygnus.com>
5280 * decl2.c (do_static_initialization): Call do_pending_stack_adjust.
5281 (do_static_destruction): Likewise.
5283 1999-04-29 Nathan Sidwell <nathan@acm.org>
5285 * cp-tree.h (TYPE_NOTHROW_P): New macro.
5286 * decl2.c (delete_sanity): Warn on deleting void *.
5287 * init.c (build_new_1): Use TYPE_NOTHROW_P.
5288 * typeck.c (c_expand_return): cp_pedwarn on returning NULL from
5289 throwing operator new.
5291 1999-04-28 Nathan Sidwell <nathan@acm.org>
5293 * cp-tree.h (build_component_addr): Remove prototype.
5294 * typeck.c (build_component_addr): Make static. Remove MSG
5296 (build_component_addr): Remove MSG parameter, clean up
5298 (build_x_function_call): Use cp_error.
5299 (build_unary_op): Adjust call of build_component_addr.
5301 1999-04-28 Mark Mitchell <mark@codesourcery.com>
5303 * pt.c (tsubst_friend_class): Check for NULL.
5305 Wed Apr 28 11:42:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
5307 * search.c (binfo_for_vtable): Initialize bfvi.var.
5309 1999-04-27 Nathan Sidwell <nathan@acm.org>
5311 * rtti.c (build_x_typeid): Check rtti is enabled.
5313 1999-04-26 Mark Mitchell <mark@codesourcery.com>
5315 * search.c (is_subobject_of_p): Make sure we're looking at the
5318 1999-04-26 Marc Espie <espie@cvs.openbsd.org>
5320 * Make-lang.in (cplib2.ready): Don't depend on phony targets.
5322 1999-04-23 Mark Mitchell <mark@codesourcery.com>
5324 * decl2.c (finish_file): Tweak handling of extern inlines so that
5325 they are not unnecessarily put out.
5327 * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
5328 such as base classes.
5330 1999-04-22 Brendan Kehoe <brendan@cygnus.com>
5332 * tree.c (build_exception_variant): Fix typo: use the chain of U,
5333 not trying V, while cycling through U.
5335 1999-04-22 Mark Mitchell <mark@codesourcery.com>
5337 * cp-tree.h (lang_decl_flags): Remove returns_first_arg and
5338 preserves_first_arg. Enlarge dummy accordingly.
5339 (DECL_TINFO_FN_P): New macro.
5340 (SET_DECL_TINFO_FN_P): Likeiwse.
5341 (DECL_RETURNS_FIRST_ARG): Remove.
5342 (DECL_PRESERVES_THIS): Likewise.
5343 (DECL_INIT_PRIORITY): New macro.
5344 (finish_struct_1): Change prototype.
5345 (cat_namespace_levels): Remove prototype.
5346 (vtable_decl_p): New prototype.
5347 (vtype_decl_p): Likewise.
5348 (sigtable_decl_p): Likewise.
5349 (walk_globals_pred): New typedef.
5350 (walk_globals_fn): Likewise.
5351 (walk_globals): New prototype.
5352 (walk_namespaces_fn): New typedef.
5353 (walk_namespaces): New prototype.
5354 (wrapup_globals_for_namespace): Likewise.
5355 (walk_vtables): Remove prototype.
5356 (walk_sigtables): Likewise.
5357 (instantiate_pending_templates): New prototype.
5358 * class.c (finish_struct_1): Don't return a value.
5359 * decl.h (pending_statics): Remove declaration.
5360 * decl.c (walk_namespaces_r): New function.
5361 (walk_globals_r): Likewise.
5362 (vtable_decl_p): Likewise.
5363 (vtype_decl_p): Likewise.
5364 (sigtable_decl_p): Likewise.
5365 (walk_namespaces): Likewise.
5366 (walk_globals_data): New type.
5367 (walk_globals): New function.
5368 (wrapup_globals_for_namespace): Likewise.
5369 (expand_static_init): Remove assertion. Remove redundancy in
5370 conditional. Don't put static data members in static_aggregates
5372 (finish_function): Remove redundancy in conditional. Don't set
5373 DECL_RETURNS_FIRST_ARG.
5374 (cat_namespace_levels): Remove.
5375 * decl2.c: Include splay-tree.h and varray.h.
5376 (priority_info_s): New structure.
5377 (finish_vtable_vardecl): Change prototype. Adjust for new calling
5379 (prune_vtable_vardecl): Likewise.
5380 (finish_sigtable_vardecl): Likewise.
5381 (setup_initp): Remove.
5384 (start_static_storage_duration_function): New function.
5385 (generate_inits_for_priority): Likewise.
5386 (finish_static_storage_duration_function): Likewise.
5387 (get_priority_info): Likewise.
5388 (do_static_initialization): Likewise.
5389 (do_static_destruction): Likewise.
5390 (do_static_initialization_and_destruction): Likewise.
5391 (generate_ctor_or_dtor_function): Likewise.
5392 (generate_ctor_and_dtor_functions_for_priority): Likewise.
5393 (pending_statics): Make it a varray.
5394 (pending_statics_used): New variable.
5395 (saved_inlines): Make it a varray.
5396 (saved_inlines_used): New variable.
5397 (finish_static_data_member): Change method of updating
5399 (mark_inline_for_output): Remove #if 0'd code. Change method of
5400 updating saved_inlines.
5401 (walk_vtables): Remove.
5402 (walk_sigtables): Likewise.
5403 (import_export_decl): Use DECL_TINFO_FN_P.
5404 (pending_templates): Remove declaration.
5405 (maybe_templates): Likewise.
5406 (static_aggregates_initp): Likewise.
5407 (setup_initp): Likewise.
5408 (finish_objects): Simplify.
5409 (INITIALIZE_P_IDENTIFIER): New macro.
5410 (PRIORITY_IDENTIFIER): New macro.
5411 (SSDF_IDENTIFIER): New macro.
5412 (initialize_p_decl): New variable.
5413 (priority_decl): Likewise.
5414 (ssdf_decl): Likewise.
5415 (priority_info_map): Likewise.
5416 (finish_file): Recode output of static intializers and other
5417 file-scope finalization tasks.
5418 * error.c (OB_END_TEMPLATE_ID): New macro.
5419 (dump_type_real): Use it.
5420 (dump_decl): Likewise.
5421 (dump_function_name): Likewise.
5422 * lex.c (set_typedecl_interface_info): Adjust for new walk_globals
5424 (check_newline): Use walk_globals, not walk_vtables.
5425 * pt.c (pending_tempalte_expansions): Remove.
5426 (set_vardecl_interface_info): Likewise.
5427 (pending_templates): Make static.
5428 (maybe_templates): Likewise.
5429 (instantiate_class_template): Adjust call to finish_struct_1.
5430 (instantiate_pending_templates): New function.
5431 * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P.
5432 * tree.c (static_aggregates_initp): Remove.
5433 (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY
5435 * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h.
5437 * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes
5438 with the RTL code RETURN.
5439 * hash.h: Regenerated.
5440 * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD.
5441 * parse.y: Replace RETURN with RETURN_KEYWORD throughout.
5442 * parse.c: Regenerated.
5443 * pt.c: Include varray.h. Include rtl.h since varray.h requires
5445 (inline_parm_levels): New variable.
5446 (inline_parm_levels_used): Likewise.
5447 (maybe_begin_member_template_processing): Update them.
5448 (maybe_end_member_template_processing): Use them, rather than
5449 guessing how many levels to pop.
5451 * decl.c (make_typename_type): Tighten error-checking.
5453 1999-04-20 Mark Mitchell <mark@codesourcery.com>
5455 * cp-tree.h (build_binary_op): Remove unneeded parameter.
5456 * class.c (build_vrable_entry_ref): Adjust call to
5458 * decl.c (expand_static_init): Likewise.
5459 (grokdeclarator): Likewise.
5460 (finish_function): Likewise.
5461 * decl2.c (delete_sanity): Likewise.
5462 (do_dtors): Likewise.
5463 (do_ctors): Likewise.
5464 * error.c (dump_type_suffix): Likewise.
5465 * expr.c (cplus_expand_expr): Likewise.
5466 * init.c (resolve_offset_ref): Likewise.
5467 (build_new): Likewise.
5468 (build_new_1): Likewise.
5469 (build_vec_delete_1): Likewise.
5470 (expand_vec_init_catch_clause): Likewise.
5471 (build_delete): Likewise.
5472 * pt.c (tsubst): Likewise.
5473 * rtti.c (synthesize_tinfo_fn): Likewise.
5474 * search.c (expand_upcast_fixups): Likewise.
5475 (expand_direct_vtbls_init): Likewise.
5476 * typeck.c (get_member_function_from_ptrfunc): Likewise.
5477 (build_binary_op_nodefault): Likewise.
5478 (point_int_sum): Likewise.
5479 (pointer_diff): Likewise.
5480 (build_unary_op): Likewise.
5481 (build_modify_expr): Likewise.
5482 (get_delta_difference): Likewise.
5483 (build_ptrmemfunc): Likewise.
5484 (expand_ptrmemfunc_cst): Likewise.
5486 1999-04-20 Jason Merrill <jason@yorick.cygnus.com>
5488 * decl.c (grokfndecl): Always call cplus_decl_attributes.
5489 * decl2.c (grokfield): Pass attrlist to grokdeclarator.
5491 1999-04-19 Mark Mitchell <mark@codesourcery.com>
5493 * cp-tree.h (finish_static_data_member_decl): New function.
5494 * decl2.c (finish_static_data_member_decl): Split out from ...
5496 * pt.c (instantiate_class_template): Use it here instead of
5498 (tsubst_decl): Don't set DECL_ASSEMBLER_NAME;
5499 finish_static_data_member_decl will do that. Explicit set
5500 DECL_EXTERNAL to match non-template processing.
5502 1999-04-18 Mark Mitchell <mark@codesourcery.com>
5504 * cp-tree.h (finish_class_definition): Add parameter.
5505 * parse.y (structsp): Use it. Don't call pop_scope here.
5506 * parse.c: Regenerated.
5507 * semantics.c (finish_class_definition): Pop it here.
5509 1999-04-17 Mark Mitchell <mark@codesourcery.com>
5511 * decl.c (xref_tag): Revise handling of nested template
5513 * pt.c (check_explicit_specialization): Tweak handling of friend
5514 templates in template classes.
5515 (tsubst_friend_class): Handle friend declarations for nested
5516 member template classes.
5518 1999-04-16 Mark Mitchell <mark@codesourcery.com>
5520 * class.c (finish_struct): Remove unused variable.
5521 (pushclass): Likewise.
5522 (invalidate_class_lookup_cache): Likewise.
5523 * cp-tree.def (TYPENAME_TYPE): Improve documentation.
5524 * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME
5525 doesn't get obliterated.
5526 (make_typename_type): Handle template classes correctly.
5528 * cp-tree.h (TREE_NONLOCAL_FLAG): Remove.
5529 (storetags): Declare.
5530 * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG.
5531 (pushclass): Likewise. Use storetags to install tag declarations,
5533 (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG.
5534 * decl.c (storetags): Make it global.
5535 (push_class_binding): Set INHERITED_VALUE_BINDING_P for an
5536 implicit typename declaration.
5537 (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG.
5538 * method.c (hack_identifier): Likewise.
5539 * search.c (lookup_member): Likewise.
5541 * decl.c (warn_about_implicit_typename_lookup): New function.
5542 (lookup_name_real): Use it. Rework handling of implicit typename
5545 1999-04-15 Mark Mitchell <mark@codesourcery.com>
5547 * cp-tree.h (lookup_nested_field): Remove.
5548 * class.c (push_nested_class): Handle UNION_TYPEs.
5549 (pop_nested_class): Likewise.
5550 * decl.c (lookup_name_real): Don't call lookup_nested_field.
5551 (start_decl): Use push_nested_class, not just pushclass.
5552 (cp_finish_decl): Use pop_nested_class, not just popclass.
5553 * search.c (lookup_nested_field): Remove.
5555 * cp-tree.h (lang_type): Add documentation.
5556 * decl2.c (handle_class_head): Create template declarations here,
5558 * parse.y (class_head): Return whether or not we entered a new
5559 scope, as well as the type named.
5560 (named_class_head): Likewise.
5561 (named_complex_class_head_sans_basetype): Likewise.
5562 (structsp): Adjust accordingly. Pop scope when required.
5563 * parse.c: Regenerated.
5564 * pt.c (check_default_tmpl_args): Robustify.
5565 (redeclare_class_template): Likewise.
5566 (instantiate_class_template): An instantiation of an
5567 anonymous union is itself an anonymous union.
5568 * semantics.c (begin_class_definition): Don't create template
5571 1999-04-15 Jason Merrill <jason@yorick.cygnus.com>
5573 * parse.y (after_type_declarator_intern): New nonterminal.
5574 (after_type_declarator): Use it.
5575 (direct_after_type_declarator): Likewise. Move above
5576 nonnested_type to fix reduce/reduce conflict resolution.
5577 (declmods): Reducing from just 'attributes' has EMPTY precedence.
5578 * Makefile.in (CONFLICTS): Update.
5580 * decl.c (define_label): Downgrade error for jumping over a
5581 non-POD decl to pedwarn.
5583 1999-04-14 Mark Mitchell <mark@codesourcery.com>
5585 * cp-tree.h (popclass): Change declaration.
5586 (pop_nested_class): Likewise.
5587 (poplevel_class): Remove declaration.
5588 * call.c (convert_default_argument): Pass no arguments to
5590 * class.c (finish_struct_1): Likewise.
5591 (finish_struct): Likewise.
5592 (popclass): Remove argument. Simplify code accordingly.
5593 (pop_nested_class): Likewise.
5594 * decl.c (poplevel_class): Declare it here, and make it static.
5595 (poplevel): Handle class scopes.
5596 (poplevel_class): Don't take an rgument. Simplify.
5597 (pop_everything): Pass no arguments to pop_nested_class.
5598 (cp_finish_decl): Pass no arguments to popclass.
5599 (grokdeclarator): Pass no arguments to pop_nested_class.
5600 (finish_function): Likewise.
5601 * decl2.c (grokfield): Likewise.
5602 (pop_scope): Pass no arguments to popclass.
5603 * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
5604 * pt.c (instantiate_class_template): Move call to pushclass, and
5605 document. Pass no arguments to popclass.
5606 (regenerate_decl_from_template): Likewise.
5608 1999-04-14 Jason Merrill <jason@yorick.cygnus.com>
5610 * typeck.c (build_unary_op): Handle taking the address of a unique
5611 bound non-static member function.
5613 1999-04-13 Martin von Loewis <loewis@informatik.hu-berlin.de>
5615 * lang-options.h (-Wdeprecated): New flag.
5616 * decl2.c (warn_deprecated): New flag.
5617 (lang_decode_option): Deprecated this-is-variable,
5618 external-templates, alt-external-templates.
5619 Support -Wdeprecated.
5620 * errfn.c (cp_deprecated): New function.
5622 1999-04-13 Jason Merrill <jason@yorick.cygnus.com>
5624 * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
5625 of the decls themselves.
5627 * pt.c (tsubst_function_type): Copy attributes over.
5629 * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority
5631 * cp-tree.h: Add prototype.
5632 * decl.c (init_decl_processing): Set valid_lang_attribute.
5634 1999-04-13 Mark Mitchell <mark@codesourcery.com>
5636 * class.c (finish_struct_1): Look at the const-ness of the field's
5637 type, not the TREE_READONLY-ness of the declaration.
5638 * method.c (synthesize_method): Likewise.
5639 * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
5640 creating new declarations.
5642 1999-04-13 Mike Stump <mrs@wrs.com>
5644 * decl2.c (import_export_decl): Because vtables always reference
5645 virtual functions, even if they are inlined, don't allow
5646 -fno-implement-inlines to not emit them, instead, emit them with
5648 * decl.c (start_function): Likewise.
5650 1999-04-12 Jason Merrill <jason@yorick.cygnus.com>
5652 * cp-tree.h (struct lang_type): Add com_interface.
5653 (CLASSTYPE_COM_INTERFACE): New macro.
5654 * class.c (set_rtti_entry): COM interface classes have no RTTI
5655 entries in their vtables; adjust.
5656 (add_virtual_function, finish_base_struct, skip_rtti_stuff,
5657 modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
5658 finish_struct_1): Likewise.
5659 * decl2.c (mark_vtable_entries): Likewise.
5660 * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
5661 * search.c (get_abstract_virtuals_1, get_abstract_virtuals,
5662 expand_upcast_fixups): Likewise.
5663 * tree.c (debug_binfo): Likewise.
5665 * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
5666 * typeck.c (comptypes): If we get it, ignore attributes.
5667 * class.c (instantiate_type): Use BASELINK_P. Change complain
5668 parameter to flags; 2 means ignore attributes.
5669 * call.c (build_op_delete_call): Pass it.
5671 * decl.c (xref_tag): Only complain once about using a typedef-name
5672 with 'struct'. Downgrade to pedwarn.
5674 * decl.c (grokdeclarator): Allow [] syntax for zero-length array.
5676 * parse.y (absdcl_intern): New nonterminal.
5677 (absdcl, direct_abstract_declarator): Use it.
5679 * pt.c (lookup_template_class): Look through implict typename.
5681 1999-04-11 Mark Mitchell <mark@codesourcery.com>
5683 * friend.c (add_friend): Deal gracefully with error_mark_node.
5684 * method.c (build_overload_value): Handle pointers-to-members as
5685 template parameters.
5687 * decl.c (push_binding): Fix typo in comment.
5689 1999-04-10 Mark Mitchell <mark@codesourcery.com>
5691 * error.c (dump_type_real): If a typename is a template-id, put
5692 out the template arguments.
5693 (dump_expr): Handle TEMPLATE_ID_EXPR.
5694 * pt.c (lookup_template_class): Now that full arguments are
5695 available everywhere, remove code that tried to guess them.
5697 1999-04-09 Mark Mitchell <mark@codesourcery.com>
5699 * decl.c (make_typename_type): Complain if we don't find a type
5700 when trying to make a typename type for a non-template type.
5702 1999-04-09 Jason Merrill <jason@yorick.cygnus.com>
5704 * decl.c (start_decl): Pass attributes to grokdeclarator.
5705 (grokdeclarator): Handle attributes on constructor-syntax
5708 1999-04-08 Mark Mitchell <mark@codesourcery.com>
5710 * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands
5713 * search.c (template_self_reference_p): Tweak.
5715 1999-04-07 Mark Mitchell <mark@codesourcery.com>
5717 * init.c (build_offset_ref): Don't build yet another weird data
5718 structure to describe overloaded functions.
5720 1999-04-06 Mark Mitchell <mark@codesourcery.com>
5722 * cp-tree.h (BASELINK_P): New macro.
5723 (SET_BASELINK_P): Likewise.
5724 * init.c (build_member_call): Remove needless assignment in if
5726 * search.c (lookup_field_r): Fix handling when we are looking
5727 specifically for a type; these are not hidden by functions and
5729 (lookup_member): Use SET_BASELINK_P.
5730 * tree.c (is_overloaded_fn): Use BASELINK_P.
5731 (really_overloaed_fn): Likewise.
5732 (get_first_fn): Likewise.
5734 1999-04-05 Mark Mitchell <mark@codesourcery.com>
5736 * decl.c (lookup_name_current_level): Tweak, and improve
5739 * class.c (maybe_fixup_vptrs): Remove declaration.
5740 (build_class_init_list): Likewise.
5741 * decl.c (pushdecl_class_level): Call check_template_shadow here
5743 (push_class_level_binding): ... not here.
5744 * search.c (dfs_push_type_decls): Only avoid
5745 template-self-reference TYPE_DECLs if they are from base classes.
5747 1999-04-04 Mark Mitchell <mark@codesourcery.com>
5749 * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL
5752 1999-04-03 Jason Merrill <jason@yorick.cygnus.com>
5754 * class.c (maybe_fixup_vptrs, build_class_init_list): Lose.
5755 (finish_struct_1): Don't call build_class_init_list.
5757 1999-04-02 Mark Mitchell <mark@codesourcery.com>
5759 * tinfo.h (__class_type_info): Fix illegal declaration.
5761 * cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
5762 * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
5763 (IDENTIFIER_CLASS_VALUE): Improve documentation.
5764 (is_properly_derived_from): Declare.
5765 (invalidate_class_lookup_cache): Likewise.
5766 (maybe_maybe_note_name_used_in_class): Likewise.
5767 (note_name_declared_in_class): Likewise.
5768 (push_using_decl): Remove duplicate declaration.
5769 (id_in_current_class): Remove declaration.
5770 (push_class_binding): Change prototype.
5771 (clear_identitifer_class_values): Declare.
5772 * call.c (is_properly_derived_from): Make it global.
5773 (build_new_function_call): Be careful about updating candidates.
5774 (build_new_method_call): Handle COMPONENT_REFs. Don't crash when
5775 asked to make illegal calls.
5776 * class.c: Include splay-tree.h.
5777 (class_stack_node): Add names_used slot.
5778 (check_member_decl_is_same_in_complete_scope): Remove.
5779 (add_method): Fix comment. Push the declaration into class
5781 (finish_struct_1): When popping the class, pop the bindings too.
5782 Remove check for data member/function member conflict.
5783 (finish_struct): Remove calls to
5784 check_member_decl_is_same_in_complete_scope. Change calls to
5786 (pushclass): Clear names_used in the class stack entry.
5787 Use invalidate_class_lookup_cache to remove cached entries, rather
5788 than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE
5789 before entering a new class. Remove dead code. Don't mess with
5790 current_function_decl when pushing declarations.
5791 (invalidate_class_lookup_cache): New function, split out from ...
5792 (popclass): Here. Clean up names_used on our way out.
5793 (instantiate_type): Adjust.
5794 (build_self_reference): Don't push the declaration here.
5795 (maybe_note_name_used_in_class): New function.
5796 (note_name_declared_in_class): Likewise.
5797 * decl.c (add_binding): Change prototype.
5798 (find_class_binding_level): New function.
5799 (innermost_nonclass_level): Likewise.
5800 (current_binding_level): Update documentation.
5801 (inner_binding_level): Remove. Replace with current_binding_level
5803 (push_binding_level): Remove special handling of
5804 class_binding_level.
5805 (pop_binding_level): Likewise. Use find_class_binding_level.
5806 (suspend_binding_level): Likewise.
5807 (global_bindings_p): Use innermost_nonclass_level.
5808 (toplevel_bindings_p): Likewise.
5809 (namespace_bindings_p): Likewise.
5810 (pseudo_global_level_p): Likewise.
5811 (push_binding): Clear INHERITED_VALUE_BINDING_P.
5812 (add_binding): Check for illegal multiple declarations. Return a
5813 value indicating whether or not the new binding was legal.
5814 (push_local_binding): Skip over class binding levels. Check
5815 return value from add_binding.
5816 (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call
5817 note_name_declared_in_class.
5818 (pushlevel_class): Remove "fake out the rest of the compiler"
5820 (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
5821 (clear_identifier_class_values): New function.
5822 (pop_from_top_level): Use it.
5823 (pop_everything): Tweak.
5824 (maybe_process_template_type_declaration): Don't push the
5825 declaration for the template here.
5826 (pushtag): Don't push tag declarations into class scope here.
5827 (pushdecl): Apply DeMorgan's law for readability.
5828 (pushdecl_class_level): Remove special-case code for
5829 TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions.
5830 (push_class_level_bindng): Deal with inherited bindings.
5831 (lookup_name_real): Remove special-case code for
5832 TYPE_BEING_DEFINED, and some implicit typename magic.
5833 (grokdeclarator): Handle COMPONENT_REF for a template function.
5834 (build_enumerator): Don't call pushdecl_class_level here.
5835 (id_in_current_class): Remove.
5836 * decl2.c (grokfield): Don't call pushdecl_class_level or
5837 check_template_shadow.
5838 * errfn.c (cp_file_of): Don't declare.
5839 (cp_line_of): Likewise.
5840 * error.c (dump_decl): Handle an OVERLOAD.
5841 (cp_file_of): Likewise.
5842 (cp_line_of): Likewise.
5843 * init.c (build_member_call): Handle a COMPONENT_REF.
5844 * lex.c (do_identifier): Call maybe_note_name_used_in_class, not
5845 pushdecl_class_level.
5846 * method.c (hack_identifier): Build COMPONENT_REFs for references
5847 to member templates as well as member functions. Remove dead
5849 * parse.y (left_curly): Remove.
5850 (nonnested_type): Call maybe_note_name_used_in_class, not
5851 pushdecl_class_level.
5852 * parse.c: Regenerated.
5853 (nested_name_specifier_1): Likewise.
5854 * pt.c (check_explicit_specialization): Adjust, for robustness.
5855 (check_template_shadow): Handle OVERLOADs.
5856 (build_template_decl): Set DECL_CONSTRUCTOR_P on the
5857 TEMPLATE_DECL, if appropriate.
5858 * search.c (envelope_add_decl): Remove.
5859 (dfs_pushdecls): Likewise.
5860 (dfs_compress_decls): Likewise.
5861 (dfs_push_decls): New function.
5862 (dfs_push_type_decls): Likewise.
5863 (setup_class_bindings): Likewise.
5864 (template_self_reference_p): Likewise.
5865 (lookup_field_r): Use it.
5866 (looup_member): Remove old comment. Deal with ambiguity.
5867 (push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
5868 and remove envelope processing.
5869 * semantics.c (begin_class_definition): Let pushclass push
5870 declarations for base classes.
5871 (finish_member_declaration): Push declarations into class scope.
5872 * typeck.c (build_component_ref): Just put an OVERLOAD into the
5873 COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
5874 (build_x_function_call): Deal with OVERLOAD. Handle template-ids.
5875 * Makefile.in (class.o): Depend on splay-tree.h.
5877 Wed Mar 31 11:30:43 1999 Nathan Sidwell <nathan@acm.org>
5879 * cvt.c (convert_pointer_to_real): Use same_type_p.
5880 * typeck.c (comp_target_types): Use same_type_p.
5882 1999-03-31 Jason Merrill <jason@yorick.cygnus.com>
5884 * semantics.c (begin_inline_definitions,
5885 finish_inline_definitions): Rename from finish_default_args and
5886 begin_inline_definitions, respectively, to something that isn't a
5888 * parse.y (structsp): Adjust.
5890 * tree.c (hash_tree_cons): Remove obsolete via_* parms.
5891 (list_hash_lookup): Likewise.
5892 (hash_tree_chain): Adjust.
5893 * pt.c (tsubst): Adjust.
5894 (tsubst_arg_types): Use plain hash_tree_cons.
5895 * cp-tree.h (hash_tree_cons_simple): Lose.
5896 * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons.
5898 Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5900 * Makefile.in (hash.h): Generate using gperf language 'C', not
5901 'KR-C', so gperf uses the `const' keyword on strings.
5903 * gxx.gperf (resword): Const-ify a char*.
5905 1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
5907 * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
5908 CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
5909 CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
5910 CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
5911 CLASSTYPE_BINFO_AS_LIST): Remove cruft.
5912 * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
5915 1999-03-29 Jason Merrill <jason@yorick.cygnus.com>
5917 * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
5919 1999-03-28 Jason Merrill <jason@yorick.cygnus.com>
5921 * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops.
5923 1999-03-27 Mark Mitchell <mark@codesourcery.com>
5925 * cp-tree.h (add_friend): Declare.
5926 (add_friends): Likewise.
5927 * friend.c (add_friend): Make it global. Don't add to
5928 DECL_BEFRIENDING_CLASSES if the befriending class is a template.
5929 (add_friends): Make it global.
5930 (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
5931 befriending class is a template.
5932 * parse.y (component_decl_1): Fix typo in comment.
5933 * parse.c: Regenerated.
5934 * pt.c (instantiate_class_template): Use add_friend and
5935 add_friends rather that duplicating some of their functionality
5938 1999-03-27 Jason Merrill <jason@yorick.cygnus.com>
5940 * call.c (build_field_call): Unify 'this' and non-'this' cases.
5942 * typeck.c (build_indirect_ref): Check for 'this' sooner.
5944 Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5946 * call.c (op_error): Const-ify a char*.
5947 (add_candidate, source_type, add_warning): Add static prototype.
5948 (print_z_candidates): Const-ify a char*.
5950 * class.c (resolve_address_of_overloaded_function,
5951 fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
5952 (get_vtable_name, finish_struct_1): Const-ify a char*.
5954 * cvt.c (convert_to_reference): Likewise.
5956 * decl.c (redeclaration_error_message, record_builtin_type,
5957 record_unknown_type, member_function_or_else, bad_specifiers):
5959 (find_binding, select_decl, unqualified_namespace_lookup,
5960 lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
5961 Add static prototype.
5962 (warn_extern_redeclared_static, duplicate_decls, pushdecl,
5963 implicitly_declare, record_builtin_java_type, define_function,
5964 grok_op_properties, tag_name): Const-ify a char*.
5966 * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
5967 (define_function, finish_builtin_type): Const-ify a char*.
5968 (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
5969 cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
5970 (file_name_nondirectory): Const-ify a char*.
5971 (init_filename_times): Don't prototype.
5972 (compiler_error): Prototype.
5973 (yyerror, init_repo): Const-ify a char*.
5974 (build_srcloc): Don't prototype.
5975 (build_x_indirect_ref, build_indirect_ref, build_component_addr):
5977 (warn_for_assignment): Don't prototype.
5978 (convert_for_initialization, readonly_error, check_for_new_type,
5979 GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
5982 * decl2.c (acceptable_java_type, output_vtable_inherit,
5983 setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
5984 merge_functions, decl_namespace, validate_nonmember_using_decl,
5985 do_nonmember_using_decl): Add static prototype.
5986 (lang_f_options): Const-ify a char*.
5987 (finish_builtin_type): Likewise.
5988 (add_function, arg_assoc_namespace, arg_assoc_class): Add static
5991 * errfn.c: Include cp-tree.h.
5992 (cp_thing): Add static prototype.
5993 (compiler_error): Don't protoptype.
5994 (cp_compiler_error): Cast `compiler_error' to `errorfn' before
5995 passing it to `cp_thing'.
5997 * error.c (interesting_scope_p): Add static prototype.
5999 * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
6002 * init.c (compiler_error): Don't prototype.
6003 (member_init_ok_or_else): Const-ify a char*.
6004 (build_java_class_ref): Add static prototype.
6006 * lex.c (compiler_error): Don't prototype.
6007 (get_time_identifier, interface_strcmp, extend_token_buffer,
6008 handle_cp_pragma): Const-ify a char*.
6009 (is_global, init_filename_times): Add static prototype.
6010 (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
6011 (compiler_error): Change from fixed args to variable args.
6012 (yyerror): Const-ify a char*.
6014 * parse.y (cond_stmt_keyword): Const-ify a char*.
6015 (parse_decl): Add static prototype.
6017 * pt.c (template_args_equal, print_template_context): Likewise.
6018 (print_candidates, check_default_tmpl_args): Const-ify a char*.
6019 (instantiate_class_template): Likewise.
6021 * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
6023 * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
6024 expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
6026 * search.c (lookup_field_info, lookup_member): Likewise.
6027 (lookup_member): Cast the first argument of `bzero' to a PTR.
6029 * sig.c (compiler_error): Don't prototype.
6030 (build_signature_pointer_or_reference_nam): Const-ify a char*.
6031 (get_sigtable_name, build_member_function_pointer): Likewise.
6033 * tree.c (compiler_error): Don't prototype.
6034 (no_linkage_helper, build_srcloc): Add static prototype.
6035 (build_vbase_pointer_fields): Const-ify a char*.
6036 (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
6038 * typeck.c (compiler_error): Don't prototype.
6039 (convert_for_assignment): Const-ify a char*.
6040 (comp_cv_target_types): Add static prototype.
6041 (build_x_indirect_ref, build_indirect_ref, convert_arguments,
6042 build_component_addr, build_unary_op, convert_for_initialization):
6045 * typeck2.c (ack): Add static prototype and change from fixed args
6047 (readonly_error, check_for_new_type): Const-ify a char*.
6049 * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
6050 fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
6051 (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'.
6052 (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
6053 gen_assign, GNU_xref_member): Const-ify a char*.
6055 1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
6057 * gxxint.texi: Remove old discussion on copying virtual bases.
6059 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
6061 * Make-lang.in: Remove all references to g++.o/g++.c.
6062 Link g++ from gcc.o.
6064 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
6066 * decl2.c (comdat_linkage): Treat vtables like functions.
6068 1999-03-25 Mark Mitchell <mark@codesourcery.com>
6070 * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES.
6072 1999-03-25 Nathan Sidwell <nathan@acm.org>
6074 * decl.c (init_decl_processing): Add `signed' type as a synonym
6077 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
6079 * typeck.c (common_type): Handle cv-qual unification for pointers
6082 * decl.c (unqualified_namespace_lookup): Return error_mark_node
6084 (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
6085 * lex.c (do_identifier): If we got error_mark_node, call
6088 1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
6090 * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
6093 1999-03-24 Jason Merrill <jason@yorick.cygnus.com>
6095 * decl.c (lookup_name_real): Do nested field lookup regardless of
6098 1999-03-24 Mark Mitchell <mark@codesourcery.com>
6100 * cp-tree.h (lang_type): Remove has_assignment and
6101 has_real_assignment. Add befriending_classes.
6102 (TYPE_HAS_ASSIGNMENT): Remove.
6103 (TYPE_HAS_REAL_ASSIGNMENT): Likewise.
6104 (CLASSTYPE_BEFRIENDING_CLASSES): New macro.
6105 (lang_decl): Document.
6106 (DECL_BEFRIENDING_CLASSES): New macro.
6107 (FRIEND_NAME): Move declaration to more obvious location.
6108 (FRIEND_DECLS): Likewise.
6109 * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
6110 * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
6111 (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
6112 (grok_op_properties): Likewise.
6113 * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
6114 (add_friend): Likewise. Don't do weird things with assignment
6115 operators. Update DECL_BEFRIENDING_CLASSES.
6116 (add_friends): Don't do weird things with assignment operators.
6117 (make_friend_class): Likewise. Update
6118 CLASSTYPE_BEFRIENDING_CLASSES.
6119 * pt.c (instantiate_class_template): Don't set
6120 TYPE_HAS_ASSIGNMENT.
6121 (tsubst_copy): Substitute the TREE_TYPE for more unary
6123 * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
6124 * search.c (protected_accessible_p): New function.
6125 (friend_accessible_p): Likewise.
6126 (accessible_p): Use them.
6128 1999-03-23 Mark Mitchell <mark@codesourcery.com>
6130 * pt.c (convert_nontype_argument): Don't create things that aren't
6131 PTRMEM_CSTs when applying a qualification conversion to a
6134 1999-03-23 Mark Mitchell <mark@codesourcery.com>
6136 * Makefile.in (OBJS): Don't mention hash.o.
6137 (OBJDEPS): Likewise.
6139 1999-03-23 Jason Merrill <jason@yorick.cygnus.com>
6141 * decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
6142 * decl.c (expand_static_init): Make sure we don't add any after
6145 * decl.c (cp_finish_decl): Move intelligence about handling
6146 DECL_COMDAT for variables from here...
6147 * decl2.c (comdat_linkage): ...to here.
6148 (maybe_make_one_only): Tweak.
6149 (import_export_decl): Call comdat_linkage for variables, too.
6150 (finish_file): Handle template statics properly.
6152 1999-03-22 Mark Mitchell <mark@codesourcery.com>
6154 * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
6155 Document internals of pointer-to-member-functions.
6156 (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
6157 (PFN_FROM_PTRMEMFUNC): Likewise.
6158 (build_type_conversion): Remove unused parameter.
6159 (build_ptrmemfunc1): Declare.
6160 (expand_ptrmemfunc_cst): New function.
6161 (delta2_from_ptrmemfunc): Likewise.
6162 (pfn_from_ptrmemfunc): Likewise.
6163 * cvt.c (cp_convert_to_pointer): Remove unused parameter to
6164 build_type_conversion. Use TYPE_PTRMEM_P for readability.
6165 (convert_to_reference): Remove unused parameter to
6166 build_type_conversion.
6167 (ocp_convert): Likewise.
6168 (build_user_type_conversion): Likewise.
6169 * error.c (dump_expr): Handle NULL pointer-to-member functions.
6170 * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
6171 * method.c (build_overload_value): Don't go splitting CONSTRUCTORs
6172 open when handling pointer-to-member functions.
6173 * pt.c (convert_nontype_argument): Clean up error messages. Be
6174 more stringent with pointers-to-members.
6175 * typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
6176 (build_unary_op): Tidy ever-so-slightly.
6177 (build_conditional_expr): Remove extra parameter to
6178 build_type_conversion.
6179 (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
6181 (expand_ptrmemfunc_cst): Define.
6182 (delta2_from_ptrmemfunc): Likewise.
6183 (pfn_from_ptrmemfunc): Likewise.
6185 1999-03-19 Mark Mitchell <mark@codesourcery.com>
6187 * init.c (build_member_call): Handle template-id expressions
6189 * typeck.c (build_x_function_call): Likewise.
6191 1999-03-19 Chip Salzenberg <chip@perlsupport.com>
6193 * friend.c (make_friend_class): Avoid core dump when
6194 not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
6196 1999-03-18 Jason Merrill <jason@yorick.cygnus.com>
6198 * decl.c (start_function): Suppress normal linkage heuristics
6199 for #pragma interface under MULTIPLE_SYMBOL_SPACES.
6201 1999-03-19 Alexandre Oliva <oliva@dcc.unicamp.br>
6203 * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c.
6204 ($(srcdir)/cp/parse.c): Moved from ../Makefile.in.
6206 1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de>
6208 * parse.y (named_complex_class_head_sans_basetype):
6209 Do not push a scope for error_mark_node.
6210 (maybe_base_class_list): Likewise.
6212 * decl.c (start_decl): Check for error_mark_node as a type.
6213 Detected by g++.brendan/array-refs.C.
6214 (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C.
6215 (maybe_build_cleanup_1): Likewise. Detected by
6216 g++.jason/incomplete1.C.
6218 * tree.c (build_dummy_object): Use void_zero_node instead of the
6220 (is_dummy_object): Check for such a node.
6221 Detected by g++.bob/inherit1.C
6223 1999-03-16 Jason Merrill <jason@yorick.cygnus.com>
6225 * method.c (old_backref_index): Split out...
6226 (flush_repeats): From here. Rename back from try_old_backref.
6227 (build_mangled_name): Put back some old-style repeat handling.
6229 Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6231 * lex.c: Don't include setjmp.h.
6232 (parse_float): New static function.
6233 (pf_args): New struct.
6234 (real_yylex): Use them in call to `do_float_handler'.
6236 1999-03-15 Mark Mitchell <mark@markmitchell.com>
6238 * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
6239 * tree.c (layout_basetypes): Not here.
6240 * search.c (dfs_search): Remove; no longer used.
6242 1999-03-12 Mark Mitchell <mark@markmitchell.com>
6244 * decl2.c (validate_nonmember_using_decl): Issue sensible
6245 error-messages on bogus qualifiers.
6247 1999-03-14 Jason Merrill <jason@yorick.cygnus.com>
6249 * call.c (add_function_candidate): Fix uninitialized variable.
6251 * Makefile.in (search.o): Add dependency on varray.h.
6253 1999-03-13 Jason Merrill <jason@yorick.cygnus.com>
6255 * decl.c (duplicate_decls): Use same_type_p.
6256 * method.c (try_old_backref): Renamed from flush_repeats. Use
6257 same_type_p. Don't try to handle repeats. Return success.
6258 (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support
6259 calls from old-style code, too.
6260 (check_ktype): Use same_type_p.
6261 (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT.
6262 (build_qualified_name): Simplify logic.
6263 (process_overload_item): Strip typedefs and quals at the top.
6264 (build_mangled_name_for_type_with_Gcode): Remove call to
6265 type_canonical_variant.
6266 (build_mangled_name): Likewise. Remove support for old-style
6267 repeats, which have been disabled since 2.7.2. Don't mess with
6269 (build_decl_overload_real): Don't mess with TREE_USED.
6271 1999-03-13 Nathan Sidwell <nathan@acm.org>
6273 * error.c (cp_printers): Add 'F' escape character.
6274 (dump_type_real): Remove TREE_LIST (fnargs) printing.
6275 Functionality moved to dump_parameters.
6276 (dump_type_suffix): Use dump_parameters and dump_exception_spec.
6277 (dump_function_decl): Extend meaning of V parameter. Use
6278 dump_parameters and dump_exception_spec.
6279 (dump_parameters): New static function.
6280 (dump_exception_spec): New static function.
6281 (fndecl_as_string): Change argument semantics. Use
6282 dump_function_decl directly.
6284 * sig.c (build_signature_table_constructor): Use cp_error.
6286 1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de>
6288 * semantics.c (finish_switch_cond): Handle error cases gracefully.
6289 Detected by g++.law/enum5.C.
6291 * typeck.c (build_modify_expr): Check for errors after resolving
6292 offsets. Detected by g++.brendan/static1.C.
6294 * decl.c (complete_array_type): Ignore initial_value if it is an
6295 error. Detected by g++.benjamin/17930.C.
6297 * typeck2.c (process_init_constructor): Return error if one argument
6298 is in error. Detected by g++.benjamin/13478.C.
6300 1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
6302 * decl.c (select_decl): Allow class templates when we need types.
6303 * decl2.c (ambiguous_decl): Likewise.
6305 1999-03-12 Mark Mitchell <mark@markmitchell.com>
6307 * lex.c (do_identifier): Correct call to enforce_access.
6308 * search.c (accessible_p): Tweak comment.
6310 1999-03-10 Mark Mitchell <mark@markmitchell.com>
6312 * semantics.c (begin_class_definition): Call build_self_reference.
6313 (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
6315 * search.c (assert_canonical_unmarked): Fix typo in prototype.
6317 * search.c (dfs_canonical_queue): New function.
6318 (dfs_assert_unmarked_p): Likewise.
6319 (assert_canonical_unmarked): Likewise.
6320 (access_in_type): Use it.
6321 (accessible_p): Likewise. Walk the whole tree when umarking.
6323 * sig.c (build_signature_table_constructor): Use accessible_p
6324 instead of compute_access.
6326 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
6328 * call.c (add_builtin_candidates): Handle overloaded conversion ops.
6330 1999-03-09 Mark Mitchell <mark@markmitchell.com>
6332 * cp-tree.h (flag_access_control): Declare.
6333 (TREE_VIA_PPUBLIC): Document.
6334 (DECL_NONSTATIC_MEMBER_P): New macro.
6335 (enforce_access): Return an indication of whether or not access
6337 (build_self_reference): Change prototype.
6338 (compute_access): Replace with ...
6339 (accessible_p): New function.
6340 (dfs_walk): Change prototype.
6341 (dfs_unmark): Likewise.
6342 (markedp): Likewise.
6343 * call.c (enforce_access): Use accessible_p.
6344 * class.c (build_self_reference): Insert the declaration into the
6345 list of members for this type, and make it public.
6346 * decl.c (xref_basetypes): Avoid ill-timed recursion.
6347 * init.c (build_offset_ref): Use lookup_member, not three separate
6348 name-lookups. Call enforce_access rather than checking for
6349 illegal accesses here.
6350 (resolve_offset_ref): Likewise.
6351 * lex.c (do_identifier): Likewise.
6352 * method.c (hack_identifier): Likewise.
6353 * parse.y (self_reference): Remove.
6354 (opt_component_decl_list): Don't use it.
6355 * parse.c: Regenerated.
6356 * pt.c (print_candidates): Generalize to handle lists of
6357 overloaded functions.
6358 (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's
6360 (get_template_base): Use new calling convention for dfs_walk.
6361 * search.c: Include varray.h. Add prototypes.
6362 (dfs_walk): Accept a data pointer to pass to the work functions.
6363 All callers changed. All work functions changed.
6364 (breadth_first_search): Rename to bfs_walk, and make consistent
6366 (dfs_walk_real): New function.
6367 (canonical_binfo): New function.
6368 (context_for_name_lookup): Likewise.
6369 (shared_marked_p): Likewise.
6370 (shared_unmarked_p): Likewise.
6371 (lokup_field_queue_p): Likewise.
6372 (lookup_field_r): Generalize to handle both functions and fields.
6373 (lookup_field): Just call lookup_member.
6374 (lookup_fnfields): Likewise.
6375 (lookup_member): Move body of lookup_field here and generalize.
6376 (dfs_accessible_queue_p): Likewise.
6377 (dfs_accessible_p): Likewise.
6378 (dfs_access_in_type): Likewise.
6379 (access_in_type): Likewise.
6380 (compute_access): Remove, and replace with ...
6381 (accessible_p): New function.
6382 (vbase_types): Remove.
6383 (vbase_decl_ptr_intermediate): Likewise.
6384 (vbase_decl_ptr): Likewise.
6385 (vbase_init_result): Likewise.
6386 (closed_envelopes): Likewise.
6387 (bvtable): Likewise.
6389 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
6391 * call.c (add_function_candidate): Check for proper number of args
6392 before checking the validity of those args.
6394 1999-03-06 Jason Merrill <jason@yorick.cygnus.com>
6396 * cp-tree.h (struct lang_type): Add anon_union field.
6397 (ANON_UNION_TYPE_P): Use it instead of examining type.
6398 (SET_ANON_UNION_TYPE_P): New macro.
6399 * decl.c (check_tag_decl): Use it.
6401 * search.c (compute_access): Handle non-type contexts earlier, and
6404 * tree.c (build_exception_variant): Use copy_to_permanent.
6406 * decl2.c (setup_initp): Give statics with no priority the default
6408 (do_dtors, do_ctors, finish_file): Remove special handling of
6409 non-prioritized statics.
6411 1999-03-05 Mark Mitchell <mark@markmitchell.com>
6413 * cp-tree.h (ANON_UNION_TYPE_P): Robustify.
6414 * decl.c (make_typename_type): Don't issue an error if an
6415 immediate lookup fails; it migt be resolved later.
6416 * friend.c (is_friend): Add comment.
6417 * search.c (breadth_first_search): Add POSTFN and DATA
6418 parameters. Tidy. All callers changed.
6419 (lookup_field_queue_p): New function.
6420 (lookup_field_r): Likewise.
6421 (lookup_field_post): Likewise.
6422 (lookup_field): Use them, via breadth_first_search, instead of
6424 (compute_access): Robustify.
6425 (lookup_fnfield_info): New structure.
6427 1999-03-05 Jason Merrill <jason@yorick.cygnus.com>
6429 * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again.
6431 1999-03-03 Jason Merrill <jason@yorick.cygnus.com>
6433 * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
6436 * decl2.c (import_export_class): Also return if
6437 CLASSTYPE_INTERFACE_ONLY is set.
6439 1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de>
6441 * decl.c (push_overloaded_decl): Only overwrite the old binding if
6443 * decl2.c (do_local_using_decl): Fix loop termination.
6445 1999-03-02 Mark Mitchell <mark@markmitchell.com>
6447 * cp-tree.h (determine_specialization): Don't declare.
6448 * pt.c (determine_specialization): Make it static. Eliminate
6449 complain parameter. Note that decl is always non-NULL now, and
6450 simplify accordingly.
6452 * decl.c (maybe_push_to_top_level): Always call
6453 push_cp_function_context.
6454 (pop_from_top_level): Always call pop_cp_function_context.
6456 1999-02-26 Nathan Sidwell <nathan@acm.org>
6458 * typeck.c (complete_type_or_else): Add VALUE arg, for helpful
6460 * cp-tree.h (complete_type_or_else): Added VALUE parameter.
6461 * init.c (build_new_1): Extra arg to complete_type_or_else.
6462 (build_delete): Likewise.
6463 * typeck.c (require_complete_type): Likewise.
6464 (pointer_int_sum): Likewise.
6465 (pointer_diff): Likewise.
6466 (build_component_ref): Likewise.
6468 * typeck2.c (incomplete_type_error): Always use cp_error.
6469 Show declaration of undefined type, if appropriate.
6470 Deal with UNKNOWN_TYPE nodes.
6472 * typeck.c (require_complete_type): Use TYPE_SIZE as
6473 size_zero_node to mean incomplete type.
6474 (require_complete_type_in_void): New function.
6475 (build_compound_expr): Call complete_type_in_void for LHS.
6476 (build_c_cast): Call complete_type_in_void for void cast.
6477 * cvt.c (ocp_convert): Call complete_type_in_void for void cast.
6478 * decl.c (cplus_expand_expr_stmt): Void expression checks moved to
6479 require_complete_type_in_void. Call it.
6480 * cp-tree.h (require_complete_type_in_void): Prototype new function.
6482 * typeck.c (convert_arguments): Use alternative format for
6483 function decls. Don't require_complete_type here. Simplify
6484 diagnostic printing.
6485 (convert_for_initialization): Don't require_complete_type on RHS yet.
6486 * call.c (convert_arg_to_ellipsis): Call require_complete_type.
6488 * call.c (build_over_call): Cope with qualified void return type.
6489 * semantics.c (finish_call_expr): Likewise.
6490 * typeck.c (build_function_call_real): Likewise.
6491 (c_expand_return): Likewise.
6492 * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
6494 * call.c (print_z_candidates): Use alternate print format, to be
6495 consistent with (pt.c) print_candidates.
6496 * method.c (hack_identifier): List candidate members.
6497 * search.c (lookup_field): Build ambiguous list, and show it, if
6500 1999-02-26 Mark Mitchell <mark@markmitchell.com>
6502 * typeck.c (decay_conversion): Don't confuse constant array
6503 variables with their initializers.
6505 * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when
6507 * pt.c (regenerate_decl_from_template): Tweak for clarity.
6508 (instantiate_decl): Mark a decl instantiated before regenerating
6509 it to avoid recursion.
6510 * tree.c (mapcar): Don't call decl_constant_value unless we know
6511 something is TREE_READONLY_DECL_P.
6513 * class.c (check_for_override): Don't stop checking when we find
6514 the first overridden function. Delete #if 0'd code.
6515 * search.c (get_matching_virtual): Likewise.
6517 1999-02-25 Richard Henderson <rth@cygnus.com>
6519 * lang-specs.h: Define __FAST_MATH__ when appropriate.
6521 1999-02-24 Mike Stump <mrs@wrs.com>
6523 * typeck.c (convert_for_assignment): Allow boolean integral constant
6524 expressions to convert to null pointer.
6526 1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
6528 * decl.c (lookup_namespace_name): Resolve namespace aliases.
6530 * class.c (push_nested_class): Allow namespaces.
6532 * decl2.c (set_decl_namespace): Add friendp parameter.
6533 * decl.c (grokfndecl): Pass it.
6534 (grokvardecl): Likewise.
6535 * cp-tree.h: Change declaration.
6537 1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
6539 * pt.c (tsubst): Allow an array of explicit size zero.
6541 1999-02-23 Jason Merrill <jason@yorick.cygnus.com>
6543 * errfn.c: Change varargs code to look like toplev.c.
6545 * method.c (process_modifiers): Don't prepend 'U' for char or
6548 1999-02-20 Craig Burley <craig@jcb-sc.com>
6550 * Make-lang.in (cplib2.ready): Don't consider updating
6551 cplib2 stuff if the current directory isn't writable, as
6552 it won't work (such as during a `make install').
6554 Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
6556 * decl2.c (start_objects): Make file scope constructors and
6557 destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
6558 ASM_OUTPUT_DESTRUCTOR are defined.
6560 1999-02-19 Mark Mitchell <mark@markmitchell.com>
6562 * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
6563 (fn_type_unification): Adjust prototype.
6564 (lookup_fnfields_1): Declare.
6565 * call.c (add_template_candidate_real): Adjust call to
6566 fn_type_unification.
6567 * class.c (add_method): Don't allow duplicate declarations of
6568 constructors or destructors.
6569 (resolve_address_of_overloaded_function): Remove unused variable.
6570 Adjust call to fn_type_unification.
6571 * decl.c (grokfndecl): Be more robust in the face of illegal
6573 * decl2.c (check_classfn): Remove hokey handling of member
6575 * pt.c (determine_specialization): Improve comments. Adjust to
6576 handle template argument deduction as per the standard.
6577 (check_explicit_specialization): Fix comment spacing. Handle
6578 type-conversion operators correctly. Improve error-recovery.
6579 (fn_type_unification): Remove EXTRA_FN_ARG parameter.
6580 (get_bindings_real): Simplify handling of static members.
6581 * search.c (lookup_fnfields_1): Make it have external linkage.
6582 * typeck.c (compparms): Fix comment.
6583 (build_unary_op): Don't try to figure out which template
6584 specialization is being referred to when when the address-of
6585 operator is used with a template function.
6587 Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6589 * cp-tree.h (lvalue_or_else): Qualify a char* with the `const'
6590 keyword to match an analogous change at the top level.
6592 * tree.c (lvalue_or_else): Likewise.
6594 1999-02-17 Mark Mitchell <mark@markmitchell.com>
6596 * decl.c (xref_basetypes): Comment.
6597 * pt.c (instantiate_class_template): Use xref_basetypes.
6599 1999-02-16 Mark Mitchell <mark@markmitchell.com>
6601 * cp-tree.h (tsubst): Change prototype.
6602 (tsubst_expr): Likewise.
6603 (tsubst_copy): Likewise.
6604 (type_unification): Remove prototype.
6605 * call.c (convert_default_arg): Adjust call to tsubst_expr.
6606 * class.c (resolve_address_of_overloaded_function): Just use
6607 fn_type_unification.
6608 * decl.c (grokdeclarator): Adjust call to tsubst.
6609 * method.c (build_template_parm_names): Likewise.
6610 * pt.c (GTB_VIA_VIRTUAL): New macro.
6611 (GTB_IGNORE_TYPE): Likewise.
6612 (resolve_overloaded_unification): Add `complain' parameter.
6613 (try_one_overload): Likewise.
6614 (tsubst_template_arg_vector): Likewise.
6615 (tsubst_template_parms): Likewise.
6616 (tsubst_aggr_type): Likewise.
6617 (tsubst_arg_types): Likewise.
6618 (tsubst_call_declarator_parms): Likewise.
6619 (unify): Remove explicit_mask.
6620 (type_unification_real): Likewise.
6621 (get_template_base_recursive): Likewise.
6622 (coerce_template_template_parms): Provide prototype.
6623 (tsubst_function_type): Likewise.
6624 (try_class_unification): New function.
6625 All callers changed to use new complain parameter.
6626 (get_template_base): Use try_class_unification.
6627 (unify): Adjust handling of classes derived from template types.
6628 (fn_type_unification): Substitute explicit arguments before
6631 1999-02-16 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6633 * decl.c (pushdecl): Remove dead code.
6635 1999-02-16 Jason Merrill <jason@yorick.cygnus.com>
6637 * decl2.c (finish_objects): Fix code I missed in previous change.
6639 1999-02-13 Jason Merrill <jason@yorick.cygnus.com>
6641 * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
6642 (grokdeclarator): Don't expect error_mark_node from grokfndecl.
6644 * pt.c (maybe_process_partial_specialization): Complain about
6645 'template <>' on non-specialization.
6647 1999-02-10 Jason Merrill <jason@yorick.cygnus.com>
6649 * decl.c (grokdeclarator): Catch wierd declarators.
6650 * decl2.c (finish_file): Don't abort because of namespace parsing
6652 (check_decl_namespace): Remove.
6654 1999-02-09 Mark Mitchell <mark@markmitchell.com>
6656 * cp-tree.h (get_template_base): Don't declare.
6657 (dfs_walk): Declare.
6658 (dfs_unmark): Likewise.
6659 (markedp): Likewise.
6660 * pt.c (unify): Remove duplicate declaration. Pass tparms and
6661 targs to get_template_base.
6662 (get_template_base_recursive): Move here from search.c. Check to
6663 see that the base found can be instantiated to form the desired
6665 (get_template_base): Likewise.
6666 (get_class_bindings): Simplify.
6667 * search.c (get_template_base_recursive): Move to pt.c.
6668 (get_template_base): Likewise.
6669 (markedp): Make it global.
6670 (dfs_walk): Likewise.
6671 (dfs_unmark): Likewise.
6673 1999-02-07 Jason Merrill <jason@yorick.cygnus.com>
6675 * pt.c (maybe_process_partial_specialization): Complain about
6676 specialization in wrong namespace.
6677 * tree.c (decl_namespace_context): New fn.
6679 1999-02-06 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6681 * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
6682 * pt.c (coerce_template_template_parms): Handle nested
6683 template template parameters.
6685 Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com)
6687 * typeck2.c: Update email addresses.
6689 1999-02-04 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6691 * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag
6694 1999-02-04 Jason Merrill <jason@yorick.cygnus.com>
6696 * lex.c (retrofit_lang_decl): Split out...
6697 (build_lang_decl): From here.
6698 * decl.c (pushdecl): Call it for functions generated by the middle
6699 end that don't have DECL_LANG_SPECIFIC.
6700 * cp-tree.h: Declare it.
6702 * decl2.c: Remove flag_init_priority. Always enable initp stuff.
6703 (start_objects, finish_objects): Only use special
6704 init_priority code if the user specified a priority.
6705 (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
6708 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
6710 * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and
6711 mkstemp.o. Get them from libiberty now.
6712 (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o.
6714 Tue Feb 2 22:38:48 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
6716 * decl2.c (lang_decode_option): Use read_integral_parameter.
6718 1999-02-01 Mark Mitchell <mark@markmitchell.com>
6720 * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
6721 before calling complete_type_or_else.
6723 Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6725 * input.c (inline): Don't define, its handled by system.h.
6727 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
6729 * decl2.c: Don't define flag_no_ident here. Don't process
6731 * cp-tree.h: Don't declare flag_no_ident here.
6732 * lang-specs.h: Map -Qn to -fno-ident.
6734 1999-01-28 Jason Merrill <jason@yorick.cygnus.com>
6736 * cp-tree.h (struct tree_binding): Replace scope field with a union.
6737 (BINDING_SCOPE): Adjust.
6738 * decl.c (BINDING_LEVEL): Adjust.
6740 1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
6742 * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
6745 * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
6748 * tree.c (equal_functions): Fix name in prototype.
6750 * decl.c (push_local_binding): Add FLAGS argument.
6751 (pushdecl, push_overloaded_decl): Pass it.
6752 * decl2.c (do_local_using_decl): Likewise.
6753 * cp-tree.h: Adjust prototype.
6754 * decl.c (poplevel): Fix logic.
6756 * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
6757 (poplevel): Handle that. Fix logic for removing TREE_LISTs.
6758 (cat_namespace_levels): Don't loop forever.
6760 1999-01-25 Richard Henderson <rth@cygnus.com>
6762 * typeck.c (build_reinterpret_cast): Fix typo in duplicated test.
6764 1999-01-25 Jason Merrill <jason@yorick.cygnus.com>
6766 * class.c (resolve_address_of_overloaded_function): Mark the
6767 chosen function used.
6769 * call.c (build_call): Make sure that a function coming in has
6770 been marked used already.
6771 * decl.c (expand_static_init): Call mark_used instead of
6773 * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
6774 alloc_eh_object, expand_throw): Likewise.
6775 * init.c (build_builtin_delete_call): Likewise.
6776 * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
6777 expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
6778 expand_generic_desc): Likewise.
6780 1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
6782 * tree.c (equal_functions): New function.
6783 (ovl_member): Call it.
6785 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6787 * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf.
6789 1999-01-25 Martin von Loewis <loewis@informatik.hu-berlin.de>
6791 * decl.c (decls_match): Return 1 if old and new are identical.
6792 (push_overloaded_decl): Set OVL_USED when PUSH_USING.
6794 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6796 * decl.c (start_function): Make member functions one_only on windows.
6797 * decl2.c (import_export_decl): Likewise.
6799 * decl.c (grokdeclarator): Don't complain about implicit int in
6800 a system header. Change same-name field check to not complain in
6801 a system header instead of within extern "C".
6803 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6805 * cp-tree.h (PUSH_GLOBAL): New macro.
6806 (PUSH_LOCAL): Likewise.
6807 (PUSH_USING): Likewise.
6808 (namespace_bindings_p): Declare.
6809 (push_overloaded_decl): Likewise.
6810 * decl.c (push_overloaded_decl): Don't make it static. Check for
6811 illegal declarations after using declarations here.
6812 (namespace_bindings_p): Likewise.
6813 (duplicate_decls): Don't consider declarations from different
6814 namespaces to be the same.
6815 (pushdecl): Use symbolic PUSH_ constants in calls to
6816 push_overloaded_decl.
6817 (push_overloaded_decl_1): Likewise.
6818 * decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
6819 (do_nonmember_using_decl): Check for illegal using declarations
6820 after ordinary declarations here.
6821 (do_local_using_decl): Call pushdecl to insert declarations.
6823 1999-01-21 Jason Merrill <jason@yorick.cygnus.com>
6825 * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo.
6827 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6829 * tree.c (build_cplus_array_type_1): Don't call build_array_type
6830 for types involving template parameters.
6832 * cp-tree.h (PARM_DECL_EXPR): Delete.
6833 (convert_default_arg): Change prototype.
6834 (check_default_argument): Declare.
6835 (search_tree): Likewise.
6836 * call.c (convert_default_arg): Take the function to which the
6837 default argument belongs as a parameter, and do any necessary
6838 instantiation here, instead of ...
6839 (build_over_call): Here.
6840 * decl.c (local_variable_p): New function.
6841 (check_default_argument): Likewise, split out and tidied from ...
6843 * error.c (dump_expr): Don't set PARM_DECL_EXPR.
6844 * pt.c (tsubst_call_declarator_parms): New function.
6845 (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing
6846 with CALL_EXPRs, rather than trying to be clever.
6847 (tsubst): Use tsubst_call_declarator_parms.
6848 * tree.c (search_tree): Don't make it static.
6849 * typeck.c (convert_arguments): Use new interface to
6850 convert_default_arg.
6852 1999-01-20 Mark Mitchell <mark@markmitchell.com>
6854 * error.c (dump_function_decl): Don't print the argument types for
6855 a function when the verbosity level is negative.
6857 * call.c (build_over_call): Check format attributes at call-time.
6859 * pt.c (tsubst_copy): Fix comment.
6860 (unify): Don't allow unification with variable-sized arrays.
6862 * semantics.c (finish_stmt_expr): When processing a template make
6863 the BIND_EXPR long-lived.
6865 1999-01-19 Jason Merrill <jason@yorick.cygnus.com>
6867 * decl2.c (finish_vtable_vardecl): Make vtables comdat here.
6868 (import_export_vtable): Not here.
6870 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6872 * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique
6873 non-static member function.
6875 1999-01-18 Nathan Sidwell <nathan@acm.org>
6877 * class.c (instantiate_type): Only diagnose illegal address of member
6878 function if complaining.
6880 * decl.c (lookup_name_real): Remove duplicate code.
6882 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6884 * tree.c (copy_template_template_parm): Use permanent_obstack.
6886 1999-01-18 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6888 * pt.c (unify): Remove restrictions on deduction of argument
6889 of template template parameters.
6891 1999-01-18 Nathan Sidwell <nathan@acm.org>
6893 * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
6895 * class.c (resolve_address_of_overloaded_function): Show list of
6896 all candidates, when none of them match.
6898 1999-01-18 Chip Salzenberg <chip@perlsupport.com>
6900 * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
6901 definition of 'casting away const' in reinterpret_cast<>.
6903 1999-01-18 Graham <grahams@rcp.co.uk>
6905 * cvt.c: Add include for decl.h, remove extern for
6906 static_aggregates which is now provided by decl.h.
6908 * Makefile.in (cvt.o): Add dependency for decl.h and missing
6909 dependencies for convert.h and flags.h.
6911 1999-01-18 Nathan Sidwell <nathan@acm.org>
6913 * decl2.c (do_dtors): Set current location to that of the
6914 decl, for sensible diagnostics and debugging.
6915 (check_classfn): Issue `incomplete type' error, if
6916 class is not defined.
6918 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6920 * cp-tree.h: Add prototype for bound_pmf_p.
6922 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6923 Manfred Hollstein <manfred@s-direktnet.de>
6925 * decl.c (grokdeclarator): Don't make 'main(){}' an error with only
6928 1999-01-16 Nathan Sidwell <nathan@acm.org>
6930 * cp-tree.h (struct lang_type): Added has_mutable flag.
6931 (CLASSTYPE_HAS_MUTABLE): New macro to access it.
6932 (TYPE_HAS_MUTABLE_P): New macro to read it.
6933 (cp_has_mutable_p): Prototype for new function.
6934 * class.c (finish_struct_1): Set has_mutable from members.
6935 * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if
6936 it contains a mutable.
6937 * typeck.c (cp_has_mutable_p): New function.
6939 1999-01-15 Mark Mitchell <mark@markmitchell.com>
6941 * pt.c (process_template_parm): Ignore top-level qualifiers on
6942 non-type parameters.
6944 * decl.c (start_function): Use current_function_parms in the call
6945 to require_complete_type_for_parms, not the probably empty
6948 1999-01-14 Jason Merrill <jason@yorick.cygnus.com>
6950 * semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
6952 * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
6953 that we don't suppress the other copies.
6954 * lex.c (handle_cp_pragma): Likewise.
6956 1999-01-13 Mark Mitchell <mark@markmitchell.com>
6958 * decl.c (grokdeclarator): Undo 1998-12-14 change.
6959 * tree.c (build_cplus_array_type_1): Likewise.
6960 * pt.c (instantiate_class_template): Remove misleading comment.
6961 (tsubst_aggr_type): Substitute if there are template parameters,
6962 regardless of whether or not they use template arguments.
6963 (unify): Likewise, but for unification.
6965 1999-01-12 Richard Henderson <rth@cygnus.com>
6967 * cp-tree.h (flag_permissive): Declare extern.
6969 1999-01-06 Mark Mitchell <mark@markmitchell.com>
6971 * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT
6973 (lang_type): Add is_partial_instantiation. Decrease width of
6975 (PARTIAL_INSTANTIATION_P): New macro.
6976 (OPERATOR_TYPENAME_P): Remove.
6977 * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not
6978 OPERATOR_TYPENAME_P.
6979 (grok_op_properties): Likewise.
6980 * friend.c (do_friend): Handle friends that are member functions
6982 * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT.
6983 * pt.c (instantiate_class_template): Rework for clarity. Avoid
6984 leaving TYPE_BEING_DEFINED set in obscure cases. Don't do
6985 any more partial instantiation than is absolutely necessary for
6986 implicit typename. Set PARTIAL_INSTANTIATION_P.
6987 (tsubst_decl): Use IDENTIFIER_TYPENAME_P.
6988 * semantics.c (begin_class_definition): Handle partial
6989 specializations of a type that was previously partially
6992 Wed Jan 6 03:18:53 1999 Mark Elbrecht <snowball3@usa.net.
6994 * g++spec.c (LIBSTDCXX): Provide default definition.
6995 (lang_specific_driver): Use LIBSTDCXX instead of "-lstdc++".
6997 Tue Jan 5 22:11:25 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6999 * Make-lang.in (g++.o): Depend on prefix.h.
7001 1999-01-04 Jason Merrill <jason@yorick.cygnus.com>
7003 * tree.c (bound_pmf_p): New fn.
7004 * typeck.c (build_c_cast): Use it.
7006 * decl.c (grok_op_properties): Use same_type_p.
7008 Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7010 * Makefile.in (cvt.o): Depend on toplev.h.
7012 * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes.
7014 * cvt.c: Include toplev.h.
7016 * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and
7019 * init.c (expand_vec_init): Initialize variable `itype'.
7021 * lex.c (yyerror): Cast the argument passed to a ctype function to
7024 * method.c (build_mangled_C9x_name): Wrap prototype and definition
7025 in "HOST_BITS_PER_WIDE_INT >= 64".
7027 * typeck.c (build_binary_op): Mark parameter `convert_p' with
7030 1998-12-22 Mark Mitchell <mark@markmitchell.com>
7032 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
7033 * tree.c (build_exception_variant): Don't crash on empty throw
7036 1998-12-18 DJ Delorie <dj@cygnus.com>
7038 * cvt.c (convert_to_reference): Check for both error_mark_node
7039 and NULL_NODE after call to convert_for_initialization.
7041 1998-12-17 Jason Merrill <jason@yorick.cygnus.com>
7043 * error.c (interesting_scope_p): New fn.
7044 (dump_simple_decl): Use it.
7045 (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
7046 (dump_expr, case OFFSET_REF): Print ->* if appropriate.
7048 1998-12-16 Mark Mitchell <mark@markmitchell.com>
7050 * class.c (resolve_address_of_overloaded_function): Do conversion
7051 to correct type here, rather than ...
7052 (instantiate_type): Here.
7054 * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
7055 (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
7056 (decl_template_parm_p): Remove.
7057 * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
7059 * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
7060 * pt.c (push_inline_template_parms_recursive): Set it.
7061 (decl_template_parm_p): Remove.
7062 (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
7063 (process_template_parm): Set it.
7065 Wed Dec 16 16:33:58 1998 Dave Brolley <brolley@cygnus.com>
7067 * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
7068 if configured with cpplib.
7070 1998-12-15 Mark Mitchell <mark@markmitchell.com>
7072 * decl.c (poplevel): Make sure ns_binding is initialized.
7074 * decl.c (finish_function): Undo inadvertent change in previous
7077 1998-12-14 Mark Mitchell <mark@markmitchell.com>
7079 * class.c (pushclass): Tweak handling of class-level bindings.
7080 (resolve_address_of_overloaded_function): Update pointer-to-member
7082 (instantiate_type): Likewise.
7083 * cvt.c (cp_convert_to_pointer): Likewise.
7084 * decl.c (pop_binding): Take the DECL to pop, not just the name.
7085 Deal with `struct stat' hack.
7086 (binding_level): Add to documentation.
7087 (push_binding): Clear BINDING_TYPE.
7088 (add_binding): New function.
7089 (push_local_binding): Use it.
7090 (push_class_binding): Likewise.
7091 (poplevel): Adjust calls to pop_binding.
7092 (poplevel_class): Likewise.
7093 (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
7094 declarations to current binding level.
7095 (push_class_level_binding): Likewise.
7096 (push_overloaded_decl): Adjust handling of OVERLOADs in local
7098 (lookup_namespace_name): Don't crash when confronted with a
7100 (lookup_name_real): Do `struct stat' hack in local binding
7102 (build_ptrmemfunc_type): Adjust documentation.
7103 (grokdeclarator): Don't avoid building real array types when
7104 processing templates unless really necessary.
7105 (finish_method): Adjust calls to pop_binding.
7106 * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
7107 not reparse_decl_as_expr.
7108 (build_expr_from_tree): Deal with a template-id as the function to
7109 call in a METHOD_CALL_EXPR.
7110 * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
7111 (maybe_adjust_types_For_deduction): Don't do peculiar things with
7113 (resolve_overloaded_unification): Handle COMPONENT_REFs. Build
7114 pointer-to-member types where necessary.
7115 * tree.c (build_cplus_array_type_1): Don't avoid building real
7116 array types when processing templates unless really necessary.
7117 (build_exception_variant): Compare the exception lists correctly.
7119 1998-12-13 Mark Mitchell <mark@markmitchell.com>
7121 * cp-tree.def (CPLUS_BINDING): Update documentation.
7122 * cp-tree.h (LOCAL_BINDING_P): New macro.
7123 (lang_identifier): Rename local_value to bindings.
7124 (tree_binding): Make `scope' of type `void*', not `tree'.
7125 (BINDING_SCOPE): Update documentation.
7126 (IDENTIFIER_LOCAL_VALUE): Remove.
7127 (IDENTIFIER_CLASS_VALUE): Document.
7128 (IDENTIFIER_BINDING): New macro.
7129 (IDENTIFIER_VALUE): Likewise.
7130 (TIME_IDENTIFIER_TIME): Likewise.
7131 (TIME_IDENTIFIER_FILEINFO): Likewise.
7132 (IMPLICIT_TYPENAME_P): Likewise.
7133 (set_identifier_local_value): Remove.
7134 (push_local_binding): New function.
7135 (push_class_binding): Likewise.
7136 * class.c (pushclass): Update comments; use push_class_binding.
7137 * decl.c (set_identifier_local_value_with_scope): Remove.
7138 (set_identifier_local_value): Likewise.
7139 (push_binding): New function.
7140 (pop_binding): Likewise.
7141 (binding_level): Update documentation. Remove shadowed.
7142 (BINDING_LEVEL): New macro.
7143 (free_binding_nodes): New variable.
7144 (poplevel): Adjust for new name-lookup scheme. Don't mess up
7145 BLOCK_VARs when doing for-scope extension. Remove effectively
7147 (pushlevel_class): Tweak formatting.
7148 (poplevel_class): Adjust for new name-lookup scheme.
7149 (print_binding_level): Likewise.
7150 (store_bindings): Likewise.
7151 (pushdecl): Likewise.
7152 (pushdecl_class_level): Likewise.
7153 (push_class_level_binding): Likewise.
7154 (push_overloaded_decl): Update comments. Adjust for new
7156 (lookup_name_real): Likewise.
7157 (lookup_name_current_level): Likewise.
7158 (cp_finish_decl): Likewise.
7159 (require_complete_types_for_parms): Likewise. Remove misleading
7161 (grok_parms): Likewise. Don't call
7162 require_complete_types_for_parms here.
7163 (grok_ctor_properties): Don't treat templates as copy
7165 (grop_op_properties): Or as assignment operators.
7166 (start_function): Document. Adjust for new name-lookup scheme.
7167 (finish_function): Likewise.
7168 * decl2.c (do_local_using_decl): Use push_local_binding.
7169 * lex.c (begin_definition_of_inclass_inline): New function, split
7171 (do_pending_inlines): Here, and ...
7172 (process_next_inline): Here.
7173 (get_time_identifier): Use TIME_IDENTIFIER_* macros.
7174 (init_filename_times): Likewise.
7175 (extract_interface_info): Likewise.
7176 (ste_typedecl_interface_info): Likewise.
7177 (check_newline): Likewise.
7178 (dump_time_statistics): Likewise.
7179 (handle_cp_pragma): Likewise.
7180 (do_identifier): Adjust for new name-lookup scheme.
7181 * parse.y (function_try_block): Return ctor_initializer_opt value.
7183 (fn.defpen): Pass appropriate values to start_function.
7184 (pending_inline): Use functor_try_block value, and pass
7185 appropriate values to finish_function.
7186 * pt.c (is_member_template): Update documentation; remove handling
7187 of FUNCTION_DECLs. As per name, this function should deal only in
7189 (decl_template_parm_p): Change name of olddecl parameter to decl.
7190 (check_template_shadow): Adjust for new name-lookup scheme.
7191 (lookup_template_class): Likewise.
7192 (tsubst_decl): Tweak so as not to confuse member templates with
7193 copy constructors and assignment operators.
7194 (unify): Handle UNION_TYPEs.
7195 * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
7196 (lang_print_xnode): Adjust for new name-lookup scheme.
7197 * typeck.c (mark_addressable): Likewise.
7198 (c_expand_return): Likewise.
7200 1998-12-08 Jason Merrill <jason@yorick.cygnus.com>
7202 * decl.c (grokdeclarator): Allow field with same name as class
7205 * decl.c (lookup_name_real): Don't limit field lookup to types.
7206 * class.c (check_member_decl_is_same_in_complete_scope): No error
7207 if icv and x are the same.
7208 * lex.c (do_identifier): Tweak error message.
7210 1998-12-10 Mark Mitchell <mark@markmitchell.com>
7212 * decl.c (start_enum): Use push_obstacks, not
7213 end_temporary_allocation.
7214 (finish_enum): Call pop_obstacks.
7216 1998-12-10 Mark Mitchell <mark@markmitchell.com>
7218 * class.c (instantiate_type): Return error_mark_node rather than
7221 1998-12-09 Mark Mitchell <mark@markmitchell.com>
7223 * cp-tree.h (most_specialized_instantiation): New function.
7224 (print_candidates): Likewise.
7225 * class.c (validate_lhs): Remove.
7226 (resolve_address_of_overloaded_function): New function, split out
7227 and then substantially reworked, from ...
7228 (instantiate_type): Use it. Simplify.
7229 * cvt.c (convert_to_reference): Complain when caller has indicated
7230 that's the right thing to do. Don't crash if instantiate_type
7232 * pt.c: Substitute `parameters' for `paramters' throughout.
7233 (print_candidates): Don't make it static.
7234 (most_specialized_instantiation): Split out from ...
7235 (most_specialized): Here.
7237 Wed Dec 9 15:33:01 1998 Dave Brolley <brolley@cygnus.com>
7239 * lex.c (lang_init_options): Initialize cpplib.
7240 * decl2.c (parse_options,cpp_initialized): Removed.
7241 (lang_decode_option): Move initialization of cpplib to
7244 1998-12-09 Mark Mitchell <mark@markmitchell.com>
7246 * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
7247 well as the TYPE_DECL, when a typedef name is assigned to a
7248 previously anonymous type.
7250 1998-12-08 Andrew MacLeod <amacleod@cygnus.com>
7252 * cp/except.c (call_eh_info): Use __start_cp_handler instead of
7253 __cp_eh_info for getting the eh info pointer. Add table_index to
7255 (push_eh_cleanup): Don't increment 'handlers' data field.
7256 (process_start_catch_block): Don't set the 'caught' field.
7258 * cp/exception.cc (CP_EH_INFO): New macro for getting the
7259 exception info pointer within library routines.
7260 (__cp_eh_info): Use CP_EH_INFO.
7261 (__start_cp_handler): Get exception info pointer, set caught field,
7262 and increment the handlers field. Avoids this being done by handlers.
7263 (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
7264 (uncaught_exception): Use CP_EH_INFO macro.
7266 Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com)
7268 * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
7270 Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
7272 * lex.c (check_newline): Add support for \ as `natural'
7273 characters in file names in #line to be consistent with #include
7274 handling. We support escape processing in the # 1 "..." version of
7275 the command. See also support in cp/lex.c.
7277 1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
7279 * cp/decl2.c: s/data/opts/ when initializing cpp_reader
7282 1998-12-07 Jason Merrill <jason@yorick.cygnus.com>
7284 * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
7286 * error.c (dump_simple_decl): Also print namespace context.
7287 (dump_function_decl): Likewise.
7289 * decl2.c (ambiguous_decl): Don't print old value if it's
7292 * decl.c (lookup_name_real): Fix handling of local types shadowed
7293 by a non-type decl. Remove obsolete code.
7294 * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
7296 * lang-options.h: Add -fpermissive.
7297 * decl2.c: Likewise.
7298 * cp-tree.h: Add flag_permissive.
7299 * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
7300 were specified, set flag_pedantic_errors.
7301 * call.c (build_over_call): Turn dropped qualifier messages
7303 * cvt.c (convert_to_reference): Likewise.
7304 * typeck.c (convert_for_assignment): Likewise.
7306 1998-12-05 Jason Merrill <jason@yorick.cygnus.com>
7308 * decl2.c (coerce_new_type): Use same_type_p.
7309 (coerce_delete_type): Likewise.
7311 * call.c (check_dtor_name): Return 1, not error_mark_node.
7313 1998-12-04 Jason Merrill <jason@yorick.cygnus.com>
7315 * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
7316 if MULTIPLE_SYMBOL_SPACES.
7318 * pt.c (check_template_shadow): New fn.
7319 * decl2.c (grokfield): Use it.
7320 * decl.c (pushdecl): Likewise.
7321 (pushdecl_class_level): Likewise.
7322 (start_method): Likewise.
7323 (xref_tag): Don't try to use 't' if we're defining.
7325 * call.c (check_dtor_name): Just return an error_mark_node.
7326 * pt.c (lookup_template_class): Complain about using non-template here.
7327 * parse.y (apparent_template_type): Not here.
7329 * pt.c (check_explicit_specialization): Complain about specialization
7332 * lang-options.h: Add -f{no-,}implicit-inline-templates.
7334 * pt.c (convert_nontype_argument): Don't assume that any integer
7335 argument is intended to be a constant-expression.
7337 1998-12-03 Mark Mitchell <mark@markmitchell.com>
7339 * class.c (handle_using_decl): Fix comment. Don't lookup
7340 constructors in base classes.
7341 (validate_lhs): Fix typo in comment.
7342 * search.c (lookup_field_1): Don't return a USING_DECL.
7344 * cp-tree.h (DECL_ACCESS): Improve documentation.
7346 * decl.c (expand_static_init): Don't set the initialization-done
7347 flag until the initialization is done.
7349 1998-12-02 Mark Mitchell <mark@markmitchell.com>
7351 * decl2.c (validate_nonmember_using_decl): Complain about using
7352 declarations for class members.
7354 1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
7356 * typeck2.c (process_init_constructor): Use same_type_p.
7358 * decl.c (check_tag_decl): Don't warn about null decl inside a
7361 * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
7363 (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
7364 (resolve_overloaded_unification): Strip baselinks.
7366 Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7368 * g++spec.c: Don't prototype xmalloc.
7370 1998-11-25 Jason Merrill <jason@yorick.cygnus.com>
7372 * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
7374 * decl.c (check_tag_decl): Do complain about null friend decl at
7377 1998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
7379 * lex.c (make_lang_type): Clear the whole struct lang_type, not
7380 only the first multiple of sizeof (int).
7382 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
7384 * decl.c (start_decl): An explicit specialization of a static data
7385 member is only a definition if it has an initializer.
7387 * except.c (expand_throw): Use cp_finish_decl for the throw temp.
7388 * cvt.c (build_up_reference): Pass DIRECT_BIND down into
7390 * init.c (expand_default_init): Check for DIRECT_BIND instead of
7393 * call.c (build_over_call): Use build_decl.
7395 * except.c (expand_throw): Just use convert, not
7396 build_reinterpret_cast.
7398 * lex.c (handle_generic_pragma): Use token_buffer.
7400 * decl.c (check_tag_decl): Don't complain about null friend decl.
7402 1998-11-24 Dave Pitts <dpitts@cozx.com>
7404 * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the
7406 * lex.c (check_newline): Use ISALPHA.
7407 (readescape): Use ISGRAPH.
7408 (yyerror): Use ISGRAPH.
7410 1998-11-24 Nathan Sidwell <nathan@acm.org>
7412 * search.c (get_abstract_virtuals): Do not use initial
7413 CLASSTYPE_ABSTRACT_VIRTUALS.
7414 * typeck2.c (abstract_virtuals_error): Show location of abstract
7416 * call.c (build_new_method_call): Use
7417 CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
7418 * class.c (finish_struct_bits): Don't bother working out whether
7419 get_abstract_virtuals will do anything, just do it.
7421 1998-11-24 Graham <grahams@rcp.co.uk>
7423 * typeck.c (build_component_ref): Remove unused statement.
7425 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
7427 * class.c (add_method): Catch invalid overloads.
7429 * class.c (add_method): Build up OVERLOADs properly for conversion ops.
7430 * search.c (lookup_conversions): Handle getting real OVERLOADs.
7431 (add_conversions): Likewise. Revert last change.
7432 * call.c (add_conv_candidate): Pass totype to add_candidate instead
7433 of fn. Don't add a new candidate if the last one was for the same
7435 (print_z_candidates): Handle getting a type as a function.
7436 (joust): If we got two conversion candidates to the same type,
7438 (build_object_call): Lose 'templates'.
7439 (build_user_type_conversion_1): Handle getting real OVERLOADs.
7441 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
7443 * typeck2.c (process_init_constructor): If there are elements
7444 that don't have initializers and they need to have constructors
7445 run, supply them with initializers.
7447 * class.c (finish_struct_1): A class with a 0-width bitfield is
7450 1998-11-23 Mark Mitchell <mark@markmitchell.com>
7452 * pt.c (instantiate_class_template): Don't try to figure out what
7453 specialization to use for a partial instantiation. Correct
7454 typos in a couple of comments. Avoid calling uses_template_parms
7457 1998-11-23 Benjamin Kosnik <bkoz@cygnus.com>
7459 * method.c (process_overload_item): Add call to
7460 build_mangled_C9x_name for intTI_type_nodes.
7461 (build_mangled_C9x_name): Add prototype, define.
7462 * decl.c (init_decl_processing): Add names for
7465 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
7467 * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
7469 * class.c (finish_struct_1): Set things up for 0-width bitfields
7470 like we do for others.
7472 * decl.c (check_tag_decl): New fn.
7473 (shadow_tag): Split out from here.
7474 * decl2.c (grok_x_components): Call it.
7476 1998-11-22 Jason Merrill <jason@yorick.cygnus.com>
7478 * decl.c: Lose warn_about_return_type.
7479 (grokdeclarator): Always complain about implicit int, except for
7482 * decl.c (tag_name): New fn.
7483 (xref_tag): Complain about using typedef-name after class-key.
7485 * init.c (expand_vec_init): Also keep going if from_array.
7487 * tree.c (is_overloaded_fn): Also handle the output of
7490 * decl.c (grokdeclarator): Use constructor_name when comparing
7491 field name against enclosing class.
7492 * class.c (finish_struct_anon): Likewise.
7494 1998-11-22 Mark Mitchell <mark@markmitchell.com>
7496 * decl.c (poplevel): Remove code to handle KEEP == 2.
7497 (finish_function): Don't confuse BLOCK-order when
7498 processing a destructor.
7500 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
7502 * decl.c (require_complete_types_for_parms): Call layout_decl
7503 after we've completed the type.
7505 1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de>
7507 * decl2.c (validate_nonmember_using_decl): Allow using templates
7508 from the global namespace.
7510 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
7512 Handle specifying template args to member function templates.
7513 * tree.c (build_overload): Always create an OVERLOAD for a template.
7514 * search.c (add_conversions): Handle finding an OVERLOAD.
7515 * decl2.c (check_classfn): Likewise.
7516 * lex.c (identifier_type): See through a baselink.
7517 * parse.y (do_id): Don't call do_identifier if we got a baselink.
7518 * class.c (instantiate_type, case TREE_LIST): Recurse.
7520 * decl.c (grokdeclarator): Allow a boolean constant for array
7521 bounds, odd as that sounds.
7523 * pt.c (unify): Be more strict about non-type parms, except for
7525 (UNIFY_ALLOW_INTEGER): New macro.
7527 1998-11-19 Manfred Hollstein <manfred@s-direktnet.de>
7529 * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir).
7531 1998-11-19 Jason Merrill <jason@yorick.cygnus.com>
7533 * semantics.c (begin_class_definition): Call
7534 maybe_process_partial_specialization before push_template_decl.
7535 Don't call push_template_decl for a specialization.
7536 * search.c (lookup_field): Do return a member template class.
7537 * decl2.c (handle_class_head): Handle member template classes.
7539 * decl.c (grokdeclarator): A parm type need not be complete.
7541 * pt.c (convert_nontype_argument): Fix thinko.
7543 1998-11-18 Mark Mitchell <mark@markmitchell.com>
7545 * cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
7546 (global_delete_fndecl): New variable.
7547 * decl.c (global_delete_fndecl): Define it.
7548 (init_decl_processing): Set it.
7549 * init.c (build_builtin_delete_call): Use it.
7550 * tree.c (mapcar): Recursively call mapcar for the type of EXPR
7553 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
7555 * decl.c (cplus_expand_expr_stmt): Always complain about unresolved
7558 * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue.
7559 * call.c (build_object_call): Also support references to functions.
7560 * typeck.c (convert_for_initialization): Don't decay a function
7561 if the target is a reference to function.
7563 * search.c (add_conversions): Get all the overloads from a class.
7565 * decl.c (grok_ctor_properties): Complain about any constructor
7566 that will take a single arg of the class type by value.
7568 * typeck2.c (build_functional_cast): Can't create objects of
7569 abstract classes this way.
7570 * cvt.c (ocp_convert): Likewise.
7572 * decl.c (grokfndecl): Member functions of local classes are not
7575 1998-11-18 Mark Mitchell <mark@markmitchell.com>
7577 * Make-lang.in (cc1plus): Add dependency on hash.o.
7579 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
7581 * search.c (get_abstract_virtuals): Complain about virtuals with
7583 * typeck2.c (abstract_virtuals_error): Remove handling for virtuals
7584 with no final overrider.
7585 * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
7586 on virtuals with no final overrider.
7588 * lex.c (reinit_parse_for_block): Add a space after the initial ':'.
7590 * class.c (finish_struct_1): Don't remove zero-width bit-fields until
7593 * friend.c (do_friend): Don't set_mangled_name_for_decl.
7595 * class.c (finish_struct_anon): Complain about non-fields.
7596 * decl2.c (build_anon_union_vars): Likewise.
7598 * decl.c (grokdeclarator): Normal data members can't have the same
7599 name as the class, either.
7600 * class.c (finish_struct_anon): Neither can members of an
7603 1998-11-17 Mark Mitchell <mark@markmitchell.com>
7605 * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses.
7606 (TYPE_BINFO): Likewise.
7607 (IS_AGGR_TYPE): Tweak.
7608 (SET_IS_AGGR_TYPE): New macro.
7609 (CLASS_TYPE_P): Tweak.
7610 (lang_type): Group mark bitfields together. Remove linenum.
7611 (CLASSTYPE_SOURCE_LINE): Remove macro.
7612 (CLASSTYPE_MARKED_N): New macro.
7613 (SET_CLASSTYPE_MARKED_N): Likewise.
7614 (CLEAR_CLASSTYPE_MARKED_N): Likewise.
7615 (CLASS_TYPE_MARKED_*): Use them.
7616 (SET_CLASSTYPE_MARKED_*): Likewise.
7617 (CLEAR_CLASSTYPE_MARKED_*): Likewise.
7618 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
7619 (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well.
7620 (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE.
7621 * class.c (class_cache_obstack): New variable.
7622 (class_cache_firstobj): Likewise.
7623 (finish_struct): Don't set CLASSTYPE_SOURCE_LINE.
7624 (pushclass): Free the cache, when appropriate.
7626 (maybe_push_cache_obstack): Use class_cache_obstack.
7627 * decl.c (include hash.h).
7628 (typename_hash): New function.
7629 (typename_compare): Likewise.
7630 (build_typename_type): Check the hash table to avoid creating
7632 (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE.
7633 (grokdeclarator): Use CLASS_TYPE_P.
7634 (xref_basetypes): Likewise.
7635 (start_function): Likewise. Don't put current_class_ref on the
7637 * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO
7639 * lex.c (note_got_semicolon): Use CLASS_TYPE_P.
7640 (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated
7641 fields for types other than class types. Do clear TYPE_ALIAS_SET
7642 for types other than class types, though.
7643 * method.c (build_overload_identifier): Use CLASS_TYPE_P and
7644 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7645 * pt.c (process_template_parm): Don't set
7646 CLASSTYPE_GOT_SEMICOLON.
7647 (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7648 Coerce arguments on the momentary obstack.
7649 (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7650 (instantiate_class_template): Calculate template arguments on the
7651 momentary obstack. Tidy.
7652 (tsubst_template_arg_vector): Use make_temp_vec.
7653 (tsubst_aggr_type): Put template arguments on the momentary
7655 (tsubst_decl): Likewise.
7656 (tsubst): Copy the array bounds index to the permanent obstack
7657 before building index types. Use new macros.
7658 (unify): Use new macros.
7659 (do_type_instantiation): Likewise.
7660 * search.c (lookup_fnfields_1): Use new macros.
7661 (dfs_pushdecls): Build envelopes on the cache obstack.
7662 (dfs_compress_decls): Use new macros.
7663 (push_class_decls): Build on the cache obstack.
7664 * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON.
7665 * sign.c (build_signature_pointer_or_reference_type): Use
7667 * tree.c (make_binfo): Check CLASS_TYPE_P.
7668 (copy_template_template_parm): Adjust.
7669 (make_temp_vec): Use push_expression_obstack.
7670 * typeck.c (complete_type): Use new macros.
7671 (comptypes): Likewise.
7673 1998-11-17 Jason Merrill <jason@yorick.cygnus.com>
7675 * pt.c (tsubst): Add diagnostics for invalid array, reference
7676 and pointer to member types.
7678 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7680 * typeck2.c (my_friendly_abort): Don't fatal twice in a row.
7682 * typeck.c (c_expand_start_case): Use build_expr_type_conversion.
7685 * parse.y (structsp): Fix cut-and-paste error.
7687 * init.c (build_new): Complain about non-integral size.
7689 * parse.y (unary_expr): Complain about defining types in sizeof.
7691 * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn.
7693 * rtti.c (build_x_typeid): Complain about typeid without
7694 including <typeinfo>.
7695 (get_typeid): Likewise. Complain about typeid of incomplete type.
7696 (get_tinfo_fn_dynamic): Likewise.
7697 (get_typeid_1): Not static anymore.
7698 * except.c (build_eh_type_type): Use get_typeid_1.
7700 * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to
7701 ambiguous or private bases. Fix warning for reference cast.
7703 1998-11-16 Mark Mitchell <mark@markmitchell.com>
7705 * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
7706 * decl.c (duplicate_decls): Remove special-case code to deal with
7707 template friends, and just do the obvious thing.
7708 * pt.c (register_specialization): Tweak for clarity, and also to
7709 clear DECL_INITIAL for an instantiation before it is merged with a
7711 (check_explicit_specialization): Fix indentation.
7712 (tsubst_friend_function): Handle both definitions in friend
7713 declaration and outside friend declarations.
7714 (tsubst_decl): Don't clear DECL_INITIAL for an instantiation.
7715 (regenerate_decl_from_template): Tweak accordingly.
7716 (instantiate_decl): Likewise.
7718 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7720 * decl.c (cplus_expand_expr_stmt): Promote warning about naked
7721 member function reference to error.
7722 * cvt.c (ocp_convert): Complain about converting an overloaded
7725 * init.c (build_offset_ref): Just return a lone static member
7728 * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs,
7731 * typeck.c (build_binary_op_nodefault): Improve error handling.
7733 * decl.c (grokfndecl): Complain about making 'main' a template.
7735 * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*.
7737 * call.c (build_method_call): Handle a BIT_NOT_EXPR around a
7738 TYPE_DECL in a template.
7740 1998-11-15 Jason Merrill <jason@yorick.cygnus.com>
7742 * typeck2.c (my_friendly_abort): Add URL in the other case, too.
7744 * decl.c (struct cp_function): Add named_label_uses.
7745 (push_cp_function_context): Save it.
7746 (pop_cp_function_context): Restore it.
7747 (define_label): Also complain about jumping into the scope of
7748 non-POD objects that don't have constructors.
7749 * tree.c (pod_type_p): New fn.
7751 * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner.
7752 * rtti.c (synthesize_tinfo_fn): Call import_export_decl here.
7753 (get_tinfo_fn): Not here.
7754 * repo.c (repo_get_id): Abort if we get called for an incomplete
7757 1998-11-13 Mark Mitchell <mark@markmitchell.com>
7759 * except.c (expand_throw): Make sure first argument to
7760 __cp_push_exception is of type `void*' to avoid spurious error
7763 1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
7765 * pt.c (try_one_overload): Take orig_targs again. Only check for
7766 mismatches against them; we don't care what a previous call found.
7767 (resolve_overloaded_unification): Adjust.
7769 * search.c (lookup_field): Don't return anything for a non-type
7770 field from a dependent type.
7771 * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
7772 in an array declarator.
7773 (start_decl): Push into the class before looking for the field.
7775 1998-11-08 Mark Mitchell <mark@markmitchell.com>
7777 * method.c (build_overload_value): Handle REFERENCE_TYPE.
7779 1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
7781 * decl.c (grokdeclarator): Allow namespace-scoped members if they
7784 1998-11-08 Jason Merrill <jason@yorick.cygnus.com>
7786 * pt.c (tsubst_decl): Don't mess with the global value of an
7787 un-mangled DECL_ASSEMBLER_NAME.
7789 1998-11-03 Christopher Faylor <cgf@cygnus.com>
7791 * decl.c (init_decl_processing): Remove CYGWIN conditional
7792 since CYGWIN is now able to deal with trapping signals.
7794 Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7796 * cp-tree.h: Don't include gansidecl.h.
7797 * exception.cc: Include gansidecl.h (since we don't include config.h)
7798 * g++spec.c: Don't include gansidecl.h.
7800 1998-11-06 Mark Mitchell <mark@markmitchell.com>
7802 * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease
7804 (DECL_DEFINED_IN_CLASS_P): New macro.
7805 (TEMPLATE_PARMS_FOR_INLINE): Document.
7806 (check_static_variable_definition): New function.
7807 * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if
7809 (check_static_variable_definition): Split out from ...
7810 (grokdeclarator): Here.
7811 * pt.c (check_default_tmpl_args): New function, split out from ...
7812 (push_template_decl_real): Here.
7813 (instantiate_template): Fix comment.
7815 1998-11-04 Mark Mitchell <mark@markmitchell.com>
7817 * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued.
7818 (CP_TYPE_VOLATILE_P): Likewise.
7819 (CP_TYPE_RESTRICT_P): Likewise.
7821 1998-11-03 Mark Mitchell <mark@markmitchell.com>
7823 * pt.c (tsubst): Use build_index_type, not build_index_2_type.
7825 1998-11-02 Jason Merrill <jason@yorick.cygnus.com>
7827 * class.c (instantiate_type): Be more helpful.
7829 * decl2.c (import_export_decl): Call import_export_class.
7831 * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
7832 * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
7833 * pt.c (tsubst_copy): Likewise.
7835 1998-11-02 Mark Mitchell <mark@markmitchell.com>
7837 * init.c (expand_vec_init): Fix off-by-one error.
7839 1998-11-02 Alexandre Oliva <oliva@dcc.unicamp.br>
7841 * parse.y (apparent_template_type): New type.
7842 (named_complex_class_head_sans_basetype): Use it.
7843 * Makefile.in (CONFLICTS): One new conflict.
7844 * parse.c: Regenerated.
7846 1998-11-01 Mark Mitchell <mark@markmitchell.com>
7848 * cp-tree.h (COMPARE_STRICT): New macro.
7849 (COMPARE_BASE): Likewise.
7850 (COMPARE_RELAXED): Likewise.
7851 (COMPARE_REDECLARATION): Likewise.
7852 (same_type_p): Likewise.
7853 (same_or_base_type_p): Likewise.
7854 * call.c (standard_conversion): Use them, in place of comptypes
7855 with numeric arguments.
7856 (reference_binding): Likewise.
7857 (convert_like): Likewise.
7858 (build_over_call): Likewise.
7859 (is_subseq): Likewise.
7860 (is_properly_derived_from): Likewise.
7861 (compare_ics): Likewise.
7863 * class.c (delete_duplicate_fields_1): Likewise.
7864 (resolves_to_fixed_type_p): Likewise.
7865 (instantiate_type): Likewise. Remove #if 0'd code.
7866 * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here.
7867 (pushdecl): Likewise.
7868 (lookup_name_real): Likewise.
7869 (grokdeclarator): Likewise. Check for illegal array declarations.
7870 (grokparms): Likewise.
7871 (grok_op_properties): Likewise.
7872 * decl2.c (check_classfn): Likewise.
7873 * friend.c (is_friend): Likewise.
7874 (make_friend_class): Likewise.
7875 * init.c (expand_aggr_init): Likewise.
7876 (expand_vec_init): Likewise.
7877 * pt.c (is_member_template_class): Remove declaration.
7878 (is_specialization_of): Use COMPARE_* and new macros.
7879 (comp_template_parms): Likewise.
7880 (convert_nontype_argument): Likewise.
7881 (coerce_template_template_parms): Likewise.
7882 (template_args_equal): Likewise.
7883 (lookup_template_class): Likewise.
7884 (type_unification_real): Likewise.
7886 (get_bindings_real): Likewise.
7887 * search.c (covariant_return_p): Likewise.
7888 (get_matching_virtual): Likewise.
7889 * sig.c (match_method_types): Likewise.
7890 * tree.c (vec_binfo_member): Likewise.
7891 (cp_tree_equal): Likewise.
7892 * typeck.c (common_type): Likewise.
7893 (comp_array_types): Likewise. Get issues involving unknown array
7895 (comptypes): Update comments. Use new flags.
7896 (comp_target_types): Use new macros.
7897 (compparms): Likewise.
7898 (comp_target_parms): Likewise.
7899 (string_conv_p): Likewise.
7900 (build_component_ref): Likewise.
7901 (build_indirect_ref): Likewise.
7902 (build_conditional_expr): Likewise.
7903 (build_static_cast): Likewise.
7904 (build_reinterpret_cast): Likewise.
7905 (build_const_cast): Likewise.
7906 (build_modify_expr): Likewise.
7907 (convert_for_assignment): Likewise.
7908 (comp_ptr_ttypes_real): Likewise.
7909 (ptr_reasonably_similar): Likewise.
7910 (comp_ptr_ttypes_const): Likewise.
7912 1998-10-31 Jason Merrill <jason@yorick.cygnus.com>
7914 * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error.
7916 1998-10-30 Mark Mitchell <mark@markmitchell.com>
7918 * decl2.c (delete_sanity): Pass integer_zero_node, not
7919 integer_two_node, to build_vec_delete.
7920 * init.c (build_array_eh_cleanup): Remove.
7921 (expand_vec_init_try_block): New function.
7922 (expand_vec_init_catch_clause): Likewise.
7923 (build_vec_delete_1): Don't deal with case that auto_delete_vec
7924 might be integer_two_node anymore.
7925 (expand_vec_init): Rework for initialization-correctness and
7926 exception-correctness.
7927 * typeck2.c (process_init_constructor): Make mutual exclusivity
7928 of cases more obvious.
7930 1998-10-29 Jason Merrill <jason@yorick.cygnus.com>
7932 * decl.c (lookup_name_real): OK, only warn if not lexing.
7933 Simplify suggested fix.
7935 * cp-tree.h (IDENTIFIER_MARKED): New macro.
7936 * search.c (lookup_conversions): Use breadth_first_search.
7937 (add_conversions): Avoid adding two conversions to the same type.
7938 (breadth_first_search): Work with base binfos, rather
7939 than binfos and base indices.
7940 (get_virtual_destructor): Adjust.
7941 (tree_has_any_destructor_p): Adjust.
7942 (get_matching_virtual): Adjust.
7944 * pt.c (push_template_decl_real): Generalize check for incorrect
7945 number of template parms.
7946 (is_member_template_class): #if 0.
7948 1998-10-29 Richard Henderson <rth@cygnus.com>
7950 * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
7953 1998-10-28 Zack Weinberg <zack@rabi.phys.columbia.edu>
7955 * lex.c: Call check_newline from lang_init always. After
7956 calling cpp_start_read, set yy_cur and yy_lim to read from the
7957 cpplib token buffer.
7959 1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
7961 * class.c (instantiate_type): Don't consider templates for a normal
7964 * class.c (finish_struct_1): Don't complain about non-copy
7965 assignment ops in union members.
7967 * class.c (build_vtable): Don't pass at_eof to import_export_vtable.
7968 (prepare_fresh_vtable): Likewise.
7969 (finish_struct_1): Don't call import_export_class.
7970 * decl2.c (finish_vtable_vardecl): Do import/export stuff.
7971 (finish_prevtable_vardecl): Lose.
7972 (finish_file): Don't call it.
7973 * pt.c (instantiate_class_template): Likewise.
7974 * cp-tree.h: Remove it.
7976 * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
7977 * decl.c (finish_function): Not here.
7978 (start_function): Do set DECL_INITIAL.
7980 * pt.c (push_template_decl_real): Complain about default template
7981 args for enclosing classes.
7983 * call.c (add_function_candidate): Treat conversion functions
7984 as coming from the argument's class.
7985 * cp-tree.h (DECL_CONV_FN_P): New fn.
7986 (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE.
7987 * class.c (add_method): Use DECL_CONV_FN_P.
7988 * decl2.c (check_classfn): Likewise.
7989 * error.c (dump_function_name): Likewise.
7990 (dump_function_decl): Likewise.
7991 * pt.c (fn_type_unification): Likewise.
7992 * search.c (add_conversions): Likewise.
7994 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7996 * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL.
7997 * method.c (hack_identifier): Also check for using RESULT_DECL
8000 1998-10-27 Mark Mitchell <mark@markmitchell.com>
8002 * decl.c (grokdeclarator): Use type_quals, rather than constp,
8005 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
8007 * call.c (standard_conversion): instantiate_type here.
8008 (reference_binding): And here.
8009 (implicit_conversion): Not here.
8010 (build_op_delete_call): No need to cons up an OVERLOAD.
8011 * cvt.c (cp_convert_to_pointer): instantiate_type here.
8012 (convert_to_reference): And here.
8013 * decl.c (grok_reference_init): Not here.
8014 (grokparms): Or here.
8015 * typeck2.c (digest_init): Or here.
8016 * typeck.c (decay_conversion): Take the address of overloaded
8018 (require_instantiated_type): Lose.
8019 (convert_arguments): Don't handle unknown types here.
8020 (build_c_cast): Likewise.
8021 (build_binary_op): Gut.
8022 (build_conditional_expr): Don't require_instantiated_type.
8023 (build_modify_expr): Likewise.
8024 (build_static_cast): Don't instantiate_type.
8025 (build_reinterpret_cast): Likewise.
8026 (build_const_cast): Likewise.
8027 (convert_for_initialization): Likewise.
8028 (build_ptrmemfunc): Use type_unknown_p.
8029 (convert_for_assignment): Also do default_conversion on overloaded
8030 functions. Hand them off to ocp_convert.
8032 1998-10-26 Mark Mitchell <mark@markmitchell.com>
8034 * error.c (dump_decl): Deal with TEMPLATE_DECLs that are
8035 VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
8037 * class.c (finish_struct_1): Use build_cplus_array_type to build
8039 * decl.c (init_decl_processing): Likewise.
8040 * except.c (expand_end_eh_spec): Likewise.
8041 * search.c (expand_upcast_fixups): Simplify very slightly.
8043 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
8045 * decl.c (grokdeclarator): Complain about a variable using
8046 constructor syntax coming back null from start_decl.
8048 * friend.c (make_friend_class): Complain about trying to make
8049 a non-class type a friend.
8051 * decl.c (grokfndecl): Set DECL_INITIAL for a defn here.
8052 (start_function): Not here.
8054 1998-10-26 Brendan Kehoe <brendan@cygnus.com>
8056 * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
8058 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
8060 * typeck2.c (process_init_constructor): Only skip anonymous fields
8061 if they are bitfields.
8063 * cp-tree.def (TYPEOF_TYPE): New code.
8064 * error.c (dump_type_real): Handle it.
8065 * pt.c (tsubst): Likewise.
8066 * tree.c (search_tree): Likewise.
8067 * semantics.c (finish_typeof): New fn.
8068 * parse.y (typespec): Use it.
8069 * cp-tree.h: Declare it.
8071 1998-10-26 Manfred Hollstein <manfred@s-direktnet.de>
8073 * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional.
8075 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
8077 * typeck.c (convert_arguments): Don't handle pmf references
8080 * init.c (build_member_call): Don't try to convert to the base type
8081 if it's ambiguous or pedantic.
8083 * typeck2.c (check_for_new_type): Only depend on pedantic for
8086 1998-10-25 Mark Mitchell <mark@markmitchell.com>
8088 * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all
8089 non-converting constructors.
8091 1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
8093 * gxxint.texi: Correct documentation for n, N, Q, and B.
8095 1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
8097 * parse.y (condition): Convert VAR_DECL from reference to indirect
8100 1998-10-23 Andrew MacLeod <amacleod@cygnus.com>
8102 * exception.cc (__cp_pop_exception): Free the original exception
8103 value, not the potentially coerced one.
8105 1998-10-23 Mark Mitchell <mark@markmitchell.com>
8107 * Makefile.in (hash.h): Run gperf when necessary.
8109 * cp-tree.h (CP_TYPE_READONLY): Remove.
8110 (CP_TYPE_VOLATILE): Likewise.
8111 (CP_TYPE_QUALS): New macro.
8112 (CP_TYPE_CONST_P): Likewise.
8113 (CP_TYPE_VOLATILE_P): Likewise.
8114 (CP_TYPE_RESTRICT_P): Likewise.
8115 (CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
8116 (cp_build_type_variant): Rename to ...
8117 (cp_build_qualified_type): New function.
8118 (c_apply_type_quals_to_decl): Declare.
8119 (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
8120 (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
8121 (cp_type_qual_from_rid): New function.
8122 (compparms): Remove unused parameter. All callers changed.
8123 (cp_type_quals): New function.
8124 (at_least_as_qualified_p): Likewise.
8125 (more_qualified_p): Likewise.
8127 * call.c (standard_conversion): Replace calls to
8128 cp_build_type_variant with cp_build_qualified_type. Use
8129 CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
8130 compare them. Use CP_TYPE_* macros to check qualifiers.
8131 (reference_binding): Likewise.
8132 (implicit_conversion): Likewise.
8133 (add_builtin_candidates): Likewise.
8134 (build_over_call): Likewise.
8135 * class.c (overrides): Compare all qualifiers, not just `const',
8136 on method declarations.
8137 * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
8138 (convert_pointer_to_real): Likewise.
8139 (type_promotes_to): Likewise.
8140 * decl.c (check_for_uninitialized_const_var): New function.
8141 (init_decl_processing): More CP_TYPE_QUALS conversion, etc.
8142 (cp_finish_decl): Use check_for_uninitialized_const_var.
8143 (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to
8145 (grok_ctor_properties): Likewise.
8146 (grok_op_properties): Likewise.
8147 (start_function): Likewise.
8148 (rever_static_member_fn): Likewise.
8149 * decl2.c (grok_method_quals): Likewise.
8150 (grokfield): Likewise.
8151 * error.c (dump_readonly_or_volatile): Rename to ...
8152 (dump_qualifiers): New function. Handle `restrict'.
8153 (dump_type_real): Use it.
8154 (dump_aggr_type): Likewise.
8155 (dump_type_prefix): Likewise.
8156 (dump_type_suffix): Likewise.
8157 (dump_function_decl): Likewise.
8158 (cv_as_string): Likewise.
8159 * gxx.gperf: Add __restrict and __restrict__.
8160 * gxxint.texi: Document `u' as used for `__restrict', and a few
8161 other previously undocumented codes.
8162 * hash.h: Regenerated.
8163 * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
8164 (build_member_call): Likewise.
8165 (build_new_1): Likewise.
8166 * lex.c (init_parse): Add entry for RID_RESTRICT.
8167 (cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
8168 (cp_type_qual_from_rid): Define.
8169 * lex.h (enum rid): Add RID_RESTRICT.
8170 * method.c (process_modifiers): Deal with `restrict'.
8171 * parse.y (primary): More CP_TYPE_QUALS conversion, etc.
8172 * parse.c: Regenerated.
8173 * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
8174 (tsubst_aggr_type): Likewise.
8176 (check_cv_quals_for_unify): Likewise.
8178 * rtti.c (init_rtti_processing): Likewise.
8179 (build_headof): Likewise.
8180 (get_tinfo_var): Likewise.
8181 (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling.
8182 (expand_class_desc): Likewise.
8183 (expand_attr_desc): Likewise.
8184 (synthesize_tinfo_fn): Likewise.
8185 * search.c (covariant_return_p): Likewise. Fix `volatile' handling.
8186 (get_matching_virtual): Likewise.
8187 (expand_upcast_fixups): Likewise.
8188 * sig.c (build_signature_pointer_or_reference_name): Take
8189 type_quals, not constp and volatilep.
8190 (build_signature_pointer_or_reference_type): Likewise.
8191 (match_method_types): More CP_TYPE_QUALS conversion, etc.
8192 (build_signature_pointer_constructor): Likewise.
8193 (build_signature_method_call): Likewise.
8194 * tree.c (build_cplus_array_type): Likewise.
8195 (cp_build_type_variant): Rename to ...
8196 (cp_build_qualified_type): New function. Deal with `__restrict'.
8197 (canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
8198 (build_exception_variant): Likewise.
8200 * typeck.c (qualif_type): Likewise.
8201 (common_type): Likewise.
8202 (comptypes): Likewise.
8203 (comp_cv_target_types): Likewise.
8204 (at_least_as_qualified_p): Define.
8205 (more_qualified_p): Likewise.
8206 (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
8207 (compparms): Likewise.
8208 (inline_conversion): Likewise.
8209 (string_conv_p): Likewise.
8210 (build_component_ref): Likewise.
8211 (build_indirect_ref): Likewise.
8212 (build_array_ref): Likewise.
8213 (build_unary_op): Likewise.
8214 (build_conditional_expr): Likewise.
8215 (build_static_cast): Likewise.
8216 (build_c_cast): Likewise.
8217 (build_modify_expr): Likewise.
8218 (convert_For_assignment): Likewise.
8219 (comp_ptr_ttypes_real): Likewise.
8220 (cp_type_quals): New function.
8222 1998-10-23 Jason Merrill <jason@yorick.cygnus.com>
8224 * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
8225 (CP_TYPE_VOLATILE): Likewise.
8226 * decl.c (grokdeclarator): Use them.
8227 * tree.c (canonical_type_variant): Likewise.
8229 1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de>
8231 * parse.y (named_class_head): Push into class while parsing the
8233 * decl2.c (push_scope, pop_scope): New functions.
8234 * cp-tree.h: Declare them.
8235 * init.c (build_new_1): Delay cleanup until end of full expression.
8237 1998-10-21 Jason Merrill <jason@yorick.cygnus.com>
8239 * typeck.c (build_component_ref): Use of a type here is an error.
8241 1998-10-19 Jason Merrill <jason@yorick.cygnus.com>
8243 Revamp references to member functions.
8244 * method.c (hack_identifier): Call build_component_ref for a
8245 reference to a member function.
8246 * typeck.c (build_component_ref): Only return a single function
8247 if it's static. Otherwise, return a COMPONENT_REF.
8248 (build_x_function_call): Handle a COMPONENT_REF.
8249 (build_unary_op): Handle all unknown-type things.
8250 * decl2.c (arg_assoc): Handle COMPONENT_REF.
8251 * class.c (instantiate_type): Complain if the function we get is a
8252 nonstatic member function. Remove code for finding "compatible"
8254 * pt.c (tsubst_copy): Handle NOP_EXPR.
8255 * tree.c (build_dummy_object): New fn.
8256 (maybe_dummy_object): New fn.
8257 (is_dummy_object): New fn.
8258 * cp-tree.h: Declare them.
8259 * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
8260 * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
8261 * init.c (build_member_call): Use maybe_dummy_object and
8263 (build_offset_ref): Use maybe_dummy_object.
8264 (resolve_offset_ref): Use is_dummy_object.
8265 * typeck.c (build_x_function_call): Call build_dummy_object.
8266 (unary_complex_lvalue): Call is_dummy_object.
8268 * typeck.c (build_component_addr): Make sure field is a field.
8270 * call.c (build_new_op): Delete obsolete code.
8272 * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
8274 1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
8276 * decl2.c (validate_nonmember_using_decl): Fix using-directives of
8277 std if std is ignored.
8279 1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
8281 * decl.c (grokvardecl): Fix thinko.
8283 * decl.c (grokdeclarator): Embedded attrs bind to the right,
8286 * parse.y (fn.def2): Fix 'attrs' format.
8288 1998-10-18 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
8290 * Makefile.in (CONFLICTS): Update.
8291 * parse.y (expr_or_declarator_intern): New rule.
8292 (expr_or_declarator, direct_notype_declarator, primary,
8293 functional_cast): Use it.
8294 (notype_declarator_intern): New rule.
8295 (notype_declarator, complex_notype_declarator): Use it.
8297 1998-10-17 Jason Merrill <jason@yorick.cygnus.com>
8299 * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate.
8300 (grokvardecl): Likewise.
8302 Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8304 * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR).
8305 (add_method): Likewise for arguments 1 & 2 of `bcopy'.
8307 * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN.
8309 * pt.c (process_partial_specialization): Cast 1st argument of
8312 * tree.c (build_base_fields): Cast `base_align' to (int) when
8313 comparing against one.
8315 1998-10-16 Mark Mitchell <mark@markmitchell.com>
8317 * decl.c (lookup_name_real): Handle template parameters for member
8318 templates where said parameters have the same name as the
8321 * decl.c (expand_static_init): Build cleanups before entering the
8322 anonymous function used to do them to avoid access-checking
8325 * decl.c (grokfndecl): Add back call to cplus_decl_attributes
8326 accidentally removed by previous change, and make DECL_RTL here.
8327 * class.c (add_method): Don't make DECL_RTL here.
8329 * pt.c (for_each_template_parm): Don't examine uninstantiated
8332 1998-10-16 Dave Brolley <brolley@cygnus.com>
8334 * lex.c (real_yylex): Fix unaligned access of wchar_t.
8336 1998-10-16 Mark Mitchell <mark@markmitchell.com>
8338 * class.c (add_method): Fix documentation to reflect previous
8339 changes. Check for duplicate method declarations here.
8340 * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL
8341 correctly; such things never match.
8342 (grokfndecl): Don't look for duplicate methods here.
8343 * decl2.c (check_classfn): Don't assume names are mangled.
8344 Don't add bogus member function declarations to a class before the
8345 class type is complete.
8346 (grokfield): Reformat error message.
8347 * method.c (set_mangled_name_for_decl): Don't mangle names while
8348 processing_template_decl.
8350 1998-10-16 Jason Merrill <jason@yorick.cygnus.com>
8352 * typeck.c (build_indirect_ref): Complain about a pointer to data
8354 * typeck2.c (build_m_component_ref): Don't indirect a pointer to
8356 * init.c (resolve_offset_ref): Don't undo the above.
8358 * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros.
8359 (struct lang_decl_flags): Add `bitfield'.
8360 * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of
8362 * decl2.c (grokbitfield, grok_alignof): Likewise.
8363 * init.c (build_offset_ref): Likewise.
8364 * typeck.c (build_component_addr, expr_sizeof): Likewise.
8365 * cvt.c (build_up_reference): Don't crash if taking the address
8366 returns error_mark_node.
8368 * decl.c (grokfndecl): Also check ctype when checking for ::main().
8370 1998-10-15 Jason Merrill <jason@yorick.cygnus.com>
8372 * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
8374 (grokdeclarator): Instead of here.
8375 * friend.c (do_friend): Lose special handling of ::main and
8377 * cp-tree.h (DECL_MAIN_P): Check for C linkage.
8379 * spew.c (yylex): Clear looking_for_typename if we got
8382 1998-10-15 Mark Mitchell <mark@markmitchell.com>
8384 * class.c (maybe_warn_about_overly_private_class): Improve error
8385 messages for class with only private constructors.
8387 * cp-tree.def (TYPENAME_TYPE): Add to documentation.
8388 * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
8389 (build_typename_type): New function.
8390 * decl.c (build_typename_type): Broken out from ...
8391 (make_typename_type): Use it.
8392 * search.c (lookup_field): Likewise.
8394 1998-10-14 Benjamin Kosnik <bkoz@rhino.cygnus.com>
8396 * pt.c (convert_nontype_argument): Check against type_referred_to.
8397 * decl.c (grokvardecl): Check for declarator name before building
8398 DECL_ASSEMBLER_NAME.
8400 1998-10-14 Mark Mitchell <mark@markmitchell.com>
8402 * pt.c (lookup_template_class): Add comment.
8403 (instantiate_class_template): Don't mark the _TYPE node for
8404 member class templates as an instantiation.
8406 1998-10-14 Jason Merrill <jason@yorick.cygnus.com>
8408 * decl.c (grokfndecl): Fix my thinko.
8410 1998-10-13 Jason Merrill <jason@yorick.cygnus.com>
8412 * tinfo2.cc (fast_compare): Remove.
8413 (before): Just use strcmp.
8414 * tinfo.cc (operator==): Just use strcmp.
8416 1998-10-13 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
8418 * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
8421 1998-10-13 Mark Mitchell <mark@markmitchell.com>
8423 * cp-tree.h (specializations_of_same_template_p): Remove.
8424 * search.c (get_template_base): Don't use it.
8425 (get_template_base_recursive): Likewise.
8426 * pt.c (specializations_of_same_template_p): Remove.
8427 (unify): Don't use it.
8428 (lookup_template_class): Find the correct parent when setting
8429 CLASSTYPE_TI_TEMPLATE.
8431 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
8433 * tinfo.cc (operator==): Always compare names.
8435 1998-10-12 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
8437 * decl.c (start_function): Fix cut-and-paste error.
8439 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
8441 * inc/typeinfo: Add #pragma interface.
8442 (operator!=): Just call operator==.
8443 * tinfo.cc: Add #pragma implementation.
8444 (operator==): Move from inc/typeinfo and tinfo2.cc.
8445 Check __COMMON_UNRELIABLE instead of _WIN32.
8447 * typeck2.c (my_friendly_abort): Add URL.
8449 1998-10-12 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
8451 * decl.c (start_method): Added extra parameter for attributes.
8452 * cp-tree.h (start_method): Update prototype.
8453 * parse.y (fn.def2): Update start_method parameter list.
8455 1998-10-11 Mark Mitchell <mark@markmitchell.com>
8457 * cp-tree.h (specializations_of_same_template_p): Declare.
8458 * pt.c (specializations_of_same_template_p): New function.
8460 * search.c (get_template_base): Use it.
8461 (get_template_base_recursive): Likewise.
8463 1998-10-10 Manfred Hollstein <manfred@s-direktnet.de>
8465 * decl2.c (start_objects): Add new variable `joiner' and
8466 initialize it properly.
8468 1998-10-09 Mark Mitchell <mark@markmitchell.com>
8470 * search.c (expand_upcast_fixups): Tweak to match 1998-10-07
8471 change to vtable types.
8473 * cvt.c (ocp_convert): Avoid infinite recursion caused by
8476 1998-10-08 Jason Merrill <jason@yorick.cygnus.com>
8478 * pt.c (resolve_overloaded_unification): New fn.
8479 (try_one_overload): Likewise.
8480 (unify): Don't fail on unknown type.
8481 (type_unification_real): Likewise. Use resolve_overloaded_unification
8482 to handle an overloaded argument.
8483 (template_args_equal): Split out...
8484 (comp_template_args): From here.
8485 (determine_specialization): Also allow a template with more
8486 parms than were explicitly specified.
8487 * cp-tree.h: Add template_args_equal.
8488 * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code.
8490 Thu Oct 8 15:58:30 1998 Anthony Green <green@cygnus.com>
8492 * semantics.c (finish_asm_stmt): Revert my 1998-09-28
8495 Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com)
8497 * typeck.c (unsigned_type): Only return TItype nodes when
8498 HOST_BITS_PER_WIDE_INT is >= 64 bits.
8499 (signed_type): Likewise.
8500 * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
8501 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
8502 (init_decl_processing): Only create TItype nodes when
8503 HOST_BITS_PER_WIDE_INT is >= 64 bits.
8504 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare
8505 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
8507 Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8509 * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
8510 (gxx.gperf): Update comments describing invocation flags.
8511 (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
8513 1998-10-07 Mark Mitchell <mark@markmitchell.com>
8515 * class.c (finish_struct_1): Add commentary on previous change.
8517 * cp-tree.h (vtbl_ptr_type_node): New variable.
8518 * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
8519 already of the right type.
8520 (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
8521 Simplify code to grow vtable.
8522 * decl.c (vtbl_ptr_type_node): Define.
8523 (init_decl_processing): Initialize it.
8525 1998-10-06 Mark Mitchell <mark@markmitchell.com>
8527 * cp-tree.def (PTRMEM_CST): New tree node.
8528 * cp-tree.h (ptrmem_cst): New type.
8529 (lang_type): Remove local_typedecls.
8530 (dummy): Increase to 12 bits from 11.
8531 (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
8532 (PTRMEM_CST_CLASS): New macro.
8533 (PTRMEM_CST_MEMBER): Likewise.
8534 (current_access_specifier): New variable.
8535 (current_class_type): Remove duplicate declaration.
8536 (finish_struct): Change prototype.
8537 (unreverse_member_declarations): New function.
8538 (pushdecl_class_level): Change prototype.
8539 (grok_enum_decls): Remove.
8540 (fixup_anonymous_union): New function.
8541 (grok_x_components): Change prototype.
8542 (tsubst_chain): Remove.
8543 (finish_member_template_decl): Likewise.
8544 (check_explicit_specialization): Fix indentation.
8545 (finish_class_definition): Change prototype.
8546 (finish_member_class_template): Likewise.
8547 (finish_member_declaration): New function.
8548 (check_multiple_declarators): Likewise.
8549 * class.c (class_stack_node_t): New type.
8550 (current_class_base): Remove.
8551 (current_class_stack): Change type.
8552 (current_access_specifier): New variable.
8553 (grow_method): Remove.
8554 (check_member_decl_is_same_in_complete_scope): Break out from
8556 (make_method_vec): New function.
8557 (free_method_vec): Likewise.
8558 (add_implicitly_declared_members): Break out from finish_struct_1.
8559 (free_method_vecs): New variable.
8560 (add_method): Rework for direct use from parser.
8561 (handle_using_decl): Watch for NULL_TREE while iterating through
8562 CLASSTYPE_METHOD_VEC.
8563 (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
8564 just do some error-checking.
8565 (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
8566 (finish_struct_1): Simplify. Use add_implicitly_declared_members.
8567 (finish_struct): Change prototype. Simplify; fields and methods
8568 are already set up at this point.
8569 (init_class_processing): Set up current_class_stack.
8570 (pushclass): Save current_access_specifier.
8571 (popclass): Restore it.
8572 (currently_open_class): Simplify.
8573 (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
8574 * decl.c (saved_scope): Add access_specifier.
8575 (maybe_push_to_top_level): Save it.
8576 (pop_from_top_level): Restore it.
8577 (maybe_process_template_type_declaration): Use
8578 finish_member_declaration.
8579 (pushtag): Likewise.
8580 (pushdecl_class_level): Don't return a value.
8581 (fixup_anonymous_union): Break out from grok_x_components.
8582 (shadow_tag): Use it.
8583 (xref_tag): Complain about using an elaborated type specifier to
8584 reference a template type parameter or typedef name.
8585 (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
8586 (current_local_enum): Remove.
8587 (build_enumerator): Call finish_member_declaration.
8588 (grok_enum_decls): Remove.
8589 * decl2.c (grok_x_components): Simplify.
8590 (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
8591 (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
8592 (merge_functions): Add to comment.
8593 (arg_assoc_type): Prototype.
8594 (arg_assoc): Pass as many arguments as there are parameters.
8595 * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of
8597 * expr.c (cpls_expand_expr): Remove dead code. Handle
8599 * friend.c (do_friend): Lookup friends when in nested classes.
8601 * init.c (build_offset_ref): Do lookup even for classes that are
8602 only partially defined.
8603 (decl_constant_value): Remove dead code.
8604 * method.c (build_overload_value): Remove hack where by TYPE was
8605 not a TYPE. Handle PTRMEM_CST.
8606 (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
8608 * parse.y (components, notype_components, component_decl,
8609 component_decl_1, component_declarator, component_declarator0):
8610 Now all are itype rather than ttype. Rework to add members to
8612 (typesqpecqual_reserved): Use check_multiple_declarators.
8613 (structsp): Update class to finish_class_definition.
8614 (do_xref_defn): Unsplit into named_class_head.
8615 (access_specifier): Set current_access_specifier.
8616 * pt.c (set_current_access_from_decl): New function.
8617 (finish_member_template_decl): Don't take the parameters.
8618 (comp_template_args): Make more robust.
8619 (lookup_template_class): Don't use current_local_enum.
8620 (for_each_template_parm): Handle PTRMEM_CST.
8621 (instantiate_class_template): Use set_current_access_from_decl,
8622 finish_member_declaration and unreverse_member_declarations. Set
8623 lineno/input_filename before generating implicit member functions.
8624 (type_unification_real): Don't assume back-unification happens
8625 only for the last argument.
8626 (regenerate_decl_from_template): Call pushclass a bit earlier.
8627 (tsubst_chain): Remove.
8628 (tsubst_enum): Use set_current_access_from_decl.
8629 (set_mangled_name_for_template_decl): Fix indentation.
8630 * search.c (lookup_fnfields_1): Change iteration through
8631 CLASSTYPE_METHOD_VEC.
8632 (dfs_pushdecls): Likewise.
8633 (dfs_compress_decls): Likewise.
8634 (add_conversions): Likewise.
8635 * semantics.c (finish_class_definition): Don't take components.
8636 Change call to finish_struct.
8637 (finish_member_declaration): New function.
8638 (finish_member_class_template): Don't take template parameters.
8639 Change call to grok_x_components. Call finish_member_template_decl.
8640 (check_multiple_declarators): New function.
8641 * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
8642 a passed in fieldlist.
8643 * tree.c (search_tree): Handle PTRMEM_CST.
8645 * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
8646 INTEGER_CSTs, for pointer-to-data members.
8648 * call.c (resolve_args): Resolve template specializations, if
8651 Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8653 * Makefile.in (spew.o): Depend on toplev.h.
8655 * call.c (compare_ics): Initialize variables `deref_from_type2',
8656 `deref_to_type1' and `deref_to_type2'.
8658 * except.c (get_eh_type): Hide prototype and definition.
8659 (process_start_catch_block_old): Remove unused static prototype.
8661 * pt.c (tsubst_decl): Initialize variable `argvec'.
8663 * spew.c: Include toplev.h.
8665 1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
8667 * pt.c (instantiate_decl): Do save and restore file position.
8669 1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
8671 * method.c (build_decl_overload_real): Clear
8672 numeric_output_need_bar after __.
8674 1998-10-05 Nathan Sidwell <nathan@acm.org>
8676 * call.c (build_new_method_call): Issue 'incomplete type' error,
8677 if class is not defined.
8679 1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8681 * call.c (build_object_call): Move declaration of variable
8682 `fn' into the scope where it is used. Don't access variable
8683 `fn' when it is uninitialized, instead use `fns'.
8685 1998-10-04 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
8687 * errfn.c (cp_thing): Print buf as a string not as a printf format
8688 to avoid problems with the operator%. Consequently, `%%' sequences
8689 in format are copied as `%' in buf.
8691 1998-10-04 Jason Merrill <jason@yorick.cygnus.com>
8693 * pt.c (pop_tinst_level): Call extract_interface_info.
8694 (instantiate_decl): Don't save and restore file position.
8696 * decl.c (cp_finish_decl): Make statics in extern inlines and
8697 templates common, if possible and the target doesn't support weak
8700 * decl.c (grokdeclarator): Remove redundant calls to
8701 build_type_variant and some duplicated code.
8702 * sig.c (build_signature_reference_type): Only take the type parm.
8703 (build_signature_pointer_type): Likewise.
8704 * tree.c (build_cplus_method_type): Adjust.
8705 * cp-tree.h: Update.
8707 1998-10-04 Mark Mitchell <mark@markmitchell.com>
8709 * call.c (build_over_call): Make pedwarns about dropped qualifiers
8710 into full-fledged errors.
8711 * cvt.c (convert_to_reference): Likewise.
8712 * typeck.c (convert_for_assignment): Likewise.
8714 * search.c (expand_upcast_vtables): In addition to unsetting
8715 TREE_READONLY, remove top-level const type qualifier.
8717 1998-10-03 Mark Mitchell <mark@markmitchell.com>
8719 * class.c (current_class_ptr, current_class_ref): Clarify
8721 * cvt.c (ocp_convert): Don't expect fold to remove all trivial
8722 NOP type conversions.
8723 * decl.c (decls_match): Use comptypes directly; ignore
8724 qualifiers on the DECL.
8725 (duplicate_decls): Remove qualifier checks on DECL.
8726 (grokdeclarator): Make the type built up include top-level
8728 * decl2.c (do_dtors): Fix spelling error.
8729 * error.c (dump_simple_decl): Don't look at qualifiers on the decl
8730 when printing type information.
8731 * init.c (build_new_1): Add documentation. Deal with the fact
8732 that type of allocated memory now contains qualifiers.
8733 * lex.c (is_global): Improve error-recovery.
8734 * sig.c (build_member_function_pointer): Don't cast away const
8735 on fields of sigtable_entry_type.
8736 * tree.c (lvalue_type): Don't look at top-level qualifiers on
8738 * typeck.c (decay_conversion): Likewise.
8739 (build_component_ref): Make sure the type of the COMPONENT_REF
8740 contains top-level qualifiers, as appropriate. Improve
8742 (build_indirect_ref): Simplify. Don't strip top-level qualifiers.
8743 (build_array_ref): Likewise.
8744 (build_unary_op): Improve error-recovery.
8745 (unary_complex_lvalue): Make taking the address a bound member
8746 function an error, not a sorry.
8747 (build_conditional_expr): Look at the type qualifiers, not the
8748 qualifiers on the expression itself.
8750 1998-10-03 Jason Merrill <jason@yorick.cygnus.com>
8752 * decl2.c (merge_functions): Remove duplicates.
8754 * decl2.c: Add -f{no-,}implicit-inline-templates.
8755 (import_export_decl): Check it.
8757 * decl.c (lookup_name_real): Template parms also take precedence
8758 over implicit typename. Only warn if yylex.
8760 * typeck.c (build_conditional_expr): Only fold if ifexp is an
8763 * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
8766 1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
8768 * cp-tree.h (FORMAT_VBASE_NAME): New macro.
8769 * class.c (build_vbase_pointer): Use it.
8770 * rtti.c (expand_class_desc): Likewise.
8771 * tree.c (build_vbase_pointer_fields): Likewise.
8773 Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
8775 * decl.c (start_decl): Add invocation of
8776 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8777 (start_function): Add invocation of
8778 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8780 * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with
8781 HANDLE_GENERIC_PRAGMAS.
8783 1998-09-28 Anthony Green <green@cygnus.com>
8785 * semantics.c (finish_asm_stmt): Always permit volatile asms.
8787 1998-09-28 Mark Mitchell <mark@markmitchell.com>
8789 * decl.c (grokdeclarator): Tighten checks for invalid
8790 destructors. Improve error-messages and error-recovery.
8791 * decl2.c (check_classfn): Don't assume that mangled destructor
8792 names contain type information.
8794 1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
8796 * search.c (get_base_distance): Remove assert.
8798 * decl2.c (build_anon_union_vars): Don't process a field with no
8800 (finish_anon_union): Also complain about local anon unions with no
8803 1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
8805 * decl.c (lookup_namespace_name): If the name is a namespace,
8806 return it immediately.
8808 Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8810 * cp-tree.h (define_case_label): Remove unused parameter.
8811 (check_java_method): Likewise.
8812 (grokclassfn): Likewise.
8813 (expand_aggr_init): Likewise.
8814 (build_x_delete): Likewise.
8815 (maybe_end_member_template_processing): Likewise.
8816 (unshare_base_binfos): Add prototype.
8817 (string_conv_p): Likewise.
8818 (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
8820 * cvt.c (build_up_reference): Remove unused parameter
8821 `checkconst', all callers changed.
8822 (build_type_conversion): Mark parameter `code' with
8824 (build_expr_type_conversion): Initialize variable `conv'.
8826 * decl.c (push_namespace): Initialize variable `d'.
8827 (define_case_label): Remove unused parameter `decl', all callers
8830 * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
8831 `argc' with ATTRIBUTE_UNUSED.
8832 (grokclassfn): Remove unused parameter `cname', all callers
8834 (check_java_method): Likewise for parameter `ctype'.
8835 (copy_assignment_arg_p): Mark parameter `virtualp' with
8837 (finish_prevtable_vardecl): Likewise for parameter `prev'.
8839 * expr.c (extract_init): Likewise for parameters `decl' and `init'.
8841 * init.c (expand_aggr_init_1): Remove unused parameter
8842 `alias_this', all callers changed.
8843 (expand_aggr_init): Likewise.
8844 (expand_default_init): Likewise.
8845 (build_new_1): Initialize variable `susp'.
8846 (build_x_delete): Remove unused parameter `type', all callers
8849 * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
8851 (readescape): Use (unsigned) value in shift.
8852 (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when
8853 comparing to a signed quantity.
8855 * pt.c (maybe_end_member_template_processing): Remove unused
8856 parameter `decl', all callers changed.
8857 (check_explicit_specialization): Add braces around empty body in
8859 (current_template_args): Initialize variable `args'.
8860 (lookup_template_class): Likewise for variable `prev_local_enum'.
8861 (tsubst_decl): Likewise for variable `r'.
8862 (set_mangled_name_for_template_decl): Initialize variable
8865 * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
8866 Likewise for variable `i'.
8867 (yylex): Initialize variable `trrr'.
8869 * typeck.c (compparms): Mark variable `strict' with
8872 * xref.c (simplify_type): Cast argument of ctype function to
8875 1998-09-24 Mark Mitchell <mark@markmitchell.com>
8877 * cp-tree.h (language_lvalue_valid): Remove.
8878 * decl.c (grokdeclarator): Don't disallow references to functions.
8879 * tree.c (lvalue_p_1): New function, combining duplicated
8882 (real_lvalue_p): Likewise.
8883 * typeck.c (language_lvalue_valid): Remove.
8884 (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
8885 they don't have TREE_READONLY set.
8886 * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
8888 1998-09-24 Benjamin Kosnik <bkoz@loony.cygnus.com>
8890 * spew.c (yylex): Give diagnostic.
8891 * hash.h (is_reserved_word): Add export.
8892 * gxx.gperf: Likewise.
8893 * lex.h (rid): Add RID_EXPORT.
8894 * lex.c (init_parse): Likewise.
8896 Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
8898 * friend.c (do_friend): Make warning a full sentence.
8900 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8902 * parse.y (component_decl_list): Improve error-recovery.
8904 1998-09-22 Benjamin Kosnik <bkoz@loony.cygnus.com>
8906 * decl.c (make_typename_type): Move error to point where name
8907 variable can be used by dump_type.
8909 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8911 * decl.c (grokfndecl): Improve error-recovery.
8912 * decl2.c (grokfield): Likewise.
8913 * pt.c (finish_member_template_decl): Likewise.
8915 1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de>
8917 * method.c (hack_identifier): Finding multiple members is always
8920 1998-09-21 Per Bothner <bothner@cygnus.com>
8922 * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o.
8924 Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
8926 * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
8928 1998-09-20 Mark Mitchell <mark@markmitchell.com>
8930 * class.c (maybe_warn_about_overly_private_class): Reformat.
8932 1998-09-17 Andrew MacLeod <amacleod@cygnus.com>
8934 * exception.cc (__cplus_type_matcher): Realign some code.
8936 1998-09-16 Mark Mitchell <mark@markmitchell.com>
8938 * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
8939 (tinfo2.o): Likewise.
8940 (exception.o): Likewise.
8942 (opnew.o): Likewise.
8943 (opnewnt.o): Likewise.
8944 (opvnew.o): Likewise.
8945 (opvnewnt.o): Likewise.
8946 (opdel.o): Likewise.
8947 (opdelnt.o): Likewise.
8948 (opvdel.o): Likewise.
8949 (opvdelnt.o): Likewise.
8951 1998-09-16 Richard Henderson <rth@cygnus.com>
8953 * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
8955 1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
8957 * call.c (build_field_call): Handle static data members too.
8959 * typeck.c (comptypes): When comparing pointer types, check
8960 whether referred types match even in strictest modes.
8962 1998-09-15 Mark Mitchell <mark@markmitchell.com>
8964 * cp-tree.h: Revert previous change.
8965 (finish_struct_methods): Remove declaration.
8966 * class.c: Revert previous change.
8967 (maybe_warn_about_overly_private_class): New function.
8968 (finish_struct_methods): Declare here, and make static. Remove
8969 unnecessary parameters. Tidy slightly. Use
8970 maybe_warn_about_overly_private_class.
8971 (finish_struct_1): Adjust. Remove check for private constructors,
8973 (finish_struct): Adjust.
8975 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8977 * except.c (expand_start_catch_block): No need to check for new
8979 (process_start_catch_block_old): Deleted.
8980 (process_start_catch_block): Add call to start_decl_1().
8981 (expand_end_catch_block): Add call to end_catch_handler().
8982 * exception.cc (__cplus_type_matcher): Only check the exception
8983 language if there is an exception table.
8985 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8987 * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
8988 as used to prevent conflicts with virtual function tables.
8990 1998-09-14 Mark Mitchell <mark@markmitchell.com>
8992 * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
8993 (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
8994 * class.c (maybe_class_too_private_p): New function.
8995 (finish_struct_methods): Use it.
8996 (finish_struct_1): Likewise.
8997 (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
9000 * pt.c (check_specialization_scope): Fix spelling error.
9001 (check_explicit_specialization): Remove code to handle explicit
9002 specializations in class scope; they are now correctly diagnosed
9005 1998-09-10 Mark Mitchell <mark@markmitchell.com>
9007 * decl.c (pushdecl): Don't copy types if the
9008 DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
9011 1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
9013 * class.c (get_enclosing_class): New function.
9014 (is_base_of_enclosing_class): Likewise.
9015 * cp-tree.h (get_enclosing_class): Declare.
9016 (is_base_of_enclosing_class): Likewise.
9017 * pt.c (coerce_template_parms): Use them.
9019 1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
9021 * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
9022 null to decide whether to use it.
9024 * error.c (dump_type_real): Handle NAMESPACE_DECL.
9025 * parse.y (base_class.1): Avoid crash on error.
9027 1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
9029 * decl.c (make_typename_type): If context is a namespace, the code
9032 1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
9034 * parse.y (nomods_initdcl0): Set up the parser stack correctly.
9036 1998-09-08 Mark Mitchell <mark@markmitchell.com>
9038 * cp-tree.h (anonymous_namespace_name): Declare.
9039 * decl.c: Define it.
9040 (push_namespace): Use anonymous_namespace_name, rather than local
9042 * error.c (dump_decl): If a namespace is named
9043 anonymous_namespace_name, call it {anonymous}.
9045 * decl.c (grokparms): Distinguish between references and pointers
9048 1998-09-08 Richard Henderson <rth@cygnus.com>
9049 Mark Mitchell <mark@markmitchell.com>
9051 * pt.c (process_partial_specialization): Consistently allocate
9052 and zero tpd.parms based on ntparms. Use tpd2.parms, not
9053 tpd.parms, where appropriate.
9055 Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
9057 * Makefile.in (INCLUDES): Update after recent toplevel gcc
9060 1998-09-05 Mark Mitchell <mark@markmitchell.com>
9062 * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
9063 * class.c (finish_struct): Remove hackery to deal with explicit
9064 specializations in class scope.
9065 * decl.c (grokfndecl): Improve error-recovery.
9066 * decl2.c (grokfield): Likewise.
9067 * pt.c (check_specialization_scope): New function.
9068 (begin_specialization): Call it.
9069 (process_partial_specialization): New function, split out from
9070 push_template_decl. Check partial specializations more
9072 (push_template_decl): Call it.
9073 (check_explicit_specialization): Don't attempt to handle explicit
9074 specializations in class scope.
9075 (template_parm_data): Document. Add current_arg and
9076 arg_uses_template_parms.
9077 (mark_template_parm): Set it.
9078 (tsubst_arg_types): Remove unused variable.
9079 * semantics.c (begin_class_definition): Tweak.
9081 1998-09-04 Mark Mitchell <mark@markmitchell.com>
9083 * inc/typeinfo (type_info::type_info(const char*)): Make
9086 * cp-tree.h (hash_tree_cons_simple): New macro.
9087 * pt.c (tsubst_arg_types): New function. Use hash_tree_cons.
9088 (coerce_template_parms): Use make_temp_vec, instead of
9089 make_tree_vec. Document this behavior.
9090 (lookup_template_class): Likewise.
9091 (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
9092 Remove dead code (and add assertion to check its deadness). Fix
9093 bug w.r.t. exception specifications.
9095 1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
9097 * decl2.c (import_export_vtable): Always make artificials comdat.
9098 (import_export_decl): Likewise.
9099 * pt.c (mark_decl_instantiated): Likewise.
9101 1998-09-03 Mark Mitchell <mark@markmitchell.com>
9103 * cp-tree.h (finish_globally_qualified_member_call_expr):
9105 (finish_qualified_call_expr).
9106 * semantics.c: Likewise.
9107 * parse.y (primary): Use it.
9108 * method.c (hack_identifier): Remove redundant code.
9110 * init.c (resolve_offset_ref): Call convert_from_reference to
9111 handle members of reference type. Improve error recovery.
9113 1998-09-03 Benjamin Kosnik <bkoz@cygnus.com>
9115 * cp-tree.h: Declare warn_nontemplate_friend.
9116 * decl2.c (lang_decode_option): Set.
9117 * lang-options.h: Add -Wnon-template-friend.
9118 * friend.c (do_friend): Use to toggle non-template function warning.
9120 1998-09-03 Mark Mitchell <mark@markmitchell.com>
9122 * decl.c (finish_enum): Don't resolve CONST_DECLs to their
9123 corresponding INTEGER_CSTs when processing_template_decl.
9124 * pt.c (tsubst_enum): Tweak accordingly.
9126 1998-09-03 Benjamin Kosnik <bkoz@rhino.cygnus.com>
9128 * decl.c (pushdecl_class_level): Add warning here.
9131 1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
9133 * cvt.c (convert_pointer_to_real): Tidy.
9134 * search.c (get_base_distance_recursive): Simplify.
9135 (get_base_distance): Likewise.
9137 * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
9140 Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
9142 * lex.c (check_newline): Call HANDLE_PRAGMA before
9143 HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
9144 if unknown pragmas are encountered.
9145 (handle_sysv_pragma): Interpret return code from
9146 handle_pragma_token (). Return success/failure indication rather
9147 than next unprocessed character.
9148 (pragma_getc): New function: retrieves characters from the
9149 input stream. Defined when HANDLE_PRAGMA is defined.
9150 (pragma_ungetc): New function: replaces characters back into the
9151 input stream. Defined when HANDLE_PRAGMA is defined.
9153 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
9155 * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
9156 * class.c (build_vtable_entry_ref): Likewise.
9158 1998-09-01 Mark Mitchell <mark@markmitchell.com>
9160 * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
9161 * decl2.c (import_export_decl): Likewise.
9162 * pt.c (instantiate_decl): Use it.
9164 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
9166 * decl.c (lookup_name_real): Also do implicit typename thing for
9167 artificial TYPE_DECLs.
9168 * search.c (lookup_field): Likewise.
9169 (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
9170 * semantics.c (begin_constructor_declarator): Use enter_scope_of.
9171 (enter_scope_of): Extract type from implicit typename.
9172 (begin_class_definition): Likewise.
9173 * lex.c (identifier_type): Handle implicit typename when checking
9176 * cp-tree.h: Declare flag_strict_prototype.
9177 * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
9179 * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
9180 specified, set it to the value of pedantic.
9182 1998-09-01 Mark Mitchell <mark@markmitchell.com>
9184 * decl2.c (arg_assoc): Handle template-id expressions as arguments.
9186 1998-08-31 Mark Mitchell <mark@markmitchell.com>
9188 * decl.c (finish_enum): Handle member enums of classes declared in
9191 * decl2.c (grok_x_components): Strip attributes before calling
9194 1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
9196 * cp-tree.h, decl2.c: Remove support for -fall-virtual,
9197 -fenum-int-equivalence and -fno-nonnull-objects.
9198 * class.c (check_for_override): Remove support for -fall-virtual.
9199 (finish_struct_1): Likewise.
9200 * call.c (build_new_op): Remove support for -fenum-int-equivalence.
9201 * typeck.c (build_binary_op_nodefault): Likewise.
9202 * cvt.c (ocp_convert): Likewise.
9203 * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
9204 * class.c (build_vbase_path): Likewise.
9206 Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
9208 * Makefile.in (INTERFACE): New, set to 1.
9210 1998-08-30 Mark Mitchell <mark@markmitchell.com>
9212 * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
9213 comparing with global_namespace.
9214 (dump_aggr_type): Likewise.
9216 * decl.c (grokfndecl): Issue error on declaration of friend
9217 templates with explicit template arguments.
9219 * pt.c (convert_template_argument): New function, split out
9221 (coerce_template_parms): Here.
9222 (tsubst): Attempt better error-recovery.
9224 1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com>
9226 * pt.c (decl_template_parm_p): Add checks for
9227 TEMPLATE_TEMPLATE_PARM.
9229 1998-08-28 Mark Mitchell <mark@markmitchell.com>
9231 * lex.c (do_identifier): Fix thinko in previous change.
9233 1998-08-28 Jason Merrill <jason@yorick.cygnus.com>
9235 * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
9236 * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
9238 1998-08-28 Richard Henderson <rth@cygnus.com>
9240 Add support for discarding unused virtual functions.
9241 * lang-options.h: Add -fvtable-gc.
9242 * cp-tree.h: Add flag_vtable_gc.
9243 * decl2.c (output_vtable_inherit): New fn.
9244 (finish_vtable_vardecl): Call it.
9245 * class.c (build_vtable_entry_ref): New fn.
9246 (build_vtbl_ref): Call it.
9248 1998-08-28 Mark Mitchell <mark@markmitchell.com>
9250 * cp-tree.h (build_enumerator): Take the enumeration type as a
9252 * decl.c (finish_enum): Don't set the TREE_TYPE for the
9253 enumeration constant values if we're processing_template_decls.
9254 Don't set the type for the CONST_DECLs either; that's done in
9256 (build_enumerator): Take the enumeration type as a
9258 * lex.c (do_identifier): Don't resolve enumeration constants while
9259 processing template declarations, even if they happen to be
9260 TEMPLATE_PARM_INDEXs.
9262 * parse.y (current_enum_type): New variable.
9263 (primary): Don't allow statement-expression in local classes just
9264 as we don't in global classes.
9265 (structsp): Use current_enum_type.
9266 (enum_list): Likewise.
9267 * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
9268 finish_enum; they no longer occur.
9270 * cp-tree.h (finish_base_specifier): New function.
9271 * parse.y (base_class): Use it.
9272 * semantics.c (finish_base_specifier): Define it.
9274 * parse.y (structsp): Warn on use of typename outside of template
9277 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
9279 * lex.c (handle_cp_pragma): Remove #pragma vtable.
9280 * lang-options.h: Remove +e options.
9281 * decl2.c (lang_decode_option): Likewise.
9282 (import_export_vtable): Don't check write_virtuals.
9283 (finish_vtable_vardecl, finish_file): Likewise.
9284 * search.c (dfs_debug_mark): Likewise.
9285 * semantics.c (begin_class_definition): Likewise.
9286 * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
9288 * call.c (build_over_call): Check flag_elide_constructors.
9289 * decl2.c: flag_elide_constructors defaults to 1.
9290 * typeck.c (convert_arguments): Remove return_loc parm.
9291 (build_function_call_real): Adjust.
9293 * search.c: Tear out all mi_matrix and memoize code.
9294 (lookup_field, lookup_fnfields): Use scratch_tree_cons.
9295 * lang-options.h: Remove documentation for -fhandle-exceptions,
9296 -fmemoize-lookups and -fsave-memoized.
9297 * cp-tree.h: Lose mi_matrix and memoize support.
9298 * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
9299 * class.c: Lose struct class_level.
9300 (pushclass, popclass): Lose memoize support.
9301 * init.c (build_offset_ref): Likewise.
9303 Never change BINFO_INHERITANCE_CHAIN.
9304 * init.c (emit_base_init): Change modification of
9305 BINFO_INHERITANCE_CHAIN to an assert.
9306 * search.c (get_base_distance_recursive): Likewise.
9307 (get_base_distance): Likewise.
9308 (lookup_member): Likewise.
9309 (convert_pointer_to_single_level): Likewise.
9310 (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs.
9311 (lookup_fnfields): Likewise.
9312 * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
9313 (unshare_base_binfos): Don't call propagate_binfo_offsets.
9314 (layout_basetypes): Call propagate_binfo_offsets instead of
9315 unshare_base_binfos.
9316 * decl.c (xref_basetypes): Call unshare_base_binfos.
9317 * pt.c (instantiate_class_template): Likewise.
9318 * tree.c (reverse_path): Remove 'copy' parm; always make a
9320 * class.c (build_vbase_path): Just call it.
9321 * search.c (compute_access): Likewise. Don't re-reverse.
9323 1998-08-27 Mark Mitchell <mark@markmitchell.com>
9325 * class.c (build_vbase_path): Use reverse_path.
9326 (finish_base_struct): Move warnings for inaccessible bases to
9328 (modify_one_vtable): Remove check of TREE_USED (binfo).
9329 (fixup_vtable_deltas1): Likewise.
9330 * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
9331 (xref_tag): Remove binfos parameter.
9332 (make_binfo): Remove chain parameter.
9333 (reverse_path): Add copy parameter.
9334 * decl.c (init_decl_processing): Change calls to xref_tag.
9335 (xref_tag): Remove binfos parameter.
9336 (xref_basetypes): Change calls to make_binfo.
9337 * decl2.c (grok_x_components): Change calls to xref_tag.
9338 (handle_class_head): Likewise.
9339 * friend.c (do_friend): Likewise.
9340 * lex.c (make_lang_type): Change calls to make_binfo.
9341 * parse.y (structsp): Change calls to xref_tag.
9342 (named_complex_class_head_sans_basetype): Likewise.
9343 (named_class_head): Likewise.
9344 * rtti.c (init_rtti_processing): Likewise.
9345 * search.c (compute_access): Change calls to reverse_path.
9346 (dfs_get_vbase_types): Change calls to make_binfo.
9347 (get_vbase_types): Remove dead code.
9348 * tree.c (unshare_base_binfos): Change calls to make_binfo.
9349 (layout_basetypes): Warn here about inaccessible bases.
9350 (make_binfo): Remove chain parameter.
9351 (reverse_path): Add copy parameter.
9353 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
9355 * class.c: #if 0 complete_type_p.
9356 * init.c (build_java_class_ref, build_new_1): Remove unused locals.
9357 * method.c (process_overload_item): Likewise.
9358 * typeck.c (comp_target_types): Likewise.
9360 Stop sharing binfos for indirect virtual bases.
9361 * tree.c (propagate_binfo_offsets): Unshare vbases, too.
9362 (layout_basetypes): Likewise.
9363 (unshare_base_binfos): Copy vbases, too.
9364 * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
9365 BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
9366 (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
9367 CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
9368 * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
9369 reference to BINFO_VIA_PUBLIC.
9370 (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
9371 (push_class_decls): Use them.
9372 (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
9373 (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
9375 1998-08-27 Mark Mitchell <mark@markmitchell.com>
9377 * decl.c (build_enumerator): Set DECL_CONTEXT for the
9380 1998-08-26 Mark Mitchell <mark@markmitchell.com>
9382 * cp-tree.h (finish_enum): Change prototype.
9383 * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
9384 VALUES parameter. Don't try to compute mins/maxs if
9385 processing_template_decl.
9386 * parse.y (structsp): Use new calling sequence for finish_enum.
9387 * pt.c (tsubst_enum): Likewise. Take the new type as input.
9388 (lookup_template_class): Remove unused variables. Tweak.
9389 Register enums on instantiation list before substituting
9390 enumeration constants.
9391 (tsubst_decl): Remove unused variables.
9392 (regenerate_decl_from_template): Likewise.
9394 * decl.c (duplicate_decls): Don't obliterate the
9395 DECL_TEMPLATE_INFO for a template if we're not replacing it with
9398 * lex.c (do_identifier): Fix typo in comment.
9400 Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9402 * errfn.c: Remove stdarg.h/varargs.h.
9405 1998-08-25 Brendan Kehoe <brendan@cygnus.com>
9407 * pt.c (tsubst_copy): Only do typename overloading on an
9408 IDENTIFIER_NODE that happens to look like a typename if it actually
9409 has a type for us to use.
9411 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
9413 * typeck.c (comp_cv_target_types): Split out...
9414 (comp_target_types): From here. Don't allow cv-qual changes under
9415 a pointer if nptrs == 0. Fix OFFSET_TYPE handling.
9416 (build_ptrmemfunc): Pass 1 to nptrs.
9417 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
9419 1998-08-25 Mark Mitchell <mark@markmitchell.com>
9421 * search.c (dependent_base_p): Don't compare a binfo to
9422 current_class_type; use the TREE_TYPE of the binfo instead.
9424 * cp-tree.h (CLASS_TYPE_P): Revise definition.
9426 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
9428 * decl.c (duplicate_decls): Don't complain about different
9429 exceptions from an internal decl even if pedantic.
9431 * typeck.c (convert_for_assignment): Converting from pm of vbase
9432 to derived is an error, not a sorry.
9434 * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
9435 * class.c (fixed_type_or_null): Rename from
9436 resolves_to_fixed_type_p. Return the dynamic type of the
9437 expression, if fixed, or null.
9438 (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type
9439 does not match the static type.
9440 (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use
9441 resolves_to_fixed_type_p again.
9443 1998-08-24 Mark Mitchell <mark@markmitchell.com>
9445 * pt.c (tsubst_decl): Move special case code for dealing with
9446 tricky friend templates here from ...
9447 (regenerate_decl_from_template): Here.
9449 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
9451 * decl.c (start_decl): Remove redundant linkage check.
9453 1998-08-24 Gavin Romig-Koch <gavin@cygnus.com>
9455 * typeck.c (c_expand_return): Handle the case that valtype
9456 is wider than the functions return type.
9458 1998-08-24 Mark Mitchell <mark@markmitchell.com>
9460 * cp-tree.h (CLASS_TYPE_P): New macro.
9461 * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
9462 * pt.c (process_template_parm): Undo previous change.
9464 1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
9466 * cp-tree.h: Declare.
9467 * pt.c (decl_template_parm_p): New function.
9468 * decl.c (pushdecl): Check decls for redeclaring template parms.
9469 (xref_tag): Make redeclaration an error, print decl.
9470 * decl2.c (grokfield): Check field_decls for redeclaration as well.
9472 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
9474 * parse.y (primary): Fix up the type of string constants.
9476 1998-08-24 Mark Mitchell <mark@markmitchell.com>
9478 * typeck.c (convert_for_initialization): Move check for odd uses
9479 of NULL to avoid duplicate warnings.
9481 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
9483 * tree.c (lvalue_type): Fix for arrays.
9484 * typeck.c (string_conv_p): New fn.
9485 (convert_for_assignment): Use it.
9486 (build_unary_op): Use lvalue_type.
9487 * call.c (standard_conversion, convert_like): Use string_conv_p.
9488 (add_function_candidate): Use lvalue_type.
9489 * cvt.c (convert_to_reference): Likewise.
9490 * decl2.c (lang_decode_option): Ignore -traditional.
9491 * decl.c (init_decl_processing): flag_writable_strings inhibits
9494 1998-08-24 Andrew MacLeod <amacleod@cygnus.com>
9496 * lang-options.h (lang_options): Add fconst-strings to the list
9498 * decl2.c (lang_f_options, lang_decode_option): Likewise.
9500 1998-08-24 Nathan Sidwell <nathan@acm.org>
9502 * lex.c (real_yylex): Don't warn about long long constants if
9503 we're allowing long long.
9505 1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
9507 * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
9508 accessing bindings directly.
9510 * search.c (my_tree_cons): Reimplement.
9512 * lang-specs.h: Remove __HONOR_STD.
9513 * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
9515 1998-08-23 Mark Mitchell <mark@markmitchell.com>
9517 * decl.c (grokdeclarator): Complain about in-class initialization
9518 of aggregates and/or references.
9519 * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
9520 TEMPLATE_TYPE_PARMs.
9522 * decl2.c (grok_array_decl): Add comment.
9523 (mark_used): Don't instantiate an explicit instantiation.
9524 * friend.c (make_friend_class): Remove bogus comment. Fix check
9525 for partial specializations.
9526 * pt.c (check_explicit_specialization): Don't
9527 SET_DECL_EXPLICIT_INSTANTIATION here.
9528 (mark_decl_instantiated): Or here.
9529 (do_decl_instantiation): Do it here, instead. Add checks for
9530 duplicate explicit instantiations, etc. Tidy.
9531 (do_type_instantiation): Likewise.
9532 (instantiate_decl): Improve comments. Complain about explicit
9533 instantiations where no definition is available.
9535 * cp-tree.h (ansi_null_node): Remove.
9536 * call.c (build_over_call): Warn about converting NULL to an
9538 * cvt.c (build_expr_type_conversion): Likewise. Use
9539 null_ptr_cst_p instead of expanding it inline.
9540 * decl.c (ansi_null_node): Remove.
9541 (init_decl_processing): Make null_node always have integral type.
9542 * except.c (build_throw): Warn about converting NULL to an
9544 * lex.c (init_parse): Remove handling of ansi_null_node.
9545 * pt.c (type_unification_real): Don't convert NULL to void* type.
9546 * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
9547 (convert_for_assignment): Warn about converting NULL to an
9549 (convert_for_initialization): Likewise.
9551 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
9553 * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
9554 * pt.c (coerce_template_parms): Use no_linkage_check.
9555 * decl.c (grokvardecl): Likewise.
9556 (grokfndecl): Likewise. Members of anonymous types have no linkage.
9558 * method.c (process_overload_item): Remove useless code.
9560 1998-08-20 Per Bothner <bothner@cygnus.com>
9562 Handle new'ing of Java classes.
9563 * init.c (build_class_classref): New function.
9564 (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject;
9565 constructor does not return this; don't need to exception-protect.
9567 * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag.
9568 * decl2.c (acceptable_java_type): Handle template-derived types.
9570 1998-08-20 Per Bothner <bothner@cygnus.com>
9572 * decl2.c (import_export_vtable): Suppress vtables for Java classes.
9574 1998-08-20 Mark Mitchell <mark@markmitchell.com>
9576 * decl.c (duplicate_decls): Always merge the old and new patterns
9577 for templates, regardless of whether or not the new one has
9578 DECL_INITIAL. Don't throw away specializations. Merge
9580 * pt.c (tsubst_decl): Use the right pattern when calculating the
9581 complete args for a new template instance.
9582 (do_decl_instantiation): Fix typo in comment.
9583 (regenerate_decl_from_template): Deal with tricky friend template
9585 (instantiate_decl): Likewise.
9587 Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com)
9589 * init.c (build_builtin_delete_call): Add missing assemble_external
9592 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
9594 * parse.y (notype_unqualified_id): Also accept ~A<int>.
9596 1998-08-19 Mark Mitchell <mark@markmitchell.com>
9598 * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
9600 * except.c (build_throw): Warn when NULL is thrown, even with
9601 -ansi. Use ansi_null_node, rather than integer_zero_node, in the
9604 * cp-tree.h (ansi_null_node): New variable.
9605 * decl.c (ansi_null_node): New variable.
9606 (init_decl_processing): Initialize its type.
9607 * lex.c (init_parse): Initialize its value. Use ansi_null_node
9608 for null_node in non-ANSI mode.
9609 * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
9610 place of null_node to avoid spurious errors.
9612 1998-08-17 Mark Mitchell <mark@markmitchell.com>
9614 * cp-tree.h (enter_scope_of): New function.
9615 * parse.y (complex_direct_notype_declarator): Use it.
9616 * semantics.c (enter_scope_of): New function.
9618 1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
9620 * decl.c (grokparms): No, here.
9622 * decl.c (grokdeclarator): Catch parm with pointer to array of
9623 unknown bound here...
9624 * method.c (process_overload_item): ...not here.
9626 * gxxint.texi: Remove obsolete documentation of overloading code.
9628 * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
9629 * class.c (finish_struct_bits): Likewise.
9631 * tree.c (lvalue_type): Fix for arrays.
9632 * typeck.c (build_unary_op): Use lvalue_type.
9633 * call.c (add_function_candidate): Likewise.
9634 * cvt.c (convert_to_reference): Likewise.
9636 * decl2.c (lang_decode_option): Ignore -traditional.
9638 * init.c (build_offset_ref): Don't mess with error_mark_node.
9639 * lex.c (do_scoped_id): Use cp_error.
9641 * rtti.c (get_tinfo_fn): Don't mess with the context for now.
9643 1998-08-17 Benjamin Kosnik <bkoz@loony.cygnus.com>
9645 * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
9647 Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com)
9649 * cp-tree.h (set_identifier_local_value): Provide prototype.
9651 * decl2.c (do_namespace_alias): Remove unused variables `binding'
9654 Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com>
9656 * Makefile.in: Rename BBISON to BISON so that it can be properly
9657 inherited from the parent makefile.
9659 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
9661 * lang-options.h: Add -finit-priority.
9662 * decl2.c: Likewise. Check flag_init_priority instead of
9665 * decl2.c (setup_initp): New fn.
9666 (start_objects, finish_objects, do_ctors): Handle init_priority.
9667 (do_dtors, finish_file): Likewise.
9669 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
9671 * pt.c (tsubst_copy): Hush warning.
9673 * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
9675 1998-08-12 Mark Mitchell <mark@markmitchell.com>
9677 * pt.c (print_template_context): Don't abort when instantiating a
9680 * decl.c (grokdeclarator): Issue errors on namespace qualified
9681 declarators in parameter lists or in class scope.
9683 1998-08-09 Mark Mitchell <mark@markmitchell.com>
9685 * pt.c (check_explicit_specialization): Don't abort on bogus
9686 explicit instantiations.
9688 1998-08-07 Mark Mitchell <mark@markmitchell.com>
9690 * typeck.c (require_complete_type): Use complete_type_or_else.
9691 (complete_type_or_else): Always return NULL_TREE on failure, as
9694 * pt.c (tsubst_aggr_type): Prototype.
9695 (tsubst_decl): New function, split out from tsubst. Set
9696 input_filename and lineno as appropriate.
9697 (pop_tinst_level): Restore the file and line number saved in
9699 (instantiate_class_template): Set input_filename and lineno as
9701 (tsubst): Move _DECL processing to tsubst_decl. Make sure the
9702 context for a TYPENAME_TYPE is complete.
9704 * decl2.c (grokbitfield): Issue errors on bitfields declared with
9706 (do_dtors): As in do_ctors, pretend to be a member of the same
9707 class as a static data member while generating a call to its
9710 * cvt.c (cp_convert_to_pointer): Handle NULL pointer
9711 conversions, even in complex virtual base class hierarchies.
9713 1998-08-06 Mark Mitchell <mark@markmitchell.com>
9715 * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
9716 (TYPE_TEMPLATE_INFO): Likewise.
9717 (SET_TYPE_TEMPLATE_INFO): Likewise.
9718 (ENUM_TI_TEMPLATE): Likewise.
9719 (ENUM_TI_ARGS): Likewise.
9720 (lookup_nested_type_by_name): Remove.
9721 * decl.c (maybe_process_template_type_declaration): Handle enums.
9722 (start_enum): Don't check for primary-template enum declarations
9724 (finish_enum): Clean up, document. Make sure template enum
9725 constants get the correct type.
9726 (build_enumerator): Copy initializers for template enumerations,
9728 (grok_enum_decls): Document.
9729 * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
9730 better. Build LOOKUP_EXPRs for local variables, even if they are
9732 * pt.c (tsubst_enum): Remove field_chain parameter.
9733 (template_class_depth): Include the depth of surrounding function
9735 (push_template_decl): Check for primary-template enum declarations
9736 here. Deal with enumeration templates.
9737 (lookup_template_class): Likewise.
9738 (for_each_template_parm): Likewise.
9739 (instantiate_class_template): Don't call tsubst_enum directly,
9740 call tsubst instead, to instantiate enums. Deal with all
9741 field_chain issues here, not in tsubst_enum.
9742 (lookup_nested_type_by_name): Remove.
9743 (tsubst_aggr_type): Revise handling of enumeration types.
9745 (tsubst_copy): Likewise.
9746 (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
9748 1998-08-04 Mark Mitchell <mark@markmitchell.com>
9750 * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
9751 uses template parameters.
9752 * method.c (build_template_parm_names): Use the full set of
9753 template arguments for tsubst'ing.
9754 (build_overload_identifier): Pass the full set of template
9755 arguments to build_template_parm_names, not just the
9757 * pt.c (TMPL_ARGS_DEPTH): Define using
9758 TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
9759 (NUM_TMPL_ARGS): New macro.
9760 (add_outermost_template_args): Deal with the case where the outer
9761 args will be completely discarded.
9762 (coerce_template_parms): Use the full set of template arguments
9763 for tsubst'ing. Simplify. Add some asserts. Improve
9765 (lookup_template_class): Pass the full set of template arguments
9766 to coerce_template_parms.
9767 (tsubst): Add assertion.
9768 (do_type_instantiation): Don't instantiate member template
9771 * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
9772 name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
9774 1998-08-03 Jason Merrill <jason@yorick.cygnus.com>
9776 * method.c (set_mangled_name_for_decl): Change return type to void.
9778 * decl.c (lookup_name_real): A namespace-level decl takes priority
9779 over implicit typename. Avoid doing the same lookup twice.
9781 * search.c (dependent_base_p): New fn.
9782 (dfs_pushdecls, dfs_compress_decls): Use it.
9784 * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
9785 virtual functions if the type doesn't have any.
9787 1998-08-03 Mark Mitchell <mark@markmitchell.com>
9789 * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
9790 uses template parameters.
9792 1998-08-02 Mark Mitchell <mark@markmitchell.com>
9794 * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument.
9795 * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
9796 * lex.c (do_identifier): Don't use a second argument, or a type,
9797 when building LOOKUP_EXPRs.
9798 (do_identifier): Likewise.
9799 (do_scoped_id): Likewise.
9800 * method.c (hack_identifier): Improve error message.
9801 * pt.c (lookup_template_function): Don't needlessly call
9802 copy_to_permanent or build_min.
9803 (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if
9805 (do_decl_instantiation): Improve error message.
9806 * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
9807 (build_min): Copy the type to the permanent obstack, too.
9809 1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
9811 * init.c (init_init_processing): Remove BI* handling.
9812 (build_builtin_call): Remove.
9813 (build_builtin_delete_call): New fn.
9814 (build_delete): Use it.
9816 1998-07-31 Mark Mitchell <mark@markmitchell.com>
9818 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
9819 (maybe_check_template_type): New function.
9820 * decl.c (maybe_process_template_type_declaration): New function,
9821 split out from pushtag Call maybe_check_template_type.
9822 (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P.
9823 (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9824 * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9825 * pt.c (template_class_depth_real): Generalization of ...
9826 (template_class_depth): Use it.
9827 (register_specialization): Use duplicate_decls for duplicate
9828 declarations of specializations.
9829 (maybe_check_template_type): New function.
9830 (push_template_decl_real): Fix comment.
9831 (convert_nontype_argument): Likewise.
9832 (lookup_template_class): Likewise. Avoid an infinite loop on
9834 (tsubst_friend_function): Fix comment.
9835 (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
9837 * semantics.c (begin_function_definition): Use
9838 reset_specialization to note that template headers don't apply
9839 directly to declarations after the opening curly for a function.
9841 1998-07-29 Jason Merrill <jason@yorick.cygnus.com>
9843 * decl.c (push_overloaded_decl): Use current_namespace instead of
9844 DECL_CONTEXT (decl) to determine where we go.
9846 * decl.c (lookup_name_real): Fix typo.
9848 1998-07-28 Mark Mitchell <mark@markmitchell.com>
9850 * friend.c (is_friend): Be lenient with member functions to deal
9851 with nested friends.
9853 1998-07-28 Jason Merrill <jason@yorick.cygnus.com>
9855 * class.c (finish_struct_1): Convert integer_zero_node to
9856 ssizetype before passing it to set_rtti_entry.
9857 * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
9858 of any size to a pointer.
9860 1998-07-27 Mark Mitchell <mark@markmitchell.com>
9862 * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
9863 (build_template_decl_overload): Remove.
9864 (set_mangled_name_for_decl): New function.
9865 (innermost_args): Remove is_spec parameter.
9866 (most_specialized, most_specialized_class): Remove declarations.
9867 (lookup_template_class): Add entering_scope parameter.
9868 (maybe_process_partial_specialization): New function.
9869 (finish_template_decl): Likewise.
9870 (finish_template_type): Likewise.
9871 * class.c (finish_struct): Clean up processing of member template
9873 * decl.c (pushtag): Fix formatting.
9874 (lookup_tag): Improve handling of pseudo-global levels.
9875 (make_typename_type): Adjust call to lookup_template_class.
9876 (shadow_tag): Use maybe_process_partial_specialization.
9877 (xref_tag): Improve handling of member friends.
9878 (start_function): Call push_nested_class before
9879 push_template_decl. Don't call push_template_decl for
9881 * decl2.c (grok_x_components): Don't call xref_tag for
9882 template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
9883 (grokclassfn): Use set_mangled_name_for_decl.
9884 (arg_assoc_class): Adjust call to innermost_args.
9885 (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
9886 * error.c (dump_function_name): Improve printing of template
9888 * friend.c (is_friend): Don't compare types of decls to determine
9889 friendship, unless flag_guiding_decls.
9890 (make_friend_class): Partial specializations cannot be friends.
9891 (do_friend): Use set_mangled_name_for_decl. Call
9892 push_template_decl_real instead of push_template_decl.
9893 * method.c (build_decl_overload_real): Remove prototype. Give it
9895 (build_overload_identififer): Adjust call to innermost_args.
9896 (build_template_decl_overload): Remove.
9897 (set_mangled_name_for_decl): New function.
9898 * parse.y (.finish_template_type): New non-terminal.
9899 (template_def): Use finish_template_decl. Use template_extdef
9901 (template_extdef, template_datadef): New non-terminals, containing
9902 only those rules for things which can be templates.
9904 (template_type, self_template_type): Use .finish_template_type.
9905 (named_class_head): Use maybe_process_partial_specialization.
9906 * pt.c (mangle_class_name_for_template): Remove context parameter.
9907 (get_class_bindings): Remove outer_args parameter.
9908 (complete_template_args): Remove.
9909 (add_outermost_template_args): New function.
9910 (register_specialization): Return the specialization.
9911 (unregister_specialization): New function.
9912 (tsubst_template_parms): Likewise.
9913 (most_specialized, most_specialized_class): Prototype here as
9915 (original_template): Rename to most_general_template.
9916 (tsubst_template_parms): New function.
9917 (set_mangled_name_for_template_decl): Likewise.
9918 (TMPL_ARGS_DEPTH): New macro.
9919 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
9920 (TMPL_ARGS_LEVEL): New macro.
9921 (SET_TMPL_ARGS_LEVEL): Likewise.
9922 (TMPL_ARG): Likewise.
9923 (SET_TMPL_ARG): Likewise.
9924 (TMPL_ARGS_DEPTH): Likewise.
9925 (finish_member_template_decl): Use finish_template_decl.
9926 (maybe_process_partial_specialization): New function, split out
9928 (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
9929 (maybe_begin_member_template_processing): Use new macros.
9930 (is_member_template): Likewise.
9931 (is_member_template_class): Likewise.
9932 (add_to_template_args): Likewise. Deal with multiple levels of
9934 (maybe_process_partial_specialization): New function.
9935 (retrieve_specialization): Add consistency check.
9936 (determine_specialization): Return full argument list.
9937 (check_explicit_specialization): Tweak friend handling. Use full
9938 argument lists. Simplify.
9939 (current_template_args): Use new macros.
9940 (push_template_decl_real): Change ill-named mainargs to specargs.
9941 Check that a partial specialization actually specializes at least
9942 one parameter. Improve friend handling. Modify for full
9944 (classtype_mangled_name): Don't mangle the names of
9946 (lookup_template_class): Add entering_scope parameter. Use it to
9947 avoid finding a template type when an instantiation is required.
9948 Simplify. Use full template arguments.
9949 (tsubst_friend_function): Use unregister_specialization. Use new
9950 macros. Use full template arguments.
9951 (tsubst_friend_class): Substitute, using tsubst_template_parms,
9952 into the template parameters before passing them to
9953 redeclare_class_template.
9954 (instantiate_class_template): Simplify. Use full template
9955 arguments. Adjust calls to get_class_bindings. Use
9956 SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
9957 (innermost_args): Use new macros.
9958 (tsubst_aggr_type): New function, split out from tsubst.
9959 (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
9960 conventions for lookup_template_class. Refine handling of partial
9961 instantiations. Remove calls to complete_template_args.
9962 Simplify. Add consistency checks. Use set_mangled_name_for_decl
9963 and set_mangled_name_for_template_decl.
9964 (tsubst_copy): Use tsubst_aggr_type.
9965 (instantiate_template): Use full template arguments.
9966 (more_specialized): Improve formatting.
9967 (more_specialized_class): Adjust calls to get_class_bindings.
9968 (get_bindings_real): Don't call complete_template_args.
9969 (most_specialized): Don't overwrite input; create a new list.
9970 (most_specialized_class): Use most_general_template.
9971 (regenerate_decl_from_template): Use unregister_specialization.
9972 Use full template arguments.
9973 (instantiate_decl): Use full template arguments.
9974 (set_mangled_name_for_template_decl): New function.
9975 * semantics.c (begin_class_definition): Use
9976 maybe_process_partial_specialization.
9977 (finish_member_class_template): New function.
9978 (finish_template_decl): Likewise.
9979 (finish_template_type): Likewise.
9980 (typeck.c): Don't crash after issuing a compiler_error.
9981 * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
9983 1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
9985 * typeck2.c (build_functional_cast): Handle default-initialization.
9987 * call.c (build_over_call): Pass 1 to popclass.
9989 * parse.y (direct_notype_declarator): Add precedence declaration
9990 to notype_unqualified_id case.
9991 * Makefile.in (EXPECT): Adjust.
9993 * tree.c (ovl_member): Fix for single function in OVL.
9995 1998-07-27 Dave Brolley <brolley@cygnus.com>
9997 * c-lex.c (yylex): Fix boundary conditions in character literal and
9998 string literal loops.
10000 1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
10002 * decl.c (lookup_name_real): OK, do return the from_obj value
10003 unless got_object depends on template parms.
10005 * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
10007 * pt.c (coerce_template_parms): Also complain about local enums.
10009 * cp-tree.h: Add prototype for set_identifier_local_value.
10010 * decl.c (set_identifier_local_value_with_scope): Make static,
10012 * search.c (covariant_return_p): Likewise.
10013 * except.c (build_terminate_handler, alloc_eh_object): Likewise.
10015 * call.c (build_method_call): Only pull out the type of a destructor
10016 if it's a template type parm.
10017 * decl.c (lookup_name_real): Never return the from_obj value.
10019 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
10021 * except.c (process_start_catch_block_old): Call start_decl_1 for
10023 * decl.c (start_decl_1): Avoid duplicate error.
10025 * init.c (expand_default_init): Only perform the initialization if
10026 it will do something.
10028 1998-07-23 H.J. Lu (hjl@gnu.org)
10030 * parse.y (base_class): Check for invalid base class.
10032 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
10034 * decl2.c (import_export_template): Fold in...
10035 (import_export_class): ...to here. Handle dllimport/export.
10037 * class.c (build_vtable): Pass at_eof to import_export_vtable.
10038 (prepare_fresh_vtable): Likewise.
10039 * decl2.c (import_export_class): Split out...
10040 (finish_prevtable_vardecl): From here.
10041 * class.c (finish_struct_1): Call import_export_class if at_eof.
10043 * decl.c (start_function): #if 0 mysterious code I wrote and have
10045 * rtti.c (get_tinfo_fn): If this is for a class type, set
10048 1998-07-22 Jason Merrill <jason@yorick.cygnus.com>
10050 * inc/exception: Change terminate and unexpected to ().
10052 * parse.y (named_class_head_sans_basetype_defn): A
10053 named_class_head_sans_basetype followed by '{' or ':' is a defn.
10055 1998-07-21 Jason Merrill <jason@yorick.cygnus.com>
10057 * tree.c (canonical_type_variant): New fn to handle arrays.
10058 * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
10059 * pt.c (unify, default case): Also fold arg. Fix array bounds case.
10060 * method.c (process_overload_item): Use build_overload_value for
10063 1998-07-20 Dave Brolley <brolley@cygnus.com>
10065 * lex.c (mbchar.h): #include it.
10066 (GET_ENVIRONMENT): New macro.
10067 (init_parse): Set character set based on LANG environment variable.
10068 (real_yylex): Handle multibyte characters in character literals.
10069 (real_yylex): Handle multibyte characters in string literals.
10071 1998-07-19 Jason Merrill <jason@yorick.cygnus.com>
10073 * lex.c (do_identifier): Look for class value even if we don't
10074 have a global value. Do implicit declaration if parsing is 2.
10075 * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
10078 1998-07-19 Mark Mitchell <mark@markmitchell.com>
10080 * decl.c (pushtag): Revert previous change.
10081 * pt.c (lookup_template_class): Don't put out debugging
10082 information for types that use template parameters.
10084 * decl.c (pushtag): Don't put out debugging information for
10085 compiler-generated typedefs.
10087 * error.c (dump_type_real): Don't crash when presented with
10088 intQI_type_node or the like.
10090 * semantics.c (finish_translation_unit): Fix spelling error in
10093 1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
10095 * decl.c (lookup_name_real): Pull out single function here.
10096 (select_decl): Not here.
10097 (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
10099 * decl.c (qualify_lookup): Tweak again.
10101 * pt.c (lookup_template_class): Don't mess with the context of the
10103 * decl2.c (current_decl_namespace): Remove special handling for
10106 * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
10107 a member template specialization.
10109 * tree.c (ovl_member): Use decls_match to compare functions.
10110 * decl.c (decls_match): Check the context of a function.
10112 * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
10113 in Koenig lookup support rules.
10114 * semantics.c (finish_call_expr): Handle the new cases.
10116 * typeck.c (build_x_function_call): Handle overloaded methods.
10118 * decl.c (grokvardecl): Don't call build_static_name for extern "C".
10120 1998-07-16 Mark Mitchell <mark@markmitchell.com>
10122 * semantics.c (finish_object_call_expr): Revert previous change.
10123 * call.c (build_new_method_call): Likewise. Instead, convert
10124 TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
10126 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
10128 * decl.c (qualify_lookup): Handle templates.
10130 * decl2.c (do_using_directive): Don't pass ancestor.
10131 * decl.c (push_using_directive): Calculate ancestor.
10133 * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
10134 * decl.c (pushdecl): Move type shadowing handling from here...
10135 (duplicate_decls): ...to here.
10136 * decl.c (set_identifier_local_value_with_scope): New fn.
10137 (pushdecl): Use it.
10138 (set_identifier_local_value, lookup_type_current_level): New fns.
10139 * decl2.c (do_local_using_decl): Handle types and binding level
10142 * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
10143 * decl.c (select_decl): Extract a lone function from an OVERLOAD.
10144 (lookup_namespace_name): Likewise.
10145 * typeck.c (build_unary_op): Not here anymore.
10147 * decl2.c (do_class_using_decl): Make sure we get an identifier.
10148 * class.c (handle_using_decl): Ignore TYPE_DECLs.
10150 * decl.c (qualify_lookup): New fn.
10151 (lookup_name_real): Use it.
10153 1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10155 * decl2.c (add_using_namespace): When directly using a namespace
10156 that was indirect before, promote it.
10158 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
10159 LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
10160 LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
10161 * decl.c (select_decl): Replace two flag parameters by one.
10162 (unqualified_namespace_lookup): Likewise, pass flag.
10163 (lookup_flags): New function.
10164 (lookup_name_real): Compute flags, pass them.
10165 (lookup_namespace_name): Call with zero-flag.
10166 * decl2.c (ambiguous_decl): Add flag parameter, complain only
10167 according to flags.
10168 (lookup_using_namespace, qualified_lookup_using_namespace):
10169 Add flag parameter, pass them through.
10170 * lex.c (do_scoped_id): Call with zero-flag.
10172 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
10174 * typeck.c (convert_for_assignment): Use comptypes.
10176 1998-07-16 Mark Mitchell <mark@markmitchell.com>
10178 * semantics.c (finish_object_call_expr): Move test for the
10179 function called being a TYPE_DECL to ...
10180 * call.c (build_new_method_call): Here.
10182 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
10184 * decl2.c (arg_assoc_class): Also look at template arguments, if any.
10185 (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
10187 * lex.c (looking_for_typename): Don't initialize.
10189 * decl2.c (ambiguous_decl): Clarify error message.
10191 * decl.c (push_using_directive): Iterate over namespaces used
10194 1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10196 * decl2.c (add_using_namespace): Iterate over namespaces used
10199 * decl.c (lookup_name_real): Accept namespace aliases as locals.
10200 (cat_namespace_levels): Ignore aliases.
10201 (duplicate_decls): Ignore duplicate aliases.
10202 * decl2.c (do_namespace_alias): Process block level namespace
10203 aliases. Store alias with pushdecl. Remove odr errors.
10204 * parse.y (namespace_alias): New non-terminal.
10207 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
10209 * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
10210 Handle TEMPLATE_TYPE_PARM.
10211 (arg_assoc): Rewrite.
10213 * pt.c (complete_template_args): Don't look at the context unless
10216 * method.c (build_decl_overload_real): Fix namespace handling.
10218 * typeck.c (build_unary_op): Extract a lone function from an
10221 * call.c (build_scoped_method_call): Handle getting a namespace
10222 for basetype in a destructor call.
10223 (check_dtor_name): Handle enums.
10225 * parse.y (using_directive): New nonterminal.
10226 (extdef, simple_stmt): Use it.
10228 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
10230 * decl2.c (add_function): Move error message ...
10231 (arg_assoc_namespace): ... from here.
10233 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
10235 * parse.y (namespace_qualifier): Fix multiple level handling.
10236 * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
10237 (arg_assoc): Don't skip the first argument of a function.
10239 Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com)
10241 * search.c (my_tree_cons): Clean up.
10243 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
10245 * call.c (joust): Don't warn about "confusing" conversions to the
10248 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
10250 * class.c (push_nested_class): Complain about namespaces.
10251 * decl.c (start_decl): Enter the object's namespace.
10252 (cp_finish_decl): Leave it.
10253 (grokdeclarator): Likewise.
10254 * decl2.c (check_decl_namespace): New function.
10255 (finish_file): Call it.
10256 * parse.y (complex_direct_notype_declarator): Set complexity
10257 of namespace-qualified ids to -1, enter the namespace.
10259 * method.c (build_template_decl_overload): Expect _DECL as first
10260 parameter. Put context temporarily into current_namespace.
10261 * pt.c (check_explicit_specialization): Change caller.
10262 (tsubst): Likewise.
10264 * init.c (build_offset_ref): Call mark_used and
10265 convert_from_reference for namespace members.
10267 Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
10269 * search.c (my_tree_cons): The bitfield is at index 2.
10271 Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com>
10273 * lang-options.h: Format changed to work with new --help support
10276 1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
10278 * decl2.c (build_expr_from_tree): Change calls of do_identifier.
10279 Do Koenig lookup in CALL_EXPR.
10280 (arg_assoc): Handle error_mark.
10281 * lex.c (is_global): New function.
10282 (do_identifier): Expect arguments for Koenig lookup.
10283 * parse.y (primary): Add rules for calls of unqualified function calls.
10284 (do_id): Change call of do_identifier.
10285 * pt.c (finish_stmt_expr): Likewise.
10286 * semantics.c (finish_id_expr): Likewise.
10287 (finish_call_expr): Add integer parameter to indicate
10288 argument-dependent lookup.
10290 * decl.c (struct binding_level): New field using_directives.
10291 (push_using_decl): Not sorry anymore.
10292 (push_using_directive): New function.
10293 (lookup_tag): Use CP_DECL_CONTEXT to iterate.
10294 (unqualified_namespace_lookup): New function, code from ...
10295 (lookup_name_real): ... here.
10296 * decl2.c (lookup_using_namespace): Pass using list instead of
10298 (validate_nonmember_using_decl): New function.
10299 (do_nonmember_using_decl): New function.
10300 (do_toplevel_using_decl): Use them.
10301 (do_local_using_decl): New function.
10302 (do_using_directive): Support block-level directives.
10303 * parse.y (simple_stmt): Support using declarations and
10305 (namespace_qualifier, namespace_using_decl): New non-terminals.
10307 * xref.c (classname): New function.
10308 (GNU_xref_hier): Change class and base parameters to tree.
10309 * decl.c (xref_baseypes): Change caller.
10310 * friend.c (make_friend_class): Likewise.
10312 1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
10314 * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
10317 * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
10318 template template parameter, record its use.
10319 (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
10320 its template arguments if exists.
10322 * pt.c (coerce_template_template_parms): New function equivalent
10323 to coerce_template_parms when IS_TMPL_PARM is true.
10324 (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter,
10325 all callers changed.
10327 (coerce_template_parms): Access ARGLIST properly when creating a
10328 new vector. Only accept implicit TYPE_DECL as valid argument for
10329 a template template parameter when it is a base class of
10330 current_class_type. Don't display error message when COMPLAIN is
10333 1998-07-12 Klaus Kaempf (kkaempf@progis.de)
10335 * repo.c (get_base_filename): Use file_name_nondirectory.
10336 (open_repo_file): Likewise.
10337 * cp-tree.h (file_name_nondirectory): Add prototype.
10339 1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
10341 * friend.c (do_friend): Pull the identifier out of declarator.
10342 Use cp_error and friends.
10343 * decl2.c (qualified_lookup_using_namespace): Fix call to
10345 * decl.c (lookup_name_real): Don't call complete_type on a namespace.
10346 (grokvardecl): Use DECL_CLASS_SCOPE_P.
10347 * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
10348 * class.c (warn_hidden): Fix for OVERLOAD.
10349 From grahams@rcp.co.uk:
10350 * cp-tree.h (DEFARG_NODE_CHECK): New macro.
10351 (DEFARG_LENGTH, DEFARG_POINTER): Use it.
10353 Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com)
10355 * g++.1 (-traditional): Remove duplicated documentation.
10357 1998-07-11 Mark Mitchell <mark@markmitchell.com>
10359 * method.c (flush_repeats): Add nrepeats parameter.
10360 (issue_nrepeats): Likewise.
10361 (is_back_referenceable_type): New function. Don't back-reference
10362 TEMPLATE_TYPE_PARMs as well as simple types like integers.
10363 (build_mangled_name_for_type): Likewise.
10364 (build_mangled_name_for_type_with_Gcode): Likewise.
10365 (lasttype): Remove.
10366 (nrepeats): Likewise.
10367 (Nrepeats): Likewise.
10368 (start_squangling): Don't clear the variables removed above.
10369 (end_squangling): Likewise.
10370 (flush_repeats): Tidy. Use nrepeats parameter rather than
10372 (issue_nrepeats): Likewise, but with nrepeats global. Use
10373 is_backreferenceable_type.
10374 (build_overload_nested_name): Tidy. Add comment. Use
10375 build_mangled_name_for_type.
10376 (build_underscore_int): Comment.
10377 (build_overload_scope_ref): Use build_mangled_name_for_type.
10378 (build_overload_int): Likewise.
10379 (build_template_template_parm_names): Tidy.
10380 (build_template_parm_names): Use build_mangled_name_for_type.
10381 (build_overload_identifier): Add comments.
10382 (build_mangled_name_for_type_with_Gcode): Split out from
10383 build_mangled_name.
10384 (build_mangled_name_for_type): Use it.
10385 (build_mangled_name): Rework to use build_mangled_name_for_type
10386 and to not use global nrepeats/Nrepeats. Tidy.
10387 (process_modifiers): Tidy.
10388 (check_btype): Use is_backreferenceable_type. Add comment.
10389 Rename `node' to `type'.
10390 (process_overload_item): Set numeric_output_need_bar here.
10391 Use build_mangled_name_for_type. Tidy.
10392 (build_decl_overload_real): Tidy. Don't use Nrepeats. Use
10393 build_mangled_name_for_type.
10395 * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
10398 1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com>
10400 * cp-tree.h (warn_long_long): Define.
10401 * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
10402 warning "ANSI C++ does not support `long long'".
10403 * decl2.c (warn_long_long): Define.
10404 (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
10406 1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
10408 * decl.c (xref_tag): Handle attributes between 'class' and name.
10409 * parse.y (aggr): Likewise.
10410 * semantics.c (finish_class_definition): Likewise.
10411 * Makefile.in (EXPECTED): Adjust.
10413 * cp-tree.h: Declare flag_optional_diags and warn_multichar.
10414 * decl2.c: Define them.
10415 (lang_decode_option): Handle them.
10416 * lang-options.h: Add -foptional-diags.
10417 * class.c (finish_struct): Don't complain about multiple meanings of
10418 name if -fno-optional-diags.
10419 * decl.c (pushdecl_class_level): Likewise.
10420 * lex.c (real_yylex): Check warn_multichar.
10422 1998-07-06 Jason Merrill <jason@yorick.cygnus.com>
10424 * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
10426 * tree.c (make_binfo): Fix length.
10428 1998-06-30 Benjamin Kosnik <bkoz@bliss.nabi.net>
10430 * decl2.c (lang_decode_option): Remove warn_template_debugging.
10431 * lang-options.h: Likewise.
10433 Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10435 * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
10436 (process_start_catch_block): Likewise for variables
10437 `false_label_rtx', `call_rtx' and `return_value_rtx'.
10439 1998-06-29 Brendan Kehoe <brendan@cygnus.com>
10441 * tree.c (build_srcloc): Make sure we allocate this node on the
10444 Sat Jun 27 23:34:18 1998 Fred Fish <fnf@ninemoons.com>
10446 * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
10447 (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
10448 (lang_specific_driver): Only add -lm automatically if need_math is
10451 Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com)
10453 * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o
10455 Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10457 * Makefile.in (EXPR_H): New dependency variable.
10458 (decl2.o): Depend on $(EXPR_H).
10459 (typeck.o): Likewise.
10460 (init.o): Likewise.
10461 (expr.o): Likewise.
10463 1998-06-25 Benjamin Kosnik <bkoz@lisa.cygnus.com>
10465 * decl.c (start_enum): Put local enums on permanent_obstack.
10467 1998-06-25 Mark Mitchell <mark@markmitchell.com>
10469 * cp-tree.h (c_get_alias_set): Declare.
10470 * decl.c (init_decl_processing): Set lang_get_alias_set.
10472 1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
10474 * cp-tree.h (mark_all_runtime_matches): Add function prototype.
10475 * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
10476 flag for all function decls which are in the exception table.
10477 * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
10478 * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
10479 code is emitted for any referenced rtti function.
10481 1998-06-25 Dave Brolley <brolley@cygnus.com>
10483 * lang-specs.h: Use new | syntax to eliminate
10484 string concatenation.
10486 1998-06-25 Jason Merrill <jason@yorick.cygnus.com>
10488 * cp-tree.h (CP_DECL_CONTEXT): New macro.
10489 * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
10490 * method.c (build_overload_nested_name): Likewise.
10491 * sig.c (build_signature_pointer_or_reference_type): Don't set
10494 1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10496 Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
10497 * cp-tree.h (FROB_CONTEXT): New macro.
10498 (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
10499 * decl.c (namespace_binding): Replace NULL_TREE with
10501 (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
10502 * decl2.c (is_namespace_ancestor, lookup_using_namespace):
10504 * decl.c (pushtag): Use FROB_CONTEXT.
10505 (pushdecl, make_typename_type, define_function, grokdeclarator):
10507 * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
10508 * pt.c (push_template_decl_real, lookup_template_class, tsubst):
10510 * decl2.c (decl_namespace): Return global_namespace if no context.
10511 * method.c (build_overload_nested_name): Expect null as context.
10512 * pt.c (mangle_class_name_for_template): Do nothing for null
10514 (lookup_template_class): Allow for null id_context.
10516 1998-06-25 Richard Henderson <rth@cygnus.com>
10518 * method.c (emit_thunk): Set current_function_is_thunk for the
10519 ASM_OUTPUT_MI_THUNK case as well.
10521 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
10523 * exception.cc (__cplus_type_matcher): Get a match_info pointer
10524 instead of an exception table entry as a parameter.
10526 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
10528 * parse.y (function_try_block): Don't call start_catch_handler.
10529 * except.c (call_eh_info): Remove coerced field from declaration.
10530 (build_eh_type_type_ref): New function to create an address of a
10531 rtti function for the new style exception tables.
10532 (expand_start_catch_block): Split function, this contains the
10534 (process_start_catch_block_old): New function to perform the rest
10535 of expand_start_catch_block under old style exceptions.
10536 (process_start_catch_block_old): New function to perform the rest
10537 of expand_start_catch_block under new style exceptions.
10538 (expand_end_catch_block): Only pop the false label off the stack under
10539 the old style of exceptions.
10540 * semantics.c (finish_try_block): Don't call start_catch_handler.
10541 * exception.cc (struct cp_eh_info): Add original_value field.
10542 (__cplus_type_matcher): Perform type matching on the original exception
10543 value, and if we have a match, set the current value.
10544 (__cp_push_exception): Set the original exception value.
10546 1998-06-23 Jason Merrill <jason@yorick.cygnus.com>
10548 * call.c (joust): Fix confusing conversion warning.
10550 * call.c (build_op_delete_call): Add placement parm. Check
10551 LOOKUP_SPECULATIVELY.
10552 * cp-tree.h, decl2.c, init.c: Adjust.
10553 * decl.c (finish_function): Use it.
10555 * pt.c (tsubst): Diagnose creating void fields or variables.
10557 Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10559 * call.c (build_scoped_method_call): Remove unused variable `tmp'.
10561 * cp-tree.h (check_dtor_name): Add prototype.
10563 * init.c (expand_member_init): Remove unused variables
10564 `ptr_type_node', `parm' and `rval'.
10566 * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
10567 in call to fprintf.
10568 (lang_print_xnode): Likewise.
10570 * typeck2.c (enum_name_string): Cast argument to sprintf to long
10571 and use %ld specifier.
10573 * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
10574 specifier in call to fprintf.
10575 (GNU_xref_member): Cast argument to sprintf to int.
10577 Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
10579 * typeck2.c (pop_init_level): Warn about implicit zero initialization
10582 Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10584 * cp-tree.h: Prototype function `check_java_method'.
10586 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10588 * class.c (finish_struct): Make conflicting use of id a pedwarn.
10589 * decl.c (pushdecl_class_level): Likewise.
10591 1998-06-17 Mark Mitchell <mark@markmitchell.com>
10593 * pt.c (convert_nontype_argument): Issue an error when presented
10594 with an integer (real) constant that cannot be simplified to an
10595 INT_CST (REAL_CST).
10597 * cp-tree.h (c_get_alias_set): Remove declaration added in
10598 1998-06-13 change that should never have been checked in.
10600 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10602 * typeck.c (build_binary_op_nodefault): Change % in format strings
10605 * decl.c (grokvardecl): Don't build_static_name for decls that
10606 aren't at namespace scope.
10608 * init.c (perform_member_init): Catch default-initialization of
10611 1998-06-17 Mark Mitchell <mark@markmitchell.com>
10613 * errfn.c (cp_thing): Handle the `%%' formatting sequence.
10615 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10617 * method.c (hack_identifier): Complain about getting a namespace
10619 * typeck.c (decay_conversion): Remove check for namespaces.
10620 * typeck2.c (incomplete_type_error): Likewise.
10621 * parse.y (template_arg): Add PTYPENAME expansion.
10623 1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
10625 * decl.c (grokvardecl): Don't build external assembler names for
10626 TYPENAMEs in other namespaces as there is no declarator.
10627 * error.c (cp_file_of, cp_line_of): Don't extract file or line number
10628 info from DECL_CONTEXT if it is NULL.
10630 1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
10632 * call.c (check_dtor_name): Split out.
10633 (build_scoped_method_call): Use it.
10634 (build_method_call): Use it.
10635 * init.c (build_offset_ref): Use it.
10637 * typeck.c (build_static_cast): Fix handling of pointers to members.
10639 * decl.c (finish_function): Just return nothing from a constructor.
10640 * typeck.c (c_expand_return): Complain about returning a void
10641 expression from a destructor.
10643 1998-06-13 Mark Mitchell <mark@markmitchell.com>
10645 * class.c (alter_access): Accept a BINFO explaining how to get
10646 from the entity whose accessed is being altered to the type doing
10648 (handle_using_decl): New function containing code split out from ...
10649 (finish_struct_1): Here.
10651 * cp-tree.h (complete_type_or_else): Declare.
10652 * init.c (build_new_1, build_delete): Use it.
10653 * typeck.c (require_complete_type): Use complete_type, rather than
10654 expanding it inline.
10655 (complete_type_or_else): New function.
10656 (build_component_ref): Use it.
10657 (pointer_int_sum): Make sure the type pointed to is complete.
10658 (pointer_diff): Likewise.
10660 * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
10663 * search.c (get_matching_virtual): Note that member templates
10664 cannot override virtual functions.
10666 1998-06-12 Brendan Kehoe <brendan@cygnus.com>
10668 * pt.c (check_explicit_specialization): If DECLARATOR turned into
10669 an error_mark_node from lookup_template_function, return the same.
10670 (determine_specialization): Also make sure TEMPLATE_ID isn't an
10671 error_mark_node, before we try to read its operands.
10672 * decl.c (grokdeclarator): If we got an error_mark_node from
10673 check_explicit_specialization, just return it right back.
10675 1998-06-12 Mark Mitchell <mark@markmitchell.com>
10677 * class.c (instantiate_type): Don't treat template-ids that don't
10678 specify any template arguments as equivalent to ordinary
10679 identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to
10680 pointer-to-members for member templates. Tidy slightly.
10681 * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
10682 * init.c (build_offset_ref): Handle template-ids like ordinary
10683 identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
10684 offset part of the OFFSET_REF.
10685 * typeck.c (build_unary_op): Change check for unknown types to
10686 look for OFFSET_REFs, not SCOPE_REFs.
10688 1998-06-11 Mark Mitchell <mark@markmitchell.com>
10690 * pt.c (is_member_template_class): New function.
10691 (push_template_decl_real): Use it.
10693 1998-06-11 Benjamin Kosnik <bkoz@elmo.cygnus.com>
10695 * friend.c (do_friend): Add support for nested classes using
10696 member functions of the enclosing class as friends.
10698 1998-06-10 Mark Mitchell <mark@markmitchell.com>
10700 * call.c (convert_default_arg): Make global, not static.
10701 (convert_arg_for_ellipsis): Split out from ...
10702 (build_over_call): Here.
10703 * cp-tree.h (convert_default_arg); Declare.
10704 (convert_arg_to_ellipsis): Likewise.
10705 (do_member_init): Remove.
10706 * init.c (do_member_init): Remove; this code is dead.
10707 (expand_member_init): Remove much of this code; it is dead.
10708 * typeck.c (convert_arguments): Use convert_default_arg and
10709 convert_arg_for_ellipsis, rather than duplicating here.
10711 * call.c (convert_like): Don't fail silently if
10712 build_user_type_conversion fails. Always return error_mark_node
10715 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10717 * search.c (covariant_return_p): Complain about ambiguous base.
10719 * typeck.c (build_component_ref): Diagnose ref to nested type.
10721 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10723 * decl.c (grokparms): Check that INIT isn't an error_mark_node
10724 before giving error about invalid type for default arg.
10726 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10728 * call.c (build_method_call): Fix thinko.
10730 1998-06-10 Dave Brolley <brolley@cygnus.com>
10732 * decl2.c (lang_decode_option): New argc/argv interface.
10733 * cp-tree.h (lang_decode_option): New argc/argv interface.
10734 * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
10735 specified for cpplib-enabled compilers.
10736 * lex.c (lang_init): Don't check_newline for cpplib.
10737 (init_parse): Don't initialize cpplib here.
10739 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10741 * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
10742 piece before checking DECL_MUTABLE_P.
10744 1998-06-10 John Carr <jfc@mit.edu>
10746 * tree.c (debug_binfo): Make printf format match arguments.
10748 * error.c (OB_PUTI): Make printf format match arguments.
10750 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10752 * init.c (perform_member_init): Handle default-initialization.
10754 * except.c (build_throw): Handle throwing NULL.
10756 * typeck.c (build_x_function_call): Use resolve_offset_ref.
10758 * search.c (compute_access): Only strip an anonymous union
10761 * call.c (add_builtin_candidates): Tweak.
10763 * cvt.c (build_expr_type_conversion): Restore code for conversion
10765 * decl2.c (delete_sanity): Use it. Clean up.
10767 * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
10769 1998-06-10 Branko Cibej <branko.cibej@hermes.si>
10771 * typeck.c (c_expand_return): Don't warn about void expressions on
10772 return statements in functions returning void.
10774 1998-06-09 Mark Mitchell <mark@markmitchell.com>
10776 * pt.c (fn_type_unification): Revise documentation. Tidy.
10777 (type_unification): Likewise.
10779 1998-06-09 Andrew MacLeod <amacleod@cygnus.com>
10781 * semantics.c (finish_try_block): Rename expand_start_catch, and delete
10783 * parse.y (function_try_block): Rename expand_start_catch, and delete
10785 * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
10788 1998-06-09 Jason Merrill <jason@yorick.cygnus.com>
10790 * search.c (lookup_member): New fn.
10791 * class.c (finish_struct_1): Use it.
10792 * decl.c (lookup_name_real): Use it.
10794 Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10796 * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
10798 * cp-tree.h: Add prototype for `maybe_print_template_context' and
10799 `maybe_make_one_only'.
10801 * decl.c (auto_function): Remove unused variable `decl'.
10803 * decl2.c: Include dwarf2out.h and dwarfout.h.
10805 * lex.c: Remove redundant declarations of `set_float_handler' and
10808 1998-06-08 Andrew MacLeod <amacleod@cygnus.com>
10810 * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
10811 time flag. Call __cp_eh_info instead of __cp_exception_info.
10812 * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
10813 (__cp_exception_info): Return offset into cp_eh_info structure to
10814 match what use to be the start of this structure.
10815 (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
10816 (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
10818 (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
10819 __cp_eh_info instead of __cp_exception_info.
10821 1998-06-08 Jason Merrill <jason@yorick.cygnus.com>
10823 * decl.c (cp_finish_decl): Disable inlining of extern inlines
10824 with static variables.
10826 1998-06-08 Mark Mitchell <mark@markmitchell.com>
10828 * init.c (build_offset_ref): Correct previous change to use build,
10831 1998-06-07 Mark Mitchell <mark@markmitchell.com>
10833 * class.c (instantiate_type): Handle pointer-to-members where the
10834 member is a template.
10835 * init.c (build_offset_ref): Likewise.
10836 * typeck.c (build_unary_op): Likewise.
10838 1998-06-07 Richard Henderson <rth@cygnus.com>
10840 * lex.c (lang_init_options): New function.
10841 (lang_init): Remove flag_exceptions == 2 hack.
10843 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10845 * search.c (envelope_add_decl): Tweak for implicit typename.
10847 * call.c (joust): Also warn about confusing conversion op/constructor
10848 overload resolution.
10850 * spew.c (yylex): Also return the TYPE_DECL if got_object.
10851 Don't clear got_object after '~'.
10852 * call.c (build_scoped_method_call): Tweak destructor handling.
10853 (build_method_call): Likewise.
10854 * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
10855 TYPE_MAIN_VARIANT for destructors.
10856 * semantics.c (finish_object_call_expr): Complain about calling a
10859 1998-06-05 Per Bothner <bothner@cygnus.com>
10861 * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
10862 Define - update needed by gcc.c change.
10864 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10866 * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
10868 1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10870 * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
10871 * decl.c (lookup_name_real): Add namespaces_only parameter.
10872 If set, return only NAMESPACE_DECLs.
10873 (select_decl): Likewise.
10874 (identifier_type_value): Give additional parameter.
10875 (lookup_name_nonclass): Likewise.
10876 (lookup_name): Likewise.
10877 (find_binding): Skip namespace aliases.
10878 (binding_for_name): Likewise.
10879 (push_namespace): Check for namespace aliases.
10880 (lookup_name_namespace_only): New function.
10881 (begin_only_namespace_names, end_only_namespace_names): New functions.
10882 * decl2.c (set_decl_namespace): Skip namespace aliases.
10883 (do_using_directive): Likewise.
10884 (do_namespace_alias): Produce namespace aliases, fix alias
10886 * error.c (dump_decl): Support SCOPE_REF.
10887 * parse.y (extdef): Wrap lookup with namespace_only for namespace
10888 aliases and using declarations.
10890 1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
10892 * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
10894 * error.c (dump_expr): Clean up NEW_EXPR case.
10896 1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
10898 Suggested by Brendan Kehoe
10899 * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
10900 treat it as using ::decl.
10902 * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
10904 * tree.c (mapcar): Support NEW_EXPR.
10906 * error.c (dump_expr): Support NEW_EXPR.
10908 1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
10910 * method.c (make_thunk): Use overload machinery to make name.
10911 * search.c (covariant_return_p): New fn.
10912 (get_matching_virtual): Use it.
10914 * init.c (build_new_1): Fix check for void.
10916 1998-06-01 Per Bothner <bothner@cygnus.com>
10918 * cp-tree.h (TYPE_FOR_JAVA): New macro.
10919 * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
10920 java_int_type_node, java_long_type_node, java_float_type_node,
10921 java_double_type_node, java_char_type_node, java_boolean_type_node):
10922 New "primitive" types, with predefined names __java_byte etc.
10923 (record_builtin_java_type): New function.
10924 (init_decl_processing): Make Java types with record_builtin_java_type.
10925 (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
10926 (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
10927 (grokfndecl): Call check_java_method for Java classes.
10928 * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
10929 (process_overload_item): Match types against specific
10930 java_XX_type_node types, rather than using is_java_type.
10931 * class.c (finish_struct_1): Don't add default copy constructor
10932 or operator= if TYPE_FOR_JAVA.
10933 (pop_lang_conext): Restore strict_prototyp proper if Java.
10934 * decl2.c (acceptable_java_type, check_java_method): New functions.
10935 * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
10936 (tsubst): Move common statement after if statement.
10937 * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
10939 1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
10941 * pt.c (for_each_template_parm): Use first_rtl_op.
10943 * tree.c (build_cplus_array_type_1): Also check index_type for
10946 1998-05-31 Jason Merrill <jason@yorick.cygnus.com>
10948 * pt.c (tsubst): Always copy BINFO_BASETYPES.
10950 1998-05-29 scott snyder <snyder@d0sgif.fnal.gov>
10952 * tree.c (layout_basetypes): If we change TYPE_SIZE, change
10953 TYPE_SIZE_UNIT too.
10955 1998-05-29 Mark Mitchell <mark@markmitchell.com>
10957 * decl.c (grokdeclarator): Don't complain about in-class
10958 initialization of static consts if we don't really know the type
10961 1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
10963 * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
10964 * method.c (build_destructor_name): New fn.
10965 * decl2.c (maybe_retrofit_in_chrg): Split out...
10966 (grokclassfn): From here. Reorganize.
10967 * decl.c (grok_ctor_properties): Make sure ctors for types with
10968 vbases have the in_chrg parm.
10969 * pt.c (instantiate_class_template): Update
10970 TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call
10972 (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
10974 1998-05-28 Mark Mitchell <mark@markmitchell.com>
10976 * pt.c (instantiate_decl): Make test for whether or not static
10977 variables should be instantiated early match its comment.
10979 1998-05-28 Jason Merrill <jason@yorick.cygnus.com>
10981 * decl.c (start_decl): Always pedwarn about vacuously redeclaring
10983 (start_function): Call check_default_args.
10984 * decl2.c (grokfield): Don't call check_default_args.
10985 (check_default_args): Use cp_error_at.
10986 * lex.c (do_pending_defargs): Call check_default_args.
10988 1998-05-27 Brendan Kehoe <brendan@cygnus.com>
10990 * call.c (build_method_call): Make sure get_type_value returns
10991 something before we try to use its TYPE_MAIN_VARIANT.
10992 (build_scoped_method_call): Likewise.
10994 1998-05-27 Jason Merrill <jason@yorick.cygnus.com>
10996 * typeck2.c (digest_init): Complain about getting a TREE_LIST to
10997 initialize an array.
10999 * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
11002 * friend.c (do_friend): Clarify template warning.
11004 1998-05-27 Mark Mitchell <mark@markmitchell.com>
11006 * decl.c (shadow_label): Don't treat decls as identifiers.
11007 (maybe_push_to_top_level): Clear shadowed_labels.
11009 * pt.c (instantiate_decl): Reset lineno and filename after calling
11010 regenerate_decl_from_template.
11012 * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
11015 1998-05-27 Kevin Buhr <buhr@stat.wisc.edu>
11017 * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
11019 1998-05-26 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11021 * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
11022 (convert_nontype_argument): Handle cases when nontype template
11023 parameters become classes after substitution.
11025 1998-05-26 Mark Mitchell <mark@markmitchell.com>
11027 * friend.c (is_friend): Use comptypes, rather than == to compare
11028 types. Modify for new representation of template friends.
11029 (make_friend_class): Likewise.
11030 * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak.
11031 (instantiate_class_template): Deal with template friends.
11033 * decl.c (store_parm_decls): Remove redundant call to
11034 expand_main_function.
11036 1998-05-26 Benjamin Kosnik <bkoz@loony.cygnus.com>
11038 * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
11041 1998-05-26 Per Bothner <bothner@cygnus.com>
11043 * language_as_string: Handle lang_java.
11045 1998-05-26 Jason Merrill <jason@yorick.cygnus.com>
11047 * decl.c (pushdecl): Don't copy the type_decl.
11049 1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de>
11051 * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
11052 current_class_type.
11053 * decl.c (grokdeclarator): Put typedefs on the type's obstack.
11055 * parse.y (complex_direct_notype_declarator): Use $1 to access
11056 scope of notype_qualified_id.
11058 1998-05-26 Dave Brolley <brolley@cygnus.com>
11060 * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
11061 (init_parse): Initialize cpplib interface.
11063 * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
11064 empty continuation.
11066 1998-05-26 Mark Mitchell <mark@markmitchell.com>
11068 * decl.c (pushtag): Avoid crashing on erroneous input.
11070 1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de>
11072 * decl.c (push_namespace): Only produce one unique name for
11073 anonymous namespaces.
11074 (get_unique_name): Remove.
11076 1998-05-25 Mark Mitchell <mark@markmitchell.com>
11078 * call.c (tourney): Don't do any extra comparisons.
11080 * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
11082 * cp-tree.h (processing_template_parmlist): Declare.
11083 * decl.c (pushtag): Don't call push_template_decl when we
11085 * pt.c (processing_template_parmlist): New variable.
11086 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
11087 (complete_template_args): Use it.
11088 (add_to_template_args): Likewise.
11089 (innermost_args): Likewise.
11090 (tsubst): Likewise.
11091 (begin_template_parm_list): Use processing_template_parmlist.
11092 (end_template_parm_list): Likewise.
11094 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
11095 * decl.c (grokdeclarator): Use it.
11096 * decl2.c (grok_x_components): Likewise.
11097 * init.c (initializing_context): Likewise.
11098 * method.c (do_build_copy_constructor): Likewise.
11099 (do_build_assign_ref): Likewise.
11100 * search.c (compute_access): Likewise.
11101 * typeck.c (build_component_ref): Likewise.
11103 * decl.c (grokdeclarator): Don't give a cv-qualified version of an
11104 unnamed type a typedef name "for linkage purposes".
11106 * pt.c (lookup_template_class): Don't look at
11107 IDENTIFIER_CLASS_VALUE when there's no current_class_type.
11109 * method.c (build_overload_int): Handle error cases gracefully.
11111 * pt.c (instantiate_decl): Handle static member variables
11114 * pt.c (tsubst): Use the tsubst'd type when producing new
11115 TEMPLATE_PARM_INDEX nodes.
11117 1998-05-24 Mark Mitchell <mark@markmitchell.com>
11119 * tree.c (cp_tree_equal): Handle pointers to member functions.
11121 * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make
11122 sure the type of the REF_BIND is a reference type.
11123 (maybe_handle_ref_bind, compare_ics): Rename reference_type to
11124 target_type for clarity.
11126 * parse.y (xcond): Move call to condition_conversion ...
11127 * semantics.c (finish_for_cond): Here.
11128 * parse.c: Regenerated.
11130 1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
11132 * decl.c (push_namespace): Namespaces have type void.
11133 * typeck2.c (incomplete_type_error): Complain about namespace
11134 used as expression.
11135 * typeck.c (decay_conversion): Likewise.
11137 1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
11139 * error.c (dump_expr): Support namespaces.
11141 1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
11143 * cp-tree.def: Add SRCLOC.
11144 * cp-tree.h: Add struct tree_srcloc and accessor macros.
11145 * tree.c (build_srcloc, build_srcloc_here): New fns.
11146 * pt.c (add_pending_template): Use build_srcloc_here.
11147 (push_tinst_level): Update last_template_error_tick before erroring.
11148 (instantiate_decl): Restore lineno and input_filename before
11149 calling add_pending_template.
11150 * decl2.c (finish_file): Set up lineno and input_filename for
11153 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
11155 * decl.c (lang_print_error_function): New fn.
11156 (init_decl_processing): Set print_error_function to use it.
11157 * errfn.c (cp_thing): Don't call maybe_print_template_context here.
11159 * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
11162 * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
11163 copy-initialization.
11165 * class.c (build_vtable_entry): Use int_fits_type_p.
11166 (build_vtable): Pass a signed offset to build_vtable_entry.
11167 (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
11168 set_rtti_entry): Likewise.
11170 1998-05-22 Per Bothner <bothner@cygnus.com>
11172 * cp-tree.h: Add comments documenting which LANG_FLAGS are used.
11173 (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used.
11175 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
11177 * pt.c (print_template_context): Use fprintf instead of cp_error.
11179 * pt.c (determine_specialization): Just return an error_mark_node.
11180 Also print the decl we want in error messages. If we complain,
11181 return error_mark_node.
11182 (tsubst_friend_function): Set lineno and input_filename so
11183 error messages will be useful.
11184 (instantiate_template): Just return an error_mark_node.
11185 (check_explicit_specialization): Don't mess with a returned
11188 * pt.c (print_template_context): Add new argument.
11189 (maybe_print_template_context): New fn.
11190 (push_tinst_level): Increment tinst_level_tick.
11191 (pop_tinst_level): Likewise.
11192 * errfn.c (cp_thing): Call maybe_print_template_context. Use
11193 xrealloc instead of xmalloc.
11195 * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
11197 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
11199 * pt.c (tsubst_friend_class): Don't call redeclare_class_template
11200 if the template we looked up is the same as the one we already
11203 Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
11205 * lex.c: (handle_sysv_pragma): FILE* parameter not used.
11206 (cpp_reader,parse_in): Add for cpplib.
11207 (check_newline): Call handle_sysv_pragma with new interface.
11208 (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
11210 * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
11211 (sub_getch): Call GETC for cpplib.
11213 * cp-tree.h: (get_directive_line): Different prototype for cpplib.
11214 (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
11216 * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib.
11218 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
11220 * decl2.c (maybe_make_one_only): New fn.
11221 (import_export_vtable): Use it.
11222 (import_export_decl): Likewise.
11223 * pt.c (mark_decl_instantiated): Likewise.
11225 1998-05-21 Mark Mitchell <mmitchell@usa.net>
11227 * decl2.c (find_representative_member): Rename to ...
11228 (build_anon_union_vars): New function.
11229 (finish_anon_union): Fix stupidity of previous change.
11231 1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
11233 * decl.c (grokfndecl): Handle definition of specialization in
11234 friend declaration.
11236 * error.c (dump_decl): Fix LOOKUP_EXPR handling.
11238 1998-05-20 Mark Mitchell <mmitchell@usa.net>
11240 * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
11241 to look for type declarations.
11242 (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
11243 * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
11244 (finish_member_class_template): Declare.
11245 * decl.c (pushtag): Put member class templates on the
11246 CLASSTYPE_TAGS list, just as for ordinary member classes.
11247 (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
11248 (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
11249 IDENTIFIER_NAMESPACE_VALUEs.
11250 * parse.y (component_decl): Move code to ...
11251 * semantics.c (finish_member_class_template): New function.
11252 Don't put member class templates on the list of components for a
11254 * parse.c: Regenerated.
11255 * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
11256 In fact, don't use DECL_CONTEXT at all here.
11258 1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
11260 * decl.c (record_unknown_type): New function.
11261 (init_decl_processing): Call it for the unknown and global type
11264 1998-05-20 Mark Mitchell <mmitchell@usa.net>
11266 * decl2.c (find_representative_member): New function.
11267 (finish_anon_union): Use it.
11269 * cp-tree.h (MAIN_NAME_P): New macro.
11270 (DECL_MAIN_P): Likwise.
11271 * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
11272 (grokfndecl): Use the new macros.
11273 (grokdeclarator): Likewise.
11274 (start_function): Likewise.
11275 (store_parm_decls): Likewise.
11276 (finsh_function): Likewise.
11277 * friend.c (do_friend): Likewise.
11278 * typeck.c (build_function_call_real): Likewise.
11279 (build_unary_op): Likewise.
11281 Wed May 20 02:16:01 1998 Jason Merrill <jason@yorick.cygnus.com>
11283 * decl2.c (start_objects, finish_objects, do_dtors,
11284 do_ctors): Split out from...
11285 (finish_file): ...here.
11287 Tue May 19 20:36:23 1998 Jason Merrill <jason@yorick.cygnus.com>
11289 * tree.c (is_overloaded_fn): Don't abort on placeholders from
11292 Tue May 19 15:16:22 1998 Brendan Kehoe <brendan@cygnus.com>
11294 * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
11296 * error.c (dump_expr): Handle an ARROW_EXPR.
11298 Tue May 19 15:13:39 1998 Mark Mitchell <mmitchell@usa.net>
11300 * decl.c (saveable_obstack): Declare.
11301 (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
11302 declare, if necessary.
11304 Tue May 19 14:50:27 1998 Mark Mitchell <mmitchell@usa.net>
11306 * call.c (compare_qual): Remove.
11307 (is_subseq): Tweak.
11308 (is_properly_derived_from): New function.
11309 (maybe_handle_ref_bind): Likewise.
11310 (maybe_handle_implicit_object): Likewise.
11311 (compare_ics): Modify substantially to bring into conformance with
11313 * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
11314 (comp_cv_qualification): Declare.
11315 (comp_cv_qual_signature): Likewise.
11316 * typeck.c (comp_cv_qualification): Likewise.
11317 (comp_cv_qual_signature): Likewise.
11319 Tue May 19 10:05:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11321 * Makefile.in (parse.o): Depend on toplev.h.
11323 * class.c (typecode_p): Remove prototype and definition.
11325 * cp-tree.h (currently_open_class, is_empty_class, member_p):
11328 * decl.c (push_overloaded_decl_top_level): Remove prototype and
11331 * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
11332 in call to `cp_thing'.
11333 (cp_warning): Likewise for function pointer `warning'.
11335 * except.c (do_function_call): Remove prototype and definition.
11336 (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
11338 * method.c (is_java_type): Add prototype and make it static.
11340 * parse.y: Include toplev.h.
11342 * pt.c (type_unification): Remove unused variable `arg'.
11343 (instantiate_decl): Likewise for `save_ti'.
11345 * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
11347 Tue May 19 02:43:25 1998 Jason Merrill <jason@yorick.cygnus.com>
11349 * init.c (build_member_call): Handle template_ids.
11350 * parse.y (primary): Add global_scope template_id.
11352 Mon May 18 23:22:52 1998 Jason Merrill <jason@yorick.cygnus.com>
11354 * decl2.c (get_sentry): Use end_temporary_allocation.
11355 Don't declare permanent_obstack.
11357 Mon May 18 12:28:44 1998 Mark Mitchell <mmitchell@usa.net>
11359 * parse.y (.finish_new_placement): New non-terminal.
11360 (unary_expr, new_type_id): Use it.
11361 * parse.c: Regenerated.
11363 Mon May 18 12:20:27 1998 Brendan Kehoe <brendan@cygnus.com>
11365 * pt.c (redeclare_class_template): Say where the original definition
11366 of the template-parameter's default argument appeared.
11368 Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com>
11370 * call.c (build_over_call): Tweak empty class handling.
11372 * decl.c (make_typename_type): Use currently_open_class.
11374 * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
11376 Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
11378 * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
11379 for a type unless it is one.
11381 * class.c (finish_struct_1): Use OVL_CURRENT in error message.
11383 Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com)
11385 * Makefile.in (program_transform_name, objdir): Define.
11387 * Makefile.in (BISON): Use bison from the build tree if it exists.
11390 Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
11392 * typeck.c (type_unknown_p): Return true for TREE_LIST also.
11394 * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
11396 Sun May 17 14:51:41 1998 Jason Merrill <jason@yorick.cygnus.com>
11398 * call.c (build_scoped_method_call): Likewise.
11400 Sun May 17 13:53:48 1998 Mark Mitchell <mmitchell@usa.net>
11402 * init.c (build_new_1): Call suspend_momentary around the creation
11403 of values that must be saved for exception handling.
11404 * parse.y (.build_new_placement): New non-terminal.
11405 (unary_expr, new_placement): Use it.
11406 * parse.c: Regenerated.
11408 Sun May 17 12:32:08 1998 Jason Merrill <jason@yorick.cygnus.com>
11410 * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
11413 * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
11416 * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
11418 Fri May 15 20:28:00 1998 Jason Merrill <jason@yorick.cygnus.com>
11420 * decl.c (start_decl): Revert problem change.
11422 * Makefile.in (CONFLICTS): Fix.
11424 Fri May 15 15:34:02 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
11426 * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
11428 Fri May 15 00:46:05 1998 Jason Merrill <jason@yorick.cygnus.com>
11430 * class.c (finish_struct_1): Use BINFO_SIZE.
11432 * decl.c (start_decl): Use 'tem'.
11434 Thu May 14 16:30:47 1998 Andrew MacLeod <amacleod@cygnus.com>
11436 * exception.cc: Include eh-common.h.
11437 (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL.
11438 (__cplus_type_matcher): First stab at new C++ runtime type matcher.
11439 (__cp_push_exception): Initialize eh_info struct as well.
11440 * except.c: Remove local structs and include eh-common.h.
11441 (init_exception_processing): Set language and version codes.
11442 (call_eh_info): Add presence of eh_info to runtime description of
11444 (expand_end_eh_spec): Call start_catch_block() and end_catch_block().
11445 * semantics.c (finish_try_block): Call start_catch_block() and
11447 * parse.y (function_try_block): Call start_catch_block() and
11450 Thu May 14 12:27:34 1998 Brendan Kehoe <brendan@cygnus.com>
11452 * typeck.c (original_type): New function.
11453 (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
11454 to see if they're actually the same.
11455 * cp-tree.h (original_type): Declare.
11457 Wed May 13 12:54:30 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11459 * Makefile.in (lex.o): Depend on output.h.
11461 * call.c (add_function_candidate): Remove unused variable `cand'.
11462 (add_conv_candidate): Likewise.
11463 (build_builtin_candidate): Likewise.
11465 * cp-tree.h: Add prototype for `types_overlap_p'.
11467 * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
11469 * decl2.c (merge_functions): Remove unused variables `tmp' and
11472 * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
11473 (code_as_string): Likewise.
11474 (language_as_string): Likewise.
11475 (parm_as_string): Likewise.
11476 (op_as_string): Likewise.
11477 (assop_as_string): Likewise.
11478 (cv_as_string): Likewise.
11480 * lex.c: Include output.h.
11482 * pt.c (type_unification): Cast first argument of `bzero' to a char*.
11484 * search.c (dfs_no_overlap_yet): Mark parameter `t' with
11487 * tinfo.cc (__class_type_info::dcast): Change the type of variable
11488 `i' from int to size_t.
11490 * typeck.c (language_lvalue_valid): Mark parameter `exp' with
11493 Tue May 12 21:37:49 1998 Jason Merrill <jason@yorick.cygnus.com>
11495 * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
11496 DECL_NAMESPACE_SCOPE_P.
11497 (lang_decl_name): Likewise.
11498 * pt.c (tsubst_friend_function, tsubst): Likewise.
11499 * decl.c (pushdecl, redeclaration_error_message, start_decl,
11500 cp_finish_decl, start_function): Likewise.
11501 * class.c (finish_struct_1): Likewise.
11502 * call.c (build_over_call): Likewise.
11503 (compare_ics): Use DERIVED_FROM_P.
11505 Tue May 12 07:24:18 1998 Mark Mitchell <mmitchell@usa.net>
11507 * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
11508 * method.c (build_mangled_name): Use it.
11509 (build_decl_overload_real): Likewise.
11511 * error.c (dump_simple_decl): New function, broken out from ...
11512 (dump_decl): Use it.
11514 Mon May 11 11:38:07 1998 Mark Mitchell <mmitchell@usa.net>
11516 * ptree.c (lang_print_xnode): Add missing `break'.
11518 * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
11520 * call.c (add_template_candidate): Adjust for changes to
11521 fn_type_unification.
11522 (add_template_candidate_real): Likewise.
11523 (add_template_conv_candidate): Likewise.
11524 (build_user_type_conversion_1): Likewise.
11525 (build_new_function_call): Likewise.
11526 (build_object_call): Likewise.
11527 (build_new_op): Likewise.
11528 (build_new_method_call): Likewise.
11529 * class.c (instantiate_type): Likewise.
11530 * cp-tree.h (unification_kind_t): New type.
11531 (fn_type_unification): Adjust prototype.
11532 (type_unificaiton): Likewise.
11533 * pt.c (UNIFY_ALLOW_NONE): New macro.
11534 (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
11535 (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
11536 (UNIFY_ALLOW_DERIVED): Likewise.
11537 (unify): Change prototype.
11538 (maybe_adjust_types_for_deduction): New function.
11539 (check_cv_quals_for_unify): Likewise.
11540 (determine_specialization): Adjust.
11541 (fn_type_unification): Likewise.
11542 (type_unification): Likewise.
11543 (type_unification_real): Likewise. Use
11544 maybe_adjust_types_for_deduction. Fix mishandling of
11545 back-unification of template functions passed as arguments. Pass
11546 appropriate combination of UNIFY_ALLOW_* to unify.
11547 (unify): Remove unused NTPARMS parameter. Use
11548 check_cv_quals_for_unify. Remove bogus code that allowed
11549 too-generous unification in order to adhere more closely to standard.
11550 (get_bindings_real): Adjust.
11551 (get_class_bindings): Likewise.
11553 * method.c (build_overload_identifier): Only use the innermost
11554 template arguments when mangling.
11555 * pt.c (tsubst_template_argument_vector): New function.
11556 (complete_template_args): Deal with the situation where the
11557 extra_args contain more than one level of arguments.
11558 (lookup_template_class): Deal with member template classes, which
11559 may have more than one level of arguments.
11560 (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
11561 Improve handling of member template classes. Use
11562 DECL_PRIMARY_TEMPLATE instead of inline expansion. Use
11563 tsubst_template_argument_vector where appropriate.
11564 (regenerate_decl_from_template): Break out from ...
11565 (instantiate_decl): Here.
11567 * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
11568 * parse.h: Regenerated.
11569 * parse.c: Really regenerated.
11571 * cp-tree.h (finish_unary_op_expr): New function.
11572 (finish_id_expr): Likewise.
11573 (begin_new_placement): Likewise.
11574 (finish_new_placement): Likewise.
11575 (finish_declarator): Likewise.
11576 (finish_translation_unit): Likewise.
11577 (finish_parmlist): Likewise.
11578 (begin_class_definition): Likewise.
11579 (finish_class_definition): Likewise.
11580 (finish_default_args): Likewise.
11581 (finish_inline_definitions): Likewise.
11582 * parse.y (GCC_ASM_KEYWORD): Remove.
11583 (TYPENAME_ELLIPSIS): Likewise.
11584 * parse.c: Regenerated.
11585 Use new functions in semantics.c in the actions for many rules.
11586 * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
11587 * hash.h: Regenerated.
11588 * semantics.c (finish_expr_stmt): Allow NULL expr.
11589 (finish_unary_op_expr): New function, containing
11590 code previously in parse.y.
11591 (finish_id_expr): Likewise.
11592 (begin_new_placement): Likewise.
11593 (finish_new_placement): Likewise.
11594 (finish_declarator): Likewise.
11595 (finish_translation_unit): Likewise.
11596 (finish_parmlist): Likewise.
11597 (begin_class_definition): Likewise.
11598 (finish_class_definition): Likewise.
11599 (finish_default_args): Likewise.
11600 (finish_inline_definitions): Likewise.
11602 Sun May 10 23:43:13 1998 Mark Mitchell <mmitchell@usa.net>
11604 * typeck.c (build_c_cast): Don't decay arrays and functions to
11605 pointer type when converting to a class type.
11607 Sun May 10 22:53:56 1998 Jason Merrill <jason@yorick.cygnus.com>
11609 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
11610 (DECL_CLASS_SCOPE_P): Likewise.
11612 Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org)
11614 * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
11615 * decl2.c (constructor_name_full): Likewise.
11617 Sun May 10 22:48:12 1998 Mike Stump <mrs@wrs.com>
11619 * tree.c (mapcar): Add OVERLOAD support.
11621 * init.c (resolve_offset_ref): We must use basetype_path before we
11622 destroy it with a call to convert_pointer_to.
11624 Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com>
11626 * class.c (currently_open_class): New fn.
11627 * decl.c (lookup_name_real): Use it.
11628 * search.c (lookup_field): Likewise.
11630 Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
11632 * cp-tree.def (OVERLOAD): New node.
11633 * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
11634 SET_IDENTIFIER_NAMESPACE_VALUE): Define.
11635 (NAMESPACE_BINDING): Remove.
11636 (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
11638 (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
11640 (tree_overload): New struct.
11641 (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
11642 (REAL_IDENTIFIER_TYPE_VALUE): Define.
11643 (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
11644 (lang_decl_flags): Remove in_namespace.
11645 (lang_decl): Remove chain.
11646 (DECL_CHAIN, DECL_NAMESPACE): Remove.
11647 (flag_honor_std): Declare extern.
11648 (identifier_type_value, pushdecl_namespace_level, push_using_decl,
11649 namespace_binding, set_namespace_binding,
11650 lookup_function_nonclass, cat_namespace_levels,
11651 set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
11652 scratch_ovl_cons, ovl_member, build_overload): Declare.
11653 (decl_list_length, get_namespace_id, current_namespace_id,
11654 overloaded_globals_p): Remove.
11655 (lookup_using_namespace, qualified_lookup_using_namespace): Change
11657 (push_scratch_obstack): New macro.
11658 * call.c (add_function_candidate): Special-case type of OVERLOAD node.
11659 (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
11661 (build_new_function_call): Iterate using OVL_CHAIN.
11662 Print DECL_NAME in when reporting ambiguities.
11663 (build_object_call): Iterate using OVL_NEXT for fns, convs.
11664 (build_new_op): Call lookup_function_nonclass.
11665 Iterate using OVL_NEXT.
11666 (build_op_delete_call): Change detection of members.
11667 Do not wrap TREE_LIST around fields and single global functions.
11668 (build_over_call): Don't push a class level if the context is a
11670 (build_new_method_call): Iterate using OVL_NEXT.
11671 * class.c (add_method): Chain overloaded members using
11672 build_overload. Remove copying of method.
11673 (grow_method): When iterating through the obstack, expect OVERLOAD
11674 nodes. Chain overload members.
11675 (finish_struct_methods): Chain overload members. Unpack OVERLOAD
11676 nodes in call to get_baselinks.
11677 (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
11678 (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle
11679 fdecls that are OVERLOAD nodes.
11680 (validate_lhs): New function.
11681 (instantiate_type): Do not copy OVERLOAD nodes. Remove dead
11682 code. Use DECL_NAME in error messages. Split code between global
11683 and member function processing.
11684 * decl.c (global_type_node): New static variable.
11685 (in_std): New global.
11686 (struct binding_level): New field usings.
11687 (resume_binding_level): Assert that we are not in a class.
11688 (toplevel_bindings_p): Just check for namespace_p or
11690 (resume_level): Remove.
11691 (find_binding): New function.
11692 (binding_for_name): Call it.
11693 (namespace_binding, set_namespace_binding): New functions.
11694 (push_namespace): Associate binding level with new namespace,
11695 resume_binding_level for existing namespace. Remove old code.
11696 Fake std by counting.
11697 (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
11698 (maybe_push_to_top_level): Save current namespace.
11699 (pop_from_top_level): Restore saved namespace.
11700 (pop_namespace): Call suspend_binding_level. Remove old code.
11701 (cat_namespace_levels): New function.
11702 (set_identifier_type_value_with_scope): For namespace bindings,
11703 set BINDING_TYPE, and use global_type_node.
11704 Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
11705 (identifier_type_value): New function.
11706 (pushtag): If no context, use current_namespace.
11707 (duplicate_decls): Don't process DECL_CHAIN.
11708 (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
11709 already set. Never reset it to NULL_TREE. Lookup global variables
11710 in their namespace. Push overloaded templates if they are on
11712 (pushdecl_namespace_level): New function.
11713 (pushdecl_top_level): Implement using pushdecl_namespace_level.
11714 (pushdecl_using_decl): New function.
11715 (overloaded_globals_p): Remove.
11716 (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
11717 them. Use namespace_binding and set_namespace_value.
11718 (redeclaration_error_message): Complain if the declarations come
11719 from different namespaces.
11720 (lookup_tag): On namespace level, look in the BINDING_TYPE.
11721 (lookup_namespace_name): Pass tree_bindings from stack. Remove
11723 (select_decl): New function.
11724 (lookup_name_real): Call it for qualified and unqualified lookup.
11725 Pass tree_bindings from the stack.
11726 If prefer_type is 1, also accept namespaces.
11727 (lookup_function_nonclass): New function.
11728 (init_decl_processing): Set the binding level of the global
11729 namespace to global_binding_level.
11730 Build a proper type list for __builtin_apply.
11731 Initialize std_node to "fake std" if flag_honor_std is set.
11732 Initialize global_type_node.
11733 Allocated bad_alloc in namespace std if flag_honor_std.
11734 (define_function): Set the DECL_CONTEXT to the current_namespace.
11735 (start_decl): A namespace is not considered as a context here. If
11736 the DECL_CONTEXT is a namespace, push the decl.
11737 (cp_finish_decl): Check for namespaces used as initializers.
11738 (grokfndecl): Add namespace parameter. Remove processing of
11740 (grokvardecl): Add namespace parameter.
11741 (grokdeclarator): Process SCOPEs that are namespaces. For
11742 mangling, temporarily set the DECL_CONTEXT on anonymous structs.
11743 (start_function): Check for contexts that are namespaces.
11744 Set context for declarations that have not been pushed.
11745 (store_parm_decls): Check for ::main only.
11746 (finish_function): Likewise.
11747 (start_method): Check for contexts that are namespaces.
11748 (start_method): Remove DECL_CHAIN processing.
11749 * decl2.c (flag_honor_std): Declare.
11750 (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
11751 (decl_namespace_list): New static global.
11752 (grok_x_components): Ignore namespaces as type contexts.
11753 (check_classfn): Expect OVERLOAD nodes.
11754 (grokfield): Remove DECL_CHAIN processing.
11755 (finish_file): Call cat_namespace_levels.
11756 (merge_functions): New function.
11757 (ambiguous_decl): Rewrite.
11758 (lookup_using_namespace): Produce tree_bindings.
11759 (qualified_lookup_using_namespace): Likewise.
11760 (set_decl_namespace, decl_namespace, current_decl_namespace,
11761 push_decl_namespace, pop_decl_namespace): New functions.
11762 (arg_lookup): New struct.
11763 (add_function, arg_assoc_namespace, arg_assoc_class,
11764 arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
11766 (get_namespace_id, current_namespace_id): Remove.
11767 (do_toplevel_using_decl): Rewrite.
11768 (do_class_using_decl): Complain about namespace qualifiers.
11769 (do_using_directive): Sorry if not on namespace level. Complain
11770 about unknown namespaces.
11771 * error.c (dump_aggr_type): Check for namespace contexts.
11772 * except.c (init_exception_processing): Push terminate into std.
11773 * friend.c (is_friend): A namespace is not a context, here.
11774 * init.c (expand_member_init): Remove DECL_CHAIN processing.
11775 (build_offset_ref): Process OVERLOAD nodes.
11776 * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
11777 * lex.c (identifier_type): Loop using OVL_CHAIN.
11778 (see_typename): Set looking_for_typename to 2.
11779 (real_yylex): Likewise.
11780 (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
11781 (do_scoped_id): Expect OVERLOAD nodes.
11782 Change calling convention for qualified_lookup_using_namespace.
11783 (build_lang_decl): Don't set in_namespace anymore.
11784 * method.c (typevec_size): New global.
11785 (build_overload_nested_name): Return if global_namespace.
11786 Otherwise, always expect a declaration context.
11787 (build_qualified_name): Likewise.
11788 Make sure we don't write beyond typevec_size.
11789 (build_decl_overload_real): Likewise.
11790 Allocate one extra slot for the namespace.
11791 (hack_identifier): Mark code dead.
11792 Process OVERLOAD and NAMESPACE_DECL nodes.
11793 * parse.y (program): Pop namespaces until in global namespace.
11794 (extdef): In a using-declaration, don't discard the identifier if
11795 there is no declaration.
11796 (left_curly): Ignore type contexts which are namespaces.
11797 (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
11799 * pt.c (template_class_depth): Expect types to be namespaces.
11800 (determine_specialization): Simplify by expecting OVERLOAD nodes.
11801 (push_template_decl): Push into namespace level.
11802 Reset ctx if it is a namespace.
11803 Set DECL_CONTEXT to current_namespace if not set already.
11804 Ignore real contexts that are namespaces.
11805 (mangle_class_name_for_template): Skip global_namespace.
11806 Mangle other namespaces as declarations.
11807 (lookup_template_function): Set type of OVERLOAD nodes to unknown.
11808 (lookup_template_class): Push into namespace of context.
11809 If the context is a namespace, set it to global_namespace.
11810 Use id_context for mangling.
11811 (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
11812 (tsubst_friend_function): Ignore namespace contexts.
11813 Push into namespace level.
11814 (tsubst): Handle NAMESPACE_DECL nodes.
11815 Remove DECL_CHAIN processing.
11816 (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
11817 * ptree.c (print_lang_identifier): Print bindings.
11818 (lang_print_xnode): Print OVERLOAD nodes.
11819 * rtti.c (init_rtti_processing): Push type_info into std.
11820 * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
11821 (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
11822 dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
11823 lookup_fnfields_here): Likewise.
11824 Process all nodes, instead of going through TREE_CHAIN.
11825 * sig.c (build_signature_pointer_or_reference_type): Set context
11826 to global_namespace.
11827 (build_signature_table_constructor): Expect OVERLOAD nodes.
11828 * spew.c (yylex): Save old setting of looking_for_typename.
11829 * tree.c (decl_list_length): Remove.
11830 (binding_init): New function.
11831 (count_functions): Rewrite.
11832 (is_overloaded_fn): Expect OVERLOAD nodes.
11833 (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
11834 (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
11835 ovl_member): New functions.
11836 * typeck.c (require_complete_type): Expect OVERLOAD nodes.
11837 (type_unknown_p): Likewise.
11838 (require_instantiated_type): Likewise.
11839 (build_component_ref): Declare code dead.
11840 (build_x_function_call): Create and expect OVERLOAD nodes.
11841 (build_function_call_real): Check for ::main only.
11842 (build_unary_op): Likewise. Expect OVERLOAD nodes.
11843 (convert_for_assignment): Check for TREE_LIST before accessing
11845 * decl.c (duplicate_decls): Check for namespace bindings instead
11846 of global bindings.
11847 (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
11848 lookup_name_current_level, start_decl, xref_tag,
11849 finish_enum): Likewise.
11850 * init.c (build_offset_ref): Likewise.
11851 * search.c (lookup_field): Likewise.
11852 (lookup_fnfields): Likewise.
11853 (dfs_debug_mark): Likewise.
11854 * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
11855 (poplevel_class, pop_from_top_level): Likewise.
11856 * decl2.c (finish_method): Likewise.
11857 * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
11858 * decl.c (record_builtin_type): Likewise.
11859 (init_decl_processing, grokfndecl): Likewise.
11860 * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
11861 (make_lang_type): Likewise.
11862 * parse.y (make_thunk): Likewise.
11863 * pt.c (tsubst): Likewise.
11864 * tree.c (debug_binfo): Likewise.
11865 * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
11866 tinfo2.cc, inc/new.h: Add std qualifications.
11867 * inc/new: Wrap with namespace std if __HONOR_STD.
11868 * inc/typeinfo: Likewise.
11870 Fri May 8 00:43:50 1998 Jason Merrill <jason@yorick.cygnus.com>
11872 * call.c (build_user_type_conversion_1): Handle second_conv
11873 properly for templates.
11875 Thu May 7 17:09:25 1998 Andrew MacLeod <amacleod@cygnus.com>
11877 * method.c (build_decl_overload_real): Set TREE_USED flag to
11878 zero for build_type_variants nodes as well.
11880 Wed May 6 19:27:09 1998 Jason Merrill <jason@yorick.cygnus.com>
11882 * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE.
11884 Wed May 6 16:49:48 1998 Jim Wilson <wilson@cygnus.com>
11886 * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o,
11887 except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o,
11888 rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o,
11889 xref.o): Add toplev.h dependencies.
11891 Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com)
11893 * errfn.c (cp_error, cp_warning): Remove declarations for
11894 error and warning respectively.
11896 Wed May 6 14:28:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11898 * error.c: Convert to using ctype macros defined in system.h.
11899 * method.c: Likewise.
11900 * xref.c: Likewise.
11901 * lex.c: Likewise. Also remove redundant system header stuff.
11903 Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
11905 * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
11906 expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c,
11907 search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c,
11908 xref.c: Add include of toplev.h.
11910 Wed May 6 02:33:39 1998 Jason Merrill <jason@yorick.cygnus.com>
11912 * tree.c (perm_manip): Also regenerate the RTL of an extern.
11913 (copy_to_permanent): Use end_temporary_allocation.
11915 Tue May 5 23:54:04 1998 Jason Merrill <jason@yorick.cygnus.com>
11917 * init.c (expand_vec_init): The initialization of each array
11918 element is a full-expression.
11920 Tue May 5 18:24:13 1998 Andrew MacLeod <amacleod@cygnus.com>
11922 * method.c (build_mangled_name): Add a call to build_type_variant
11923 to get the right type.
11925 Tue May 5 01:25:03 1998 Jason Merrill <jason@yorick.cygnus.com>
11927 * Makefile.in: Add .SUFFIXES.
11929 * cp-tree.def: Remove NAMESPACE_DECL.
11931 Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
11933 * call.c (build_over_call): Do evaluate arg even if it has empty
11935 * decl.c (start_function): Don't push a member function.
11937 Thu Apr 30 18:59:23 1998 Jim Wilson <wilson@cygnus.com>
11939 * Makefile.in (g++FAQ.info): Put -o option before input file.
11941 Thu Apr 30 13:05:33 1998 Andrew MacLeod <amacleod@cygnus.com>
11943 * gxxint.texi: Add info for squangling codes K and B.
11945 Tue Apr 28 13:22:01 1998 Mark Mitchell <mmitchell@usa.net>
11947 * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
11948 the expression in templates.
11949 (finish_stmt_expr): Likewise.
11951 1998-04-28 Brendan Kehoe <brendan@cygnus.com>
11953 * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int.
11955 Mon Apr 27 13:58:10 1998 Mark Mitchell <mmitchell@usa.net>
11957 * decl.c (maybe_push_to_top_level): Always clear
11958 current_template_parms and processing_template_decl.
11959 (pushtag): Remove check of current_class_type and some comments,
11960 since maybe_push_to_top_level no longer creates confusion.
11962 Sun Apr 26 12:10:18 1998 Mark Mitchell <mmitchell@usa.net>
11964 * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
11965 (DECL_CLASS_TEMPLATE_P): Likewise.
11966 (DECL_PRIMARY_TEMPLATE): Likewise.
11967 (PRIMARY_TEMPLATE_P): Use it.
11968 (push_template_decl_real): New function.
11969 (redeclare_class_template): Take new template parameters as
11971 (is_specialization_of): New function.
11972 (comp_template_args): Declare.
11973 * decl.c (pushtag): Handle friend template classes.
11974 (xref_tag): Likewise. Use new calling convention for
11975 redeclare_class_template.
11976 * decl2.c (grok_x_components): Handle friend templates.
11977 * friend.c (is_friend): Use is_specialization_of where
11978 appropriate. Deal with friend class templates.
11979 (make_friend_class): Let a class template be friends with itself.
11980 * pt.c (comp_template_args): Remove declaration.
11981 (tsubst_friend_class): New function.
11982 (push_template_decl_real): New function.
11983 (push_template_decl): Use it.
11984 (redeclare_class_template): Adjust for new calling convention.
11985 (comp_template_args): Give it external linkage.
11986 (instantiate_class_type): Use tsubst_friend_class to deal
11987 with friend templates.
11988 * typeck.c (comptypes): Use comp_template_args, rather than
11989 expanding it inline.
11990 * parse.y (component_decl): Handle a nested template type
11991 like other component type declarations.
11993 * pt.c (check_explicit_specialization): Handle overloaded
11994 constructors correctly.
11996 * pt.c (mabybe_get_template_decl_from_type_decl): New function.
11997 (lookup_template_class): Use it.
11999 Thu Apr 23 21:19:06 1998 Jason Merrill <jason@yorick.cygnus.com>
12001 * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops.
12002 * cp-tree.h: Add WRAPPER support.
12003 * call.c (add_candidate): Split out from add_*_candidate fns.
12004 (build_over_call): Take the candidate instead of function and args.
12005 Enforce access control here. Emit overload warnings here.
12006 (add_warning): New fn.
12007 (joust): Add WARN parm. If not set, call add_warning instead of
12008 printing a warning. Re-enable some warnings.
12009 (tourney): Pass it.
12010 (convert_like): Adjust.
12011 (build_new_op): Adjust.
12012 (build_new_function_call): Adjust.
12013 (build_user_type_conversion_1): Adjust.
12014 (USER_CONV_FN): Adjust.
12015 * tree.c (build_expr_wrapper, build_expr_ptr_wrapper,
12016 build_int_wrapper): New fns.
12018 Thu Apr 23 18:27:53 1998 Mark P. Mitchell <mmitchell@usa.net>
12020 * pt.c (unify): Fix typo in previous change.
12022 Thu Apr 23 09:32:58 1998 Jason Merrill <jason@yorick.cygnus.com>
12024 * error.c (dump_type_real): Declare canonical_name.
12026 * typeck.c (comp_target_types): Fix PMFs.
12028 Wed Apr 22 13:24:48 1998 Mark Mitchell <mmitchell@usa.net>
12030 * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for
12031 the DECL_RESULTs of a member TEMPLATE_DECL, not just the
12034 * pt.c (tsubst): Decrease the template-level of
12035 TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a
12036 TEMPLATE_PARM_INDEX.
12037 (template_decl_level): New function.
12038 (unify): Make sure to record unifications for template
12039 parameters, even when the parameters exactly match the arguments.
12040 Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
12041 TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that
12042 aren't from the level we're currently working on.
12044 Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net>
12046 * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
12048 * decl2.c (check_member_template): Set DECL_IGNORED for member
12049 class templates, too.
12051 * decl2.c (grokfield): Remangle the name of a member TYPE_DECL.
12053 Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
12055 * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
12057 Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com)
12059 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare.
12060 * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
12061 (init_decl_processing): Handle TI types.
12062 * typeck.c (unsigned_type, signed_type): Handle TI types.
12064 Sat Apr 18 15:25:21 1998 Jim Wilson <wilson@cygnus.com>
12066 * g++spec.c (lang_specific_driver): New argument in_added_libraries.
12067 New local added_libraries. Increment count when add library to
12070 Fri Apr 17 21:25:00 1998 Mark Mitchell <mmitchell@usa.net>
12072 * cp-tree.h (type_as_string_real): New function.
12073 * pt.c (mangle_class_name_for_template): Use it.
12074 * error.c (dump_aggr_type): Change prototype.
12075 (dump_type_prefix): Likewise.
12076 (dump_type_suffix): Likewise.
12077 (dump_type_real): Convert from dump_type. If desired, the
12078 "canonica" name of a typedef, i.e., the name of the underlying
12079 type, can be printed.
12080 (dump_type): Call dump_type_real.
12082 Fri Apr 17 14:30:45 1998 Jason Merrill <jason@yorick.cygnus.com>
12084 * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks.
12086 * typeck.c (comp_target_types): Tweak pedantic case.
12087 (comp_target_parms): Tweak pedantic case. Clean up somewhat.
12088 Return -1 or 1 instead of 1 or 2.
12089 (compparms): Remove STRICT handling.
12090 (convert_for_assignment): Fix handling of pmfs.
12092 Fri Apr 17 14:04:16 1998 Mark Mitchell <mmitchell@usa.net>
12094 * typeck.c (comp_target_types): Handle references like pointers.
12095 (comp_target_parms): Note that return code from comp_target_types
12096 can be negative to indicate failure.
12098 Fri Apr 17 09:10:52 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12100 * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG),
12101 which requires a working target compiler to build.
12103 Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com)
12105 * tree.c (avoid_overlap): Add prototype.
12107 * spew.c (num_tokens): Add prototype.
12108 (nth_noken, add_token, consume_token, debug_yychar): Likewise.
12110 * search.c (dfs_check_overlap): Add prototype.
12111 (dfs_no_overlap_yet): Likewise.
12113 * pt.c (original_template): Add prototype.
12114 (inline_needs_template_parms): Likewise.
12115 (push_inline_template_parms_recursive): Likewise.
12116 (retrieve_specialization, register_specialization): Likewise.
12117 (print_candidates, reduce_template_parm_level): Likewise.
12118 (build_template_decl, mark_template_parm): Likewise.
12119 (tsubst_friend_function, get_bindings_real): Likewise.
12121 * method.c (start_squangling): Add prototype.
12122 (end_squangling, check_ktype, issue_ktype): Likewise.
12123 (build_overloaded_scope_ref, check_btype): Likewise.
12124 (build_mangled_template_parm_index): Likewise.
12126 * lex.c (init_cpp_parse): Add prototype.
12127 (handle_cp_pragma, handle_sysv_pragma): Likewise.
12128 (reduce_cmp, token_cmp): Likewise.
12130 * except.c (call_eh_info): Add prototype.
12131 (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise.
12132 (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise.
12134 * decl2.c (is_namespace_ancestor): Add prototype.
12135 (namespace_ancestor, add_using_namespace): Likewise.
12136 (ambiguous_decl): Likewise.
12138 * decl.c (indent): Add prototype.
12140 * call.c (add_template_candidate_real): Add prototype.
12142 Fri Apr 17 01:57:12 1998 Jason Merrill <jason@yorick.cygnus.com>
12144 * decl2.c (build_expr_from_tree): Just return a PMF.
12146 Fri Apr 17 00:45:12 1998 Mark Mitchell <mmitchell@usa.net>
12148 * typeck2.c (process_init_constructor): Don't strip cv-qualifiers
12149 when doing initializations.
12151 * pt.c (unify): Use comptypes to compare type args.
12153 Fri Apr 17 00:24:22 1998 Jason Merrill <jason@yorick.cygnus.com>
12155 * decl.c (duplicate_decls): Fix check for when it's safe to free
12158 * pt.c (mangle_class_name_for_template): Don't pass a typedef type
12161 Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
12163 * pt.c (build_template_parm_index): Add prototype.
12165 * search.c (my_tree_cons): Don't clear words outside the
12166 newly allocated node.
12168 Wed Apr 15 15:34:44 1998 Dave Brolley <brolley@cygnus.com>
12170 * lex.c (init_parse): Now returns char* containing the filename.
12172 Wed Apr 15 13:20:06 1998 John Carr <jfc@mit.edu>
12173 Jeff Law <law@cygnus.com>
12175 * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer
12178 Sun Apr 12 22:31:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
12180 * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
12182 Fri Apr 10 12:16:49 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
12184 * decl.c (duplicate_decls): Don't warn for redundant decls if
12185 friend: let add_friend take care of it.
12187 Thu Apr 9 02:40:48 1998 Jason Merrill <jason@yorick.cygnus.com>
12189 * sig.c (build_signature_pointer_constructor): Don't set
12190 TREE_HAS_CONSTRUCTOR for a signature pointer.
12191 * cvt.c (ocp_convert): Don't force a temporary for internal structs.
12192 * init.c (resolve_offset_ref): Warn about implicit & on pmfs
12194 * typeck.c (build_unary_op): Only allow taking the address of a
12196 * typeck2.c (digest_init): Simplify.
12197 (store_init_value): Don't pedwarn about using { } for pmfs.
12199 Thu Apr 9 22:16:57 1998 Per Bothner <bothner@cygnus.com>
12201 * cp-tree.h (start_decl): Update prototype.
12202 * decl.c (start_decl): Like the C version, new parameters
12203 for the attributes. Call cplus_decl_attributes here,
12204 (pushdecl): Like C version, do build_type_copy if TYPE_DECL,
12205 (grokdeclarator): Pass NULL for new start_decl arguments.
12206 * pt.c (tsubst_expr): Likewise.
12207 * parse.y: Merge cplus_decl_attribute calls into start_decl calls.
12208 * typeck.c (common_type): Check TYPE_MAIN_VARIANT.
12209 * lex.c (build_lang_decl): Add lang_name_java.
12210 * class.c (push_lang_context): Add lang_name_java.
12211 * method.c (build_mangled_name): Check for is_java_type.
12213 Thu Apr 9 22:16:57 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
12215 * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
12216 * call.c (build_scoped_method_call): Check for TREE_CODE for
12217 VOID_TYPE instead of type == void_type_node.
12218 (build_method_call): Likewise.
12219 * decl.c (lookup_name_real): Likewise.
12220 (grokdeclarator): Likewise.
12221 (start_decl): Likewise.
12222 (grokparms): Likewise.
12223 (start_function): Likewise.
12224 (finish_function): Likewise.
12225 (start_method): Likewise.
12227 Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
12229 * lex.c (finput): New variable.
12230 (init_cpp_parse): Renamed from init_parse.
12231 (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished.
12232 (finish_parse): New function.
12233 * cp-tree.h (init_lex, init_parse): Remove declarations.
12235 Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
12237 * call.c (build_call): Still evaluate the actual argument.
12238 * class.c (is_empty_class): Update for -fnew-abi.
12240 * decl2.c: -fnew-abi implies -fsquangle.
12242 * method.c (do_build_assign_ref): Don't do anything to copy
12244 (do_build_copy_constructor): Likewise.
12245 * call.c (build_over_call): Likewise.
12247 Sat Apr 4 18:43:58 1998 Jason Merrill <jason@yorick.cygnus.com>
12249 * tree.c (avoid_overlap): Return a value.
12251 Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com)
12253 * method.c (check_btype): Add missing argument to xrealloc.
12254 (check_ktype): Likewise.
12256 Fri Apr 3 02:22:59 1998 Jason Merrill <jason@yorick.cygnus.com>
12258 Implement empty base optimization.
12259 * class.c (finish_struct_1): Add vbase fields earlier. Set
12260 CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty.
12261 * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns.
12262 (types_overlap_p): New fn.
12263 * tree.c (avoid_overlap): New fn.
12264 (build_base_fields): Use it to avoid overlapping empty bases.
12265 * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi.
12267 * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
12269 Re-implement allocation of base class subobjects.
12270 * tree.c (unshare_base_binfos): New fn.
12271 (layout_basetypes): Use it. Now handles offsets of both virtual and
12272 non-virtual bases, after layout_type.
12273 (layout_vbasetypes): Remove.
12274 (build_base_fields): Generate FIELD_DECLs for each non-virtual base.
12275 (build_vbase_pointer_fields): Split out from old layout_basetypes.
12276 * class.c (finish_base_struct): Lose offset handling code.
12277 Move nonvdtor warning here. Don't mess with t_binfo anymore.
12278 (finish_struct_1): Don't mess with t_binfo anymore. Use fns above.
12279 * cp-tree.h: Adjust.
12281 Thu Apr 2 14:25:13 1998 Jason Merrill <jason@yorick.cygnus.com>
12283 * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff.
12284 * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise.
12285 * class.c (duplicate_tag_error): Likewise.
12286 (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN.
12287 * tree.c (layout_vbasetypes): Update from layout_record, remove
12288 var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE.
12289 (layout_basetypes): Likewise.
12291 Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com)
12293 * class.c, Make sure system.h is included just after config.h.
12294 Delete lingering stdio and errno references too.
12295 * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise.
12297 Wed Apr 1 15:38:36 1998 Jason Merrill <jason@yorick.cygnus.com>
12299 * friend.c (is_friend): Fix access control for local classes.
12301 * class.c (is_empty_class): New fn.
12302 * call.c (build_call): Don't pass empty class objects to a function.
12304 Wed Apr 1 14:58:35 1998 Mark Mitchell <mmitchell@usa.net>
12306 * call.c (build_over_call): Do name resolution for default
12307 arguments of function templates in the scope of the templates.
12309 Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com)
12311 * call.c: Include system.h. Remove includes, declarations and
12312 defines provided by system.h.
12313 * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
12314 * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
12315 * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
12316 * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
12317 * typeck2.c, xref.c: Likewise.
12318 * Makefile.in: Dependencies updated as appropriate.
12319 * Make-lang.in: Likewise.
12321 Mon Mar 30 12:15:00 1998 Mark Mitchell <mmitchell@usa.net>
12323 * pt.c (fn_type_unification): Allow incomplete unification without
12324 an immediate error message.
12326 Mon Mar 30 08:55:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12328 * tree.c (member_p): New fn.
12329 * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for
12330 initializing class members.
12332 * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'.
12333 * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX.
12335 * call.c (build_method_call): Handle non-scoped destructors, too.
12336 * pt.c (tsubst_copy): Likewise.
12338 * pt.c (print_template_context): Split out...
12339 (push_tinst_level): ...from here.
12341 * friend.c (is_friend): Don't pass a type to decl_function_context.
12343 * typeck.c (convert_for_initialization): Always hand off
12344 conversions to class type.
12346 Sun Mar 29 20:01:59 1998 Jason Merrill <jason@yorick.cygnus.com>
12348 * friend.c (is_friend): Local classes have the same access as the
12349 enclosing function.
12351 Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com)
12353 * typeck.c (expand_target_expr): Delete dead function.
12355 * search.c: Put various prototypes inside #ifdef MI_MATRIX.
12357 * repo.c (save_string): Delete dead function.
12359 * method.c (thunk_printable_name): Delete dead function.
12361 * lex.c (yynextch): Delete dead function.
12363 * expr.c (tree_extract_aggr_init): #if 0 out.
12365 * except.c (do_unwind): Delete dead function.
12366 (easy_expand_asm): Likewise.
12368 * cvt.c (build_conversion_type_1): Delete dead function.
12370 * cp-tree.h (push_expression_obstack): Declare.
12372 * call.c (source_type): #if 0 out.
12374 * class.c (alter_access): Remove unused label. Add braces
12375 around empty else clause.
12377 * lex.c (yyprint): Fix argument to printf.
12379 Sat Mar 28 17:43:52 1998 Mark Mitchell <mmitchell@usa.net>
12381 * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
12383 * pt.c (instantiate_class_template): Make sure template
12384 arguments are permanent.
12385 * init.c (resolve_offset_ref): Don't go looking around in
12388 * semantics.c: Add routines to handle expressions, and some
12389 declaration processing.
12390 * parse.y: Use them.
12391 (current_class_depth): Move declaration to cp-tree.h.
12392 * parse.c: Regenerated.
12393 * cp-tree.h: Use them.
12394 (current_class_depth): Declare.
12395 * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr.
12397 Fri Mar 27 20:23:18 1998 Mark Mitchell <mmitchell@usa.net>
12399 * error.c (dump_decl): Be a bit more explicit with template
12400 type arguments, when verbose.
12402 Fri Mar 27 18:16:40 1998 Jason Merrill <jason@yorick.cygnus.com>
12404 * inc/exception: Reorder closing braces.
12406 Fri Mar 27 13:22:18 1998 Mark Mitchell <mmitchell@usa.net>
12408 * pt.c (redeclare_class_template): New function.
12409 * cp_tree.h (redeclare_class_template): Declare it.
12410 * decl.c (xref_tag): Use it.
12412 Thu Mar 26 11:16:30 1998 Jason Merrill <jason@yorick.cygnus.com>
12414 * call.c (build_over_call): Check IS_AGGR_TYPE, not
12415 TYPE_LANG_SPECIFIC.
12416 * typeck.c (convert_arguments): Likewise.
12418 * decl.c (grokdeclarator): Remove const and volatile from type after
12419 setting constp and volatilep.
12421 * class.c (finish_struct_1): Don't warn about bool bitfield larger
12424 Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
12426 * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
12428 Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
12430 * call.c (build_object_call): Complain about ambiguous operator(),
12431 rather that crashing.
12432 (build_new_op): Likewise.
12433 (build_op_delete_call): Likewise.
12435 Thu Mar 26 10:23:24 1998 Mark Mitchell <mmitchell@usa.net>
12437 * cvt.c (perform_qualification_conversions): Use comp_target_types
12438 instead of comp_ptr_ttypes.
12440 Wed Mar 25 16:10:50 1998 Mark Mitchell <mmitchell@usa.net>
12442 * cp-tree.h (enforce_access): Declare.
12443 * call.c (enforce_access): Make it extern, not static.
12444 * class.c (alter_access): Use enforce_access; modify code for ISO
12445 compliance, rather than ARM rules.
12447 Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12449 * cp-tree.h: Fix typo.
12451 Wed Mar 25 02:01:02 1998 Jason Merrill <jason@yorick.cygnus.com>
12453 * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
12454 if (aggregate_value_p (type)).
12456 * decl2.c (constructor_name_full): Handle TYPENAME_TYPE.
12458 Tue Mar 24 16:12:01 1998 Mark Mitchell <mmitchell@usa.net>
12460 * tree.c (mapcar): When dealing with a DECL, use it's constant
12462 * pt.c (lookup_template_class): Don't mangle the names of template
12463 classes whose arguments are unknown.
12465 * pt.c (tsubst_expr): Handle GOTO_STMT correctly.
12467 Tue Mar 24 12:21:55 1998 Benjamin Kosnik <bkoz@lisa.cygnus.com>
12469 * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1.
12471 Tue Mar 24 12:21:48 1998 Jim Wilson <wilson@cygnus.com>
12473 * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for
12474 boolean_type_node to 1.
12476 Tue Mar 24 10:23:47 1998 Mark Mitchell <mmitchell@usa.net>
12478 * error.c (dump_expr): Remove unused variable `l'.
12480 * pt.c (for_each_template_parm): New function, created by
12481 converting uses_template_parms.
12482 (tree_fn_t): New typedef.
12483 (uses_template_parms): Use it.
12484 (mark_template_parm): New function.
12485 (push_template_decl): Check that the argument list of a partial
12486 specialization uses all the template parameters.
12488 * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
12489 with it; we might want it for debugging.
12490 * cp-tree.h (type_unification): Change interface.
12491 * class.c (finish_struct_1): Skip nested template types, just like
12492 ordinary nested types.
12493 (instantiate_type): Use new interface to type_unification.
12494 * lex.c (init_lex): Add __sz as opname for sizeof.
12495 * method.c (build_overload_scope_ref): New function.
12496 (build_overload_int): Handle complex expressions. Set
12497 numeric_output_need_bar if necessary.
12498 (build_overload_value): Handle non-PARM_DECL nodes; this
12499 routine is now used by build_overload_int. Remove some
12500 assignments to numeric_output_need_bar. Use
12501 build_overload_scope_ref.
12502 (build_qualified_name): Note that some template mangled names end
12503 with digits, and set numeric_output_need_bar appropriately. Use
12504 build_underscore_int.
12505 * pt.c (unify): Change interface.
12506 (type_unification_real): Likewise.
12507 (determine_specialization): Use new interfaces.
12508 (tsubst): Deal gracefully with situations in which the argument
12509 vector is not fully filled.
12510 (fn_type_unification): Use new interfaces.
12511 (type_unification): Likewise. Remove NOP_EXPR hack.
12512 (type_unification_real): Likewise.
12513 (unify): Likewise. Deal with unification of complex expressions.
12515 Mon Mar 23 12:24:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12517 * pt.c (complete_template_args): Initialize skip properly.
12519 * decl.c (make_typename_type): Revert.
12520 (make_implicit_typename): Remove.
12521 (lookup_name_real): Don't call it. Call lookup_field if we see a
12522 TYPE_DECL from a template base.
12523 * search.c (lookup_field): Do implicit typename stuff.
12525 Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
12526 Geoff Noer <noer@cygnus.com>
12528 * Makefile.in: Various fixes for building cygwin32 native toolchains.
12529 * Make-lang.in: Likewise.
12531 Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12533 * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify.
12535 Fri Mar 20 10:42:07 1998 Jason Merrill <jason@yorick.cygnus.com>
12537 * decl.c (make_implicit_typename): Rewrite removed code.
12538 (make_typename_type): Call it if the type we look up comes from
12539 a base that uses template parms.
12541 * pt.c (complete_template_args): Rewrite.
12542 (tsubst, FUNCTION_DECL): Use it.
12544 Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org)
12546 * semantics.c (finish_asm_stmt): Fix combine strings. Call
12547 c_expand_asm_operands () if output_operands, input_operands or
12548 clobbers is not NULL_TREE.
12550 Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12552 * pt.c (complete_template_args): New function.
12553 (get_bindings): Deal with specializations of function templates
12554 with return type containing parameters from outer class
12556 (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level,
12557 substitute arguments and compose a new type.
12559 Thu Mar 19 19:01:48 1998 Mark Mitchell <mmitchell@usa.net>
12561 * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new
12564 Thu Mar 19 11:51:58 1998 Jason Merrill <jason@yorick.cygnus.com>
12566 * decl.c (make_implicit_typename): Lose useless code.
12568 * call.c (standard_conversion): Handle A* -> const A* properly.
12570 * pt.c (get_bindings_real): Rename from get_bindings. Add
12571 check_rettype parm.
12572 (get_bindings): Pass 1.
12573 (get_bindings_overload): Pass 0.
12575 Wed Mar 19 09:08:12 1998 Mark Mitchell <mmitchell@usa.net>
12577 * pt.c (check_explicit_specialization): When reverting a static
12578 member function, also remove the `this' parameter from
12579 last_function_parms.
12581 Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com>
12583 * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
12584 a function context.
12586 * decl.c (store_bindings): Use free_binding_vecs.
12587 (pop_from_top_level): Likewise.
12589 Wed Mar 18 12:41:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12591 * decl.c (make_implicit_typename): Only change the type of a
12594 Wed Mar 18 10:09:51 1998 Mark Mitchell <mmitchell@usa.net>
12596 * semantics.c: New file, containing routines to perform the
12597 semantic phase of parsing.
12599 * pt.c (tsubst_expr): Likewise.
12600 * cp-tree.h: Declare the various functions in semantics.c.
12601 Provide macros to access _STMT tree nodes.
12602 * cp-tree.def: Add ASM_STMT tree node.
12603 * Makefile.in, Make-lang.in: Add dependencies on and for
12606 Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com>
12608 * pt.c (push_template_decl): Only check primary templates.
12610 * pt.c (check_explicit_specialization): Complain about default args
12611 in explicit specialization.
12613 * parse.y (nomods_initdcl0): Also call cp_finish_decl for a
12614 constructor_declarator.
12616 Tue Mar 17 14:44:54 1998 Mark Mitchell <mmitchell@usa.net>
12618 * typeck2.c (build_x_arrow): Don't crash when an aggregate type
12619 has no overloaded operator ->.
12621 * call.c (build_field_call): Don't crash when presented with a
12622 field that is actually a nested type.
12624 * decl.c (pushtag): Deal with friend class injection in local
12627 * call.c (build_object_call): Don't crash if OBJ is a
12628 pointer-to-member-function.
12630 Tue Mar 17 11:40:26 1998 Jason Merrill <jason@yorick.cygnus.com>
12632 * pt.c (push_template_decl): Complain about template with C linkage,
12633 anonymous template class.
12635 Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
12637 * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
12638 * search.c: Likewise.
12640 * lex.c (do_pending_defargs): Only call
12641 maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
12643 * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
12645 Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
12647 * parse.y: Deal with CONSTRUCTORS in new_initializers.
12649 Mon Mar 16 10:54:21 1998 Mark Mitchell <mmitchell@usa.net>
12651 * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
12652 closely mimics the behavior in parse.y.
12653 (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing
12654 into a compound statement.
12656 Sun Mar 15 02:07:26 1998 Jason Merrill <jason@yorick.cygnus.com>
12658 * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro.
12659 * pt.c (inline_needs_template_parms): New fn.
12660 (original_template): New fn.
12661 (push_inline_template_parms_recursive): New fn.
12662 (maybe_begin_member_template_processing): Use them.
12663 (maybe_end_member_template_processing): Likewise.
12664 (is_member_or_friend_template): Rename to is_member_template.
12665 Member functions of local classes are never member templates.
12667 Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12669 * lex.c (do_identifier): Handle TEMPLATE_DECL that was
12670 added in the class scope to catch redefinition error.
12672 * pt.c (reduce_template_parm_level): Also copy
12673 the DECL_TEMPLATE_PARMS field.
12675 Sun Mar 15 10:54:08 1998 Mark Mitchell <mmitchell@usa.net>
12677 * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a
12678 reduced-level template type parameter.
12680 Sun Mar 15 12:26:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
12682 * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider.
12683 (DECL_NEEDS_FINAL_OVERRIDER_P): New macro.
12684 * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P.
12685 * decl.c (duplicate_decls): Propagate it.
12686 * typeck2.c (abstract_virtuals_error): Use two loops to emit
12687 abstract virtual functions and virtual functions which need a
12688 final overrider separately.
12690 Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
12692 * lang-specs.h: Properly put brackets around array elements in
12695 * typeck.c (build_binary_op_nodefault): Correctly place parens around
12696 && and || in expression.
12698 Thu Mar 12 09:26:04 1998 Manfred Hollstein <manfred@s-direktnet.de>
12700 * call.c (default_parm_conversions): Remove prototype definition.
12701 (build_method_call): Remove unused variable result.
12703 * cvt.c (ocp_convert): Remove unused variable conversion.
12705 * decl2.c (ambiguous_decl): Add explicit parameter definition for name.
12707 * except.c (do_unwind): #if 0 definition of unused variables fcall
12710 * expr.c (extract_scalar_init): #if 0 prototype and function
12713 * init.c (expand_aggr_init_1): Remove unused variable init_type.
12714 (build_new_1): Remove unused variable t.
12716 * pt.c (instantiate_class_template): Remove unused variable newtag;
12717 cast called function return value to void.
12718 (do_decl_instantiation): Remove unused variables name and fn.
12720 * tree.c (get_type_decl): Add default return to shut up compiler from
12721 complaining control reaches end of non-void function.
12723 * typeck.c (build_x_conditional_expr): Remove unused variable rval.
12725 Thu Mar 12 09:12:15 1998 Manfred Hollstein <manfred@s-direktnet.de>
12727 * call.c (default_parm_conversions): Remove prototype definition.
12728 (build_method_call): Remove unused variable result.
12729 (build_over_call): Add default case in enumeration switch.
12731 Thu Mar 12 08:39:13 1998 Manfred Hollstein <manfred@s-direktnet.de>
12733 * decl2.c (lang_decode_option): Change j's type to size_t.
12735 * tree.c (layout_vbasetypes): record_align and desired_align are of
12736 type unsigned int; const_size and nonvirtual_const_size likewise.
12738 Wed Mar 11 07:25:20 1998 Mark Mitchell <mmitchell@usa.net>
12740 * parse.y (new_initializer): Make sure all initializers are
12743 Tue Mar 10 07:32:36 1998 Mark Mitchell <mmitchell@usa.net>
12745 * decl2.c (import_export_decl): Mark tinfo functions for
12746 cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN.
12748 Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com)
12750 * method.c: Fix typo.
12752 Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12754 * method.c: Include "system.h" to get stdlib.h, stdio.h,
12755 ctype.h, string.h, etc.
12756 (issue_nrepeats): Add default case in enumeration switch.
12757 (check_btype): Likewise.
12758 (process_overload_item): Likewise.
12760 * Makefile.in (method.o): Depend on system.h.
12762 Wed Mar 4 22:26:53 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12764 * lex.c (do_scoped_id): Fix parenthesizing.
12766 Wed Mar 4 12:11:53 1998 Michael Tiemann <tiemann@axon.cygnus.com>
12768 * rtti.c (get_tinfo_fn_dynamic): If this function is called an
12769 FLAG_RTTI is unset, initialize type info machinery and continue
12770 with FLAG_RTTI enabled.
12771 (get_typeid): Likewise.
12773 Wed Mar 4 11:47:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12775 * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
12778 Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
12780 * pt.c (finish_member_template_decl): Deal more gracefully with
12781 invalid declarations.
12783 Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
12785 * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c,
12786 cp-tree.h: Clean up more old overloading code, old RTTI code, and
12787 some formatting quirks.
12789 * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
12790 method.c, pt.c, ptree.c, typeck.c: Remove support for
12791 -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
12793 * Makefile.in: Adjust.
12795 * pt.c (unify): Don't allow reduced cv-quals when strict.
12797 * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from
12798 *type_unification* and unify.
12800 Mon Mar 2 12:11:06 1998 Jason Merrill <jason@yorick.cygnus.com>
12802 * parse.y (explicit_template_type): Remove TEMPLATE keyword.
12803 (nested_name_specifier): And add it before this use.
12804 (typename_sub0): And this use. Also add use without the keyword.
12805 (typename_sub1): Likewise.
12806 * pt.c (instantiate_class_template): Don't actually instantiate
12807 anything if our type uses template parms.
12809 Mon Mar 2 11:04:59 1998 Jim Wilson <wilson@cygnus.com>
12811 * decl.c (start_function): Don't call temporary_allocation for a
12814 Sun Mar 1 21:06:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12816 * pt.c (instantiate_class_template): Don't mess with friends if
12817 our type uses template parms.
12819 Sat Feb 28 12:06:44 1998 Jason Merrill <jason@yorick.cygnus.com>
12821 * parse.y (nested_name_specifier): Use explicit_template_type.
12822 (typename_sub): Allow a template_type, an explicit_template_type,
12823 or an implicit template type at the end.
12824 * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL.
12825 * decl.c (make_typename_type): Handle template-id where the name
12826 is a TEMPLATE_DECL.
12827 * call.c (build_scoped_method_call): Handle member template
12829 * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member
12830 destructor is represented by the type.
12832 * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro.
12833 * parse.y (nested_name_specifier): Add 'template' case.
12834 (explicit_template_type): New rule.
12835 (typename_sub): Use it.
12836 * decl.c (make_typename_type): Handle getting a template-id for NAME.
12837 * pt.c (tsubst): Likewise.
12839 Fri Feb 27 11:17:50 1998 Jason Merrill <jason@yorick.cygnus.com>
12841 * pt.c (add_to_template_args): Fix thinko.
12842 (instantiate_class_template): Call it later.
12844 * pt.c (get_class_bindings): Add outer_args parm.
12845 (most_specialized_class): Likewise.
12846 (instantiate_class_template): Pass it.
12847 (more_specialized_class): Likewise.
12848 (lookup_template_class): Get context from template if none
12850 (finish_member_template_decl): Don't do anything with a
12851 partial specialization.
12852 * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of
12854 * class.c (finish_struct): Member class templates have already been
12855 checked for name clashes.
12856 * decl.c (pushdecl_with_scope): Handle pushing at class level.
12858 Fri Feb 27 02:25:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12860 * pt.c (tsubst, TEMPLATE_DECL): Support member class templates.
12861 (tsubst, *_PARM): Support multiple levels of template classes.
12862 (instantiate_class_template): Look up the pattern from the
12864 (lookup_template_class): Handle getting a template for d1.
12865 (push_template_decl): Correct setting of 'primary'.
12866 (reduce_template_parm_level): Add 'levels' parm.
12867 (finish_member_template_decl): Support member class templates.
12868 (template_class_depth): Handle multiple levels.
12869 * parse.y (component_decl_1, fn.def2): Remove member template case.
12870 (component_decl): Add member template cases.
12871 * decl2.c (check_member_template): We now handle member template
12873 * decl.c (pushtag): Handle member templates.
12874 * method.c (do_inline_function_hair): Don't touch
12875 IDENTIFIER_GLOBAL_VALUE.
12876 * init.c (build_offset_ref): If name isn't an identifier, just
12878 * spew.c (yylex): Handle PTYPENAME like TYPENAME.
12880 * typeck.c (get_delta_difference): Do adjust for conversions to
12881 and from virtual base.
12883 Wed Feb 25 09:51:29 1998 Jason Merrill <jason@yorick.cygnus.com>
12885 * typeck.c (get_delta_difference): Give hard error for conversion
12888 * cp-tree.h: Tweak formatting.
12890 Wed Feb 25 00:35:33 1998 Jason Merrill <jason@yorick.cygnus.com>
12892 * decl.c (push_namespace): Handle redeclaration error.
12894 * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro.
12895 (IDENTIFIER_NAMESPACE_BINDINGS): New macro.
12896 (NAMESPACE_BINDING): New macro.
12897 (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING.
12900 * pt.c (push_template_decl): Use innermost_args.
12902 * decl.c (get_unique_name): Tweak from earlier in the name.
12904 Tue Feb 24 22:15:04 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
12906 * cp-tree.def: Add CPLUS_BINDING node.
12907 * cp-tree.h (tree_binding): New struct.
12908 (BINDING_SCOPE, BINDING_VALUE): New macros.
12909 (current_namespace, global_namespace): Declare extern.
12910 (struct lang_decl_flags): New field in_namespace.
12911 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros.
12912 (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros.
12913 (TREE_INDIRECT_USING): New macro.
12914 * decl2.c (current_namespace, global_namespace): Declare. The
12915 value is a NAMESPACE_DECL now, not a TREE_LIST.
12916 (is_namespace_ancestor, namespace_ancestor): New static functions.
12917 (add_using_namespace, ambiguous_decl): Likewise.
12918 (lookup_using_namespace): New support function for lookup_name.
12919 (qualified_lookup_using_namespace): New support function for
12920 do_scoped_id and lookup_namespace_name.
12921 (get_namespace_id): Mark as obsolete.
12922 (current_namespace_id): Likewise.
12923 (do_namespace_alias): Implement.
12924 (do_using_directive): Implement as call to add_using_namespace.
12925 * decl.c (binding_for_name): New function.
12926 (push_namespace, pop_namespace): Implement.
12927 (push_decl): Don't install a FUNCTION_DECL in the global branch.
12928 (lookup_namespace_name): Implement using qualified lookup.
12929 (lookup_name_real): For global scoping, lookup in
12930 global_namespace. For namespace scoping, lookup in given
12931 namespace. For unscoped lookup, iterate over namespace,
12932 considering using directives.
12933 (init_decl_processing): Initialize global_namespace.
12934 (grokvardecl): Build assembler name as static name for globals.
12935 (grokdeclarator): Remove old namespace mangling.
12936 (xref_tag): When installing a global binding for the
12937 tag, make sure we have an identifier.
12938 * method.c (build_overload_nested_name): Mangle namespaces.
12939 (build_qualified_name): Likewise.
12940 (build_decl_overload_real): Likewise.
12941 * lex.c (build_lang_decl): Set namespace for new declaration to
12943 (do_scoped_id): Find global names in global or current
12944 namespace, or using qualified namespace lookup, depending on
12946 * init.c (build_member_call): When scope is namespace, use
12947 build_x_function_call instead.
12948 (build_offset_ref): When scope is namespace, collapse processing
12949 to lookup_namespace_name instead.
12950 * error.c (dump_decl): Support NAMESPACE_DECL.
12951 * decl.c (pushdecl): Bind globals to current namespace.
12952 (push_overloaded_decl): Likewise.
12953 (lookup_tag): Likewise.
12954 (lookup_name_current_level): Likewise.
12955 (xref_tag): Likewise.
12956 (start_function): Likewise.
12957 * lex.c (do_identifier): Likewise.
12958 (identifier_typedecl_value): Likewise.
12959 (real_yylex): Likewise.
12960 * method.c (do_inline_function_hair): Likewise.
12961 * parse.y (unscoped): Likewise.
12962 * pt.c (check_explicit_specialization): Likewise.
12963 (lookup_template_class): Likewise.
12964 * rtti.c (call_void_fn): Likewise.
12965 * sig.c (build_sigtable): Likewise.
12966 * ptree.c (lang_print_xnode): New function.
12968 Tue Feb 24 01:40:24 1998 Jason Merrill <jason@yorick.cygnus.com>
12970 * pt.c (instantiate_class_template): Don't instantiate if pedantic
12971 and the args use template parms.
12973 * pt.c (push_tinst_level): If the instantiation uses template parms,
12975 * decl.c (xref_basetypes): Do call complete_type for basetypes
12976 that involve template parameters.
12978 Tue Feb 24 00:36:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12980 * typeck2.c (process_init_constructor): Fix labeled init check.
12982 Mon Feb 23 05:08:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12984 * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS
12985 argument to tsubst and friends.
12987 * pt.c (tsubst, FUNCTION_DECL): Tidy.
12989 * typeck.c (build_x_function_call): Handle static member function
12990 templates like non-templates. Handle friend templates like normal
12991 function templates.
12992 * pt.c (tsubst, *_PARM): Don't use orig_level.
12993 (get_bindings): Don't call add_to_template_args.
12994 (instantiate_template): Likewise.
12995 (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
12996 * ptree.c (print_lang_type): Print index/level for template parms.
12998 Mon Feb 23 02:52:29 1998 Mark Mitchell <mmitchell@usa.net>
13000 * Make-lang.in (cc1plus): Note that cc1plus depends on
13001 cp/cp-tree.h and cp/cp-tree.def.
13003 * cp-tree.def (TEMPLATE_CONST_PARM): Remove.
13004 (TEMPLATE_PARM_INDEX): New tree code, used to indicate a
13005 position in a template parameter list.
13006 * cp-tree.h (template_parm_index): New structure, used as the tree
13007 structure for a TEMPLATE_PARM_INDEX.
13008 (TEMPLATE_PARM_IDX): New macro.
13009 (TEMPLATE_PARM_LEVEL): Likewise.
13010 (TEMPLATE_PARM_DESCENDANTS): Likewise.
13011 (TEMPLATE_PARM_ORIG_LEVEL): Likewise.
13012 (TEMPLATE_PARM_DECL): Likewise.
13013 (TEMPLATE_TYPE_PARM_INDEX): Likewise.
13014 (TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
13015 (TEMPLATE_TYPE_DECL): Likewise.
13016 (TEMPLATE_CONST_IDX): Remove.
13017 (TEMPLATE_CONST_LEVEL): Likewise.
13018 (TEMPLATE_CONST_SET_INFO): Likewise.
13019 (TEMPLATE_TYPE_SET_INFO): Likewise.
13020 (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
13022 (TEMPLATE_TYPE_LEVEL): Likewise.
13023 * decl.c (decls_match): Call comp_template_parms, rather than
13024 expanding it inline.
13025 (duplicate_decls): If two template declarations are being merged,
13026 then their TEMPLATE_INFOs should be merged as well.
13027 (grokfndecl): Save template-id information when declaring a friend
13028 with explicit template arguments. Pass arguments to
13029 check_explicit_specialization via correct convention; at some
13030 point check_explicit_specialization changed, but these call-sites
13032 (grokdeclarator): Tidy up slightly.
13033 * decl2.c (check_classfn): Tidy up slightly. Don't assume that
13034 two template functions with the same DECL_ASSEMBLER_NAME the same,
13035 since the names are not yet mangled.
13036 * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
13037 TEMPLATE_CONST_PARM.
13038 (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the
13039 decl for a non-type parameter, rather than printing `<tparm ...>'.
13040 * friend.c (is_friend): Handle TEMPLATE_DECL friends.
13041 (do_friend): Deal with template friends.
13042 * lex.c (do_pending_inlines): Call
13043 maybe_begin_member_template_processing, rather than
13044 conditionally calling begin_member_template_processing.
13045 (process_next_inline): Likewise. Call
13046 maybe_end_member_template_processing, rather than
13047 conditionally calling end_member_template_processing.
13048 (do_pending_defargs): Likewise.
13049 (do_identifier): Use TEMPLATE_PARM_INDEX instead of
13050 TEMPLATE_CONST_PARM.
13051 * method.c (build_mangled_template_parm_index): New function.
13052 (build_overload_value): Use it.
13053 (build_overload_name): Likewise.
13054 * pt.c (finish_member_template_decl): Allow friend declarations.
13055 (template_class_depth): New function.
13056 (is_member_template): Rename, and modify, to become...
13057 (is_member_or_friend_template): New function.
13058 (end_member_template_processing): Rename, and modify, to become...
13059 (maybe_end_member_template_processing).
13060 (build_template_parm_index): New function.
13061 (reduce_template_parm_level): New function.
13062 (process_template_parm): Modify to use build_template_parm_index.
13063 (push_template_decl): Deal with friend templates.
13064 (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
13065 TEMPLATE_CONST_PARM.
13066 (tsubst_friend_function): New function.
13067 (instantiate_class_template): Generate the DECL_FRIENDLIST
13068 for a new instantiation by using tsubst_friend_function rather
13070 (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
13071 Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
13072 appropriate new macros. Use reduce_template_parm_level to
13073 generate lower-level template parameters. Handle tsubst'ing into
13074 TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget
13075 to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
13076 templates. Similarly for the template parameters for a new
13078 (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead
13079 of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them.
13080 (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
13081 (get_bindings): Call add_to_template_args if necessary.
13082 (instantiate_decl): Handle instantiations of friend templates.
13083 * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
13084 TEMPLATE_TYPE_PARM as a list of fields; it's not!
13085 * spew.c (yylex): Do a little manual constant propagation to
13088 Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com)
13090 * error.c: Include sys/types.h.
13092 Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com)
13094 * method.c (build_mangled_name): Start CPP directives in column zero.
13096 Thu Feb 19 10:36:48 1998 Jason Merrill <jason@yorick.cygnus.com>
13098 * typeck2.c (process_init_constructor): Sorry about non-trivial
13099 labeled initializers.
13100 * parse.y (initlist): Re-enable labeled initializers.
13102 Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13104 * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm,
13105 all callers changed. Rely on the new parameter instead of arg
13106 being a TREE_LIST when determine whether we are working inside
13107 template template parameter. Clean up is_type test.
13109 Thu Feb 19 10:04:12 1998 Jason Merrill <jason@yorick.cygnus.com>
13111 * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT.
13112 * typeck2.c (initializer_constant_valid_p): Allow conversions
13113 between pointers and references.
13115 1998-02-19 Brendan Kehoe <brendan@cygnus.com>
13117 * typeck.c (build_unary_op): Only warn about incr/decr a pointer
13118 if pedantic || warn_pointer_arith.
13120 Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13122 * pt.c (unify): Handle TEMPLATE_DECL.
13124 1998-02-18 Brendan Kehoe <brendan@cygnus.com>
13126 * cp-tree.h (strip_attrs): Remove decl.
13128 1998-02-18 Doug Evans <devans@cygnus.com>
13130 * decl.c (duplicate_decls): Call merge_machine_decl_attributes.
13131 Update olddecl's attributes too.
13132 (strip_attrs): Remove function.
13133 * typeck.c (common_type): Call merge_machine_type_attributes.
13135 Tue Feb 17 14:07:52 1998 Mark Mitchell <mmitchell@usa.net>
13137 * parse.y (initdcl0_innards): New grammar symbol.
13138 (nomods_initdecls, nomods_initdcl0): Change type from itype to
13139 none, since the resulting value is never used.
13140 (parse_decl): New function.
13141 (datadef): Remove redundant actions.
13142 (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards.
13143 * parse.c: Regenerated.
13145 Tue Feb 17 11:54:16 1998 Jason Merrill <jason@yorick.cygnus.com>
13147 * parse.y (simple_stmt): Use getdecls() to check for decl.
13149 Sat Feb 14 11:50:51 1998 Manfred Hollstein <manfred@s-direktnet.de>
13151 * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
13153 (c++.install-common): Install c++filt properly as native or as cross
13155 (c++.uninstall): Add c++filt.
13157 Fri Feb 13 14:55:37 1998 Jason Merrill <jason@yorick.cygnus.com>
13159 * call.c (standard_conversion): Fix multi-level ptr conversions.
13161 Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com>
13163 * init.c (build_new): Propagate error_mark_node up.
13165 Fri Feb 13 13:24:32 1998 Jason Merrill <jason@yorick.cygnus.com>
13167 * parse.y (simple_stmt): If the condition isn't a declaration,
13168 start the controlled block after the test.
13170 Fri Feb 13 02:26:10 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
13172 * call.c (build_over_call): Convert builtin abs, labs and fabs to
13174 * decl.c (init_decl_processing): Re-enable abs, labs and fabs as
13177 Fri Feb 13 01:36:42 1998 Jason Merrill <jason@yorick.cygnus.com>
13179 * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV.
13181 Fri Feb 13 00:21:59 1998 Jason Merrill <jason@yorick.cygnus.com>
13183 * cp-tree.h: Add access_protected_virtual_node.
13184 * class.c (init_class_processing): Initialize it.
13185 * decl.c (xref_basetypes): Use it.
13186 * parse.y (base_class_access_list): Likewise.
13188 * Make-lang.in (DEMANGLER_PROG): Add $(exeext).
13189 (c++.install-common): Install c++filt.
13191 Thu Feb 12 12:46:51 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13193 * decl.c (shadow_tag): Give error for typedef-ing built-in types.
13195 Wed Feb 11 23:28:05 1998 Mark Mitchell <mmitchell@usa.net>
13197 * call.c (reference_binding): Use comptypes when comparing
13198 TYPE_MAIN_VARIANTS to handle non-canonical array/index types.
13200 Wed Feb 11 16:42:04 1998 Mark Mitchell <mmitchell@usa.net>
13202 * tree.c (is_overloaded_fn): Use really_overloaded_fn.
13203 (really_overloaded_fn): Move check here from is_overloaded_fn.
13204 (get_first_fn): Use really_overloaded_fn and is_overloaded_fn.
13206 Wed Feb 11 15:54:18 1998 Mark Mitchell <mmitchell@usa.net>
13208 * typeck.c (build_ptrmemfunc): Type-check pointer-to-member
13211 Mon Feb 9 22:23:31 1998 Mark Mitchell <mmitchell@usa.net>
13213 * cp-tree.h (push_template_decl): Return the decl passed in, or an
13214 equivalent duplicate.
13215 * decl.c (pushtag): Use the return value from push_template_decl.
13216 (duplicate_decls): When duplicating a template declaration, merge
13217 the DECL_TEMPLATE_RESULTs as well.
13218 (make_implicit_typename): Don't try to dive into typename types to
13219 find a context for making a new implicit typename.
13220 (start_decl): Use the return value from push_template_decl.
13221 (grokdeclarator): Complain about declarations list `const operator
13222 int'. Since we don't correctly handle in-class initializations of
13223 non-static data members, complain about this (now illegal)
13224 practice. Issue an error for initializations of non-const statics
13225 since that is illegal as well, and since we don't handle that case
13227 (start_function): Use the return value from push_template_decl.
13228 (start_method): Likewise.
13229 * decl2.c (grokfield): Likewise. Since the change to
13230 grokdeclarator ensures that all initialized fields are in fact
13231 static, remove a redundant test for TREE_PUBLIC.
13232 * parse.y (initlist): Disable labeled initializers since they do
13233 not work as per the documentation, and since they do not use the
13234 same syntax as the C front end.
13235 * pt.c (push_template_decl): Return the decl passed in, or an
13236 equivalent duplicate.
13237 (lookup_template_class): When searching in a nested context,
13238 use the right arguments.
13239 (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL.
13240 * typeck.c (build_component_ref): Assign the correct type to the
13241 result of build_vfn_ref.
13243 Tue Feb 10 23:56:46 1998 Jason Merrill <jason@yorick.cygnus.com>
13245 * pt.c (convert_nontype_argument): Fix typo.
13246 (check_explicit_specialization): Allow old-style specialization
13247 of class template members.
13249 Tue Feb 10 20:36:52 1998 Jason Merrill <jason@yorick.cygnus.com>
13250 Manfred Hollstein <manfred@s-direktnet.de>
13252 * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead
13253 when deciding to override DECL_ASSEMBLER_NAME.
13255 Tue Feb 10 15:30:55 1998 Andrew MacLeod <amacleod@torpedo.to.cygnus.com>
13257 * decl2.c (lang_f_options): Add -fsquangle to option processing list.
13258 * cp-tree.h (flag_do_squangling): Add declaration.
13259 * lang-options.h: Add -fsquangle and -fno-squangle.
13260 * method.c: Add macros and static variables for squangling.
13261 (build_overload_name): Rename to build_mangled_name, add logic for B
13262 compression, and split into process_modifiers and
13263 process_overload_item.
13264 (process_modifiers): New function, to handle constant, reference,
13266 (process_overload_item): New function, handles issue of type codes.
13267 (build_overload_name): New function, start squangling and call
13268 build_mangled_name.
13269 (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline.
13270 (start_squangling): New function to initialize squangling structs.
13271 (end_squangling): New function to destroy squangling structs.
13272 (nrepeats): Rename variable to Nrepeats.
13273 (issue_nrepeats): New function for issuing 'n' type repeats.
13274 (check_ktype): New function to check for type K name compression.
13275 (build_overload_nested_name): Add a check for K name compression.
13276 (build_qualified_name): Add a check for K name compression and don't
13277 use DECL_ASSEMBLER_NAME when squangling is on.
13278 (check_btype): New function, checks for B type compression.
13279 (build_static_name, build_decl_overload_real): Initiate squangling.
13280 (build_typename_overload, build_overload_with_type): Initiate
13283 Sun Feb 8 23:47:38 1998 scott snyder <sss@d0linux01.fnal.gov>
13285 * method.c (make_thunk): Avoid name buffer overflow.
13287 Sat Feb 7 16:48:54 1998 Jason Merrill <jason@yorick.cygnus.com>
13289 * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we
13290 don't define them yet.
13292 * parse.y (nomods_initdcl0): Add constructor_declarator case.
13294 Fri Feb 6 21:32:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13296 * config-lang.in (diff_excludes): Use basename only.
13298 Thu Feb 5 19:10:40 1998 Jason Merrill <jason@yorick.cygnus.com>
13300 * tinfo2.cc: Add tinfo for signed char.
13302 Thu Feb 5 14:38:23 1998 Mike Stump <mrs@wrs.com>
13304 * search.c (compute_access): Handle protected constructors in derived
13305 classes as accessible.
13307 Wed Feb 4 01:26:49 1998 Jason Merrill <jason@yorick.cygnus.com>
13309 * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
13310 Call convert_from_reference sooner.
13312 Tue Feb 3 23:50:52 1998 Mark Mitchell <mmitchell@usa.net>
13314 * cvt.c (ocp_convert): Obtain the constant values from constant
13315 decls even if the destination type is the same as the type of the
13318 * decl2.c (finish_file): Make sure that static inlines with
13319 definitions are not marked DECL_EXTERNAL before returning.
13321 Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
13323 * decl.c: Lose arg_looking_for_template.
13324 (lookup_name_real): Likewise.
13325 * parse.y: Lose processing_template_arg, template_arg1.
13326 (primary): Likewise.
13327 * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
13329 Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13331 * error.c (dump_decl): Fix type of default arguments for template
13332 template parameters and nontype template parameters.
13333 * parse.y (template_parm): Handle invalid default template
13334 template arguments here.
13336 * parse.y (template_parm): Use template_arg instead of PTYPENAME
13337 for default template template argument.
13338 * pt.c (coerce_template_parms): Merge default template argument
13339 codes. Can treat RECORD_TYPE as template name if it is implicitly
13340 created. Fix argument index in error message.
13341 * typeck.c (comptypes): Merge template argument comparison codes in
13342 TEMPLATE_TEMPLATE_PARM and RECORD_TYPE.
13344 Tue Jan 6 01:42:44 1998 Mumit Khan <khan@xraylith.wisc.edu>
13346 * lex.c (file_name_nondirectory): Also check for '/'.
13348 Mon Feb 2 11:24:22 1998 Mark Mitchell <mmitchell@usa.net>
13350 * parse.y (primary): Deal with statement-expressions in
13352 * pt.c (tsubst_copy): Handle BIND_EXPR.
13353 * tree.c (mapcar): Likewise.
13355 * call.c (add_template_candidate_real): Pass extra parameter to
13356 fn_type_unification.
13357 * cp-tree.h (fn_type_unification): Add parameter.
13358 * pt.c (fn_type_unification): Add additional parameter to deal with
13359 static member functions.
13360 (get_bindings): Deal with static member functions.
13362 * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro.
13363 (revert_static_member_fn): Declare.
13364 * decl.c (revert_static_member_fn): Remove declaration. Change
13365 linkage from internal to external.
13366 (cp_finish_decl): Deal with virtual functions in classes local to
13367 template functions.
13368 * decl2.c (finish_file): Don't forget to emit increment/decrement
13369 expressions in initializers for file-scope variables.
13370 * parse.y (typename_sub2): If the typename doesn't names a
13371 template, rather than a type, issue an error message.
13372 * pt.c (check_explicit_specialization): Handle specializations of
13373 static member functions.
13374 (coerce_template_parms): Handle offset references to lists of
13376 * search.c (note_debug_info_needed): Don't crash when handed a
13377 type which is being defined.
13378 * typeck.c (complete_type): Don't crash when handed NULL_TREE;
13379 that can happen with some illegal code.
13381 Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13383 * call.c (user_harshness): Initialize `code' to 0.
13384 (build_method_call): Initialize `candidates', `cp' and `len' to 0.
13385 (null_ptr_cst_p): Add parentheses around && within ||.
13386 (standard_conversion): Likewise.
13387 (z_candidate): Likewise.
13388 (build_user_type_conversion_1): Initialize `args' to NULL_TREE.
13389 (build_object_call): Likewise for `mem_args'.
13390 (build_new_op): Likewise for `mem_arglist'. Add `return' from
13391 default case in enumeration switch.
13393 * class.c (build_vtable_entry): Add explicit braces to avoid
13395 (build_class_init_list): Likewise.
13396 (finish_struct_1): Initialize `width' to 0.
13397 (instantiate_type): Initialize `name' to NULL_TREE. Add
13398 explicit braces to avoid ambiguous `else'.
13400 * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous
13403 * decl.c (grok_reference_init): Eliminate unused parameter, all
13405 (record_builtin_type): Initialize `tdecl' to NULL_TREE.
13406 (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE.
13407 (cp_finish_decl): Initialize `ttype' to NULL_TREE.
13408 (grokdeclarator): Add parentheses around && within ||. Add
13409 explicit braces to avoid ambiguous `else'.
13410 (grokparms): Initialize `type' to NULL_TREE.
13411 (xref_tag): Remove unused label `just_return'.
13412 (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE.
13413 (finish_function): Initialize `cond' and `thenclause' to NULL_TREE.
13414 (hack_incomplete_structures): Add parentheses around assignment
13415 used as truth value.
13417 * decl2.c (coerce_delete_type): Hide definition of `e3'.
13419 * error.c: Include <stdlib.h>.
13420 (dump_expr): Change the type of `i' to size_t. Remove unused
13423 * except.c (init_exception_processing): Remove unused variable `d'.
13424 (expand_throw): Likewise for `label'.
13426 * friend.c (add_friends): Add explicit braces to avoid ambiguous
13429 * init.c (sort_member_init): Initialize `last_field' to NULL_TREE.
13430 (sort_base_init): Likewise for `binfo'.
13431 (expand_member_init): Likewise for `rval'.
13432 (build_member_call): Add parentheses around assignment used as
13434 (build_offset_ref): Add explicit braces to avoid ambiguous `else'.
13435 (build_new): Initialize `nelts' to NULL_TREE. Initialize
13436 `old_immediate_size_expand' to 0.
13437 (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE.
13438 (build_vec_delete_1): Remove unused variable `block'.
13439 (expand_vec_init): Initialize `itype' to NULL_TREE.
13441 * lex.c: Include <strings.h> if we don't have <string.h>. Protect
13442 declaration of `index' and `rindex' with autoconf macros.
13443 (reinit_parse_for_expr): Remove unused variables
13444 `look_for_semicolon' and `look_for_lbrac'.
13445 (cons_up_default_function): Initialize `args' to NULL_TREE.
13446 (readescape): Initialize `firstdig' to 0.
13447 (real_yylex): Add parentheses around assignment used as truth value.
13449 * method.c: Include <strings.h> if we don't have <string.h>.
13450 Protect declaration of `index' with autoconf macro.
13452 * parse.y (primary): Add explicit braces to avoid ambiguous `else'.
13453 Initialize `type' to NULL_TREE.
13454 (structsp): Remove unused variable `id'.
13456 * pt.c (coerce_template_parms): Add explicit braces to avoid
13458 (lookup_template_class): Initialize `template' to NULL_TREE.
13459 (instantiate_class_template): Remove unused variable `name' and `e'.
13460 (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE.
13461 (do_poplevel): Initialize `saved_warn_unused' to 0.
13462 (type_unification): Remove unused varable `parm'.
13463 (unify): Likewise for `j'.
13465 * repo.c (init_repo): Add parentheses around assignment used as
13467 (finish_repo): Remove unused varable `p'.
13469 * search.c (get_binfo): Initialize `type' to NULL_TREE.
13470 (get_base_distance): Likewise.
13471 (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path'
13472 and `new_v' to NULL_TREE.
13473 (lookup_fnfields): Likewise for `rval_binfo_h'.
13474 (breadth_first_search): Add parentheses around assignment used as
13476 (get_template_base): Initialize `type' to NULL_TREE.
13478 * sig.c (append_signature_fields): Initialize `last_mfptr' to
13480 (build_signature_table_constructor): Likewise for
13481 `last_rhs_field', `pfn' and `vt_off'.
13482 (build_sigtable): Likewise for `init'.
13484 * tree.c (break_out_calls): Initialize `t2' to NULL_TREE.
13485 (propagate_binfo_offsets): Likewise for `delta'.
13486 (hash_tree_cons): Initialize hashcode to 0.
13487 (can_free): Likewise for `size'.
13488 (cp_tree_equal): Add explicit braces to avoid ambiguous `else'.
13490 * typeck.c (convert_sequence): Hide prototype.
13491 (common_type): Add explicit braces to avoid ambiguous `else'.
13492 (comp_target_types): Likewise.
13493 (build_x_function_call): Initialize `ctypeptr' to NULL_TREE.
13494 (build_function_call_real): Add explicit braces to avoid ambiguous
13496 (convert_arguments): Initialize `called_thing' to 0.
13497 (convert_for_initialization): Initialize `savew' and `savee' to 0.
13499 * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0.
13500 (digest_init): Initialize `old_tail_contents' to NULL_TREE.
13501 (build_x_arrow): Likewise for `last_rval'.
13503 * xref.c (GNU_xref_decl): Initialize `cls' to 0.
13505 Sun Feb 1 12:45:34 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
13507 * decl.c (init_decl_processing): Use set_sizetype.
13508 * decl2.c (sizetype): Don't declare.
13509 * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype.
13510 (c_sizeof_nowarn, build_binary_op_nodefault): Likewise.
13511 (build_component_addr, unary_complex_lvalue): Likewise.
13512 * rtti.c (expand_class_desc): Likewise.
13513 * class.c (get_vfield_offset): Likewise.
13515 Thu Jan 29 10:39:30 1998 Mark Mitchell <mmitchell@usa.net>
13517 * pt.c (convert_nontype_argument): Move check for is_overloaded_fn
13518 early to avoid bogus error. Handle overloaded function
13519 names provided as template arguments correctly.
13520 (coerce_template_parms): Don't mishandle overloaded functions when
13521 dealing with template template parameters.
13522 (lookup_template_class): Issue an error message, rather than
13523 crashing, when the TYPE_DECL provided is not a template type.
13525 Wed Jan 28 23:14:44 1998 Jason Merrill <jason@yorick.cygnus.com>
13527 * class.c (instantiate_type): Don't just return a known type if
13530 Wed Jan 28 11:04:07 1998 Mark Mitchell <mmitchell@usa.net>
13532 * class.c (instantiate_type): Remove handling of FUNCTION_DECL
13533 since that code could never be reached.
13535 * error.c (dump_decl): Avoid aborting in the midst of printing an
13536 error message about an illegal template declaration.
13538 * parse.y (structsp): Print an error message, rather than crashing,
13539 when a class-head does not name a class.
13541 * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE
13542 template arguments as a g++ extension.
13544 * cp-tree.def (ALIGNOF_EXPR): New tree code.
13545 * decl2.c (grok_alignof): If processing_template_decl, just store
13547 * typeck.c (c_alignof): Likewise.
13548 * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR.
13549 * error.c (dump_expr): Likewise.
13550 * pt.c (tsubst_copy): Likewise.
13551 * tree.c (cp_tree_equal): Likewise.
13552 * pt.c (uses_template_parms): Correctly determine whether or not a
13553 SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant
13554 folding can be done.
13556 * cp-tree.h (grok_enum_decls): Remove type parameter.
13557 * decl.c (grok_enum_decls): Likewise.
13558 * decl2.c (grok_x_components): Call grok_enum_decls
13559 unconditionally, since it will do nothing if there is no
13560 current_local_enum. Use the new calling sequence.
13561 * pt.c (tsubst_enum): Use the new calling sequence for
13564 * decl.c (start_function): Make member functions of local classes
13565 in extern inline functions have comdat linkage here...
13566 (grokdeclarator): Rather than here.
13568 Wed Jan 28 10:55:47 1998 Jason Merrill <jason@yorick.cygnus.com>
13570 * pt.c (convert_nontype_argument): Use decl_constant_value.
13572 Tue Jan 27 16:42:21 1998 Mark Mitchell <mmitchell@usa.net>
13574 * call.c (add_template_candidate_real): New function.
13575 (add_template_candidate): Use it.
13576 (add_template_conv_candidate): Likewise.
13577 (joust): Pass extra argument to more_specialized.
13578 * class.c (instantiate_type): Handle a single FUNCTION_DECL.
13579 (is_local_class): Remove.
13580 (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
13581 * cp-tree.h (is_local_class): Remove.
13582 (perform_array_to_pointer_conversion): Likewise.
13583 (finish_member_template_decl): Add.
13584 (check_explicit_specialization): Return a tree, not an int.
13585 (more_specialized): Take additional argument.
13586 (get_bindings): Likewise.
13587 (TI_PENDING_SPECIALIZATION_FLAG): New macro.
13588 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
13589 (perform_array_to_pointer_conversion): Remove.
13590 * decl.c (saved_scope): Add processing_specialization,
13591 processing_explicit_instantiation fields.
13592 (maybe_push_to_top_level): Save them.
13593 (pop_from_top_level): Restore them.
13594 (grokfndecl): Use new return value from
13595 check_explicit_specialization.
13596 (start_decl): Don't check flag_guiding_decls before pushing
13598 (cp_finish_decl): Remove previous (bogus) change.
13599 (grok_declarator): Use decl_function_context rather than
13601 * decl2.c (finish_file): Pass extra argument to get_bindings.
13602 (build_expr_from_tree): Let build_x_component_ref check
13603 validity of arguments rather than doing it here.
13604 * lex.c (cons_up_default_function): Remove code fooling with
13605 processing_specialization, processing_explicit_instantiation
13606 flags, as that is now done in {maybe_push_top,pop_from}_top_level.
13607 * method.c (build_overload_identifier): Mangle local classes in
13608 template functions correctly.
13609 * parse.y (finish_member_template_decl): Move to pt.c.
13610 * pt.c (finish_member_template_decl): Moved here from parse.y.
13611 (print_candidates): New function.
13612 (determine_specialization): Change interface. Properly look for
13613 most specialized versions of template candidates.
13614 (check_explicit_specialization): Fully process explicit
13616 (push_template_decl): Avoid looking at CLASSTYPE fields in
13618 (determine_overloaded_function): Remove.
13619 (convert_nontype_argument): Change name from
13620 convert_nontype_parameter. Use determine_overloaded_function
13621 instead of instantiate_type.
13622 (mangle_class_name_for_template): Handle type contexts as well as
13624 (classtype_mangled_name): Likewise.
13625 (lookup_template_class): Likewise.
13626 (tsubst): Likewise.
13627 (more_specialized): Take explict template arguments as a
13629 (most_specialized): Likewise.
13630 (get_bindings): Likewise. Check that return types match before
13631 proclaiming a function a match.
13632 (do_decl_instantiation): Remove code searching for function to
13633 instantiate; that is now done in check_explicit_specialization.
13634 (add_maybe_template): Pass extra argument to get_bindings.
13635 * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
13637 * typeck.c (build_component_ref): Check for invalid arguments.
13639 Tue Jan 27 01:44:02 1998 Jason Merrill <jason@yorick.cygnus.com>
13641 * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
13642 return_target and call_target are equivalent.
13644 * pt.c (type_unification_real): Just accept function parms that
13645 don't use any template parms.
13647 Sun Jan 25 03:30:00 1998 Jason Merrill <jason@yorick.cygnus.com>
13649 * decl.c (cp_finish_decl): When bailing on a comdat variable, also
13650 unset DECL_NOT_REALLY_EXTERN.
13652 * parse.y (typename_sub*): Fix std::.
13654 Sat Jan 24 12:13:54 1998 Jason Merrill <jason@yorick.cygnus.com>
13656 * error.c (dump_decl): Fix type default template args.
13657 (dump_type): Hand TEMPLATE_DECL off to dump_decl.
13659 Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
13661 * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
13662 (file_name_nondirectory): Use.
13664 Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13666 * pt.c (coerce_template_parms): Don't access elements of ARGLIST
13667 that are not really present. Substitute default arguments in
13668 template template arguments. Correctly convert TEMPLATE_DECL to
13669 TEMPLATE_TEMPLATE_PARM.
13670 (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM
13671 are no longer treated specially here.
13672 * parse.y (template_template_parm): Fix copy error.
13673 * decl.c (grokdeclarator): Warn about missing `typename' for nested
13674 type created from template template parameters.
13675 * parse.y (bad_parm): Likewise
13677 * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM.
13678 (push_nested_class): Likewise.
13679 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code.
13680 * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro.
13681 (copy_template_template_parm): Declare.
13682 * decl.c (arg_looking_for_template): New variable.
13683 (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM.
13684 Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM
13685 node if arg_looking_for_template is nonzero.
13686 (pushdecl): Handle TEMPLATE_TEMPLATE_PARM.
13687 (grok_op_properties, xref_tag, xref_basetypes): Likewise.
13688 (grokdeclarator): Handle TEMPLATE_DECL.
13689 * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM.
13690 * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM.
13691 (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM.
13692 (dump_decl): Handle unnamed template type parameters.
13693 Handle template template parameters.
13694 (dump_function_name): Handle template template parameters.
13695 * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef):
13696 Handle TEMPLATE_TEMPLATE_PARM.
13697 * method.c (build_template_template_parm_names): New function.
13698 (build_template_parm_names): Handle TEMPLATE_DECL.
13699 (build_overload_nested_name, build_overload_name):
13700 Handle TEMPLATE_TEMPLATE_PARM.
13701 * parse.y (maybe_identifier): New nonterminal.
13702 (template_type_parm): Use it.
13703 (template_template_parm, template_arg1): New nonterminal.
13704 (template_parm): Add template_template_parm rules.
13705 (template_arg): Set processing_template_arg.
13706 (template_arg1): Rules moved from template_arg.
13707 (primary, nonnested_type): Set arg_looking_for_template if we are
13708 processing template arguments.
13709 * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL.
13710 (process_template_parm): Handle template template parameters.
13711 (coerce_template_parms, comp_template_args): Likewise.
13712 (mangle_class_name_for_template, lookup_template_class): Likewise.
13713 (uses_template_parms): Handle TEMPLATE_DECL and
13714 TEMPLATE_TEMPLATE_PARM.
13715 (current_template_args): Handle TEMPLATE_DECL.
13716 (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM.
13717 * search.c (dfs_walk, dfs_record_inheritance):
13718 Handle TEMPLATE_TEMPLATE_PARM.
13719 * tree.c (copy_template_template_parm): New function.
13720 (mapcar): Handle TEMPLATE_TEMPLATE_PARM.
13721 * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM.
13723 Mon Jan 19 22:40:03 1998 Mark Mitchell <mmitchell@usa.net>
13725 * decl.c (start_decl): Don't allow duplicate definitions of static
13728 * call.c (build_user_type_conversion_1): Handle user-defined
13729 template conversion operators correctly.
13731 * decl2.c (build_expr_from_tree): Issue an error message if the
13732 object in a COMPONENT_REF is a TEMPLATE_DECL.
13734 * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs.
13736 * class.c (is_local_class): New function.
13737 * cp-tree.h (is_local_class): Declare it.
13738 (last_tree): Likewise.
13739 (begin_tree): Likewise.
13740 (end_tree): Likewise.
13741 (lookup_template_class): Change prototype.
13742 * decl.c (cp_finish_decl): Check for NULL where necessary.
13743 Consider FUNCTION_DECLS to declare objects with top-level binding,
13744 when calling make_decl_rtl.
13745 (grokdeclarator): Give members of local classes internal linkage.
13746 (start_function): Remove declaration of last_tree.
13747 (finish_function): Set flag_keep_inline_functions around call to
13748 rest_of_compilation if we are processing a member function in a
13750 (start_method): Call push_template_decl for member functions of
13751 local classes in template functions.
13752 * decl2.c (import_export_decl): Don't give external linkage to
13753 instantiations of templates with internal linkage.
13754 * parse.y (last_tree): Remove declaration.
13755 (template_type): Pass extra parameter to lookup_template_class.
13756 (self_template_type): Likewise.
13757 (structsp): Move call to reset_specialization into left_curly.
13758 (left_curly): Call reset_specialization, and begin_tree.
13759 * pt.c (saved_trees): New variable.
13760 (mangle_class_name_for_template): Change prototype. Use
13761 additional function context to name local classes in templates
13763 (classtype_mangled_name): Pass the context.
13764 (push_template_decl): Handle local classes and templates, and
13765 member functions for such classes.
13766 (convert_nontype_parameter): Fix handling of pointer-to-member
13768 (lookup_template_class): Handle local classes in templates.
13769 (tsubst): Likewise. Don't assume that template instantiations
13770 have external linkage; pay attention to the template declaration.
13771 (mark_decl_instantiated): Likewise.
13772 (begin_tree): New function.
13773 (end_tree): Likewise.
13775 * decl.c (xref_basetypes): Don't call complete_type for basetypes
13776 that involve template parameters; that can lead to infinite
13777 recursion unnecessarily.
13779 * pt.c (register_specialization): Do not register specializations
13780 that aren't ready to be registered yet.
13781 (check_explicit_specialization): Handle explicit specialization of
13782 constructors and destructors.
13783 (build_template_decl): New function.
13784 (push_template_delc): Handle out-of-class specializations of
13787 * pt.c (check_explicit_specialization): Set up the template
13788 information before registering the specialization.
13789 (coerce_template_parms): Fix thinko.
13790 (tsubst): Handle specializations of member templates correctly.
13792 * class.c (finish_struct_methods): Remove calls to
13793 check_explicit_specialization from here.
13794 (finish_struct): And insert them here.
13795 * cp-tree.h (perform_qualification_conversions): New function.
13796 (perform_array_to_pointer_conversion): Likewise.
13797 (begin_explicit_instantiation): Likewise.
13798 (end_explicit_instantiation): Likewise.
13799 (determine_specialization): Renamed from
13800 determine_explicit_specialization.
13801 (comp_template_parms): New function.
13802 (processing_explicit_instantiation): New variable.
13803 * cvt.c (perform_qualification_conversions): New function.
13804 (perform_array_to_pointer_conversion): Likewise.
13805 * decl.c (duplicate_decls): Don't consider template functions
13806 alike unless they have the same parameters. Refine handling of
13807 instantiation/specialization mismatches.
13808 (start_decl): Don't call pushdecl for template specializations,
13809 since they don't affect overloading.
13810 (start_function): Likewise.
13811 (grokfndecl): Call check_explicit_specialization a little later.
13812 Don't call duplicate_decls for memberm template specializations.
13813 (grokdeclarator): Don't update template_count for classes that are
13814 themselves specializations. Remove use of `2' as parameter to
13815 grokfndecl since that value isn't used.
13816 * lex.c (cons_up_default_function): Save and restore
13817 processing_explicit_instantiation around calls to grokfield.
13818 * parse.y (finish_member_template_decl): New function.
13819 (component_decl_1): Use it.
13820 (fn.def2): Likewise.
13821 (template_arg_list_opt): New nonterminal.
13822 (template_type): Use it.
13823 (self_template_type): Likewise.
13824 (template_id): Likewise.
13825 (object_template_id): Likewise.
13826 (notype_template_declarator): Likwise.
13827 (begin_explicit_instantiation): Likewise.
13828 (end_explicit_instantiation): Likewise.
13829 (explicit_instantiation): Use them.
13830 * pt.c (coerce_template_parms): Add parameters.
13831 (processing_explicit_instantiation): New variable.
13832 (convert_nontype_parameter): New function.
13833 (determine_overloaded_function): Likewise.
13834 (begin_explicit_instantiation): Likewise.
13835 (end_explicit_instantiation): Likewise.
13836 (retrieve_specialization): Likewise.
13837 (register_specialization): Likewise.
13838 (processing_explicit_specialization): Removed.
13839 (determine_specialization): Handle specializations of member
13840 functions of template class instantiations.
13841 (check_explicit_specialization): Refine to conform to standard.
13842 (comp_template_parms): New function.
13843 (coerce_template_parms): Call convert_nontype_parameter.
13844 (tsubst): Refine handling of member templates. Use
13845 register_specialization.
13846 (instantiate_template): Use retrieve_specialization.
13847 (do_decl_instantiation): Likewise.
13848 (instantiate_decl): Likewise.
13849 (type_unification): Improve handling of explict template
13851 * tree.c (mapcar): Return error_mark_node, rather than aborting,
13852 on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
13853 * typeck.c (build_unary_op): Call determine_specialization, rather
13854 than determine_explicit_specialization.
13856 Mon Jan 19 13:18:51 1998 Jason Merrill <jason@yorick.cygnus.com>
13858 * cvt.c (build_up_reference): A TARGET_EXPR has side effects.
13860 Fri Jan 16 11:40:50 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13862 * error.c (dump_decl): For enum tags, output the tag, not its value.
13864 1998-01-13 Brendan Kehoe <brendan@cygnus.com>
13866 * decl.c (init_decl_processing): Only call init_rtti_processing
13869 Mon Jan 12 01:35:18 1998 Jason Merrill <jason@yorick.cygnus.com>
13871 * init.c (build_new_1): Split out from build_new.
13872 (build_new): Just return a NEW_EXPR.
13873 * expr.c (cplus_expand_expr): Handle NEW_EXPR.
13875 * decl2.c (get_temp_regvar): Tweak.
13877 * cp-tree.h (TREE_CALLS_NEW): Comment out.
13878 * class.c (resolves_to_fixed_type_p): Remove use.
13879 * method.c (build_opfncall): Likewise.
13880 * call.c (build_new_op): Likewise.
13882 Wed Jan 7 23:47:13 1998 Jason Merrill <jason@yorick.cygnus.com>
13884 * exception.cc (__eh_alloc, __eh_free): New fns.
13885 (__cp_push_exception, __cp_pop_exception): Use them.
13886 (__uncatch_exception): Call terminate here if no exception.
13887 * except.c (build_terminate_handler): New fn.
13888 (expand_start_catch_block): Use it.
13889 (expand_exception_blocks): Likewise.
13890 (alloc_eh_object): New fn.
13891 (expand_throw): Use it. Protect exception init with terminate.
13892 * typeck.c (build_modify_expr): Remove code that ignores trivial
13895 Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13897 * call.c (add_builtin_candidate): Add default case in enumeration
13899 (build_new_op): Likewise.
13900 (convert_like): Likewise.
13901 * cvt.c (build_expr_type_conversion): Likewise.
13902 * tree.c (real_lvalue_p): Likewise.
13903 (lvalue_p): Likewise.
13904 (cp_tree_equal): Likewise.
13905 * typeck.c (comptypes): Likewise.
13906 (build_component_ref): Likewise.
13907 (build_function_call_real): Likewise.
13908 (build_binary_op_nodefault): Likewise.
13909 (build_unary_op): Likewise.
13910 (build_modify_expr): Likewise.
13911 * typeck2.c (initializer_constant_valid_p): Likewise.
13913 Sun Dec 21 15:59:00 1997 Nick Clifton <nickc@cygnus.com>
13915 * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas.
13917 Thu Dec 18 14:51:50 1997 Mark Mitchell <mmitchell@usa.net>
13919 * pt.c (coerce_template_parms): Make sure to digest_init if
13922 * decl.c (duplicate_decls): Make the newdecl virtual if the
13923 olddecl was, just as is done with other attributes of olddecl.
13925 Thu Dec 18 14:43:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13927 * typeck.c (unary_complex_lvalue): Ignore op0 when taking the
13928 address of an OFFSET_REF.
13930 * cp-tree.def: Add AGGR_INIT_EXPR.
13931 * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
13932 AGGR_INIT_EXPR where appropriate.
13933 * expr.c (cplus_expand_expr): Likewise. Simplify.
13935 * decl2.c (finish_file): Remove call to register_exception_table.
13937 Wed Dec 17 17:08:52 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13939 * pt.c (instantiate_class_template): Don't do injection when
13940 processing_template_decl is true, as pollutes current_binding_level
13943 Wed Dec 17 21:17:39 1997 Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de>
13945 * pt.c (maybe_fold_nontype_arg): Add prototype.
13947 Tue Dec 16 10:31:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13949 * tree.c (mapcar): Handle TRY_CATCH_EXPR et al.
13950 * error.c (dump_expr): Likewise.
13952 Mon Dec 15 12:22:04 1997 Jason Merrill <jason@yorick.cygnus.com>
13954 * typeck.c (build_function_call_real): Remove "inline called before
13955 definition" pedwarn.
13957 * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg.
13959 Sun Dec 14 22:34:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13961 * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
13963 * pt.c (type_unification_real): Change __null to type void* with
13966 Sun Dec 14 20:38:35 1997 Mark Mitchell <mmitchell@usa.net>
13968 * call.c (implicit_conversion): Don't call
13969 build_user_type_conversion_1 with a NULL expr, since it will
13972 * pt.c (unify): Don't try to unify array bounds if either array is
13975 Fri Dec 12 16:09:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13977 * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at):
13978 Replace extern decls with casts.
13980 * decl.c (expand_start_early_try_stmts): Don't mess with a sequence.
13981 Update last_parm_cleanup_insn.
13982 (store_after_parms): Remove.
13983 * cp-tree.h: Adjust.
13985 Thu Dec 11 22:18:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13987 * decl2.c (comdat_linkage): Also set DECL_COMDAT.
13988 (finish_file): Check DECL_COMDAT instead of weak|one_only.
13989 (import_export_vtable): Use make_decl_one_only instead of
13990 comdat_linkage for win32 tweak.
13991 (import_export_decl): Likewise.
13992 * pt.c (mark_decl_instantiated): Likewise.
13994 * decl2.c (finish_file): Lose handling of templates in pending_statics.
13996 Thu Dec 11 21:12:09 1997 Jason Merrill <jason@yorick.cygnus.com>
13998 * decl2.c (finish_file): Lose call to expand_builtin_throw.
13999 * except.c (expand_builtin_throw): Remove.
14000 * cp-tree.h: Remove ptr_ptr_type_node.
14001 * decl.c: Likewise.
14003 Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
14005 * decl.c (ptr_ptr_type_node): Define.
14006 (init_decl_processing): Initialize it.
14007 * cp-tree.h: Declare it.
14008 * exception.cc (__cp_exception_info): Use __get_eh_info.
14009 (__cp_push_exception): Likewise.
14010 (__cp_pop_exception): Likewise.
14012 From Scott Snyder <snyder@d0sgif.fnal.gov>:
14013 * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
14015 (init_exception_processing): Removed saved_pc initialization.
14017 Wed Dec 10 11:04:45 1997 Jason Merrill <jason@yorick.cygnus.com>
14019 * pt.c (instantiate_decl): Defer all templates but inline functions.
14021 Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14023 * init.c (expand_vec_init): Don't fold a list of parameters.
14025 * decl.c (copy_args_p): Handle copy elision for types with virtual
14027 * call.c (build_over_call): Likewise.
14029 Sun Dec 7 22:38:12 1997 Mark Mitchell <mmitchell@usa.net>
14031 * pt.c (lookup_template_function): Copy the template arguments,
14032 not just the list containing them, to the permanent obstack.
14034 Sun Dec 7 15:53:06 1997 Jason Merrill <jason@yorick.cygnus.com>
14036 * except.c (expand_start_catch_block): suspend_momentary for the
14039 * error.c (dump_decl): Handle LOOKUP_EXPR.
14041 Sun Dec 7 15:45:07 1997 Mark Mitchell <mmitchell@usa.net>
14043 * rtti.c (build_dynamic_cast): Copy the cast-to type to the
14044 permanent obstack if we are processing a template decl.
14045 * typeck.c (build_static_cast): Likewise.
14046 (build_const_cast): Likewise.
14047 (build_reinterpret_cast): Likewise.
14049 * pt.c (coerce_template_parms): Coerce some expressions, even
14050 when processing_template_decl.
14052 Sun Dec 7 01:46:33 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14054 * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
14055 handling of pointer difference expressions.
14057 * typeck.c (comp_target_types): Comparison of function/method types
14058 is independent of nptrs.
14060 Sun Dec 7 01:40:27 1997 Mark Mitchell <mmitchell@usa.net>
14062 * pt.c (tsubst): Avoid creating pointer to reference and
14063 reference to reference types.
14065 Sat Dec 6 01:29:37 1997 Jason Merrill <jason@yorick.cygnus.com>
14067 * parse.y (do_id): New nonterminal.
14068 (template_id): Use it.
14070 Fri Dec 5 01:17:34 1997 Jason Merrill <jason@yorick.cygnus.com>
14072 * parse.y (template_id): do_identifier for PFUNCNAMEs, too.
14073 * spew.c (yylex): Don't do_identifier here.
14074 * decl2.c (build_expr_from_tree): Revert last change.
14076 * decl2.c (build_expr_from_tree): Expand the name for a method call.
14077 * parse.y (object_template_id): Don't try to take the DECL_NAME.
14079 Wed Dec 3 20:02:39 1997 Jason Merrill <jason@yorick.cygnus.com>
14081 * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for
14083 * call.c (build_op_delete_call): Adjust.
14085 * except.c (expand_end_catch_block): Lose rethrow region.
14086 (expand_start_catch_block): Likewise.
14087 (expand_end_catch_block): Don't expand_leftover_cleanups.
14089 Wed Dec 3 13:24:04 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14091 * pt.c (tsubst): Remove tree_cons call (places redundant info into
14092 DECL_TEMPLATE_INSTANTIATION).
14094 Wed Dec 3 11:44:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14096 * tree.c (is_overloaded_fn): Handle getting a fn template.
14097 (really_overloaded_fn): Likewise.
14098 * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better.
14099 * pt.c (check_explicit_specialization): Tweak.
14100 (determine_explicit_specialization): Tweak.
14102 * tree.c, cp-tree.h (get_target_expr): New fn.
14104 Wed Dec 3 08:47:27 1997 Paul Eggert <eggert@twinsun.com>
14106 * pt.c (check_explicit_specialization): Fix misspelling in
14107 diagnostic: `preceeded'.
14108 * typeck.c (get_delta_difference): Fix misspelling in diagnostic:
14111 1997-12-02 Mark Mitchell <mmitchell@usa.net>
14113 * pt.c (determine_explicit_specialization): Avoid an internal
14114 error for bad specializations.
14116 * method.c (build_overload_value): Handle SCOPE_REF.
14118 Tue Dec 2 19:18:50 1997 Mike Stump <mrs@wrs.com>
14120 * class.c (prepare_fresh_vtable): Enable even more complex MI
14123 Tue Dec 2 01:37:19 1997 Jason Merrill <jason@yorick.cygnus.com>
14125 * exception.cc (__check_eh_spec): Optimize a bit.
14127 * exception.cc (__cp_pop_exception): Lose handler arg.
14128 * except.c (do_pop_exception): Likewise.
14129 (push_eh_cleanup): Let the cleanup mechanism supply the handler.
14130 (expand_end_catch_block): Likewise.
14132 Fri Nov 28 01:58:14 1997 Jason Merrill <jason@yorick.cygnus.com>
14134 * pt.c (check_explicit_specialization): Complain about using a
14135 template-id for a non-specialization.
14137 Fri Nov 28 12:35:19 1997 Scott Christley <scottc@net-community.com>
14139 * repo.c: Prototype rindex only if needed.
14140 * xref.c: Likewise.
14142 Fri Nov 28 01:56:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14144 * error.c (dump_decl): Handle TEMPLATE_ID_EXPR.
14146 Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com>
14148 * typeck.c (build_const_cast): Handle references here instead of
14149 handing off to convert_to_reference.
14151 * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
14152 TerminateFunctionCall.
14153 (init_exception_processing): Likewise. Terminate et al are now
14154 the fns, not ADDR_EXPRs.
14155 (various): Lose redundant assemble_external calls.
14156 (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/.
14158 * cp-tree.h (struct lang_decl_flags): Add comdat.
14159 (DECL_COMDAT): New macro.
14160 * decl.c (duplicate_decls): Propagate it.
14161 (cp_finish_decl): Handle it.
14162 * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs.
14164 * class.c: Remove static pending_hard_virtuals.
14165 (add_virtual_function): Take pointers to pending_virtuals
14166 and pending_hard_virtuals.
14167 (finish_struct_1): Pass them. Declare pending_hard_virtuals.
14169 Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com>
14171 * decl2.c (import_export_vtable): If we support one_only but not
14172 weak symbols, mark instantiated template vtables one_only.
14173 (import_export_decl): Likewise for tinfo functions.
14174 (finish_vtable_vardecl): Also write out vtables from explicitly
14175 instantiated template classes.
14176 * pt.c (mark_class_instantiated): Revert last change.
14178 * except.c (expand_throw): Call mark_used on the destructor.
14180 Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com)
14182 * lex.c (lang_init): Enable flag_exceptions by default if no
14183 command line switch was specified.
14185 1997-11-26 Mark Mitchell <mmitchell@usa.net>
14187 * pt.c (unify): Handle `void' template parameters in
14190 Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
14192 * rtti.c (build_dynamic_cast): Handle template case here.
14193 (build_dynamic_cast_1): Not here.
14195 * typeck2.c (digest_init): Make copies where appropriate.
14197 * decl2.c (delete_sanity): resolve_offset_ref.
14199 * except.c: Call terminate without caching so many bits.
14201 * except.c (expand_start_catch_block): Fix catching a reference
14204 Tue Nov 25 11:28:21 1997 Jason Merrill <jason@yorick.cygnus.com>
14206 * init.c (build_new): Copy size to the saveable obstack.
14208 * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the
14209 TRY_CATCH_EXPR for now.
14211 Mon Nov 24 12:15:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14213 * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
14214 has DECL_LANG_SPECIFIC.
14216 * exception.cc (struct cp_eh_info): Add handlers field.
14217 (__cp_push_exception): Initialize it.
14218 (__cp_pop_exception): Decrement it. Don't pop unless it's 0.
14219 (__throw_bad_exception): Remove.
14220 * except.c (call_eh_info): Add handlers field.
14221 (get_eh_handlers): New fn.
14222 (push_eh_cleanup): Increment handlers.
14224 Fri Nov 21 12:22:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14226 * except.c (expand_start_eh_spec): Use the try/catch code.
14227 (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of
14228 doing everything inline.
14229 (init_exception_processing): throw_type_match now takes
14230 const void pointers.
14231 * exception.cc (__check_eh_spec): New fn.
14232 * inc/exception: Neither terminate nor unexpected return.
14233 * decl.c: Make const_ptr_type_node public.
14234 * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly.
14236 * except.c (expand_start_catch_block): We only need the rethrow
14237 region for non-sjlj exceptions.
14238 (expand_end_catch_block): Likewise. Use outer_context_label_stack.
14240 Thu Nov 20 14:40:17 1997 Jason Merrill <jason@yorick.cygnus.com>
14242 * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
14243 (various.o): Likewise.
14244 * inc/new: Add placement deletes. Add throw specs for default new.
14245 * new.cc (set_new_handler): Move here from libgcc2.
14246 * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
14247 (new): Move from libgcc2. Throw bad_alloc.
14248 * new2.cc: Move the rest of the op news and op deletes from libgcc2.
14249 * decl.c (init_decl_processing): Update exception specs on new and
14252 * method.c (build_decl_overload_real): Don't mess with global
14255 * init.c (build_new): Check for null throw spec, not nothrow_t.
14257 * decl.c (duplicate_decls): Don't complain about different exceptions
14258 from an internal declaration.
14260 * call.c (build_op_delete_call): Fix check for member fns again.
14262 * decl2.c (import_export_decl): Interface hackery affects
14263 virtual synthesized methods.
14265 Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
14267 * decl.c (start_decl): Don't just complain about a mismatched
14270 * decl.c (make_implicit_typename): Handle case where t is not
14271 actually from context.
14272 * tree.c (get_type_decl): Lose identifier case.
14273 * spew.c (yylex): Lose useless call to identifier_typedecl_value.
14274 * parse.y (nonnested_type): Just use lookup_name.
14275 (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
14277 Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
14279 * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
14280 T was built in C language context (for example, by
14281 output_func_start_profiler).
14283 Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
14285 * decl.c (make_implicit_typename): New fn.
14286 (lookup_name_real): Use it. Use current_class_type as the context.
14288 Mon Nov 17 23:42:03 1997 Bruno Haible <haible@ilog.fr>
14290 * pt.c (do_poplevel): Don't prohibit jumps into this contour.
14292 Mon Nov 17 02:01:28 1997 Jason Merrill <jason@yorick.cygnus.com>
14294 * friend.c (do_friend): Warn about non-template friends in templates.
14296 * call.c (build_op_delete_call): Fix handling of inherited delete.
14298 * search.c (dfs_record_inheritance): Ignore template type parms.
14300 Sat Nov 15 00:30:51 1997 Jason Merrill <jason@yorick.cygnus.com>
14302 * call.c (build_new_op): Fix copy error.
14303 (build_op_new_call): New fn.
14304 (build_op_delete_call): New fn.
14305 * cp-tree.h: Declare them.
14306 * init.c (build_new): Use them. Support placement delete.
14307 (build_x_delete): Use build_op_delete_call.
14308 (build_delete): Likewise.
14309 * decl2.c (delete_sanity): Likewise.
14310 (coerce_delete_type): Don't complain about placement delete.
14312 Thu Nov 13 01:52:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14314 * call.c (build_new_function_call): Remove unused 'obj' parm.
14315 * cp-tree.h, typeck.c: Adjust.
14317 * init.c (build_new): Make the cleanup last longer.
14318 (expand_vec_init): Call do_pending_stack_adjust.
14320 Wed Nov 12 11:04:33 1997 Jason Merrill <jason@yorick.cygnus.com>
14322 * pt.c (do_type_instantiation): Fix typo.
14323 (mark_class_instantiated): If we support one_only but not weak
14324 symbols, don't mark this as known.
14326 * init.c (build_new): Handle vec delete in EH cleanup.
14328 Wed Nov 12 08:11:55 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14330 * call.c (build_method_call): Call complete_type before checking
14333 Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com)
14335 * decl.c (add_block_current_level): Delete.
14336 * init.c (build_vec_delete_1): Delete build_block and
14337 add_block_current_level calls.
14339 Wed Nov 12 00:48:16 1997 Jason Merrill <jason@yorick.cygnus.com>
14341 * init.c (build_new): Handle freeing allocated memory when the
14342 constructor throws.
14344 * call.c (build_new_method_call): Fix flags arg.
14346 * pt.c (do_type_instantiation): Don't try to instantiate
14348 (mark_decl_instantiated): If we support one_only but not
14349 weak symbols, mark this one_only.
14350 * decl2.c (import_export_vtable): Don't defer handling of vtables
14351 if MULTIPLE_SYMBOL_SPACES.
14353 Tue Nov 11 12:02:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14355 * except.c (expand_end_catch_block): Lose call to __sjpopnthrow.
14357 Tue Nov 11 02:53:44 1997 Jason Merrill <jason@lasher.cygnus.com>
14359 * except.c (do_pop_exception): Return a value.
14361 Mon Nov 10 20:25:31 1997 Jason Merrill <jason@yorick.cygnus.com>
14363 * call.c (build_new_method_call): Handle getting a
14364 TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field
14365 if we got template parms.
14366 * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR,
14368 * decl2.c (build_expr_from_tree): Tweak last change.
14369 * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE.
14370 (maybe_fold_nontype_arg): Split out from tsubst_copy.
14371 * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR.
14373 Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
14375 * pt.c (tsubst_copy): Handle explicit template arguments in
14377 * typeck.c (build_x_function_call): Likewise.
14378 * decl2.c (build_expr_from_tree): Lookup function name if it
14381 * pt.c (tsubst): Instantiate template functions properly when
14382 template parameter does not appear in function arguments and return
14384 (comp_template_args): Handle member templates required by tsubst.
14386 Mon Nov 10 20:08:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14388 * decl.c (grokdeclarator): Tweak conditions for pedwarn in
14391 Mon Nov 10 20:08:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14393 * pt.c (coerce_template_parms): Tweak error message.
14395 * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
14396 return type defaults to `int', even if there are storage-class
14399 Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com>
14401 Complete nested exception support.
14402 * except.c (do_pop_exception): Split out...
14403 (push_eh_cleanup): From here. Handle the EH region by hand.
14404 (expand_start_catch_block): Add a new level for the catch parm.
14405 Move the rethrow region outside the two cleanup regions.
14406 Protect the initializer for the catch parm with terminate.
14407 (expand_end_catch_block): Likewise. End the region for the eh_cleanup.
14408 * exception.cc (__cp_pop_exception): Now takes two parms. Handle
14409 popping off the middle of the stack.
14410 * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
14411 WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
14412 (build_cplus_new): Only wrap CALL_EXPRs.
14413 * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
14414 the constructor call.
14416 Sun Nov 9 18:00:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
14418 * Make-lang.in (c++.distdir): Make inc subdirectory.
14420 Fri Nov 7 11:57:28 1997 Jason Merrill <jason@yorick.cygnus.com>
14422 * decl2.c (finish_file): Put back some code.
14424 Thu Nov 6 11:28:14 1997 Jason Merrill <jason@yorick.cygnus.com>
14426 * decl2.c (finish_file): Remove redundant code.
14427 * method.c (emit_thunk): Don't let the backend defer generic thunks.
14429 Wed Nov 5 23:52:50 1997 Jason Merrill <jason@yorick.cygnus.com>
14431 * except.c (call_eh_info): Split out...
14432 (push_eh_info): From here.
14433 (expand_builtin_throw): Use it.
14434 (expand_start_catch_block): Move region start back.
14436 Tue Nov 4 13:45:10 1997 Doug Evans <devans@canuck.cygnus.com>
14438 * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
14439 (real_yylex): Record wide strings using target endianness, not host.
14441 1997-11-03 Brendan Kehoe <brendan@lisa.cygnus.com>
14443 * repo.c (rindex): Add decl unconditionally.
14444 (get_base_filename, open_repo_file): Don't cast rindex.
14445 * xref.c (rindex): Add decl unconditionally.
14446 (index): Remove unused decl.
14447 (open_xref_file): Don't cast rindex.
14449 Sun Nov 2 15:04:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14451 * class.c (build_vbase_path): Propagate the result type properly.
14453 1997-11-01 Brendan Kehoe <brendan@lisa.cygnus.com>
14455 * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
14456 remaining use of saved_throw_type with a call to get_eh_type.
14458 1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
14460 * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
14461 (file_name_nondirectory): New function, doing the same as the macro.
14462 (set_typedecl_interface_info): Use it instead of the macro.
14463 (check_newline): Likewise.
14464 (handle_cp_pragma): Likewise.
14466 * repo.c (get_base_filename): Cast result of rindex to char*.
14467 (open_repo_file): Likewise.
14468 * xref.c (open_xref_file): Likewise.
14469 * error.c (dump_char): Make its arg int, not char.
14471 * except.c (push_eh_info): Pass the number of fields - 1 down, not
14472 the exact number of fields.
14474 Fri Oct 31 01:47:57 1997 Jason Merrill <jason@yorick.cygnus.com>
14476 Support for nested exceptions.
14477 * tinfo2.cc (__is_pointer): New fn.
14478 * exception.cc (struct cp_eh_info): Define.
14479 (__cp_exception_info, __uncatch_exception): New fns.
14480 (__cp_push_exception, __cp_pop_exception): New fns.
14481 * except.c: Lose saved_throw_{type,value,cleanup,in_catch}.
14483 (init_exception_processing): Likewise. __eh_pc is now external.
14484 (push_eh_info): New fn.
14485 (get_eh_{info,value,type,caught}): New fns.
14486 (push_eh_cleanup): Just call __cp_pop_exception.
14487 (expand_start_catch_block): Use push_eh_info. Start the eh region
14489 (expand_end_eh_spec): Use push_eh_info.
14490 (expand_throw): Call __cp_push_exception to set up the exception info.
14491 Just pass the destructor or 0 as the cleanup. Call __uncatch_exception
14493 (expand_builtin_throw): Don't refer to empty_fndecl.
14495 Thu Oct 23 02:01:30 1997 Jason Merrill <jason@yorick.cygnus.com>
14497 * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl.
14499 1997-10-22 Brendan Kehoe <brendan@cygnus.com>
14501 * method.c (build_template_parm_names, build_decl_overload_real):
14502 Add static to definitions.
14503 * pt.c (add_to_template_args, note_template_header,
14504 processing_explicit_specialization, type_unification_real): Likewise.
14505 ({determine,check}_explicit_specialization): Use a single string for
14508 Mon Oct 20 12:06:34 1997 Jason Merrill <jason@yorick.cygnus.com>
14510 * except.c (expand_exception_blocks): Call do_pending_stack_adjust.
14511 (expand_end_catch_block): Likewise.
14512 (expand_end_eh_spec): Likewise.
14514 Mon Oct 20 11:44:20 1997 Mark Mitchell <mmitchell@usa.net>
14516 * decl.c (duplicate_decls): Handle template specializations
14518 * error.c (dump_function_name): Fix printing of specializations of
14519 member functions that are not member templates.
14520 * cp-tree.h (processing_specialization): Make global.
14521 * pt.c (processing_specialization): Likewise.
14522 * lex.c (cons_up_default_function): Save and restore
14523 processing_specialization to avoid confusion.
14525 Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14527 * decl.c (init_decl_processing): Give null_node unknown* type.
14528 * typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
14529 (common_type): Likewise.
14530 * error.c (args_as_string): Recognize null_node.
14532 Sun Oct 19 09:13:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
14534 * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
14535 (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
14537 * decl.c (init_decl_processing): Call using_eh_for_cleanups.
14539 * Make-lang.in (g++): Include prefix.o.
14541 Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
14543 * pt.c (determine_explicit_specialization): Initialize "dummy"
14544 to keep Purify quiet.
14546 Thu Oct 16 00:14:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14548 * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here.
14549 (build_overload_int): Not here.
14551 Wed Oct 15 00:35:28 1997 Mike Stump <mrs@wrs.com>
14553 * class.c (build_type_pathname): Remove.
14554 (prepare_fresh_vtable): Fix problem with complex MI vtable names.
14556 1997-10-14 Brendan Kehoe <brendan@lisa.cygnus.com>
14558 * parse.y (unary_expr): Give a pedwarn if someone tries to use the
14559 &&label GNU extension.
14561 Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
14563 * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it,
14564 so as to avoid incorrect manglings.
14565 * method.c (build_decl_overload_real): Don't mangle return types
14568 Tue Oct 14 11:46:14 1997 Jason Merrill <jason@yorick.cygnus.com>
14570 * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
14571 scratch_tree_cons): Define as macros for now.
14572 * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
14573 lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
14574 typeck2.c: Use them and the expression_obstack variants.
14576 Mon Oct 13 17:41:26 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14578 * decl.c (store_return_init): Allow classes with explicit ctors to
14579 be used with the named return values extension.
14581 Fri Oct 10 12:21:11 1997 Jason Merrill <jason@yorick.cygnus.com>
14583 * pt.c (instantiate_decl): Fix previous change.
14585 Thu Oct 9 12:08:21 1997 Jason Merrill <jason@yorick.cygnus.com>
14587 * pt.c (tsubst): Fix thinko.
14588 (instantiate_decl): Really use the original template.
14590 * call.c (build_new_method_call): Use simple constructor_name for
14593 Wed Oct 8 22:44:42 1997 Jeffrey A Law <law@cygnus.com>
14595 * method.c (build_underscore_int): Don't use ANSI specific
14598 Wed Oct 8 00:18:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14600 * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN
14601 for our key method; it might have been inlined by -O3.
14603 Tue Oct 7 23:00:12 1997 Mark Mitchell <mmitchell@usa.net>
14605 * decl.c (make_typename_type): Do not try to call lookup_field for
14606 non-aggregate types.
14608 Tue Oct 7 22:52:10 1997 Jason Merrill <jason@yorick.cygnus.com>
14610 * typeck.c (build_reinterpret_cast): Tweak.
14612 Tue Oct 7 22:45:31 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14614 * typeck.c (build_reinterpret_cast): Converting a void pointer
14615 to function pointer with a reinterpret_cast produces a warning
14616 if -pedantic is issued.
14618 Tue Oct 7 22:43:43 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14620 * typeck.c (c_expand_return): Don't warn about returning a
14621 reference-type variable as a reference.
14623 Tue Oct 7 21:11:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14625 * method.c (build_static_name): Fix typo.
14627 1997-10-07 Brendan Kehoe <brendan@lisa.cygnus.com>
14629 * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on
14630 OLDDECL before we try to do DECL_USE_TEMPLATE.
14632 Tue Oct 7 00:48:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14634 * decl.c (duplicate_decls): Don't warn about template instances.
14636 * typeck.c (mark_addressable): Lose ancient code that unsets
14639 * pt.c (do_decl_instantiation): Lose support for instantiating
14642 * call.c (build_new_function_call): Fix handling of null explicit
14644 (build_new_method_call): Likewise.
14646 Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net>
14648 * method.c (build_underscore_int): Fix typo.
14650 1997-10-06 Brendan Kehoe <brendan@lisa.cygnus.com>
14652 * tree.c (print_lang_statistics): #if 0 call to
14653 print_inline_obstack_statistics until its definition is checked in.
14655 Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14657 * decl2.c (finish_file): Move dump_tree_statistics to end.
14659 * pt.c (instantiate_decl): Look for the original template.
14660 (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
14661 of member templates.
14663 Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14665 * Makefile.in (g++FAQ.*): New rules.
14666 (CONFLICTS): Update.
14667 * g++FAQ.texi: Moved from libg++.
14669 * parse.y (PFUNCNAME): Only specify the type once.
14671 1997-10-01 Brendan Kehoe <brendan@lasher.cygnus.com>
14673 * lex.c (real_yylex): Clean up the code to fully behave the way
14674 the c-lex.c parser does for complex and real numbers.
14676 Tue Sep 30 08:51:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14678 * method.c (build_decl_overload_real): Reformat.
14680 Tue Sep 30 00:18:26 1997 Jason Merrill <jason@yorick.cygnus.com>
14682 * method.c (synthesize_method): If at_eof, determine our linkage.
14684 1997-09-29 Paul Eggert <eggert@twinsun.com>
14686 * lex.c (real_yylex): Treat `$' just like `_', except issue a
14687 diagnostic if !dollars_in_ident or if pedantic.
14689 * lang-specs.h (@c++): -ansi no longer implies -$.
14691 * decl2.c (lang_decode_option):
14692 -traditional and -ansi now do not mess with
14695 Mon Sep 29 19:57:51 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
14697 * Makefile.in (parse.o, decl.o): Also depend on
14698 $(srcdir)/../except.h $(srcdir)/../output.h.
14699 (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
14700 $(srcdir)/../except.h $(srcdir)/../output.h.
14701 (typeck.o, init.o): Also depend on $(srcdir)/../expr.h
14704 * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.
14706 * expr.c (cplus_expand_expr): Make it static.
14708 * decl2.c, init.c, typeck.c: Include "expr.h".
14709 (expand_expr): Use proper values when calling the function.
14711 Mon Sep 29 11:05:54 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14713 * lang-options.h: New -Wold-style-cast flag.
14714 * cp-tree.h (warn_old_style_cast): New variable.
14715 * decl2.c (warn_old_style_cast): Likewise.
14716 (lang_decode_option): Support -Wold-style-cast.
14717 (reparse_absdcl_as_casts): Produce old-style-cast warning.
14719 Mon Sep 29 09:20:53 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14721 * decl.c (cp_finish_decl): Allow expand_aggr_init to set
14722 TREE_USED, reset value based on already_used.
14724 * init.c (expand_member_init): Revert change.
14726 Mon Sep 29 08:57:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14728 * cp-tree.h, decl.c, decl2.c, pt.c:
14729 Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public.
14731 * decl2.c (lang_decode_option): Add missing ;.
14733 Sat Sep 27 16:22:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14735 * friend.c (do_friend): Disable injection for all template-derived
14737 * decl2.c (lang_decode_option): Handle -fguiding-decls.
14738 * parse.y (notype_template_declarator): New nonterminal.
14739 (direct_notype_declarator): Use it.
14740 (complex_direct_notype_declarator): Likewise.
14741 (object_template_id): Accept any kind of identifier after TEMPLATE.
14742 (notype_qualified_id): Don't add template declarators here.
14744 Sat Sep 27 16:21:58 1997 Mark Mitchell <mmitchell@usa.net>
14746 * call.c (add_template_candidate): Add explicit_targs parameter.
14747 (build_scoped_method_call): Use it.
14748 (build_overload_call_real): Likewise.
14749 (build_user_type_conversion_1): Likewise.
14750 (build_new_function_call): Likewise.
14751 (build_object_call): Likewise.
14752 (build_new_op): Likewise.
14753 (build_new_method_call): Likewise.
14754 (build_new_function_call): Handle TEMPLATE_ID_EXPR.
14755 (build_new_method_call): Likewise.
14757 * class.c (finish_struct_methods): Add specialization pass to
14758 determine which methods were specializing which other methods.
14759 (instantiate_type): Handle TEMPLATE_ID_EXPR.
14761 * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.
14763 * cp-tree.h (name_mangling_version): New variable.
14764 (flag_guiding_decls): Likewise.
14765 (build_template_decl_overload): New function.
14766 (begin_specialization): Likewise.
14767 (reset_specialization): Likewise.
14768 (end_specialization): Likewise.
14769 (determine_explicit_specialization): Likewise.
14770 (check_explicit_specialization): Likewise.
14771 (lookup_template_function): Likewise.
14772 (fn_type_unification): Add explicit_targs parameter.
14773 (type_unification): Likewise.
14775 * decl.c (duplicate_decls): Add smarts for explicit
14777 (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
14779 (grokfndecl): Call check_explicit_specialization.
14781 * decl2.c (lang_decode_option): Handle -fname-mangling-version.
14782 (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
14783 (check_classfn): Handle specializations.
14785 * error.c (dump_function_name): Print specialization arguments.
14787 * friend.c (do_friend): Don't call pushdecl for template
14790 * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.
14792 * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
14793 and -fno-guiding-decls.
14795 * lex.c (identifier_type): Return PFUNCNAME for template function
14798 * method.c (build_decl_overload_real): New function.
14799 (build_template_parm_names): New function.
14800 (build_overload_identifier): Use it.
14801 (build_underscore_int): New function.
14802 (build_overload_int): Use it. Add levels for template
14804 (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs.
14805 (build_overload_nested_names): Handle template type parameters.
14806 (build_template_decl_overload): New function.
14808 * parse.y (YYSTYPE): New ntype member.
14809 (nested_name_specifier): Use it.
14810 (nested_name_specifier_1): Likewise.
14811 (PFUNCNAME): New token.
14812 (template_id, object_template_id): New non-terminals.
14813 (template_parm_list): Note specializations.
14814 (template_def): Likewise.
14815 (structsp): Likewise.
14816 (fn.def2): Handle member template specializations.
14817 (component_decl_1): Likewise.
14818 (direct_notype_declarator): Handle template-ids.
14819 (component_decl_1): Likewise.
14820 (direct_notype_declarator): Handle template-ids.
14821 (primary): Handle TEMPLATE_ID_EXPR, and template-ids.
14823 * pt.c (processing_specializations): New variable.
14824 (template_header_count): Likewise.
14825 (type_unification_real): New function.
14826 (processing_explicit_specialization): Likewise.
14827 (note_template_header): Likewise.
14828 (is_member_template): Handle specializations.
14829 (end_template_decl): Call reset_specialization.
14830 (push_template_decl): Handle member template specializations.
14831 (tsubst): Likewise.
14832 (tsubst_copy): Handle TEMPLATE_ID_EXPR.
14833 (instantiate_template): Handle specializations.
14834 (instantiate_decl): Likewise.
14835 (fn_type_unification): Handle explicit_targs.
14836 (type_unification): Likewise. Allow incomplete unification
14837 without an error message, if allow_incomplete.
14838 (get_bindings): Use new calling sequence for fn_type_unification.
14840 * spew.c (yylex): Handle PFUNCNAME.
14842 * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
14843 (really_overloaded_fn): Likewise.
14844 (get_first_fn): Handle function templates.
14846 * typeck.c (build_x_function_call): Use really_overloaded_fn.
14847 Handle TEMPLATE_ID_EXPR.
14848 (build_x_unary_op): Likewise.
14849 (build_unary_op): Likewise.
14850 (mark_addressable): Templates whose address is taken are marked
14853 1997-09-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14855 * decl.c (init_decl_processing): Declare __builtin_constant_p as
14856 accepting any kind of type, not only int.
14858 Fri Sep 26 00:22:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14860 * search.c (get_matching_virtual): Notice virtual bases when sorrying
14861 about covariant returns.
14863 * parse.y (member_init): Also imply typename here. Remove ancient
14864 extension for initializing base members.
14866 Thu Sep 25 11:11:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14868 Handle multi-level typenames and implicit typename in base list.
14869 * parse.y (typename_sub{,[0-2]}): New rules.
14870 (structsp, rule TYPENAME_KEYWORD): Use typename_sub.
14871 (nonnested_type): New rule.
14872 (complete_type_name): Use it.
14873 (base_class.1): Use typename_sub and nonnested_type.
14874 (nested_name_specifier): Don't elide std:: here.
14875 * decl.c (make_typename_type): Handle getting a type for NAME.
14876 (lookup_name_real): Turn std:: into :: here.
14878 Rvalue conversions were removed in London.
14879 * call.c (is_subseq): Don't consider lvalue transformations.
14880 (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK.
14881 (joust): Re-enable ?: kludge.
14883 1997-09-22 Brendan Kehoe <brendan@lisa.cygnus.com>
14885 * decl.c (start_function): Up warning of no return type to be a
14888 Mon Sep 22 14:15:34 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14890 * init.c (expand_member_init): Don't set TREE_USED.
14891 * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
14892 set,don't clear TREE_USED wholesale.
14894 Sat Sep 20 15:31:00 1997 Jason Merrill <jason@yorick.cygnus.com>
14896 * call.c (build_over_call): Do require_complete_type before
14899 Thu Sep 18 16:47:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14901 * search.c (lookup_field): Call complete_type in all cases.
14903 * decl.c (finish_function): Just warn about flowing off the end.
14905 Wed Sep 17 10:31:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14907 * decl.c (grokparms): Don't bash a permanent list node if we're
14910 1997-09-17 Brendan Kehoe <brendan@lisa.cygnus.com>
14912 * Makefile.in (CONFLICTS): Fix s/r conflict count to 18.
14914 Tue Sep 16 14:06:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14916 * call.c (build_new_op): Give better error for syntactically
14917 correct, but semantically invalid, use of undeclared template.
14919 * call.c (compare_qual): Handle pmfs.
14921 * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
14922 after the exception spec.
14924 Mon Sep 15 11:52:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14926 * call.c (null_ptr_cst_p): Integer type, not integral type.
14928 * call.c (joust): Disable warnings until they can be moved to the
14931 Fri Sep 12 16:11:13 1997 Per Bothner <bothner@cygnus.com>
14933 * Makefile.in, config-lang.in: Convert to autoconf.
14935 Thu Sep 11 17:14:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14937 * decl.c (lookup_name_real): Add implicit 'typename' to types from
14940 * pt.c (most_specialized_class): Fix typo.
14941 (tsubst): Move constant folding to TREE_VEC case.
14943 Thu Sep 11 10:08:45 1997 Mark Mitchell <mmitchell@usa.net>
14945 * pt.c (do_poplevel): Don't warn about unused local variables
14946 while processing_template_decl since we don't always know whether
14947 or not they will need constructing/destructing.
14949 * pt.c (uses_template_parms): Check the values of an enumeration
14950 type to make sure they don't depend on template parms.
14952 * decl.c (make_typename_type): Don't lookup the field if the
14953 context uses template parms, even if we're not
14954 processing_template_decl at the moment.
14956 * pt.c (coerce_template_parms): Avoid looking at the
14957 TYPE_LANG_DECL portion of a typename type, since there won't be
14959 (tsubst): Do constant folding as necessary to make sure that
14960 arguments passed to lookup_template_class really are constants.
14962 Wed Sep 10 11:21:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14964 * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO.
14965 * decl2.c (finish_file): Only register exception tables if we
14968 * decl.c (init_decl_processing): Add __builtin_[fs]p.
14970 Tue Sep 9 19:49:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14972 * pt.c (unify): Just return 0 for a TYPENAME_TYPE.
14974 Tue Sep 9 17:57:25 1997 Mark Mitchell <mmitchell@usa.net>
14976 * error.c (dump_decl): Avoid crashing when presented with a
14977 uninitialized constant, as can occur with a template parameter.
14978 (dump_expr): Make sure that there are enough levels of
14979 current_template_parms before we start diving through them.
14981 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
14983 * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to
14986 Tue Sep 9 09:36:39 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14988 * except.c (expand_throw): Call build_delete for all
14989 exception types, not just objects with destructors.
14991 Mon Sep 8 02:33:20 1997 Jody Goldberg <jodyg@idt.net>
14993 * decl.c (current_local_enum): Remove static.
14994 * pt.c (tsubst_enum): Save and restore value of current_local_enum
14995 in case template is expanded in enum decl.
14996 (instantiate_class_template): Use new tsubst_enum signature.
14997 (tsubst_expr): Likewise.
14999 Mon Sep 8 01:21:43 1997 Mark Mitchell <mmitchell@usa.net>
15001 * pt.c (begin_member_template_processing): Take a function as
15002 argument, not a set of template arguments. Use the template
15003 parameters, rather than the arguments. Handle non-type parameters
15004 correctly. Push a binding level for the parameters so that multiple
15005 member templates using the same parameter names can be declared.
15006 (end_member_template_processing): Pop the binding level.
15007 (push_template_decl): Mark member templates as static when
15010 * lex.c (do_pending_inlines): Pass the function, not its template
15011 arguments, to begin_member_template_processing.
15012 (process_next_inline): Likewise.
15013 (do_pending_defargs): Likewise.
15015 * error.c (dump_expr): Obtain the correct declaration for a
15016 TEMPLATE_CONST_PARM.
15018 * call.c (add_template_conv_candidate): New function.
15019 (build_object_call): Handle member templates, as done in the other
15022 Sat Sep 6 10:20:27 1997 Mark Mitchell <mmitchell@usa.net>
15024 * decl.c (replace_defag): Undo previous change.
15025 * lex.c (do_pending_defargs): Deal with member templates.
15027 * pt.c (is_member_template): Avoid crashing when passed a
15028 non-function argument.
15030 Fri Sep 5 17:27:38 1997 Jason Merrill <jason@yorick.cygnus.com>
15032 * class.c (grow_method): Remove check for redeclaration.
15034 Fri Sep 5 01:37:17 1997 Mark Mitchell <mmitchell@usa.net>
15036 * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
15037 (DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
15038 (PRIMARY_TEMPLATE_P): Use it.
15039 * call.c (build_overload_call_real): Use it.
15040 * class.c (instantiate_type): Likewise.
15041 * decl.c (decls_match): Likewise.
15042 * method.c (build_overload_identifier): Likewise.
15043 * pt.c (push_template_decl): Likewise.
15044 (classtype_mangled_name): Likewise.
15045 (lookup_template_class): Likewise.
15047 * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
15048 DECL_NTPARMS to conform to usage elsewhere.
15049 * call.c (add_template_candidate): Likewise.
15050 * class.c (instantiate_type): Likewise.
15051 * pt.c (instantiate_template): Likewise.
15052 (get_bindings): Likewise.
15054 * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
15055 is_member_template.
15057 * pt.c (unify): Undo changes to allow multiple levels of template
15059 (type_unification): Likewise.
15060 (fn_type_unification): Likewise.
15061 (get_class_bindings): Likewise.
15062 * cp-tree.h (Likewise).
15064 * decl.c (replace_defarg): Check that the type of the default
15065 parameter does not invlove a template type before complaining
15066 about the initialization.
15068 * error.c (dump_expr): Deal with template constant parameters in
15069 member templates correctly.
15071 * pt.c (is_member_template): Deal with class specializations
15073 (tsubst): Handle "partial instantiation" of member templates
15076 Wed Sep 3 12:30:24 1997 Mark Mitchell <mmitchell@usa.net>
15078 * pt.c (type_unification): Change calling sequence to allow for
15079 multiple levels of template parameters.
15080 (tsubst_expr): Likewise.
15081 (tsubst): Likewise.
15082 (tsubst_copy): Likewise.
15083 (instantiate_template): Likewise.
15085 * call.c (build_overload_call_real): Use it.
15086 (add_builtin_candidate): Use it.
15087 (build_new_method_call): Use it.
15088 * class.c (instantiate_type): Use it.
15089 * decl.c (grokdeclarator): Use it.
15090 * decl2.c (finish_file): Use it.
15091 * method.c (build_overload_identifier): Use it.
15093 * call.c (add_template_candidate): Add additional parameter for
15094 the function return type. Call fn_type_unification istead of
15096 (build_user_type_conversion_1): Handle member templates.
15097 (build_new_function_call): Likewise.
15098 (build_new_op): Likewise.
15099 (build_new_method_call): Likewise.
15101 * class.c (grow_method): Don't give an error message indicating
15102 that two member templates with the same name are ambiguous.
15103 (finish_struct): Treat member template functions just like member
15106 * cp-tree.h (check_member_template): Add declaration.
15107 (begin_member_template_processing): Likewise.
15108 (end_member_template_processing): Likewise.
15109 (fn_type_unification): Likewise.
15110 (is_member_template): Likewise.
15111 (tsubst): Change prototype.
15112 (tsubst_expr): Likewise.
15113 (tsubst_copy): Likewise.
15114 (instantiate_template): Likewise.
15115 (get_bindings): Likewise.
15117 * decl.c (decls_match): Handle multiple levels of template
15119 (pushdecl): Handle template type params just like other type
15121 (push_class_level_binding): Return immediately if the
15122 class_binding_level is NULL.
15123 (grokfndecl): If check_classfn() returns a member_template, use
15124 the result of the template, not the template itself.
15126 * decl2.c (check_member_template): New function. Check to see
15127 that the entity declared to be a member template can be one.
15128 (check_classfn): Allow redeclaration of member template functions
15129 with different types; the new functions can be specializations or
15130 explicit instantiations.
15132 * error.c (dump_decl): Handle multiple levels of template
15134 (dump_function_decl): Update to handle function templates.
15136 * lex.c (do_pending_inlines): Set up template parameter context
15137 for member templates.
15138 (process_next_inline): Likewise.
15140 * method.c (build_overload_identifier): Adjust for multiple levels
15141 of template parameters.
15143 * parse.y (fn.def2): Add member templates.
15144 (component_decl_1): Likewise.
15146 * pt.c (begin_member_template_processing): New function.
15147 (end_member_template_processing): Likewise.
15148 (is_member_template): Likewise.
15149 (fn_type_unification): Likewise.
15150 (current_template_parms): Return a vector of all the template
15151 parms, not just the innermost level of parms.
15152 (push_template_decl): Deal with the possibility of member
15154 (lookup_template_class): Likewise.
15155 (uses_template_parms): Likewise.
15156 (tsubst): Modify processing to TEMPLATE_TYPE_PARM and
15157 TEMPLATE_CONST_PARM to deal with multiple levels of template
15158 arguments. Add processing of TEMPLATE_DECL to produce new
15159 TEMPLATE_DECLs from old ones.
15160 (do_decl_instantiation): Handle member templates.
15162 * search.c (lookup_fnfields_1): Handle member template conversion
15165 * tree.c (cp_tree_equal): Check the levels, as well as the
15166 indices, of TEMPLATE_CONST_PARMs.
15168 * typeck.c (comptypes): Check the levels, as well as the indices,
15169 fo TEMPLATE_TYPE_PARMs.
15170 (build_x_function_call): Treat member templates like member
15173 Wed Sep 3 11:09:25 1997 Jason Merrill <jason@yorick.cygnus.com>
15175 * typeck.c (c_expand_return): Always convert_for_initialization
15176 before checking for returning a pointer to local.
15178 * pt.c (type_unification): If strict and the function parm doesn't
15179 use template parms, just compare types.
15181 Wed Sep 3 10:35:49 1997 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
15183 * method.c (build_overloaded_value): Replace direct call
15184 to the floating point emulator with REAL_VALUE_TO_DECIMAL macro.
15186 Wed Sep 3 00:02:53 1997 Jason Merrill <jason@yorick.cygnus.com>
15188 * typeck.c (convert_arguments): Don't arbitrarily choose the first
15189 of a set of overloaded functions.
15191 Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
15193 * lex.c (real_yylex): Don't elide __FUNCTION__.
15195 * method.c (build_overload_value): Add in_template parm.
15196 (build_overload_int): Likewise.
15197 (build_overload_identifier): Pass it.
15199 * decl.c (duplicate_decls): Don't bash a previous template
15200 definition with a redeclaration.
15202 * pt.c (unify): float doesn't match double.
15204 * pt.c (do_type_instantiation): Handle getting a _TYPE or a
15205 TYPE_DECL. Handle getting non-template types.
15206 * parse.y (explicit_instantiation): Use typespec instead of
15207 aggr template_type.
15209 Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
15211 * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
15213 Mon Sep 1 13:19:04 1997 Eugene Mamchits <eugin@ips.ras.ru>
15215 * call.c (add_builtin_candidate): Add missing TREE_TYPE.
15216 (compare_ics): Likewise.
15218 Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
15220 * call.c (joust): Warn about choosing one conversion op over
15221 another because of 'this' argument when the other return type is
15223 (source_type): New fn.
15225 * call.c (build_new_op): Strip leading REF_BIND from first operand
15226 to builtin operator.
15228 * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
15231 Thu Aug 28 09:45:23 1997 Jason Merrill <jason@yorick.cygnus.com>
15233 * call.c (null_ptr_cst_p): Remove support for (void*)0.
15235 Wed Aug 27 02:03:34 1997 Jeffrey A Law <law@cygnus.com>
15237 * typeck.c (expand_target_expr): Make definition match declaration.
15239 * class.c (get_basefndecls): Make definition match declaration.
15241 Mon Aug 25 14:30:02 1997 Jason Merrill <jason@yorick.cygnus.com>
15243 * input.c (sub_getch): Eventually give up and release the input file.
15245 * decl.c (cp_finish_decl): If #p i/i, put inline statics in the
15248 * call.c (joust): Tweak message.
15250 Sat Aug 23 18:02:59 1997 Mark Mitchell <mmitchell@usa.net>
15252 * error.c (type_as_string): Put const/volatile on template type
15253 parameters where appropriate.
15255 Sat Aug 23 17:47:22 1997 Jeffrey A Law <law@cygnus.com>
15257 * call.c (strictly_better): Make arguments unsigned ints.
15259 Thu Aug 21 18:48:44 1997 Jason Merrill <jason@yorick.cygnus.com>
15261 * lex.c (real_yylex): Refer to __complex instead of complex.
15263 Thu Aug 21 22:25:46 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
15265 * lex.c (real_yylex): Don't use getc directly.
15267 Wed Aug 20 17:25:08 1997 Jason Merrill <jason@yorick.cygnus.com>
15269 * call.c (is_subseq): Don't try to be clever.
15271 Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
15273 * parse.y, pt.c: Include "except.h".
15274 * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
15275 error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
15276 lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
15277 sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
15280 Wed Aug 20 01:34:40 1997 Jason Merrill <jason@yorick.cygnus.com>
15282 * decl2.c (mark_vtable_entries): Instead of replacing pure
15283 virtuals with a reference to __pure_virtual, copy the decl and
15286 Tue Aug 19 02:26:07 1997 Jason Merrill <jason@yorick.cygnus.com>
15288 * pt.c (lookup_nested_type_by_name): Handle typedef wierdness.
15290 * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com.
15292 * pt.c (instantiate_class_template): Call repo_template_used
15293 before finish_prevtable_vardecl.
15295 * call.c (is_subseq): New fn.
15296 (compare_ics): Use it.
15298 * repo.c (finish_repo): Don't crash on no args.
15300 * parse.y (named_complex_class_head_sans_basetype): Handle
15301 explicit global scope.
15302 * decl2.c (handle_class_head): New fn.
15304 * pt.c (unify): Add CONST_DECL case.
15306 Thu Aug 14 10:05:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15308 * rtti.c (permanent_obstack): Fix decl to not be a pointer.
15310 * cp-tree.h (report_type_mismatch): Add prototype.
15311 * call.c (build_overload_call_real): Remove erroneous fourth
15312 argument to report_type_mismatch.
15313 (build_user_type_conversion_1): Remove erroneous second arg to
15315 (build_new_function_call): Likewise.
15316 (build_object_call): Likewise.
15317 (build_new_op): Likewise.
15318 (build_new_method_call): Likewise.
15320 Wed Aug 13 19:19:25 1997 Jason Merrill <jason@yorick.cygnus.com>
15322 * error.c (dump_decl): Don't bother processing a function with no
15323 DECL_LANG_SPECIFIC.
15325 * method.c (emit_thunk): Call init_function_start in the macro case.
15327 Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
15329 * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
15330 defined and used to set flag_vtable_thunks.
15332 Tue Aug 12 20:13:57 1997 Jason Merrill <jason@yorick.cygnus.com>
15334 * parse.y: Don't clear the inlines from their obstack until they've
15335 all been processed.
15337 * decl.c (duplicate_decls): Don't complain about exception
15338 specification mismatch if flag_exceptions is off.
15340 Mon Aug 11 15:01:56 1997 Marc Lehmann <pcg@goof.com>
15342 * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
15344 Sun Aug 10 12:06:09 1997 Paul Eggert <eggert@twinsun.com>
15346 * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
15347 * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
15348 Include <stdio.h> before include files that formerly used STDIO_PROTO.
15350 * decl.c, g++spec.c, lex.c, method.c, repo.c:
15351 Include "config.h" first, as per autoconf manual.
15353 Fri Aug 8 11:47:48 1997 Jason Merrill <jason@yorick.cygnus.com>
15355 * decl.c (duplicate_decls): Tweak wording.
15356 * lex.c (do_pending_defargs): Don't die if we see a default arg
15357 that isn't a DEFAULT_ARG.
15358 * error.c (dump_expr): Handle DEFAULT_ARG.
15360 * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
15361 * lang-options.h: Add -fhandle-exceptions.
15363 * class.c (build_vtable): Vtables are artificial.
15364 (prepare_fresh_vtable): Likewise.
15366 Wed Aug 6 11:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
15368 * cvt.c (ocp_convert): After converting to the target type, set
15369 LOOKUP_NO_CONVERSION.
15371 * call.c (joust): Warn about potentially confusing promotion rules
15373 * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
15375 Tue Aug 5 15:15:07 1997 Michael Meissner <meissner@cygnus.com>
15377 * exception.cc: Declare __terminate_func with noreturn attribute.
15379 Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
15381 * parse.y: Break out eat_saved_input, handle errors.
15382 (function_try_block): Use compstmt instead of compstmt_or_error.
15384 Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
15386 * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
15388 Fri Jul 4 01:45:16 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
15390 * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
15391 existence of cc1plus check whether $(LANGUAGES) contains C++.
15393 Wed Jul 30 13:04:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
15395 * method.c (do_build_copy_constructor): When copying an anonymous
15396 union member loop around to handle nested anonymous unions. Use
15397 the offset of the member relative to the outer structure, not the
15400 Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com>
15402 * call.c (resolve_args): New fn.
15403 (build_new_function_call): Use it.
15404 (build_object_call): Likewise.
15405 (build_new_method_call): Likewise.
15407 Mon Jul 28 16:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
15409 * call.c (build_over_call): tsubst all default parms from templates.
15411 Wed Jul 23 13:36:25 1997 Jason Merrill <jason@yorick.cygnus.com>
15413 * decl.c (struct cp_function): Add static_labelno.
15414 (push_cp_function_context): Save it.
15415 (pop_cp_function_context): Restore it.
15417 Tue Jul 22 14:43:29 1997 Jason Merrill <jason@yorick.cygnus.com>
15419 * typeck.c (build_component_ref_1): Convert from reference.
15421 Tue Jul 22 11:06:23 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15423 * parse.y (current_declspecs, prefix_attributes): Initialize to
15426 * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil
15427 before we try to force it to be a TREE_LIST.
15428 (decl): Make sure $1.t is non-nil.
15430 Sun Jul 20 11:53:07 1997 Jason Merrill <jason@yorick.cygnus.com>
15432 * pt.c (uses_template_parms): Handle template first-parse codes.
15434 * decl.c (cp_finish_decl): Only warn about user-defined statics.
15436 Fri Jul 18 17:56:08 1997 Jason Merrill <jason@yorick.cygnus.com>
15438 * pt.c (unify): Handle BOOLEAN_TYPE.
15440 * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE.
15441 * pt.c (tsubst): Don't set it.
15442 * call.c (build_over_call): Use uses_template_parms.
15444 Thu Jul 17 18:06:30 1997 Jason Merrill <jason@yorick.cygnus.com>
15446 * method.c (build_overload_nested_name): Use static_labelno
15447 instead of var_labelno.
15448 (build_qualified_name): New fn.
15449 (build_overload_name): Split out from here.
15450 (build_static_name): Use build_qualified_name.
15451 * decl.c (cp_finish_decl): Statics in extern inline functions
15452 have comdat linkage.
15453 (start_function): Initialize static_labelno.
15455 Thu Jul 17 11:20:17 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
15457 * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy
15458 before "all member functions in class [] are private".
15460 Wed Jul 16 23:47:08 1997 Jason Merrill <jason@yorick.cygnus.com>
15462 * lex.c (do_scoped_id): convert_from_reference.
15463 * init.c (build_offset_ref): Likewise.
15465 Wed Jul 16 12:34:29 1997 Benjamin Kosnik <bkoz@lisa.cygnus.com>
15467 * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list.
15469 Mon Jul 14 03:23:46 1997 Jason Merrill <jason@yorick.cygnus.com>
15471 * typeck.c (get_member_function_from_ptrfunc): Promote index
15474 Sun Jul 13 00:11:52 1997 Jason Merrill <jason@yorick.cygnus.com>
15476 * tree.c (layout_basetypes): Move non-virtual destructor warning.
15477 * decl.c (xref_basetypes): Remove non-virtual destructor warning.
15479 Sat Jul 12 12:47:12 1997 Jason Merrill <jason@yorick.cygnus.com>
15481 * decl.c (grokdeclarator): Call add_defarg_fn for the function
15483 * lex.c (add_defarg_fn): Adjust.
15484 (do_pending_defargs): Adjust. Don't skip the first parm.
15486 Fri Jul 11 01:39:50 1997 Jason Merrill <jason@yorick.cygnus.com>
15488 * decl.c (build_enumerator): Global enumerators are also readonly.
15490 * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast.
15491 (build_dynamic_cast): Call it and convert_from_reference.
15493 * lex.c (add_defarg_fn): New fn.
15494 (snarf_defarg): Don't add to defarg_types.
15495 (do_pending_defargs): Lose defarg_types. All fns we process now
15497 * decl.c (grokfndecl): Call add_defarg_fn.
15499 * Makefile.in (CONFLICTS): Expect 18 s/r conflicts.
15500 * cp-tree.def: Add DEFAULT_ARG.
15501 * spew.c (yylex): Call snarf_defarg as appropriate.
15502 * parse.y: New tokens DEFARG and DEFARG_MARKER.
15503 (defarg_again, pending_defargs, defarg, defarg1): New rules.
15504 (structsp): Use pending_defargs.
15505 (parms, full_parm): Use defarg.
15506 * lex.c (init_lex): Initialize inline_text_firstobj.
15507 (do_pending_inlines): Never pass the obstack to feed_input.
15508 (process_next_inline): Call end_input instead of restore_pending_input.
15509 (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs,
15510 finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns.
15511 * input.c (end_input): New fn.
15512 (sub_getch): At the end of some fed input, just keep returning EOF
15513 until someone calls end_input.
15514 Remove 'obstack' field from struct input_source.
15515 * decl.c (grokparms): Handle DEFAULT_ARG.
15516 (replace_defarg): New fn.
15517 * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros.
15519 Wed Jul 9 13:44:12 1997 Jason Merrill <jason@yorick.cygnus.com>
15521 * call.c (implicit_conversion): If nothing else works, try binding
15522 an rvalue to a reference.
15524 Wed Jul 9 13:04:38 1997 Geoffrey Noer <noer@cygnus.com>
15526 * decl.c (init_decl_processing): Fix Jun 30 patch -- move
15527 ifndef for Cygwin32 to include SIGSEGV.
15529 Thu Jul 3 01:44:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15531 * class.c (finish_struct_1): Only complain about pointers without
15532 copy stuff if there are any constructors.
15534 * rtti.c (build_dynamic_cast): Call complete_type on the types.
15536 * decl.c (grokfndecl): If the function we chose doesn't actually
15539 * decl2.c (grokclassfn): Don't specify 'const int' for the
15540 artificial destructor parm.
15542 * pt.c (type_unification): If we are called recursively, nothing
15545 Mon Jun 30 17:53:21 1997 Geoffrey Noer <noer@cygnus.com>
15547 * decl.c (init_decl_processing): Stop trying to catch signals
15548 other than SIGABRT since the Cygwin32 library doesn't support
15549 them correctly yet. This fixes a situation in which g++ causes
15550 a hang on SIGSEGVs and other such signals in our Win32-hosted
15553 Mon Jun 30 14:50:01 1997 Jason Merrill <jason@yorick.cygnus.com>
15555 * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
15557 Fri Jun 27 15:18:49 1997 Jason Merrill <jason@yorick.cygnus.com>
15559 * typeck2.c (store_init_value): Always return the value if our
15560 type needs constructing.
15562 * method.c (hack_identifier): Convert class statics from
15565 Thu Jun 26 11:44:46 1997 Jason Merrill <jason@yorick.cygnus.com>
15567 * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
15569 Thu Jun 19 16:49:28 1997 Mike Stump <mrs@cygnus.com>
15571 * typeck.c (c_expand_return): Make sure we clean up temporaries at
15572 the end of return x;
15574 Thu Jun 19 12:28:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15576 * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER.
15578 Tue Jun 17 18:35:57 1997 Mike Stump <mrs@cygnus.com>
15580 * except.c (expand_builtin_throw): Add support
15581 -fno-sjlj-exceptions -fPIC exception handling on the SPARC.
15583 Mon Jun 16 01:24:37 1997 Jason Merrill <jason@yorick.cygnus.com>
15585 * repo.c (extract_string): Null-terminate.
15587 * cp-tree.h (TI_SPEC_INFO): New macro.
15588 (CLASSTYPE_TI_SPEC_INFO): New macro.
15589 * pt.c (push_template_decl): Correctly determine # of template parms
15592 * call.c (compare_ics): Really fix 'this' conversions.
15594 * pt.c (do_decl_instantiation): Don't crash on explicit inst of
15597 * pt.c (push_template_decl): Complain about mismatch in # of
15598 template parms between a class template and a member template.
15600 Sun Jun 15 02:38:20 1997 Jason Merrill <jason@yorick.cygnus.com>
15602 * method.c (synthesize_method): You can't call
15603 function_cannot_inline_p after finish_function.
15604 * decl.c (finish_function): Turn on flag_inline_functions and turn
15605 off DECL_INLINE before handing a synthesized method to the
15608 Thu Jun 12 17:35:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15610 * method.c (synthesize_method): Remove July 30 change to never set
15611 DECL_INLINE if at_eof.
15613 Thu Jun 12 15:25:08 1997 Mike Stump <mrs@cygnus.com>
15615 * xref.c (GNU_xref_member): Ensure that the node has a
15616 decl_lang_specific part before checking DECL_FRIEND_P.
15618 Thu Jun 12 12:36:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15620 * pt.c (instantiate_class_template): Diagnose non-class types used
15623 Wed Jun 11 17:33:40 1997 Jason Merrill <jason@yorick.cygnus.com>
15625 * typeck.c (build_conditional_expr): Use convert_for_initialization
15626 instead of convert_and_check.
15628 Wed Jun 11 12:31:33 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15630 * parse.y (typespec): Don't pedwarn for typeof.
15632 Tue Jun 10 00:22:09 1997 Jason Merrill <jason@yorick.cygnus.com>
15634 * repo.c (finish_repo): Only check changes if we would write a
15637 * call.c (compare_ics): Fix handling of 'this' conversions.
15639 * pt.c (do_decl_instantiation): Support static data too. Rename
15640 from do_function_instantiation.
15641 * cp-tree.h: Adjust.
15644 * repo.c (extract_string): New fn.
15645 (get_base_filename): Use it.
15646 (init_repo): Compare old args with current args.
15648 Mon Jun 9 14:25:30 1997 Mike Stump <mrs@cygnus.com>
15650 * Makefile.in, Make-lang.in: Protect C-ls with a comment
15651 character, idea from Paul Eggert <eggert@twinsun.com>.
15653 Mon Jun 9 01:52:03 1997 Jason Merrill <jason@yorick.cygnus.com>
15655 * typeck.c (c_expand_return): Be more persistent in looking for
15658 * cvt.c (build_up_reference): Use NOP_EXPR for switching from
15659 pointer to reference.
15661 * class.c (build_vbase_path): Don't do anything if PATH has no steps.
15663 Sun Jun 8 03:07:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15665 * init.c (build_member_call, build_offset_ref):
15666 Use do_scoped_id instead of do_identifier.
15668 * cvt.c (convert): Remove bogosity.
15670 Sat Jun 7 20:50:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15672 * cvt.c (build_up_reference): Do checks of ARGTYPE and
15673 TARGET_TYPE before trying to use get_binfo.
15675 Fri Jun 6 17:36:39 1997 Jason Merrill <jason@yorick.cygnus.com>
15677 * cvt.c (build_up_reference): Call get_binfo to get access control.
15679 * decl2.c (import_export_decl): If we don't support weaks, leave
15682 Fri Jun 6 15:55:49 1997 Mike Stump <mrs@cygnus.com>
15684 * except.c (expand_builtin_throw): Add support for machines that
15685 cannot access globals after throw's epilogue when
15686 -fno-sjlj-exceptions is used.
15688 Thu Jun 5 16:28:43 1997 Jason Merrill <jason@yorick.cygnus.com>
15690 * parse.y: 'std::' becomes '::'.
15691 * lex.c (real_yylex): Remove 'namespace' warning.
15692 * init.c (build_member_call): Ignore 'std::'.
15693 (build_offset_ref): Likewise.
15694 * decl2.c (do_using_directive): Ignore 'using namespace std;'.
15695 (do_toplevel_using_decl): Ignore 'using std::whatever'.
15696 * decl.c (push_namespace): Just sorry.
15697 (pop_namespace): Nop.
15698 (init_decl_processing): Declare std namespace.
15700 Tue Jun 3 18:08:23 1997 Jason Merrill <jason@yorick.cygnus.com>
15702 * search.c (push_class_decls): A name which ambiguously refers to
15703 several instantiations of the same template just refers to the
15706 Tue Jun 3 12:30:40 1997 Benjamin Kosnik <bkoz@cirdan.cygnus.com>
15708 * decl.c (build_enumerator): Fix problem with unsigned long
15709 enumerated values being smashed to ints, causing overflow
15710 when computing next enumerated value (for enum values around
15713 Mon Jun 2 17:40:56 1997 Jason Merrill <jason@yorick.cygnus.com>
15715 * typeck.c (build_component_ref): Only call mark_used on a decl.
15717 Thu May 29 15:54:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15719 * typeck.c (build_c_cast): Make the check for a ptr to function
15720 more specific before possible default_conversion call.
15722 Thu May 29 13:02:06 1997 Mike Stump <mrs@cygnus.com>
15724 * except.c (expand_exception_blocks): Simplify and fix and make
15725 sure we don't end a region in a sequence, as expand_end_bindings
15728 Wed May 28 17:08:03 1997 Mike Stump <mrs@cygnus.com>
15730 * except.c (init_exception_processing): Mark terminate as not
15731 returning so that the optimizer can optimize better.
15733 Tue May 27 19:49:19 1997 Mike Stump <mrs@cygnus.com>
15735 * cvt.c (convert): Don't do any extra work, if we can avoid it
15738 Tue May 27 18:21:47 1997 Mike Stump <mrs@cygnus.com>
15740 * *.[chy]: Change cp_convert to ocp_convert, change convert to
15741 cp_convert. convert is now reserved for the backend, and doesn't
15742 have the semantics a frontend person should ever want.
15744 Fri May 23 10:58:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15746 * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled.
15747 Lose -traditional support.
15749 Thu May 22 15:41:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15751 * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype).
15753 * parse.y (self_reference): Do it for templates, too.
15754 * class.c (pushclass): Don't overload_template_name; the alias
15755 generated by build_self_reference serves the same purpose.
15757 * tree.c (list_hash): Make static, take more args.
15758 (list_hash_lookup): Likewise.
15759 (list_hash_add): Make static.
15760 (list_hash_canon): Lose.
15761 (hash_tree_cons): Only build a new node if one isn't already in the
15763 (hash_tree_chain): Use hash_tree_cons.
15764 * cp-tree.h: Adjust.
15765 * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead
15766 of calling lookup_name.
15768 Wed May 21 18:24:19 1997 Jason Merrill <jason@yorick.cygnus.com>
15770 * pt.c (instantiate_class_template): TYPE_VALUES for an enum
15771 doesn't refer to the CONST_DECLs.
15773 Tue May 20 21:09:32 1997 Bob Manson <manson@charmed.cygnus.com>
15775 * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever
15777 (expand_class_desc): Convert the last argument to a sizetype.
15779 Tue May 20 13:55:57 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15781 * gxx.gperf (__complex, __complex__, __imag, __imag__, __real,
15782 __real__): Add reswords.
15783 * hash.h: Regenerate.
15784 * lex.h (rid): Add RID_COMPLEX.
15785 (RID_LAST_MODIFIER): Set to RID_COMPLEX.
15786 * lex.c (init_lex): Add building of RID_COMPLEX.
15787 (real_yylex): General cleanup in line with what c-lex.c also has,
15788 sans the cruft for traditional; add handling of SPEC_IMAG, complex
15789 types, and imaginary numeric constants.
15790 * parse.y (REALPART, IMAGPART): Add tokens.
15791 (unary_expr): Add REALPART and IMAGPART rules.
15792 * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare.
15793 * decl.c (complex_{integer,float,double,long}_type_node): Define
15795 (init_decl_processing): Set up the types.
15796 (grokdeclarator): Add handling of RID_COMPLEX. Set and use
15797 DEFAULTED_INT instead of EXPLICIT_INT when we default to int type.
15798 * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15799 * cvt.c (cp_convert): Handle COMPLEX_TYPE.
15800 * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add
15802 * method.c (build_overload_name): Add handling of the different
15803 COMPLEX_TYPEs, prefixing them with `J'.
15804 * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE
15805 as a template parm.
15806 (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case.
15807 * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases.
15808 (mapcar): Handle COMPLEX_CST.
15809 * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE.
15810 (common_type): Add code for complex types.
15811 (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15812 (convert_for_assignment): Likewise.
15813 (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases.
15815 Mon May 19 12:26:27 1997 Jason Merrill <jason@yorick.cygnus.com>
15817 * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to
15818 tsubst_expr, as it might try to do overload resolution.
15820 Sat May 17 10:48:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15822 * pt.c (instantiate_class_template): Oops.
15824 Fri May 16 14:23:57 1997 Jason Merrill <jason@yorick.cygnus.com>
15826 * cp-tree.def: Add TAG_DEFN.
15827 * pt.c (tsubst_enum): New fn.
15828 (instantiate_class_template): Use it.
15829 (tsubst_expr): Support TAG_DEFN.
15830 (tsubst): Support local enums.
15831 (tsubst_copy): Likewise.
15832 * decl.c (finish_enum): Likewise.
15833 (start_enum): If this is a local enum, switch to permanent_obstack.
15835 Wed May 14 19:08:28 1997 Mike Stump <mrs@cygnus.com>
15837 * decl.c (store_parm_decls): Set last_parm_cleanup_insn here.
15838 (finish_function): Put the base init code for constructors just
15839 after the parm cleanup insns.
15840 (struct cp_function): Add last_parm_cleanup_insn.