1 1999-12-09 Mark Mitchell <mark@codesourcery.com>
3 * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
6 * semantics.c (finish_switch_cond): Do conversions here, not ...
7 * typeck.c (c_expand_start_case): Here.
9 * semantics.c (do_poplevel): Remove unused variable.
11 1999-12-06 Mark Mitchell <mark@codesourcery.com>
13 * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE
14 unless we're declaring the variable in question.
16 1999-12-06 Mark Mitchell <mark@codesourcery.com>
18 * decl.c (init_decl_processing): #if 0 last patch.
19 (finish_function): Likewise.
21 1999-12-05 Mark Mitchell <mark@codesourcery.com>
23 * decl.c (init_decl_processing): Set flag_inline_trees if
26 * cp-tree.h (calls_setjmp_p): Declare.
27 * decl.c (finish_function): Mark functions that call setjmp as
29 * optimize.c (calls_setjmp_r): New function.
30 (calls_setjmp_p): Likewise.
32 1999-12-04 Mark Mitchell <mark@codesourcery.com>
34 * optimize.c (expand_call_inline): Wrap the expanded call in an
35 EXPR_WITH_FILE_LOCATION node to get correct line numbers for
38 * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add
40 (remap_decl): New function.
41 (remap_block): Likewise.
42 (copy_scope_stmt): Likewise.
43 (copy_body_r): Use remap_decl and copy_scope_stmt.
44 (copy_body): Use VARRAY_TOP_TREE.
45 (initialize_inlined_parameters): Likewise.
46 (declare_return_variable): Likewise.
47 (inlinable_function_p): Check flag_inline_trees.
48 (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs
49 specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the
50 parameters of the inlined function.
51 (optimize_function): Prevent recursion into partially complete
54 * cp-tree.def (SCOPE_STMT): Take one operand.
55 * cp-tree.h (SCOPE_STMT_BLOCK): New macro.
56 (SCOPE_NULLIFIED_P): Redefine.
57 (SCOPE_NO_CLEANUPS_P): New macro.
58 (add_scope_stmt): Change prototype.
59 * decl.c (poplevel): Tidy. Warn about unused variables here.
60 Record SCOPE_STMT_BLOCKs.
61 (finish_function): Keep DECL_INITIAL for functions that might be
63 * ir.texi: Document SCOPE_NO_CLEANUPS_P.
64 * semantics.c: Include rtl.h.
65 (add_scope_stmt): Return the new scope statement and, for an
66 end-of-scope statement, its matching begin statement. Don't set
68 (do_pushlevel): Simplify, now that we are always
70 (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs.
71 (expand_stmt): Don't call expand_start_bindings or
72 expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
73 * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
75 * Makefile.in (semantics.o): Depend on RTL_H.
77 * decl2.c (pending_statics_used): Make it a macro.
78 (saved_inlines_used): Likewise.
79 (finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
80 (mark_inline_for_output): Likewise.
81 (ssdf_decls_used): Remove.
82 (start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
83 (generate_ctor_or_dtor_function): Adjust accordingly.
85 1999-11-24 Geoffrey Keating <geoffk@cygnus.com>
86 Greg McGary <gkm@gnu.org>
88 * decl.c (duplicate_decls): Merge
89 DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
90 DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
92 1999-12-02 Mike Stump <mrs@wrs.com>
94 * init.c (perform_member_init): Handle parse errors better.
96 1999-12-01 Mark Mitchell <mark@codesourcery.com>
98 * cp-tree.h (min_tree_cons): Remove.
99 (scratch_ovl_cons): Likewise.
100 * decl.c (saveable_obstack): Don't declare.
101 (duplicate_decls): Tweak error-message.
102 (initialize_local_var): Explicitly mark the definition as static.
103 (finish_function): Call permanent_allocation, just so
104 that the middle-end sees the obstacks it expects.
105 (mark_cp_function_context): Likewise.
106 * init.c (build_new): Don't use min_tree_cons.
107 * lex.c (permanent_obstack): Don't declare.
108 (current_obstack, saveable_obstack): Likewise.
109 * spew.c (current_obstack, saveable_obstack): Likewise.
110 * tree.c (current_obstack, saveable_obstack): Likewise.
111 (scratch_ovl_cons): Remove.
112 (build_min_nt): Don't mess with obstacks.
113 (build_min): Likewise.
114 (min_tree_cons): Remove
115 * typeck.c (build_component_ref): Don't use scratch_ovl_cons.
116 (build_x_function_call): Likewise.
117 (build_c_cast): Don't use min_tree_cons.
119 1999-11-29 Mark Mitchell <mark@codesourcery.com>
121 * pt.c (tsubst_decl): Robustify.
123 1999-11-27 Mark Mitchell <mark@codesourcery.com>
125 * decl2.c (finish_file): Call expand_body for inline functions
126 that will be written out but that do not yet have RTL.
127 * semantics.c (expand_body): Do not generate RTL For inline
128 functions that do not yet need to be written out.
130 1999-11-25 Mark Mitchell <mark@codesourcery.com>
132 * Make-lang.in (CXX_SRCS): Add optimize.c.
133 * Makefile.in (CXX_OBJS): Add optimize.o.
134 (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
135 (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
136 (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
137 (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
138 (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
140 (optimize.o): New target.
141 * class.c: Don't include splay-tree.h.
142 * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
143 * cp-tree.h: Include splay-tree.h.
144 (DECL_UNINLINABLE): New macro.
145 (CTOR_BEGIN_P, CTOR_END_P): New macros.
146 (flag_inline_trees): New variable.
147 (local_variable_p): New function.
148 (nonstatic_local_decl_p): Likewise.
149 (optimize_function): Likewise.
150 (cplus_unsave_expr_now): Remove.
151 (copy_tree_r): Declare.
152 (remap_save_expr): Likewise.
153 * decl.c (local_variable_p): Don't
155 (local_variable_p_walkfn): New function.
156 (make_rtl_for_local_static): Remove code to try to avoid writing
157 out static constants.
158 (emit_local_var): Fix indentation.
159 (nonstatic_local_decl_p): New function.
160 (check_default_argument): Use local_variable_p_walkfn, not
161 local_variable_p, when walking the tree.
162 (start_function): Set the DECL_CONTEXT for automatically generated
164 (finish_constructor_body): Use CTOR_STMT to mark the end of a
166 * decl2.c: Don't include splay-tree.h.
167 (flag_inline_trees): Define.
168 * dump.c: Don't include
170 * except.c (expand_end_catch_block): Fix comment formatting.
171 (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
172 (expand_throw): Tidy comment.
173 * init.c (build_vec_delete_1): Use create_temporary_var.
174 * lex.c (cplus_tree_code_type): Make it static.
175 (cplus_tree_code_length): Likewise.
176 (cplus_tree_code_name): Likewise.
177 * optimize.c: New file.
178 * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
180 (setup_vtbl_ptr): Mark the beginnings of constructors with
182 (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
183 (expand_body): Call optimize_function. Save bodies if we're doing
185 * tree.c: Don't include splay-tree.h. Include insn-config.h and
187 (copy_tree_r): Make it public.
188 (statement_code_p): New function.
189 (mark_local_for_remap_r): Likewise.
190 (cp_usave_r): Likewise.
191 (cp_unsave): Likewise.
192 (build_cplus_new): Set DECL_CONTEXT for temporary variables.
193 (walk_tree): Walk into `s' class nodes. Walk statement chains.
194 (copy_tree_r): Handle 's' class nodes. Restore chains for
195 statements. Nullify scopes. Don't copy types.
196 (init_tree): Set lang_unsave to cp_unsave.
197 (remap_save_expr): Define.
198 * ir.texi: Document CTOR_STMT.
200 1999-11-24 Jason Merrill <jason@casey.cygnus.com>
202 * search.c (note_debug_info_needed): Do perform this optimization
204 (maybe_suppress_debug_info): Likewise. Start by clearing
205 TYPE_DECL_SUPPRESS_DEBUG.
207 1999-11-24 Mark Mitchell <mark@codesourcery.com>
209 * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
211 * decl2.c (finish_vtable_vardecl): Don't prune vtables here.
213 1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
215 * decl.c (pushdecl, grokdeclarator): Don't call a variadic
216 function with a non-literal format string.
218 * lex.c (do_identifier): Likewise.
220 * typeck.c (build_unary_op): Likewise.
222 1999-11-23 Mark Mitchell <mark@codesourcery.com>
224 * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
226 1999-11-22 Mark Mitchell <mark@codesourcery.com>
228 * cp-tree.def (CTOR_COMPLETE): New tree node.
229 * decl.c (finish_constructor_body): Add it, to mark the end of the
231 (finish_function): Don't call end_protect_partials here.
232 * ir.texi (CTOR_COMPLETE): Document it.
233 * semantics.c (expand_stmt): Handle it.
235 * cp-tree.def (FUNCTION_NAME): New tree node.
236 * cp-tree.h (current_function_name_declared): Tweak documentation.
237 (lang_decl_flags): Add pretty_function_p, adjust dummy.
238 (DECL_PRETTY_FUNCTION_P): New macro.
239 * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
240 etc., in a template function. Use at_function_scope_p instead of
242 * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
244 (tsubst): Handle FUNCTION_NAME.
245 (tsubst_copy): Likewise.
246 (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
247 etc. in instantiation.
248 * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
249 even in template functions.
250 (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
251 conditional scope at the top of a destructor.
253 * error.c (dump_function_decl): Use `[ with ... ]' syntax for
256 1999-11-22 Nathan Sidwell <nathan@acm.org>
258 * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
259 when actually negative.
261 * typeck.c (convert_for_assignment): Expand comment about
262 strange NULL check, moved from ...
263 (convert_for_initialization): ... here. Remove unneeded
266 1999-11-21 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
268 * cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
269 * init.c (build_vec_delete, build_vec_delete_1): Likewise.
270 Always destruct virtual bases of array components, but never
272 (build_vec_init): Adjust invocations.
273 (build_delete): Likewise.
274 * decl2.c (delete_sanity): Likewise.
276 1999-11-19 Nathan Sidwell <nathan@acm.org>
278 * cp-tree.h (grok_method_quals): Return this pointer qualifiers.
279 * decl.c (grokdeclarator): Adjust calls to grok_method_quals.
280 * decl2.c (grok_method_quals): Accept `restrict' as applying to
281 the object pointer. Return such qualifiers.
282 (grokclassfn): Apply this pointer qualifiers. Cleanup unused
285 1999-11-18 Mark Mitchell <mark@codesourcery.com>
287 * except.c (expand_end_catch_block): Fix typo.
288 (expand_exception_blocks): Simplify. Don't call
289 expand_leftover_cleanups.
291 1999-11-15 Jason Merrill <jason@casey.cygnus.com>
293 * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
294 * pt.c (tsubst, case INTEGER_TYPE): Call it.
295 Check uses_template_parms.
297 * class.c (finish_struct): If we're a local class in a template
298 function, add a TAG_DEFN.
299 * pt.c (lookup_template_class): If this is a local class in a
300 template function, call pushtag.
301 (tsubst_expr, case TAG_DEFN): Handle classes, too.
303 Emit debug info with the vtable.
304 * search.c (maybe_suppress_debug_info): New function...
305 * class.c (finish_struct_1): ...split out from here.
306 * cp-tree.h: Declare it.
307 * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
308 if we're writing out the vtable.
309 * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
310 note_debug_info_needed): #if 0 out.
312 1999-11-14 Mark Mitchell <mark@codesourcery.com>
314 * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
315 * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
317 * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
318 * decl2.c (lookup_arg_dependent): Use it.
320 * cp-tree.h (cp_finish_decl): Change prototype.
321 (finish_static_data_member_decl): Likewise.
322 (push_permanent_obstack): Remove declaration.
323 (push_expression_obstack): Likewise.
324 (push_scratch_obstack): Likewise.
325 (DECL_TEMPLATE_PARM_P): Robustify.
326 (SET_DECL_TEMPLATE_PARM_P): New macro.
327 * class.c (add_method): Don't manipulate obstacks.
328 (finish_vtbls): Likewise.
329 * cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
330 * decl.c (binding_for_name): Don't manipulate obstacks.
331 (maybe_push_to_top_level): Likewise.
332 (pop_from_top_level): Likewise.
333 (duplicate_decls): Likewise.
334 (pushdecl): Likewise.
335 (implicitly_declare): Likewise.
336 (build_typename_type): Likewise.
337 (start_decl): Likewise.
338 (cp_finish_decl): Likewise.
339 (finish_decl): Likewise.
340 (destroy_local_static): Likewise.
341 (expand_static_init): Likewise.
342 (complete_array_type): Likewise.
343 (grokvardecl): Likewise.
344 (build_ptrmemfnc_type): Likewise.
345 (grokdeclarator): Likewise.
346 (xref_tag): Likewise.
347 (xref_basetypes): Likewise.
348 (start_enum): Likewise.
349 (finish_enum): Likewise.
350 (start_function): Likewise.
351 (finish_function): Likewise.
352 (start_method): Adjust call to cp_finish_decl.
353 * decl2.c (finish_static_data_member_decl): Don't manipulate
355 (grokfield): Likewise.
356 (grokbitfield): Likewise.
357 (get_temp_name): Likewise.
358 (get_sentry): Likewise.
359 (fnish_file): Likewise.
360 (lookup_arg_dependent): Likewise.
361 * except.c (call_eh_info): Likewise.
362 (push_eh_info): Likewise.
363 (do_pop_exception): Likewise.
364 (initialize_handler_parm): Likewise.
365 (expand_end_eh_spec): Likewise.
366 (alloc_eh_object): Likewise.
367 (expand_throw): Likewise.
368 * expr.c (extract_scalar_init): Likewise.
369 * init.c (build_java_class_ref): Likewise.
370 * lex.c (get_time_identifier): Likewise.
371 (snarf_defarg): Likewise.
372 (add_defarg_fn): Likewise.
373 (is_global): Simplify.
374 (do_identifier): Don't check TREE_PERMANENT.
375 * method.c (emit_thunk): Don't manipulate obstacks.
376 * parse.y (condition): Adjust call to cp_finish_decl.
379 (initdcl0_innards): Likewise.
380 (nomods_initdcl0): Likewise.
381 * pt.c (push_inline_template_parms_recursive): Use
382 SET_DECL_TEMPLATE_PARM_P.
383 (process_template_parm): Likewise.
384 (lookup_template_class): Don't manipulate obstacks.
385 (instantiate_class_template): Adjust call to
386 finish_static_data_member_decl.
387 (tsubst_decl): Don't manipulate obstacks.
388 (tsubst_expr): Likewise.
389 (instantiate_template): Likewise.
390 (instantiate_decl): Adjust calls to cp_finish_decl.
391 * rtti.c (call_void_fn): Don't manipulate obstacks.
392 (get_tinfo_var): Likewise.
393 (get_tinfo_fn_unused): Likewise.
394 (build_dynamic_cast_1): Likewise.
395 (expand_si_desc): Likewise.
396 (expand_class_desc): Likewise.
397 (expand_ptr_desc): Likewise.
398 (expand_attr_desc): Likewise.
399 (expand_generic_desc): Likewise.
400 (synthesize_tinfo_fn): Likewise.
401 * search.c (expand_upcast_fixups): Likewise.
402 * semantics.c (finish_asm_stmt): Likewise.
403 (finish_named_return_value): Likewise.
404 (begin_class_definition): Likewise.
405 (finish_class_definition): Likewise.
406 (finish_typeof): Likewise.
407 * tree.c (build_cplus_method_type): Likewise.
408 (reverse_path): Likewise.
409 (copy_template_template_parm): Likewise.
410 (build_expr_ptr_wrapper): Likewise.
411 (push_expression_obstack): Remove.
412 (push_permanent_obstack): Likewise.
413 * typeck.c (mark_addressable): Likewise.
415 1999-11-13 Mark Mitchell <mark@codesourcery.com>
417 * call.c (build_conditional_expr): Use build_target_expr_with_type.
418 (convert_like): Likewise.
419 (build_over_call): Likewise.
420 * cp-tree.h (build_target_expr): Remove.
421 (build_target_expr_with_type): New function.
422 * cvt.c (build_up_reference): Use get_target_expr.
423 * decl.c (build_target_expr): Move to ...
424 * tree.c (build_target_expr): Here. Make it static.
425 (build_target_expr_with_type): New function. Set DECL_CONTEXT on
426 the temporary VAR_DECLs.
427 (get_target_expr): Use it.
429 1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
431 * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
432 * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
433 * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
434 * class.c (set_rtti_entry): Use it.
436 1999-11-12 Mark Mitchell <mark@codesourcery.com>
438 * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
440 * semantics.c (finish_expr_stmt): Call it here instead. Move
441 default_conversion logic to semantic-analysis time.
443 1999-11-12 Jason Merrill <jason@yorick.cygnus.com>
445 * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
447 Fri Nov 12 12:56:32 MST 1999 Diego Novillo <dnovillo@cygnus.com>
449 * init.c (init_init_processing): Re-instated Nov 11 patch after
452 Fri Nov 12 10:42:02 MST 1999 Diego Novillo <dnovillo@cygnus.com>
454 * init.c (init_init_processing): Undo patch from Nov 11, 1999.
455 Patch had not been approved yet.
457 1999-11-12 Mark Mitchell <mark@codesourcery.com>
459 * decl.c (compute_array_index_type): New function, split out from
461 (create_array_type_for_decl): Likewise.
462 (grokdeclarator): Use them.
464 * semantics.c (expand_stmt): Don't suspend_momentary or
467 Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com>
469 * init.c (init_init_processing): Header information for
470 arrays allocated via `new' should have the same alignment used by
473 1999-11-10 Mark Mitchell <mark@codesourcery.com>
475 * error.c (dump_function_name): Don't crash if given a friend
476 pseudo-instantiation.
478 * cp-tree.h (build_enumerator): Change prototype.
479 * decl.c (enum_next_value): Remove.
480 (enum_overflow): Likewise.
481 (init_decl_processing): Don't register enum_next_value as a root.
482 (start_enum): Clear TYPE_VALUES for a redefined enum.
483 (finish_enum): Reset the type of enumeration constants.
484 (build_enumerator): Fix indentation. Don't copy CONST_DECLs when
485 we don't need to. Maintain the TYPE_VALUES list and look there
486 for the previously defined enumeration constant. Let enumeration
487 constants have the type of their values until the enumeration type
489 * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
491 * parse.c: Regenerated.
492 * pt.c (tsubst_enum): Adjust according to build_enumerator changes.
494 Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
495 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
497 * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
499 1999-11-09 Mark Mitchell <mark@codesourcery.com>
501 * cp-tree.h (language_function): Remove x_last_dtor_insn and
502 x_last_parm_cleanup_insn.
503 * decl.c (last_dtor_insn): Remove.
504 (last_parm_cleanup_insn): Likewise.
505 (expand_start_early_try_stmts): Don't set them.
506 (store_parm_decls): Likewise.
507 (save_function_data): Or save them.
508 (mark_lang_function): Or mark them.
510 1999-11-08 Mark Mitchell <mark@codesourcery.com>
512 * decl.c (store_parm_decls): Generate cleanup code at
513 semantic-analysis time. Destroy objects in the correct order.
515 1999-11-07 Mark Mitchell <mark@codesourcery.com>
517 * cp-tree.h (begin_new_placement): Remove.
518 (finish_new_placement): Likewise.
519 * class.c (finish_struct_1): Don't suspend_momentary or
521 * decl.c (grokdeclarator): Likewise.
522 (maybe_build_cleanup_1): Likewise.
523 * except.c (push_eh_cleanup): Likewise.
524 (build_terminate_handler): Likewise.
525 * init.c (build_new_1): Likewise.
526 * parse.y (parse_decl): Change prototype.
527 (initdecls, notype_initdecls, initdcl): Don't return int.
528 (initdcl0, notype_initdcl0, initdcl0_innards): Likewise.
529 (.begin_new_placement): Remove.
530 (.finish_new_placement): Likewise.
531 (nonmomentary_expr): Likewise.
532 (suspend_mom): Likewise.
533 (condition): Don't suspend_momentary, resume_momentary, or keep
534 track of need to resume.
535 (unary_expr): Likewise.
536 (new_placement): Likewise.
538 (structsp): Likewise.
539 (new_type_id): Likewise.
540 (maybe_parmlist): Likewise.
541 (direct_after_type_declaration): Likewise.
542 (direct_new_declarator): Likewise.
543 (direct_abstract_declaration): Likewise.
544 * parse.c: Regenerated.
545 * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary.
546 * semantics.c (begin_new_placement): Remove.
547 (finish_new_placement): Likewise.
549 1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de>
551 * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
552 (DECL_TEMPLATE_INFO): Use it.
553 * decl.c (warn_extern_redeclared_static): Do nothing for
555 * decl2.c (mark_used): Explicitly check for function or variable.
556 * semantics.c (finish_unary_op_expr): Check whether result is also
559 1999-11-05 Mark Mitchell <mark@codesourcery.com>
561 * Makefile.in (typeck2.o): Depend on output.h.
562 * typeck2.c: Include output.h.
564 * decl.c (flag_ansi): Remove declaration.
566 * pt.c (tinst_level_tick): Make it static.
567 (last_template_error_tick): Likewise.
569 * cp-tree.h (mapcar): Remove declaration.
570 (search_tree): Likewise.
571 (walk_tree_fn): New typedef.
572 (walk_tree): New function.
573 * tree.c (bot_manip): Change prototype. Adjust to be called via
575 (bot_replace): Likewise.
576 (no_linkage_helper): Likewise.
577 (copy_tree_r): New function.
578 (search_tree): Rename, and adjust, to become ...
579 (walk_tree): New function.
581 (target_remap): Remove.
582 (target_remap_count): Likewise.
583 (break_out_target_exprs): Use walk_tree.
584 * decl.c (local_variable_p): Change prototype.
585 (check_default_argument): Use walk_tree.
586 * pt.c (for_each_template_parm_r): New function, split out from ...
587 (for_each_template_parm): Here. Use it, via walk_tree.
589 1999-11-03 Mark Mitchell <mark@codesourcery.com>
591 * class.c (check_bitfield_decl): New function, split out from
593 (check_field_decl): Likewise. Recursively examine members of
595 (finish_struct_1): Use them.
596 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
598 1999-11-02 Mark Mitchell <mark@codesourcery.com>
600 * decl.c (grokfndecl): Remove dead code.
602 * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
604 1999-11-02 Scott Snyder <snyder@fnal.gov>
606 * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
608 * pt.c (tsubst_copy): Likewise.
610 1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
612 * decl2.c (maybe_make_one_only): Always make things comdat on
615 1999-10-31 Mark Mitchell <mark@codesourcery.com>
617 * decl.c (finish_function): Call free_after_parsing for functions
618 we are not immediately turning into RTL.
620 1999-10-31 Brendan Kehoe <brendan@cygnus.com>
622 * cp-tree.h (flag_dump_translation_unit): Add decl.
624 Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
626 * lex.c (yylex): Accept 'f' in mantissa of hex float constant.
628 1999-10-30 Mark Mitchell <mark@codesourcery.com>
630 * decl.c (pop_cp_function_context): Don't call free on a NULL
632 * semantics.c: Include ggc.h.
633 (expand_body): Do garbage-collection after processing a template
634 function. Clear DECL_SAVED_TREE after generating RTL for a
636 * Makefile.in (semantics.o): Depend on ggc.h.
638 1999-10-29 Mark Mitchell <mark@codesourcery.com>
640 * cp-tree.h (make_typename_type): Change prototype.
641 * decl.c (make_typename_type): Only complain if so requested.
642 * parse.y (nested_name_specifier): Adjust calls.
643 (typename_sub0): Likewise.
644 (typename_sub1): Likewise.
645 * parse.c: Regenerated.
646 * pt.c (convert_template_argument): Pass complain to
650 1999-10-28 Mark Mitchell <mark@codesourcery.com>
652 * semantics.c (finish_handler): End the scope of the handler
653 before attaching it to the statement-tree.
655 1999-10-28 Ian Lance Taylor <ian@zembu.com>
657 * rtti.c (build_dynamic_cast_1): Give a better error message for
658 an attempt to dynamic_cast from a non-polymorphic type.
660 1999-10-27 Mark Mitchell <mark@codesourcery.com>
662 * cp-tree.h (make_temp_vec): Remove.
663 (make_scratch_vec): Likewise.
664 * call.c (add_function_candidate): Use make_tree_vec.
665 (add_conv_candidate): Likewise.
666 (build_builtin_candidate): Likewise.
667 (add_template_candidate_real): Likewise.
668 * class.c (resolve_address_of_overloaded_function): Likewise.
669 * decl.c (start_function): Don't fool with the momentary obstack.
670 (finish_function): Likewise.
671 * init.c (expand_direct_vtbls_init): Likewise.
672 (begin_init_stmts): Likewise.
673 (finish_init_stmts): Likewise.
674 * pt.c (add_to_template_args): Use make_tree_vec.
675 (check_explicit_specialization): Likewise.
676 (coerce_template_parms): Likewise.
677 (lookup_template_class): Don't fool with the momentary obstack.
678 (instantiate_class_template): Likewise.
679 (tsubst_template_arg_vector): Use make_tree_vec.
680 (tsubst_aggr_type): Don't fool with the momentary obstack.
681 (tsubst_decl): Likewise. Use make_tree_vec.
682 (try_one_overload): Likewise.
683 (try_class_unification): Don't fool with the momentary obstack.
684 (get_bindings_real): Use make_tree_vec.
685 (set_mangled_name_for_template_decl): Likewise.
686 * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
687 * semantics.c (finish_expr_stmt): Likewise.
688 (finish_do_stmt): Likewise.
689 (finish_for_expr): Likewise.
690 (finish_switch_cond): Likewise.
691 (do_pushlevel): Likewise.
692 (do_poplevel): Likewise.
693 * tree.c (make_temp_vec): Remove.
695 * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump
696 CLEANUP_P for a TRY_BLOCK.
697 * ir.texi: Document SAVE_EXPR.
699 Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
701 * call.c (build_over_call): Check that the built-in function is
702 of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
703 * typeck.c (build_function_call_real): Similarly.
705 1999-10-26 Mark Mitchell <mark@codesourcery.com>
707 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
710 1999-10-24 Mark Mitchell <mark@codesourcery.com>
712 * decl.c (push_overloaded_decl_1): Use pushdecl.
714 * decl.c (auto_function): Replace #ifdef'd __inline with just
716 * lex.c (my_get_run_time): Likeise.
718 (identifier_type): Likewise.
719 * method.c (start_squangling): Likewise.
720 (end_squangling): Likewise.
722 (old_backref_index): Likewise.
723 (flush_repeats): Likewise.
724 (issue_ktype): Likewise.
725 * parse.y (empty_parms): Likewise.
726 * parse.c: Regenerated.
728 1999-10-21 Mark Mitchell <mark@codesourcery.com>
730 * dump.c (dequeue_and_dump): Replace several uses of
731 queue_and_dump_index with dump_child.
733 1999-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
735 * expr.c: Include tm_p.h.
737 1999-10-21 Mark Mitchell <mark@codesourcery.com>
739 * cp-tree.h (SCOPE_PARTIAL_P): New macro.
740 (pushlevel_temporary): Remove.
741 (add_scope_stmt): New function.
742 * decl.c (pushlevel_temporary): Remove.
743 (poplevel): Use add_scope_stmt.
744 (start_decl_1): Likewise.
745 * semantics.c (add_scope_stmt): New function.
746 (do_pushlevel): Use it.
747 (do_poplevel): Use it.
748 (expand_stmt): Check SCOPE_PARTIAL_P.
750 * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
751 * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
752 * expr.c (cplus_expand_expr): Expand it.
753 * ir.texi: Document EMPTY_CLASS_EXPR.
755 1999-10-20 Mark Mitchell <mark@codesourcery.com>
757 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
758 parameters as having namespace scope.
760 1999-10-19 Mark Mitchell <mark@codesourcery.com>
762 * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
763 (mangling_flags): New type.
764 (build_overload_int): Change prototype.
765 (build_overload_value): Likewise.
766 (numeric_output_need_bar): Improve comment.
767 (mangle_expression): New function, broken out from ...
768 (build_overload_int): Here.
769 (build_overload_value): Adjust for use of mangling flags. Don't
770 warn about real-valued template parameters here. Do handle
771 complex expressions involving real-valued template parameters.
772 (build_template_parm_names): Encase non-type template parameters
773 in underscores, if necessary.
774 (process_overload_item): Remove conditional on
775 PARM_CAN_BE_ARRAY_TYPE.
777 1999-10-17 Mark Mitchell <mark@codesourcery.com>
779 * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
781 * ir.texi: Clean up documentation of RETURN_INIT.
783 1999-10-15 Greg McGary <gkm@gnu.org>
785 * lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
786 (lang_init): Set default for flag_bounds_check if still "unspecified".
788 1999-10-13 Andrew Haley <aph@cygnus.com>
790 * class.c (finish_struct_1): Force alignment of non-bitfields to
793 Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
795 * typeck2.c (process_init_constructor): Handle empty constructors.
797 1999-10-13 Jason Merrill <jason@yorick.cygnus.com>
799 * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
801 * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
804 1999-10-13 Mark Mitchell <mark@codesourcery.com>
806 * decl.c (make_rtl_for_local_static): Don't create register RTL
807 for addressable constants.
809 1999-10-13 Nathan Sidwell <nathan@acm.org>
811 * cp-tree.h (build_x_va_arg): Prototype new function.
812 * call.c (build_x_va_arg): Define it.
813 * parse.y (unary_expr): Call build_x_va_arg.
815 * cp-tree.h (convert_type_from_ellipsis): Prototype new function.
816 * call.c (convert_type_from_ellipsis): Define it.
817 * decl.c (init_decl_processing): Set lang_type_promotes_to.
819 * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
821 1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
823 * class.c (fixed_type_or_null): Always set *nonnull.
825 1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
827 * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
828 __GNUC__ and __GNUC_MINOR__.
830 1999-10-09 Mark Mitchell <mark@codesourcery.com>
832 * cp-tree.h (make_rtl_for_local_static): New function.
833 * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
835 (make_rtl_for_local_static): Here.
836 * semantics.c (expand_stmt): Use make_rtl_for_local_static.
838 1999-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
840 * method.c: Include tm_p.h.
842 1999-10-7 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
844 * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
845 * lex.c (cp_make_lake_type): Likewise.
846 * tree.c (init_tree): Init make_lang_type_fn.
848 1999-10-07 Mark Mitchell <mark@codesourcery.com>
850 * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
853 * semantics.c (expand_stmt): Don't pretend to have asmspecs for
854 local statics if we don't really have them.
856 * ir.texi: Improve documentation for STMT_EXPR. Describe
859 1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
861 * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
863 1999-10-07 Greg McGary <gkm@gnu.org>
865 * class.c (finish_struct_1): Use simpler method of
866 removing elements of a singly-linked list which doesn't
867 lose for classes without data members.
869 1999-10-07 Mark Mitchell <mark@codesourcery.com>
871 * friend.c (make_friend_class): Robustify.
873 * semantics.c (finish_object_call_expr): Reject calls to template
876 1999-10-06 Mark Mitchell <mark@codesourcery.com>
878 * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
880 * cp-tree.h (CLASSTYPE_VFIELD): Remove.
881 * call.c (build_vfield_ref): Use TYPE_VFIELD, not
883 * class.c (get_vfield_offset): Likewise.
884 (finish_base_struct): Likewise.
885 (modify_one_vtable): Likewise.
886 (fixup_vtable_deltas): Likewise.
887 (finish_struct_1): Likewise.
888 * init.c (expand_virtual_init): Likewise.
889 * search.c (lookup_field_1): Likewise.
890 (expand_upcast_fixups): Likewise.
891 * typeck.c (build_component_ref): Likewise.
892 (build_binary_op_nodefault): Likewise.
894 * dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
895 * ir.texi: Document TYPE_VFIELD.
897 1999-10-06 Brendan Kehoe <brendan@cygnus.com>
899 * decl.c (grokdeclarator): Only warn about non-zero arrays if
900 !in_system_header (linux socketbits.h can give this for
901 __cmsg_data, which is using a GNU extension).
903 1999-10-05 Mark Mitchell <mark@codesourcery.com>
905 * decl2.c (start_static_storage_duration_function): Push the
906 function declaration so it ends up in namespace scope.
908 * dump.c (DUMP_CHILDREN): Remove.
909 (DUMP_BINFO): Adjust.
910 (struct dump_node_info): Remove dump_children_p.
911 (queue_and_dump_type): Remove dump_children_p parameter.
912 (queue): Don't set dump_children_p.
913 (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
914 queue_and_dump_index.
915 (dequeue_and_dump): Unconditionally print children. Adjust calls
916 to functions mentioned above.
917 (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
919 * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
920 * dump.c (dequeue_and_dump): Dump them.
922 * method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
924 * decl.c (start_function): Set current_in_charge_parm for
925 constructors, too, where appropriate.
926 * search.c (fixup_all_virtual_upcast_offsets): New function.
927 (expand_indirect_vtbls_init): Use it.
929 1999-10-04 Nathan Sidwell <nathan@acm.org>
931 * decl2.c (grok_alignof): Don't decay lvalues.
933 * init.c (build_new): Remove unused variable.
935 1999-10-04 Mark Mitchell <mark@codesourcery.com>
937 * cp-tree.h (struct language_function): Remove static_labelno.
938 (static_labelno): Remove macro.
939 * method.c (build_overload_nested_name): Make static_labelno
942 * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
943 to decide whether or not a function is defined.
945 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
946 situations where make_node will do it automatically.
947 * decl.c (grok_reference_init): Likewise.
948 (expand_static_init): Likewise.
949 (do_static_initialization): Likewise.
950 * init.c (perform_member_init): Likewise.
951 (expand_aggr_init_1): Likewise.
952 (build_new_1): Likewise.
953 * method.c (do_build_copy_constructor): Likewise.
954 (do_build_assign_ref): Likewise.
955 * search.c (expand_upcast_fixups): Likewise.
956 * semantics.c (finish_stmt_expr): Likewise.
957 * typeck.c (build_unary_op): Likewise.
958 (check_return_expr): Likewise.
960 1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
962 * init.c (build_vec_delete_1): Fold COND_EXPRs.
964 1999-10-03 Mark Mitchell <mark@codesourcery.com>
966 * cp-tree.def (VEC_INIT_EXPR): Remove.
967 * cp-tree.h (struct stmt_tree): New type.
968 (struct saved_scope): Remove firstobj. Add x_saved_tree,
970 (class_cache_firstobj): Remove.
971 (struct language_function): Remove stmts_are_full_exprs_p,
972 x_last_tree, and x_last_expr_type. Add x_stmt_tree.
973 (current_stmt_tree): New macro.
975 (last_expr_type): Likewise.
976 (doing_semantic_analysis_p): Simplify.
977 (stmts_are_full_exprs_p): Adjust.
978 (begin_tree): Remove prototype.
979 (end_tree): Likewise.
980 (begin_stmt_tree): Change prototype.
981 (finish_stmt_tree): Likewise.
982 (building_stmt_tree): Simplify.
983 * decl.c (mark_stmt_tree): New function.
984 (mark_saved_scope): Use it.
985 (start_function): Rearrange slightly to call begin_stmt_tree
987 (save_function_data): Tweak.
988 (finish_function): Adjust call to finish_stmt_tree.
989 (mark_lang_function): Use mark_stmt_tree.
990 * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
991 * init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
992 (build_vec_init): Remove creation of stand-in intializer.
993 * pt.c (begin_tree): Remove.
994 (end_tree): Likewise.
995 * semantics.c (SET_LAST_STMT): New macro. Use it throughout.
996 (begin_compound_stmt): Handle a compound-statement outside of a
998 (begin_stmt_expr): Handle a statement-expression outsidef of a
1000 (finish_stmt_expr): Likewise.
1001 (begin_class_definition): Don't call begin_tree.
1002 (finish_inline_definitions): Don't call end_tree.
1003 (begin_stmt_tree): Take a pointer to tree, not a function as input.
1004 (finish_stmt_tree): Likewise.
1005 * tree.c (search_tree): Don't handle VEC_INIT_EXPR.
1008 * parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
1009 * parse.c: Regenerated.
1011 * dump.c (dqueue_and_dump): Dump bitfieldness.
1013 * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
1014 bitfields, rather than DECL_BIT_FIELD.
1015 * ir.texi: Document how to tell whether or not a field is a
1018 * lex.c (make_lang_type): Fix typo in comment.
1020 1999-10-01 Jason Merrill <jason@yorick.cygnus.com>
1022 * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
1024 1999-10-01 Mark Mitchell <mark@codesourcery.com>
1026 * pt.c (tsubst_decl): If the type of a template instantiation is
1027 bogus, so is the whole instantiation.
1029 1999-09-30 Mark Mitchell <mark@codesourcery.com>
1031 * decl.c (initialize_local_var): Handle static variables here.
1032 (cp_finish_decl): Tweak handling of function-scope static
1034 * semantics.c (expand_stmt): Handle DECL_STMTs for static
1037 * method.c (emit_thunk): Don't crash when -fsyntax-only.
1039 * cp-tree.h (lang_decl_flags): Add global_ctor_p and
1040 global_dtor_p. Add init_priority.
1041 (DECL_ACCESS): Adjust accordingly.
1042 (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
1043 (GLOBAL_INIT_PRIORITY): Likewise.
1044 * decl.c (lang_mark_tree): Adjust accordingly.
1045 (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
1046 and GLOBAL_INIT_PRIORITY.
1047 * dump.c (dequeue_and_dump): Print them.
1048 * ir.texi: Document them.
1050 * decl2.c (struct priority_info_s): Remove initialization_sequence
1051 and destruction_sequence.
1052 (start_static_storage_duration_function): Return the body of the
1053 function. Convert for function-at-a-time mode.
1054 (generate_inits_for_priority): Remove.
1055 (finish_static_storage_duration_function): Change prototype.
1056 Adjust for function-at-a-time mode.
1057 (do_static_initialization): Likewise.
1058 (do_static_destruction): Likewise.
1059 (do_static_initialization_and_destruction): Remove.
1060 (start_static_initialization_or_destruction): New function.
1061 (finish_static_initialization_or_destruction): Likewise.
1062 (get_priority_info): Don't manipulation initialization_sequence or
1063 destruction_sequence.
1064 (prune_vars_needing_no_initialization): New function.
1065 (write_out_vars): Likewise.
1066 (finish_file): Use the various new functions instead of the old.
1068 Thu Sep 30 00:13:27 1999 Dirk Zoller <duz@rtsffm.com>
1070 * cp-tree.h (warn_float_equal): Declare.
1071 * decl2.c (warn_float_equal): Define.
1072 (lang_decode_option): Recognize -W[no-]float-equal.
1073 * typeck.c (build_binary_op_nodefault): Conditionally warn
1074 about equality tests of floating point types.
1076 1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
1078 Support normal type_info-based EH mechanisms with -fno-rtti.
1079 * except.c (build_eh_type_type): Remove special -fno-rtti handling.
1080 (build_eh_type_type_ref): Likewise.
1081 (build_eh_type): Remove.
1082 (expand_throw): Call build_eh_type_type, not build_eh_type.
1083 * decl2.c (import_export_decl): Don't associate the tinfo fn with
1084 the vtable if -fno-rtti.
1085 * decl.c (init_decl_processing): Always init_rtti_processing.
1087 * rtti.c (get_typeid): Don't complain about -fno-rtti.
1089 * class.c (class_cache_obstack, class_obstack): Remove.
1090 (init_class_processing): Don't initialize class_obstack.
1091 (push_cache_obstack): Remove.
1092 (pushclass): Don't call it.
1093 * cp-tree.h: Remove prototype for push_cache_obstack.
1094 * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
1095 (pushlevel_class): Don't push_decl_level.
1096 (poplevel_class): Don't pop_stack_level.
1097 (push_class_level_binding): Don't push_cache_obstack.
1098 (init_decl_processing): Don't intialize decl_obstack.
1099 * search.c (push_class_decls): Don't push_cache_obstack.
1100 * tree.c (list_hash_add): Put hash node on permanent_obstack.
1101 (hash_tree_cons): Don't mess with obstacks.
1102 (print_lang_statistics): Don't print stats for class_obstack and
1105 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1107 * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
1108 * ir.texi: Document DECL_EXTERNAL.
1110 * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
1111 * ir.texi: Document THUNK_DECLs.
1113 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
1114 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1115 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1116 * error.c (dump_template_bindings): Remove unused parameter.
1117 Handle multiple levels of template parameters.
1118 (dump_template_decl): Use `parms', not `args', for template
1119 parameters. Fix thinko.
1120 (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass
1121 flags to dump_template_bindings.
1122 * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
1123 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1124 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1125 (tsubst_copy): Clarify variable name.
1126 (most_general_template): Robustify.
1128 1999-09-29 Nathan Sidwell <nathan@acm.org>
1130 * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
1131 to change primary template rendering.
1133 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1135 * cp-tree.h (UPT_TEMPLATE): Remove.
1136 (UPT_PARMS): Likewise.
1137 (DECL_NEEDED_P): New macro.
1138 * decl2.c (finish_vtable_vardecl): Use it.
1139 (finish_objects): Don't crash with -fsyntax-only.
1140 (finish_file): Use DECL_NEEDED_P. Don't prune vtables when
1142 * pt.c (tsubst_friend_function): Remove FIXME that talks about
1144 (tsubst_expr): Correct handling of function try-blocks.
1145 * semantics.c: Include flags.h.
1146 (expand_body): Don't do RTL generation if -fsyntax-only.
1147 * Makefile.in (semantics.o): Depends on flags.h.
1149 1999-09-28 Gabriel Dos Reis <gdr@codesourcery.com>
1151 * pt.c (most_general_template): Adjust declaration.
1153 * cp-tree.h: (most_general_template): Declare.
1155 * error.c (dump_template_value): Rename to ...
1156 (dump_template_argument): This.
1157 (dump_template_argument_list): New function.
1158 (dump_type): Use it.
1159 (dump_template_parameter): New function.
1160 (dump_template_decl): Use it.
1161 (dump_template_bindings): New function.
1162 (dump_function_decl): Use it. Pretty print function template
1165 1999-09-28 Nathan Sidwell <nathan@acm.org>
1167 * decl.c (grokdeclarator): Distinguish parameter context for
1168 diagnostics. Tidy up missing type diagnostic.
1169 Diagnose `explicit' in one place. Diagnose `mutable' in one place.
1171 1999-09-28 Mark Mitchell <mark@codesourcery.com>
1173 * ir.texi: Improve documentation for TARGET_EXPR.
1175 1999-09-27 Nathan Sidwell <nathan@acm.org>
1177 Augment stringification of trees.
1178 * cp-tree.h (tree_string_flags): New error stringifying enumeration.
1179 (fndecl_as_string, type_as_string_real, args_as_string,
1180 code_as_string, language_as_string, parm_as_string,
1181 op_as_string, assop_as_string, cv_as_string): Remove.
1182 (type_as_string, decl_as_string, expr_as_string): Adjust prototype.
1183 (context_as_string): Declare new function.
1184 * error.c (cp_printers): Move definition.
1186 (OB_END_TEMPLATE_ID): Adjust.
1187 (interesting_scope_p): Remove.
1188 (dump_scope): New static function.
1189 (dump_qualifiers): Adjust prototype, reimplement.
1190 (dump_template_value): Use tree_string_flags.
1191 (dump_type_real): Move back to dump_type.
1192 (dump_type): Adjust prototype. Use tree_string_flags.
1193 (dump_aggr_type): Likewise. Use dump_template_parms.
1194 (dump_type_prefix): Adjust prototype. Use tree_string_flags.
1196 (dump_type_suffix): Adjust prototype. Use tree_string_flags.
1197 (dump_simple_decl): Likewise.
1198 (dump_decl): Likewise. Use dump_template_decl.
1199 (dump_template_decl): New static function broken out of dump_decl.
1200 (dump_function_decl): Adjust prototype. Use tree_string_flags.
1201 (dump_parameters): Likewise. Prefix space.
1202 (dump_exception_spec): Adjust prototype. Use tree_string_flags.
1203 (dump_function_name): Likewise. Use dump_template_parms.
1204 (dump_template_parms): New static function broken out of
1206 (dump_expr_list): Adjust prototype. Use tree_string_flags.
1207 (dump_expr): Likewise.
1208 (fndecl_as_string): Removed
1209 (type_as_string_real): Removed
1210 (dump_binary_op): Adjust prototype. Use tree_string_flags.
1211 (dump_unary_op): Likewise.
1212 (type_as_string): Likewise.
1213 (expr_as_string): Likewise.
1214 (decl_as_string): Likewise.
1215 (context_as_string): New function.
1216 (lang_decl_name): Adjust.
1217 (decl_to_string): New static print callback.
1218 (expr_to_string): Likewise.
1219 (fndecl_to_string): Likewise.
1220 (code_as_string): Renamed to ...
1221 (code_to_string): ... here. Adjust.
1222 (language_as_string): Renamed to ...
1223 (language_to_string): ... here. Adjust.
1224 (parm_as_string): Renamed to ...
1225 (parm_to_string): ... here.
1226 (op_as_string): Renamed to ...
1227 (op_to_string): ... here.
1228 (assop_as_string): Renamed to ...
1229 (assop_to_string): ... here.
1230 (type_to_string): New static print callback.
1231 (args_as_string): Renamed to ...
1232 (args_to_string): ... here. Adjust.
1233 (cv_as_string): Renamed to ...
1234 (cv_to_string): ... here. Adjust.
1235 * pt.c (mangle_class_name_for_template): Use tree_string_flags.
1236 (print_template_context): Likewise.
1238 1999-09-26 Mark Mitchell <mark@codesourcery.com>
1240 * cp-tree.h (expand_throw): Remove prototype.
1241 * except.c (expand_throw): Make it static. Use tree-generation
1242 functions, rather than RTL-generation functions.
1243 (build_throw): Use it.
1244 * expr.c: Include except.h.
1245 (cplus_expand_expr): Don't call expand_throw here.
1246 * Makefile.in (expr.o): Depend on except.h.
1247 * ir.texi: Update documentation for THROW_EXPR.
1249 * decl.c (start_function): Set x_dont_save_pending_sizes rather
1250 than calling get_pending_sizes.
1251 * init.c (build_new): Don't save and restore
1252 immediate_size_expand; instead, assert that it has the expected
1255 1999-09-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1257 * lex.c (compiler_error): Add missing call to va_end().
1259 1999-09-25 Mark Mitchell <mark@codesourcery.com>
1261 * dump.c (dequeue_and_dump): Handle RESULT_DECL.
1262 * ir.texi: Document RESULT_DECL and DECL_RESULT.
1264 * cp-tree.h (check_return_expr): New function.
1265 * decl.c (finish_constructor_body): New function.
1266 (pushdecl): Put global friend functions in namespace binding
1267 level, not the class binding level.
1268 (finish_destructor_body): Make sure the dtor_label is always
1269 defined. Fix typo in comment.
1270 (finish_function): Move generation of constructor-termination code
1271 to semantic-analysis time. Move generation of implicit `main'
1272 return value to semantic-analysis time.
1273 * semantics.c (finish_return_stmt): Generate goto's to
1274 ctor_label/dtor_label here. Use check_return_expr to do semantic
1275 analysis on the returned expression.
1276 * typeck.c (maybe_warn_about_returning_address_of_local): New
1277 function split out from c_expand_return.
1278 (check_return_expr): Likewise.
1279 (c_expand_return): Just generate the RTL for the return.
1281 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1283 * cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
1284 (cleanup_type): Likewise.
1285 (search_tree): Change prototype.
1286 * decl.c (local_variable_p): Adjust for new interface to
1288 (check_default_argument): Likewise.
1289 * error.c (dump_expr): Handle INIT_EXPR.
1290 * except.c (expand_throw): Don't make cleanup_type a local static.
1291 * expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
1292 * init.c (build_new): Call build_new_1 directly, rather than
1293 building a NEW_EXPR.
1294 (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when
1295 processing file-scope initializers.
1296 * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
1297 * tree.c: Include splay-tree.h
1298 (no_linkage_helper): Adjust for new interface to search_tree.
1299 (search_tree): Pass around pointers to tree nodes, rather than the
1300 nodes themselves. Handle VEC_INIT_EXPR.
1301 (no_linkage_check): Adjust for new interface to search_tree.
1302 (mapcar): Handle VEC_INIT_EXPR.
1303 (target_remap): New variable.
1304 (bot_manip): Use it.
1305 (bot_replace): New function.
1306 (break_out_target_exprs): Use it to remap all variables used in a
1307 default argument expression.
1308 * typeck.c (build_modify_expr): Don't crash when outside a
1309 function and presented with an INIT_EXPR assignment
1310 * Makefile.in (tree.o): Depend on splay-tree.h.
1312 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1314 * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
1316 (builtin_function): New arg CLASS. Arg CODE now of type int. All
1318 Set the builtin's DECL_BUILT_IN_CLASS.
1320 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1322 * decl.c (pushdecl): Don't make local declarations of extern
1323 variables give the variable a DECL_CONTEXT for the function.
1324 (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify.
1325 Don't accidentally make RTL for local declarations.
1326 (emit_local_var): Handle declarations with asm-specifiers here.
1328 1999-09-23 Mark Mitchell <mark@codesourcery.com>
1330 * ir.texi: Improve documentation for TARGET_EXPRs. Discuss
1331 STMT_IS_FULL_EXPR_P.
1333 * cp-tree.h (language_function): Add cannot_inline.
1334 * decl.c (start_function): Restore current_function_cannot_inline
1335 from the saved value.
1336 (save_function_data): Save current_function_cannot_inline.
1337 * decl2.c (start_objects): Change prototype. Build the function
1338 in function-at-a-time mode.
1339 (finish_objects): Likewise.
1340 (generate_ctor_or_dtor_function): Adjust accordingly.
1342 * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
1343 * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
1344 Don't call expand_anon_union_decl here
1345 * semantics.c (exapnd_stmt): Call it here, instead.
1346 * typeck.c (mark_addressable): Addressed variables are implicitly
1349 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1351 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
1352 (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
1353 (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
1354 * cp-tree.h: Add tree checking macros to various tree access
1356 * ptree.c (print_lang_decl): Test for function or variable
1357 before accessing template info.
1359 1999-09-23 Jason Merrill <jason@yorick.cygnus.com>
1361 * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
1362 * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
1363 * decl2.c (lang_f_options): Add -fshort-wchar.
1364 * cp-tree.h: Declare flag_short_wchar.
1365 * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned
1368 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1370 * ir.texi: Fix formatting errors and typos.
1372 1999-09-22 Mark Mitchell <mark@codesourcery.com>
1374 * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
1376 * decl.c (pushdecl): Do create a binding for extern "C" functions,
1377 but not for their DECL_ASSEMBLER_NAMEs.
1378 (lookup_name_current_level): Fix formatting.
1379 (xref_tag): Likewise.
1380 * decl2.c (start_objects): Mark static constructors and
1381 destructors as used.
1383 1999-09-22 Jason Merrill <jason@yorick.cygnus.com>
1385 * decl.c (define_case_label): Don't crash if we're not in a switch.
1387 * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
1388 * lang-options.h: Restore -fthis-is-variable. Remove help strings
1389 for unsupported flags.
1391 1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
1393 * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
1394 Accept and warn about -fthis-is-variable.
1396 1999-09-21 Mark Mitchell <mark@codesourcery.com>
1398 * dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
1399 CLEANUP_STMT, and SCOPE_STMT.
1401 * decl2.c (lang_decode_option): Adjust, in the wake of recent
1402 changes to option processing.
1404 1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1406 * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
1407 function pointer from pmfs with no object given.
1408 (convert_for_assignment): Do not return error when converting
1411 1999-09-21 Alex Samuel <samuel@codesourcery.com>
1413 * lex.c (internal_filename): New variable.
1414 (INTERNAL_FILENAME): New macro.
1415 (init_parse): Allocate internal_filename and mark as root. Use it
1416 instead of a string constant.
1418 1999-09-21 Nathan Sidwell <nathan@acm.org>
1420 Reimplement dynamic cast and catch matching.
1421 * cp-tree.h (get_dynamic_cast_base_type): Prototype new function
1422 * search.c (dynamic_cast_base_recurse): New function.
1423 (get_dynamic_cast_base_type): New function for dynamic cast.
1424 * rtti.c (build_dynamic_cast_1): Determine source and target
1425 class relationship. Call __dynamic_cast_2.
1426 * tinfo.h (__user_type_info::upcast): New catch dispatcher.
1427 (__user_type_info::dyncast): New dynamic cast dispatcher.
1428 (__user_type_info::sub_kind): New nested enumeration.
1429 (__user_type_info::contained_p): sub_kind predicate.
1430 (__user_type_info::contained_public_p): Likewise.
1431 (__user_type_info::contained_nonpublic_p): Likewise.
1432 (__user_type_info::contained_nonvirtual_p: Likewise.
1433 (__user_type_info::upcast_result): New nested struct.
1434 (__user_type_info::dyncast_result): New nested struct.
1435 (*::do_upcast): New catch function.
1436 (*::do_dyncast): New dynamic cast function.
1437 (__user_type_info::find_public_subobj): New dynamic cast
1439 (*::do_find_public_subobj): New dynamic cast helper function.
1440 * tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
1441 (__user_type_info::dyncast): Define dynamic cast dispatcher.
1442 (*::do_upcast): Define catch function.
1443 (*::do_dyncast): Define dynamic cast function.
1444 (*::do_find_public_subobj): Define dynamic cast helper function.
1445 * tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
1446 (__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
1447 (__dynamic_cast_2): New dynamic cast runtime.
1449 1999-09-20 Mark Mitchell <mark@codesourcery.com>
1451 * cp-tree.h (finish_stmt_expr): Change prototype.
1452 * expr.c (cplus_expand_expr): Adjust call accordingly.
1453 * init.c (finish_init_stmts): Likewise.
1454 * parse.y (primary): Likewise.
1455 * pt.c (tsubst_copy): Likewise.
1456 * semantics.c (finish_stmt_expr): Don't take two parameters.
1457 Don't remove generated BLOCKs from the block-tree.
1459 Remove support for assigning to `this'.
1460 * NEWS: Note that fact.
1461 * class.c (build_vbase_path): Don't check flag_this_is_variable.
1462 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
1463 (language_function): Remove assigns_this, just_assigned_this, and
1464 x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p.
1465 (base_init_expr): Remove.
1466 (current_vcalls_possible_p): New macro.
1467 (vtbls_set_up_p): Likewise.
1468 (emit_base_init): Change prototype.
1469 * decl.c (finish_destructor_body): New function, split out from
1471 (current_function_assigns_this): Remove.
1472 (current_function_just_assigned_this): Likewise.
1473 (start_function): Don't set them.
1474 (finish_function): Don't check them. Don't emit
1475 base-initialization code here. Generate code for destructors when
1476 doing semantic analysis.
1477 (finish_stmt): Don't check current_function_just_assigned_this.
1478 * decl2.c (lang_f_options): Remove this-is-variable.
1479 (lang_decode_option): Likewise.
1480 (grokclassfn): Don't check flag_this_is_variable.
1481 * init.c (emit_base_init): Return the expression generated.
1482 (construct_virtual_bases): Don't push/pop obstacks. Fix
1484 (build_new_1): Don't check flag_this_is_variable.
1485 (get_temp_regvar): Don't set DECL_REGISTER.
1486 (build_vec_init): Don't call use_variable.
1487 * lang-options.h: Remove "-fthis-is-variable" and
1488 "-fno-this-is-variable".
1489 * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
1490 * search.c (expand_upcast_fixups): Use finish_expr_stmt, not
1492 * semantics.c (finish_expr_stmt_real): Rename to ...
1493 (finish_expr_stmt): This. Remove assigned_this parameter.
1494 (begin_if_stmt): Call do_pushlevel before starting the statement.
1495 (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
1497 (setup_vtbl_ptr): Emit initialization code for bases and members
1498 at semantic-analysis time. Emit code to initialize vtables in
1500 (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
1501 Don't handle CTOR_INITIALIZER any more.
1502 * typeck.c (build_modify_expr): Don't check for assignments to
1504 (c_expand_return): Don't suggest assigning to `this'.
1506 * Makefile.in (decl.o): Depend on RTL_H.
1507 (decl2.o): Likewise.
1508 (class.o): Likewise.
1510 (method.o): Likewise.
1511 (search.o): Likewise.
1515 * decl.c (duplicate_decls): When a builtin function is redeclared
1516 as static, make sure it is mangled correctly.
1518 * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add
1519 detail about the statement-tree.
1521 1999-09-20 Nathan Sidwell <nathan@acm.org>
1523 * parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
1525 1999-09-20 Nick Clifton <nickc@cygnus.com>
1527 * decl2.c (lang_decode_option): Extend comment.
1529 Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1531 * typeck.c: Include "tm_p.h".
1533 1999-09-19 Mark Mitchell <mark@codesourcery.com>
1535 * ir.texi: New file.
1537 1999-09-19 Paul Burchard <burchard@pobox.com>
1539 * semantics.c (expand_stmt): Initialize return value.
1541 1999-09-18 Paul Burchard <burchard@pobox.com>
1543 * gxxint.texi: G++ now implements namespaces.
1545 1999-09-18 Mark Mitchell <mark@codesourcery.com>
1547 * decl.c (pop_label): Don't warn about unused labels more than
1549 * semantics.c (finish_goto_stmt): Always marked used labels as
1552 * decl.c (layout_var_decl): Change prototype. Call layout_decl
1553 even when the declaration is external.
1554 (cp_finish_decl): Adjust call to layout_var_decl.
1555 * pt.c (tsubst_expr): Make sure to initialize stmt before using it.
1557 1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
1559 * typeck.c (get_member_function_from_ptrfunc): Always consider
1560 virtuality inside member pointer.
1562 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1564 Turn on function-at-a-time processing.
1565 * cp-tree.h (doing_semantic_analysis_p): New macro.
1566 (SF_DEFAULT): Define to zero, not SF_EXPAND.
1567 (start_handler_parms): Change prototype.
1568 (expand_start_catch_block): Likewise.
1569 (expand_end_catch_block): Likewise.
1570 (expand_start_eh_spec): Likewise.
1571 (expand_end_eh_spec): Declare.
1572 (finish_handler_parms): Change prototype.
1573 (begin_catch_block): Declare.
1574 (finish_handler): Change prototype.
1575 (do_pushlevel): Declare.
1576 (do_poplevel): Likewise.
1577 * decl.c (pushlevel): Don't create
1578 binding levels when not doing semantic analysis.
1579 (poplevel): Don't pop them.
1580 (pushdecl): Assert that we are never called when not doing
1582 (pushdecl_top_level): Use push_to_top_level.
1583 (make_label_decl): Don't fiddle with obstacks. Make RTL For the
1584 label when expanding.
1585 (cp_finish_decl): Only inject for-scope variables when doing
1586 semantic analysis. Add comments.
1587 (start_handler_parms): Return the handler parm.
1588 (start_function): Reorganize. Don't clear DECL_INITIAL if it is
1589 already set. Reinitialize from saved function data if available.
1590 Don't pushlevel when not doing semantic analysis.
1591 (store_parm_decls): Only generate RTL when expanding. Only
1592 pushdecl when doing semantic analysis. Set
1593 current_eh_spec_try_block if appropriate.
1594 (finish_function): Simplify. Use do_pushlevel and do_poplevel.
1595 Combine common code. Don't poplevel when not doing semantic
1597 (push_cp_function_context): Don't expand functions without an
1598 explicit call to expand_body.
1599 (mark_lang_function): Make eh_spec_try_block and
1601 * except.c (expand_end_eh_spec): Don't
1603 (process_start_catch_block): Likewise.
1604 (push_eh_cleanup): Use finish_decl_cleanup.
1605 (initialize_handler_parm): New function.
1606 (expand_start_catch_block): Use it.
1607 (expand_end_catch_block): Use tree-generation functions, not
1608 RTL-generation functions.
1609 (expand_start_eh_spec): Likewise.
1610 (expand_end_eh_spec): Likewise.
1611 (expand_exception_blocks): Simplify.
1612 (start_anon_func): Use do_pushlevel.
1613 (end_anon_func): Use do_poplvel. Call expand_body for the
1615 * expr.c (do_case): Don't call define_case_label.
1616 * init.c (create_temporary_var): Set DECL_CONTEXT for local
1618 * method.c (emit_thunk): Call expand_body for the
1620 (sythesize_method): Likewise.
1621 * parse.y (handler_args): Give it ttype.
1622 (eat_saved_input): Call expand_body.
1623 (base_init): Use do_pushlevel.
1624 (pending_inline): Call expand_body.
1625 (handler): Adjust calls to finish_handler_parms and
1627 (handler_args): Don't call expand_start_catch_block. Return the
1628 catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling.
1629 * parse.c: Regenerated.
1630 * rtti.c (synthesize_tinfo_fn): Call finish_function.
1631 * semantics.c (do_pushlevel): Give it external linkage. Build
1633 (do_poplevel): Likewise.
1634 (finish_case_label): Call define_case_label when doing semantic
1636 (finish_goto_stmt): Create RTL for labels.
1637 (finish_function_try_block): Set in_function_try_handler
1639 (finish_function_handler_sequence): Unset it.
1640 (finish_handler_parms): Use expand_start_catch_block even when
1641 building a statement-tree.
1642 (begin_catch_block): New function.
1643 (finish_handler): Move a little RTL-generation logic here.
1644 (finish_decl_cleanup): Allow cleanups for empty declarations.
1645 (finish_named_return_value): Don't pushdecl when not doing
1647 (expand_stmt): Don't do semantic analysis for variable
1648 declarations. Handle START_CATCH_STMT. Call expand_label
1649 directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust
1650 HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
1651 (expand_body): Let expand_stmt handle CTOR_INITIALIZER,
1652 RETURN_INIT and function try blocks.
1654 * cp-tree.h (language_function): Add x_eh_spec_try_block. Add
1655 x_scope_stmt_stack. Add x_in_charge_parm.
1656 (current_eh_spec_try_block): New macro.
1657 (current_scope_stmt_stack): Likewise.
1658 (current_in_charge_parm): Likewise.
1659 * decl.c (start_function): Initialize current_in_charge_parm.
1660 (finish_function): Use current_in_charge_parm rather than looking
1662 * search.c (expand_indirect_vtbls_init): Likewise.
1664 * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
1665 (TRY_BLOCK): Likewise.
1666 (HANDLER): Likewise.
1667 (START_CATCH_STMT): New tree node.
1668 (SCOPE_STMT): Likewise.
1669 * cp-tree.h (SCOPE_BEGIN_P): New macro.
1670 (SCOPE_NULLIFIED_P): Likewise.
1671 (struct lang_decl_flags): Add pending_inline_p. Adjust dummy.
1672 (struct lang_decl): Add saved_language_function.
1673 (DECL_PENDING_INLINE_INFO): Adjust documentation.
1674 (DECL_PENDING_INLINE_P): New macro.
1675 (TYPE_TI_ARGS): Fix typo in comment.
1676 (DECL_SAVED_TREE): Add to documentation.
1677 (DECL_SAVED_FUNCTION_DATA): New macro.
1678 (START_CATCH_TYPE): Likewise.
1679 (SCOPE_END_P): New macro.
1680 (declare_parm_level): Don't declare.
1681 * decl.c (mark_lang_function): New function, split out from
1682 mark_cp_function_context.
1683 (save_function_data): New function.
1684 (declare_parm_level): Remove.
1685 (finish_function): Use save_function_data to squirrel away
1686 important stuff for later use.
1687 (mark_cp_function_context): Use mark_function_data.
1688 (lang_mark_tree): Likewise.
1689 * lex.c (begin_definition_of_inclass_inline): Set
1690 DECL_PENDING_INLINE_P.
1691 (store_pending_inline): Clear it.
1692 * pt.c (tsubst_decl): Likewise.
1694 1999-09-17 Nathan Sidwell <nathan@acm.org>
1696 * call.c (perform_implicit_conversion): Deal with error_mark_node.
1698 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1700 * decl.c (warn_extern_redeclared_static): Don't get confused by
1701 static member functions.
1702 (duplicate_decls): Merge DECL_THIS_STATIC.
1704 * decl.c (expand_static_init): Make sure assignments to local
1705 statics actually occur.
1707 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1709 * cp-tree.h (poplevel_class): Declare.
1710 * class.c (popclass): Use poplevel_class, not poplevel.
1711 * decl.c (poplevel_class): Don't make it static. Don't return a
1713 (poplevel): Don't call poplevel_class; abort in a class
1714 binding level is seen.
1715 * semantics.c (finish_translation_unit): Use pop_everything.
1716 * parse.y (member_init): Allow errors.
1717 (pending_inline): Call finish_function.
1718 * parse.c: Regenerated.
1719 * Makefile.in (CONFLICTS): Adjust.
1721 1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
1723 * error.c: Reduce code duplication.
1724 (dump_template_value): New function.
1725 (dump_type_real): Use it.
1726 (dump_decl): Likewise.
1727 (dump_function_name): Likewise.
1728 (dump_function_decl): Don't be too talkative about function return
1731 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1733 * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
1735 * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
1737 1999-09-16 Jason Merrill <jason@yorick.cygnus.com>
1739 * decl2.c (finish_file): Also call check_global_declarations for
1740 the pending_statics list.
1742 1999-09-15 Jason Merrill <jason@yorick.cygnus.com>
1744 * lex.c (cp_pragma_implementation): Allow #pragma implementation
1747 1999-09-15 Richard Henderson <rth@cygnus.com>
1749 * lex.c (mark_impl_file_chain): Follow the next chain.
1751 1999-09-15 Mark Mitchell <mark@codesourcery.com>
1753 * decl.c (warn_extern_redeclared_static): Simplify. Catch
1754 problems with extern "C" functions redeclared as static.
1755 (duplicate_decls): When a builtin is redeclared static, make the
1756 new function have internal linkage.
1758 1999-09-15 Mark Mitchell <mark@codesourcery.com>
1760 * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
1761 * pt.c (tsubst_copy): Likewise.
1762 * tree.c (search_tree): Likewise.
1765 1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1767 * typeck2.c (ack): Don't declare progname.
1769 1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
1771 * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
1772 filenames with ggc_alloc_string.
1774 1999-09-14 Mark Mitchell <mark@codesourcery.com>
1776 * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
1778 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
1780 * cvt.c (build_up_reference): Likewise.
1781 * tree.c (build_cplus_new): Likewise.
1782 (get_target_expr): Likewise.
1784 Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org>
1786 * Makefile.in: Prepend $(SHELL) to move-if-change calls.
1788 1999-09-13 Mark Mitchell <mark@codesourcery.com>
1790 * cp-tree.h (build_target_expr): New function.
1791 * call.c (build_conditional_expr): Use build_target_expr.
1792 (convert_like): Likewise.
1793 (build_over_call): Likewise.
1794 * cvt.c (build_up_reference): Likewise.
1795 * decl.c (build_cleanup_on_safe_obstack): Fold into ...
1796 (destroy_local_var): Here.
1797 (build_target_expr): New function.
1798 * tree.c (build_cplus_new): Use it.
1799 (get_target_expr): Likewise.
1801 1999-09-13 Nathan Sidwell <nathan@acm.org>
1803 * typeck.c (expr_sizeof): Don't decay arrays and functions.
1804 Remove misleading comment.
1805 (build_compound_expr): Don't decay arrays.
1807 1999-09-13 Jason Merrill <jason@yorick.cygnus.com>
1809 * call.c (build_conditional_expr): Always use a TARGET_EXPR for
1810 class rvalues again.
1812 Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1814 * Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
1816 * g++spec.c: Include gcc.h.
1817 (lang_specific_driver): Constify a char*. Call xcalloc, not
1818 xmalloc/bzero. All calls to the function pointer parameter now
1819 explicitly call `fatal'.
1821 1999-09-12 Mark Mitchell <mark@codesourcery.com>
1823 * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
1824 * cvt.c (ocp_convert): Complete the from and destination types.
1825 Adjust warning about functions always being `true' in conditionals.
1826 * decl.c (duplicate_decls): Don't play funny games with abort.
1827 * error.c (dump_expr): Handle OVERLOADs.
1828 * spew.c (probe_obstack): Remove.
1829 * typeck.c (condition_conversion): Use perform_implicit_conversion.
1831 1999-09-12 Bernd Schmidt <bernds@cygnus.co.uk>
1833 * cp-tree.h (auto_function, define_function): Adjust prototypes.
1834 * decl.c (define_function): Lose FUNCTION_CODE arg. All callers
1836 (auto_function): Likewise, for CODE arg.
1837 Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
1838 (builtin_function): ... here.
1840 1999-09-11 Mark Mitchell <mark@codesourcery.com>
1842 * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
1843 (init_decl_processing): Don't set TREE_PERMANENT for the
1845 (start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
1846 (grokdeclarator): Likewise.
1847 (grokparms): Don't check TREE_PERMANENT when building up lists.
1848 * decl2.c (grokfield): Don't assert TREE_PERMANENT.
1849 (mark_inline_for_output): Likewise.
1850 * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
1851 * init.c (build_offset_ref): Don't check TREE_PERMANENT.
1852 * lex.c (check_newline): Don't check ggc_p; it is always one.
1853 * pt.c (process_template_parm): Don't check TREE_PERMANENT.
1854 * spew.c (yylex): Don't copy_node or probe_obstacks for
1855 non-permanent CONSTANTs and STRINGs.
1856 * tree.c (build_cplus_array_type_1): Don't fuss with
1857 TREE_PERMANENT on ARRAY_TYPEs.
1859 * cp-tree.def (CLEANUP_STMT): New node.
1860 * cp-tree.h (language_function): Add name_declared.
1861 (current_function_name_declared): New macro.
1862 (CLEANUP_DECL): New macro.
1863 (CLEANUP_EXPR): Likewise.
1864 (emit_local_var): Likewise.
1865 (finish_decl_cleanup): New function.
1866 * cvt.c (build_up_reference): Simplify.
1867 (ocp_convert): Remove dead code.
1868 * decl.c (start_decl): Remove call to add_decl_stmt.
1869 (grok_reference_init): Adjust, to handle bindings temporaries to
1870 references. Remove dead code.
1871 (initialize_local_var): Don't generate RTL for
1872 declarations here, or build cleanups here. Don't fuss with
1873 obstacks. Replace expand_start_target_temps calls with explicit
1874 setting of stms_are_full_exprs_p.
1875 (destroy_local_var): New function.
1876 (emit_local_var): Likewise.
1877 (cp_finish_decl): Use them, as appropriate.
1878 (start_function): Announce template functions.
1879 (store_parm_decls): Don't call declare_function_name here.
1880 (finish_stmt): Don't start emit base-initialization code when just
1881 building the statement-tree.
1882 * init.c (create_temporary_var): Move add_decl_stmt call ...
1883 (get_temp_regvar): Here.
1884 * pt.c (tsubst_expr): Make DECL_INITIAL look like what
1885 cp_finish_decl would expect. Don't call add_decl_stmt.
1886 * semantics.c (begin_compound_stmt): Call declare_function_name,
1888 (finish_decl_cleanup): New function.
1889 (expand_stmt): Use emit_local_var to output variables.
1890 (expand_body): Set current_funtion_name_declared.
1892 1999-09-10 Mark Mitchell <mark@codesourcery.com>
1894 * cp-tree.h (finish_cleanup_try_block): New function.
1895 * semantics.c (finish_cleanup_try_block): Add comment.
1897 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1899 * cp-tree.h: Delete declarations for all tree nodes now moved to
1901 * decl.c: Delete their definitions.
1902 (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
1903 FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
1905 (init_decl_processing): Call build_common_tree_nodes and
1906 build_common_tree_nodes_2 instead of building their nodes here.
1907 Don't add gc roots for them.
1909 1999-09-10 Mark Mitchell <mark@codesourcery.com>
1911 * cp-tree.h (language_function): Rename expanding_p to
1912 x_expanding_p. Rename named_label_uses to x_named_label_uses.
1913 (expanding_p): Adjust accordingly.
1914 (TREE_VIA_PRIVATE): Fix typo in comment.
1915 (DECL_REFERENCE_SLOT): Remove.
1916 (SET_DECL_REFERENCE_SLOT): Likewise.
1917 * decl.c (named_label_uses): Adjust. Remove chicken comment.
1918 (push_overloaded_decl): Don't truncate the chain of bindings when
1919 adding an overloaded function.
1920 (grok_reference_init): Don't use DECL_REFERENCE_SLOT.
1921 (initialize_local_var): Fix typo in comment.
1922 (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
1923 * decl2.c (start_objects): Make the fact that we are expanding
1924 the generated function right away explicit.
1925 (start_static_storage_duration_function): Likewise.
1926 (finish_file): Fix typo in comment.
1927 * init.c (build_vec_init): Correct bugs in handling cleanups.
1928 * semantics.c (maybe_convert_cond): New function.
1929 (FINISH_COND): Always store the condition, even if there's
1931 (finish_if_stmt_cond): Use maybe_convert_cond.
1932 (finish_while_stmt_cond): Likewise.
1933 (finish_do_stmt): Likewise.
1934 (finish_for_cond): Likewise.
1935 (expand_cond): Adjust.
1937 * cp-tree.h (FN_TRY_BLOCK_P): New macro.
1938 * init.c (perform_member_init): Remove obstack machinations.
1939 (expand_cleanup_for_base): Likewise.
1940 (finish_init_stmts): Mark the statement-expression as used.
1941 * method.c (emit_thunk): Use tree-generating functions, not
1943 (do_build_copy_constructor): Likewise.
1944 (do_build_assign_ref): Likewise.
1945 (synthesize_method): Likewise. Keep track of line numbers.
1946 * pt.c (tsubst_expr): Handle various kinds of try blocks.
1947 * semantics.c (expand_stmts): Remove.
1948 (begin_function_try_block): Set FN_TRY_BLOCK_P.
1949 (finish_function_try_block): Be careful rechaining
1950 function try blocks.
1951 (expand_stmt): Loop through all the statements at a given level.
1952 (exapnd_body): Be careful with line-numbers here too. Prepare for
1953 being called directly from the parser.
1955 * cp-tree.h (finish_function): Adjust prototype.
1956 * decl.c (finish_function): Return the function compiled.
1957 * pt.c (instantiate_decl): Don't play games with obstacks.
1958 * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
1959 (search_tree): Likewise.
1960 * typeck.c: Fix typo in comment.
1961 * typeck2.c (store_init_value): Add comment.
1963 * cp-tree.h (CPTI_ATEXIT): New macro.
1964 (atexit_node): Likewise.
1965 * decl.c (destroy_local_static): New function, broken out from ...
1966 (expand_static_init): Here.
1968 * rtti.c (get_tinfo_var): These should always be global
1969 (expand_si_desc): Use tree, not RTL, functions to generate code.
1970 (expand_class_desc): Likewise.
1971 (expand_ptr_desc): Likewise.
1972 (expand_attr_desc): Likewise.
1973 (expand_generic_desc): Likewise.
1974 (synthesize_tinfo_fn): Likewise.
1976 1999-09-09 Mark Mitchell <mark@codesourcery.com>
1978 * semantics.c (RECHAIN_STMTS): Remove `last' parameter.
1979 (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
1981 (RECHAIN_STMST_FROM_CHAIN): Likewise.
1983 * parse.y (simple_stmt): Fix typo in last change.
1985 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
1986 (STMT_IS_FULL_EXPR_P): Likewise.
1987 (STMT_LINENO_FOR_FN_P): Likewise.
1988 (prep_stmt): New function.
1989 (building_stmt_tree): Tweak for safety.
1990 * pt.c (tsubst_expr): Use prep_stmt throughout.
1991 (add_tree): Move it to semantics.c
1992 * semantics.c (add_tree): Move it here.
1993 (finish_expr_stmt_real): New function.
1994 (finish_expr_stmt): Use it.
1995 (finish_if_stmt_cond): Use FINISH_COND.
1996 (finish_while_stmt_cond): Likewise.
1997 (finish_for_cond): Likewise.
1998 (finish_stmt_tree): Tweak line-number handling.
1999 (prep_stmt): New function.
2000 (expand_stmt): Use it.
2002 * cp-tree.h (begin_switch_stmt): Adjust prototype.
2003 (finish_switch_cond): Likewise.
2004 * parse.y (simple_stmt): Adjust accordingly.
2005 * parse.c: Regenerated.
2006 * pt.c (tsubst_expr): Adjust accordingly.
2007 * semantics.c (expand_cond): New function.
2008 (FINISH_COND): New macro.
2009 (begin_switch_stmt): Build the SWITCH_STMT here.
2010 (finish_switch_stmt_cond): Not here.
2011 (expand_stmt): Adjust calls to begin_switch_stmt and
2012 finish_switch_cond. Use expand_cond throughout.
2014 * dump.c (dequeue_and_dump): Dump types for constants.
2015 Describe DECL_ARG_TYPE more intuitively.
2018 * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
2019 (lang_cleanup_tree): Remove.
2020 * lex.c (make_lang_type): Use ggc_alloc to allocate
2023 Reorganize per-function data.
2024 * cp-tree.h (saved_scope): Add function_decl, bindings.
2025 (language_function): Rename binding_level to bindings.
2026 (cp_function_chain): Use the current_function, not the
2027 outer_function_chain.
2028 (current_class_ptr): Make it work, even when there's no
2030 (current_class_ref): Likewise.
2031 (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
2033 (clear_temp_name): Remove.
2034 * decl.c (check_function_type): New function, broken out from
2036 (current_binding_level): Adjust definition.
2037 (pushlevel): Simplify.
2038 (poplevel): Don't use named_label_uses when we're outside
2040 (mark_saved_scope): Mark function_decl and bindings.
2041 (maybe_push_to_top_level): Don't unconditionally push a new
2042 function context. Save bindings and the current_function_decl.
2043 Don't clear named_labels.
2044 (pop_from_top_level): Pop function context if appropriate.
2045 (init_decl_processing): Set init_lang_status and free_lang_status,
2046 rather than save_lang_status and restore_lang_status.
2047 (start_function): Take SF_* flags. Don't clear per-function data.
2048 Reorder and simplify to use new per-function data code. Add
2050 (store_parm_decls): Don't call init_function_start here.
2051 (finish_function): Adjust for new handling of per-function data.
2052 (push_cp_function_context): Simplify.
2053 (mark_cp_function_context): Change binding_level to bindings.
2054 * decl2.c (clear_temp_name): Remove.
2055 (start_objects): Use SF flags to start_function.
2056 (start_static_storage_duration_function): Likewise.
2057 * except.c (start_anon_func): Remove redundant calls to
2058 push_function_context_to. Use SF flags to start function.
2059 (end_anon_func): Remove redundant call to pop_function_context
2061 * lex.c (reinit_parse_for_function): Don't initialize per-function
2063 * method.c (emit_thunk): Clear current_function after calling
2064 assemble_end_function. Use SF flags for start_function.
2065 (synthesize_method): Use SF flags for start_function.
2066 * parse.c: Regenerated.
2067 * parse.y (fn.defpen): Likewise.
2068 (pending_inline): Clear current_function, even if something goes
2070 * pt.c (instantiate_decl): Use SF flags to start_function.
2071 Don't save and restore expanding_p.
2072 (add_tree): Handle the case where we are outside any function.
2073 (end_tree): Likewise.
2074 * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
2075 * semantics.c (begin_function_definition): Likewise.
2076 (expand_body): Likewise.
2078 1999-09-09 Nathan Sidwell <nathan@acm.org>
2080 * cp-tree.h (convert_to_void): Prototype new function.
2081 (require_complete_type_in_void): Remove prototype.
2082 * cvt.c (convert_to_void): New function.
2083 (ocp_convert): Use convert_to_void.
2084 * decl.c (cplus_expand_expr_stmt): Likewise, for complete
2086 * typeck.c (require_complete_type_in_void): Remove function.
2087 (build_compound_expr): Use convert_to_void.
2088 (build_static_cast): Likewise.
2089 (build_c_cast): Likewise.
2090 * semantics.c (finish_expr_stmt): Do not decay full expressions.
2092 * typeck.c (build_x_compound_expr): Add FIXME.
2094 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2096 * cp-tree.h (scratch_tree_cons): Remove.
2097 * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
2098 and perm_tree_cons with plain tree_cons.
2099 * class.c: Likewise.
2101 * decl2.c: Likewise.
2102 * except.c: Likewise.
2106 * method.c: Likewise.
2107 * parse.y: Likewise.
2111 * search.c: Likewise.
2112 * typeck.c: Likewise.
2113 * parse.c: Regenerated.
2114 * tree.c (build_srcloc): Simplify.
2116 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2118 * cp-tree.h (lang_decl_flags): Remove permanent_attr.
2120 (LANG_DECL_PERMANENT): Remove.
2121 * decl.c (duplicate_decls): Don't mess about with obstacks trying
2123 (lang_mark_tree): Mark DECL_LANG_SPECIFIC.
2124 * lex.c (free_lang_decl_chain): Remove.
2125 (build_lang_decl): Don't use obstacks.
2126 (retrofit_lang_decl): Likewise.
2127 (copy_lang_decl): Likewise.
2129 * cp-tree.h (saved_scope): Remove old_binding_level and
2130 function_decl. Tidy up.
2131 * decl.c (mark_saved_scope): Don't set them.
2132 (maybe_push_to_top_level): Clear memory.
2134 * decl.c (layout_var_decl): Change prototype. Don't complete
2135 types for external objects.
2136 (check_initializer): Likewise. Tidy.
2137 (initialize_local_var): Complete types here.
2138 (cp_finish_decl): Not here. Reorganize a little.
2139 (grokvardecl): Don't complete types here.
2141 * decl.c (start_function): Clear last_dtor_insn and
2142 last_parm_cleanup_insn.
2143 (push_cp_function_context): Just copy over a little of
2144 the old context, not all of it.
2146 * cp-tree.h (copy_to_permanent): Remove.
2147 (permanent_p): Likewise.
2148 * decl.c (building_typename_type): Don't use copy_to_permanent.
2149 (start_decl): Likewise.
2150 (grok_reference_init): Likewise.
2151 (cp_finish_decl): Likewise.
2152 * init.c (build_new_1): Don't use mapcar.
2153 (build_vec_delete_1): Don't use copy_to_permanent.
2154 (build_vec_init): Likewise.
2155 * parse.y (primary): Likewise.
2156 * parse.c: Regenerated.
2157 * pt.c (push_template_decl_real): Don't use copy_to_permanent.
2158 (lookup_template_class): Likewise.
2159 (tsubst_friend_function): Likewise.
2160 (instantiate_class_template): Likewise.
2161 (tsubst_decl): Likewise.
2163 (instantiate_template): Likewise.
2165 * rtti.c (get_tinfo_fn): Likewise.
2166 (build_dynamic_cast): Likewise.
2167 * semantics.c (finish_if_stmt_cond): Likewise.
2168 (finish_while_stmt_cond): Likewise.
2169 (finish_do_stmt): Likewise.
2170 (finish_for_cond): Likewise.
2171 (finish_for_expr): Likewise.
2172 (finish_cleanup): Likewise.
2173 (add_decl_stmt): Likewise.
2174 (finish_named_return_value): Likewise.
2175 (finish_qualified_call_expr): Likewise.
2176 * tree.c (perm_manip): Remove.
2177 (build_exception_variant): Don't use copy_to_permanent.
2178 (permanent_p): Remove.
2179 (copy_to_permament): Remove.
2180 (build_min_nt): Don't use copy_to_permanent.
2181 (build_min): Likewise.
2182 (min_tree_cons): Likewise.
2183 * typeckc.c (build_static_cast): Likewise.
2184 (build_reinterpret_cast): Likewise.
2185 (build_const_cast): Likewise.
2187 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2189 * decl.c (ggc_p): Set it to 1.
2190 (mark_saved_scope): Add prototype.
2192 1999-09-07 Richard Henderson <rth@cygnus.com>
2194 * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
2195 * typeck.c (self_promoting_args_p): Delete.
2197 1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
2199 * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
2200 (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
2202 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2204 * Makefile.in (tree.o): Depend on ggc.h.
2205 * class.c (make_method_vec): Remove.
2206 (free_method_vec): Likewise.
2207 (free_method_vecs): Remove.
2208 (add_method): Don't use them.
2209 * cp-tree.def (PTRMEM_CST): Make it longer.
2210 (TEMPLATE_PARM_INDEX): Make it shorter.
2211 * cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
2212 (template_parm_index): Remove RTL field.
2213 (ptrmem_cst): Add RTL field.
2214 (finish_function): Removed parameter.
2215 (process_next_inline): Change prototype.
2216 (init_cplus_unsave): Rename to init_tree.
2217 (binding_init): Remove.
2218 * decl.c (free_binding_nodes): Remove.
2219 (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P.
2220 (pop_binding): Don't use free_binding_nodes.
2221 (free_binding_vecs): Remove.
2222 (store_bindings): Don't use them.
2223 (pop_from_top_level): Likewise.
2224 (lookup_namespace_name): Simplify.
2225 (build_typename_type): Don't use obstack_free.
2226 (unqualified_namespace_lookup): Simplify.
2227 (lookup_name_real): Simplify.
2228 (start_function): Remove comment about leaks.
2229 (finish_function): Removed nested parameter. Call
2230 expand_end_bindings even when building_stmt_tree.
2231 Call ggc_push_context and ggc_pop_context around
2232 rest_of_compilation, if necessary.
2233 (mark_cp_function_context): Handle a NULL language-context.
2234 (lang_mark_false_label_stack): Fix typo.
2235 (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
2236 TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on
2237 pointer to method types.
2238 (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
2239 * decl2.c (finish_objects): Adjust call to finish_function.
2240 (finish_static_store_duration_function): Likewise.
2241 (do_nonmember_using_decl): Remove call to binding_init.
2242 * except.c (end_anon_func): Adjust call to finish_function.
2243 * lex.c (mark_impl_file_chain): New function.
2244 (init_parse): Call init_tree, not init_cplus_unsave.
2246 (cp_pramga_interface): Use xmalloc, not permalloc.
2247 (cp_pragma_implementation): Likewise.
2248 (begin_definition_of_inclass_inline): Simplify.
2249 (process_next_inline): Adjust prototype.
2250 (do_scoped_id): Don't call binding_init.
2251 (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
2252 * method.c (emit_thunk): Adjust call to finish_function.
2253 (synthesize_method): Likewise.
2254 * parse.y (%union): Add a new `pi' variant.
2255 (PRE_PARSED_FUNCTION_DECL): Use it.
2256 (fn.defpen): Likewise.
2257 (fndef): Adjust call to finish_function.
2258 * pt.c (instantiate_decl): Likewise.
2259 * rtti.c (syntheisze_tinfo_fn): Likewise.
2260 * semantics.c (expand_body): Likewise.
2261 * tree.c: Include ggc.h.
2262 (mark_list_hash): New function.
2263 (binding_init): Remove.
2264 (init_cplus_unsave): Rename to ...
2265 (init_tree): This. Add GC roots.
2267 1999-09-05 Mark Mitchell <mark@codesourcery.com>
2269 Get ready for garbage collection.
2270 * Makefile.in (CXX_TREE_H): Add varray.h
2271 (lex.o): Depend on ggc.h.
2273 (decl2.o): Likewise.
2274 (method.o): Likewise.
2275 (search.o): Likewise.
2278 * class.c: Include ggc.h.
2279 (current_class_name): Remove.
2280 (current_class_type): Likewise.
2281 (current_access_specifier): Likewise.
2282 (previous_class_type): Likewise.
2283 (previous_class_values): Likewise.
2284 (class_cache_firstobj): Likewise.
2285 (current_lang_base): Likewise.
2286 (current_lang_stack): Likewise.
2287 (current_lang_stacksize): Likewise.
2288 (lang_name_c): Likewise.
2289 (lang_name_cplusplus): Likewise.
2290 (lang_name_java): Likewise.
2291 (current_lang_name): Likewise.
2292 (base_layout_decl): Likewise.
2293 (access_default_node): Likewise.
2294 (access_public_node): Likewise.
2295 (access_protected_node): Likewise.
2296 (access_private_node): Likewise.
2297 (access_default_virtual_node): Likewise.
2298 (access_public_virtual_node): Likewise.
2299 (access_protected_virtual_node): Likewise.
2300 (access_private_virtual_node): Likewise.
2301 (signed_zero_node): Likewise.
2302 (init_class_processing): Don't build base_layout_decl.
2303 (push_lang_context): Adjust now that current_lang_base is a varray.
2304 (pop_lang_context): Likewise.
2305 * cp-tree.h: Include varray.h.
2306 (cp_global_trees): Add access_default, access_public,
2307 access_protected, access_private, access_default_virtual,
2308 access_public_virtual, access_protected_virtual,
2309 access_private_virtual, ctor_identifier, delta2_identifier,
2310 delta_identifier, dtor_identifier, in_charge_identifier,
2311 index_identifier, nelts_identifier, this_identifier,
2312 pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
2313 lang_name_c, lang_name_cplusplus, lang_name_java,
2314 empty_except_spec, null, jclass, minus_one, terminate.
2315 (saved_scope): Move here from decl.c. Define globals in terms of
2316 saved_scope: current_namespace, current_class_name,
2317 current_class_type, current_access_specifier, current_lang_stack,
2318 current_lang_base, current_lang_name, current_function_parms,
2319 current_template_parms, processing_template_decl,
2320 processing_specialization, processing_explicit_instantiation,
2321 previous_class_type, previous_class_values, class_cache_firstobj.
2322 (scope_chain): New variable.
2323 (init_pt): New function.
2324 * decl.c (current_namespace): Remove.
2325 (this_identifier, in_charge_identifier, ctor_identifier): Likewise.
2326 (dtor_identifier, pfn_identifier, index_identifier): Likewise.
2327 (delta_identifier, delta2_identifier): Likewise.
2328 (pfn_or_delta2_identifier, tag_identifier): Likewise
2329 (vt_off_identifier, empty_except_spec, null_node): Likewise.
2330 (current_function_parms, current_lang_base): Remove.
2331 (current_lang_stack, previous_class_values): Remove.
2332 (class_binding_level): Macroize.
2333 (saved_scope): Remove.
2334 (current_saved_scope): Rename to scope_chain.
2335 (mark_saved_scope): Adjust for new scope structure.
2336 (maybe_push_to_top_level): Likewise.
2337 (pop_from_top_level): Likewise.
2338 (duplicate_decls): Adjust now that current_lang_base is a varray.
2339 (build_typename_type): Call ggc_add_tree_hash_table_root.
2340 (init_decl_processing): Call init_pt. Call push_to_top_level to
2341 set up globals. Add GC roots.
2342 (xref_basetypes): Adjust now that current_lang_base is a varray.
2343 * decl.h (this_identifier): Remove.
2344 (in_charge_identifier): Likewise.
2345 * decl2.c: Don't include varray.h.
2346 (current_namespace): Remove.
2347 (init_decl2): Add GC roots.
2348 * except.c (Terminate): Remove.
2349 (init_exception_processing): Use terminate_node instead.
2350 (build_terminate_handler): Likewise.
2351 * init.c (nc_nelts_field_id): Remove.
2352 (minus_one): Likewise.
2353 (init_init_processing): Use minus_one_node and nelts_identifier
2354 instead. Add GC roots.
2355 (jclass_node): Remove.
2356 (build_new_1): Use nelts_identifier.
2357 (build_vec_init): Likewise.
2358 (build_vec_delete): Likewise.
2359 * lex.c: Include ggc.h.
2360 (defarg_fn): Move declaration early.
2361 (defarg_parms): Likewise.
2362 (init_parse): Add GC roots.
2363 (handle_cp_pragma): Remove redundant declaration of
2365 * method.c: Include ggc.h.
2366 (btypelist): Make it a varray. All uses changed.
2367 (ktypelist): Likewise.
2368 (init_method): Add GC roots.
2369 * pt.c: Don't include varray.h. Include ggc.h.
2370 (current_template_parms): Remove.
2371 (processing_template_decl): Likewise.
2372 (processing_specialization): Likewise.
2373 (processing_explicit_instantiation): Likewise.
2374 (init_pt): New function.
2375 * repo.c: Include ggc.h.
2376 (init_repo): Add GC roots.
2377 * search.c: Don't include varray.h.
2378 (_vptr_name): Remove.
2379 (lookup_field_1): Use vtpr_identifier instead.
2380 (expand_indirect_vtbls_init): Remove redundant declaration of
2381 in_charge_identifier.
2382 (init_search_processing): Use vptr_identifier.
2384 1999-09-05 Richard Henderson <rth@cygnus.com>
2385 Bernd Schmidt <bernds@cygnus.co.uk>
2386 Mark Mitchell <mark@codesourcery.com>
2388 * Makefile.in (parse.o): Depend on ggc.h.
2389 (decl2.o): Depend on ggc.h.
2390 (init.o): Depend on ggc.h.
2391 * cp-tree.h (init_decl2): Declare.
2392 (cp_parse_init): Likewise.
2393 * decl.c (ggc_p): Define to zero.
2394 (mark_saved_scope): New function.
2395 (init_decl_processing): Call cp_parse_init, and cp_decl2.
2397 (expand_static_init): Add GC roots.
2398 * decl2.c: Include ggc.h.
2399 (init_decl2): New function.
2400 * init.c: Include ggc.h.
2401 (init_init_processing): Add GC roots.
2402 * parse.y: Include ggc.h.
2403 (cp_parse_init): New function.
2405 1999-09-04 Mark Mitchell <mark@codesourcery.com>
2407 * decl.c (init_decl_processing): Set mark_lang_status.
2408 (lang_mark_false_label_stack): Adjust prototype.
2409 * decl2.c (grok_function_init): Remove extraneous declaration of
2412 * Make-lang.in (cc1plus): Remove dependency on GGC.
2413 * Makefile.in (OBJS): Don't mention ggc-simple.o.
2414 (OBJDEPS): Don't mention ggc-simple.o.
2416 * Make-lang.in (cc1plus): Depend on $(GGC).
2417 * Makefile.in (OBJS): Add ggc-simple.o.
2418 (OBJDEPS): Likewise.
2419 * cp-tree.h (language_function): Rename members to `x_' versions;
2420 we now have x_named_labels, x_ctor_label, x_dtor_label,
2421 x_base_init_list, x_member_init_list, x_base_init_expr,
2422 x_current_class_ptr, x_current_class_ref, x_last_tree,
2423 x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
2425 (dtor_label, ctor_label, current_base_init_list,
2426 current_member_init_list, base_init_expr, current_class_ptr,
2427 current_class_ref, last_tree, last_expr_type): Adjust accordingly.
2428 * decl.c: Include ggc.h.
2429 (last_dtor_insn): Adjust to use x_ names.
2430 (last_parm_cleanup_insn): Likewise.
2431 (original_result_rtx): Likewise.
2432 (named_labels): Likewise.
2433 (mark_binding_level): New function.
2434 (mark_cp_function_context): Likewise.
2435 (mark_false_label_stack): Likewise.
2436 (lang_mark_tree): Likewise.
2437 (lang_cleanup_tree): Likewise.
2439 1999-09-03 Mark Mitchell <mark@codesourcery.com>
2441 * Makefile.in (CXX_TREE_H): Include function.h.
2442 (decl.o): Don't depend on function.h.
2443 (decl2.o): Likewise.
2444 (typeck.o): Likewise.
2446 (method.o): Likewise.
2447 * cp-tree.h: Include function.h.
2448 (cp_function): Rename to language_function. Remove next.
2449 (cp_function_chain): Make it a macro, not a variable.
2450 (push_cp_function_context): Don't declare.
2451 (pop_cp_function_context): Likewise.
2452 * decl.c: Don't include function.h.
2453 (push_cp_function_context): Make it static. Make it suitable for
2454 a save_lang_status callback.
2455 (pop_cp_function_context): Likewise.
2456 (maybe_push_to_top_level): Call push_function_context_to, not
2457 push_cp_function_context.
2458 (pop_from_top_level): Call pop_function_context_from, not
2459 pop_cp_function_context.
2460 (init_decl_processing): Set save_lang_status and
2461 restore_lang_status. Call push_function_context_to, not
2462 push_cp_function_context.
2463 (cp_function_chain): Remove.
2464 * decl2.c: Don't include function.h.
2465 * except.c: Don't include function.h.
2466 (start_anon_func): Call push_function_context_to, not
2467 push_cp_function_context.
2468 (end_anon_func): Call pop_function_context_from, not
2469 pop_cp_function_context.
2470 * init.c: Don't include function.h.
2471 * lex.c (begin_definition_of_inclass_inline): Call
2472 push_function_context_to, not push_cp_function_context.
2473 (process_next_inline): Call pop_function_context_from, not
2474 pop_cp_function_context.
2475 * method.c: Don't include function.h.
2476 (synthesize_method): Call push_function_context_to, not
2477 push_cp_function_context. Call pop_function_context_from, not
2478 pop_cp_function_context.
2479 * typeck.c: Don't include function.h.
2481 * decl.c (expand_static_init): Tweak handling of static
2482 initializations for objects without constructors.
2484 1999-09-03 Nathan Sidwell <nathan@acm.org>
2486 * typeck.c (build_indirect_ref): Reject dereference of pointer to
2489 1999-09-02 Mark Mitchell <mark@codesourcery.com>
2491 * cp-tree.h (cp_function): Move here, from decl.c.
2492 (cp_function_chain): Declare.
2493 (dtor_label): New macro, instead of variable.
2494 (ctor_label): Likewise.
2495 (current_base_init_list): Likewise.
2496 (current_member_init_list): Likewise.
2497 (base_init_expr): Likewise.
2498 (current_class_ptr): Likewise.
2499 (current_class_ref): Likewise.
2500 (last_tree): Likewise.
2501 (last_expr_type): Likewise.
2502 (current_function_returns_value): Likewise.
2503 (current_function_returns_null): Likewise.
2504 (current_function_just_assigned_this): Likewise.
2505 (current_function_parms_stored): Likewise.
2506 (temp_name_counter): Likewise.
2507 (static_labelno): Likewise.
2508 (expanding_p): Likewise.
2509 (stmts_are_full_exprs_p): Likewise.
2510 (in_function_try_handler): Likewise.
2511 (lang_type): Remove nested type_flags. All uses changed.
2512 * call.c (ctor_label): Remove.
2513 (dtor_label): Likewise.
2514 * class.c (current_class_ptr): Remove.
2515 (current_class_ref): Likewise.
2516 * decl.c (static_labelno): Remove.
2517 (dtor_label): Likewise.
2518 (last_dtor_insn): New macro, instead of variable.
2519 (last_parm_cleanup_insn): Likewise.
2520 (original_result_rtx): Likewise.
2521 (in_function_try_handler): Remove.
2522 (named_label_uses): New macro, instead of variable.
2523 (named_labels): Likewise.
2524 (current_function_returns_value): Remove.
2525 (current_function_returns_null): Likewise.
2526 (current_function_assigns_this): New macro, instead of variable.
2527 (current_function_just_assigned_this): Likewise.
2528 (current_binding_level): Likewise.
2529 (init_decl_processing): Call push_cp_function_context.
2530 (cp_function): Move to cp-tree.h
2531 (cp_function_chain): Make it global.
2532 (temp_name_counter): Remove.
2533 (push_cp_function_context): Simplify.
2534 (pop_cp_function_context): Likewise.
2535 * decl2.c (temp_name_counter): Remove.
2536 * init_c (current_base_init_list): Likewise.
2537 (current_member_init_list): Likewise.
2538 (base_init_expr): Likewise.
2539 * method.c (static_labelno): Likewise.
2540 * pt.c (last_tree): Likewise.
2541 * semantics.c (expanding_p): Likewise.
2542 (stmts_are_full_exprs_p): Likewise.
2543 (last_expr_type): Likewise.
2544 * typeck.c (dtor_label): Likewise.
2545 (ctor_label): Likewise.
2547 1999-09-01 Alex Samuel <samuel@codesourcery.com>
2549 * decl2.c (arg_assoc_template_arg): New prototype. New function.
2550 (arg_assoc_class): Use arg_assoc_template_arg for template
2552 (arg_assoc): Likewise.
2553 * pt.c (mangle_class_name_for_template): Allow member template
2556 1999-09-02 Nathan Sidwell <nathan@acm.org>
2558 * call.c (build_conditional_expr): Warn on enum mismatches.
2559 (convert_arg_to_ellipsis): Move non-pod check to after
2562 1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2564 * gxx.gperf (hash, is_reserved_word): Add prototypes.
2566 * init.c (build_vec_init): Initialize variable `try_block'.
2568 * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
2569 Likewise for bzero/memset.
2570 (token_getch, token_put_back): Add static prototypes. Remove
2571 `inline' from the definitions.
2572 (retrofit_lang_decl): Call memset, not bzero, to avoid casts.
2574 1999-09-01 Mark Mitchell <mark@codesourcery.com>
2576 * cp-tree.h (lang_type): Move align into type_flags.
2577 (CLASSTYPE_ALIGN): Adjust accordingly.
2578 * call.c (direct_reference_binding): Remove misleading comment.
2580 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2582 * parse.y (language_string): Constify.
2584 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2586 * repo.c (getpwd): Don't prototype.
2587 * xref.c (getpwd): Likewise
2589 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2591 * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
2592 Remove hacks for stuff which now comes from libiberty.
2594 1999-08-30 Jason Merrill <jason@yorick.cygnus.com>
2596 * cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
2598 1999-08-30 Mark Mitchell <mark@codesourcery.com>
2600 * cp-tree.h (begin_init_stmts): Declare.
2601 (finish_init_stmts): Likewise.
2602 * cvt.c (build_up_reference): Wrap the declaration of a temporary
2603 in a statement-expression so that we will see it when expanding
2604 tree structure later.
2605 * init.c (begin_init_stmts): Don't make it static.
2606 (finish_init_stmts): Likewise.
2608 * cp-tree.h (start_handler_parms): New function.
2609 (expand_start_catch_block): Take only one parameter.
2610 (start_handler_parms): New function.
2611 * decl.c (start_handler_parms): Define it.
2612 * except.c (process_start_catch_block): Take only one parameter.
2613 Don't call grokdeclarator here.
2614 (expand_start_catch_block): Don't call grokdeclarator here,
2616 * parse.y (handler_args): Adjust call to
2617 expand_start_catch_block. Use start_handler_parms.
2618 * pt.c (push_template_decl_real): Make permanent lists have
2620 (tsubst_expr): Adjust calls to expand_start_catch_block
2622 * semantics.c (expand_stmt): Likewise.
2624 1999-08-29 Alex Samuel <samuel@codesourcery.com>
2626 * pt.c (push_template_decl_real): Use template declaration from
2627 class type if it exists.
2629 1999-08-29 Mark Mitchell <mark@codesourcery.com>
2631 * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
2632 (maybe_inject_for_scope_var): Declare it.
2633 (initialize_local_var): Likewise.
2634 * decl.c (maybe_inject_for_scope_var): Make it global.
2635 (initialize_local_var): Likewise. Move cleanup handling here,
2636 from cp_finish_decl.
2637 (make_rtl_for_nonlocal_decl): Use
2638 push_obstacks_nochange/pop_obstacks, rather than
2639 end_temporary_allocation/resume_temporary_allocation.
2640 (cp_finish_decl): Try to complete the type of a variable when it
2641 is declared. Move cleanup-handling to initialize_local_var.
2642 (expand_static_init): Use tree-building code, rather than
2644 * decl2.c (get_temp_name): Assert non-initializedness of
2646 * init.c (create_temporary_var): Move RTL-assigning code to ...
2647 (get_temp_regvar): Here.
2648 * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here.
2649 * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just
2650 call initialize_local_var to generate initialization code.
2652 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2654 * cp-tree.h (fndecl_as_string, type_as_string,
2655 type_as_string_real, args_as_string, decl_as_string,
2656 expr_as_string, code_as_string, language_as_string,
2657 parm_as_string, op_as_string, assop_as_string, cv_as_string,
2658 lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
2660 * errfn.c (cp_printer): Likewise.
2662 * error.c (cp_printer, fndecl_as_string, type_as_string_real,
2663 type_as_string, expr_as_string, decl_as_string, lang_decl_name,
2664 cp_file_of, code_as_string, language_as_string, parm_as_string,
2665 op_as_string, assop_as_string, args_as_string, cv_as_string):
2668 * tree.c (lang_printable_name): Likewise.
2670 1999-08-28 Richard Henderson <rth@cygnus.com>
2672 * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
2674 1999-08-28 Mark Mitchell <mark@codesourcery.com>
2676 * cp-tree.h (strip_array_types): New function.
2677 * decl.c (maybe_deduce_size_from_array_init): New function, split
2678 out from cp_finish_decl.
2679 (layout_var_decl): Likewise.
2680 (maybe_commonize_var): Likewise.
2681 (maybe_inject_for_scope_var): Likewise.
2682 (initialize_local_var): Likewise.
2683 (build_cleanup_on_safe_obstack): Likewise.
2684 (check_initializer): Likewise.
2685 (make_rtl_for_nonlocal_decl): Likewise.
2686 (cp_finish_decl): Use them.
2687 * typeck.c (strip_array_types): New function.
2689 * cp-tree.def (LABEL_STMT): New tree node.
2690 * cp-tree.h (LABEL_STMT_LABEL): New macro.
2691 (shadow_label): Remove.
2692 (declare_local_label): New function.
2693 (finish_label_decl): Likewise.
2694 * decl.c (make_label_decl): New function, split out from
2696 (shadowed_labels): Remove.
2697 (binding_level): Add shadowed_labels.
2698 (clear_binding_level): Remove.
2699 (push_binding_level): Just bzero the new binding level.
2700 (pushlevel): Fix indentation.
2701 (pop_label): New function.
2702 (pop_labels): Likewise, split out from poplevel.
2703 (poplevel): Pop local labels. Use pop_labels.
2704 (maybe_push_to_top_level): Don't clear shadowed_labels.
2705 (lookup_label): Use make_label_decl.
2706 (shadow_label): Remove.
2707 (declare_local_label): New function.
2708 (define_label): Simplify.
2709 (start_function): Don't clear shadowed_labels.
2710 (cp_function): Remove shadowed_labels.
2711 (push_cp_function_context): Don't save shadowed_labels.
2712 (pop_cp_function_context): Don't restore it.
2713 * dump.c (dequeue_and_dump): Handle LABEL_STMT.
2714 * parse.y (label_decl): Use finish_label_decl.
2715 * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
2717 * semantics.c (finish_label_stmt): Add a LABEL_STMT when
2719 (finish_label_decl): New function.
2720 (expand_stmt): Handle LABEL_STMTs and local label declarations.
2722 1999-08-26 Mark Mitchell <mark@codesourcery.com>
2724 * decl.c (lookup_label): Build labels on the permanent obstack
2725 when building statement trees. Don't build RTL for labels when
2726 building statement trees.
2727 * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
2728 building statement trees.
2729 (finish_label_stmt): Likewise.
2730 (expand_stmt): Adjust accordingly.
2731 * pt.c (tsubst_expr); Likewise.
2732 (do_decl_instantiation): Robustify.
2734 * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
2735 * tree.c (build_cplus_new): Set it.
2736 * expr.c (cplus_expand_expr): Use it.
2737 * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
2739 * decl.c (store_parm_decls): Reset immediate_size_expand.
2740 (finish_function): Likewise.
2742 * tree.c (cplus_unsave_expr_now): Don't return a value.
2744 * semantics.c (do_poplevel): Always initialize the return value.
2746 1999-08-26 Gavin Romig-Koch <gavin@cygnus.com>
2748 * cp-tree.h (cplus_unsave_expr_now) : Correct return type.
2749 * tree.h (cplus_unsave_expr_now) : Same.
2751 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2753 * decl.c (grokdeclarator): Amend comment.
2754 * except.c (expand_start_catch_block): Call push_template_decl for
2755 catch-block parameters.
2756 * method.c (synthesize_method): Build an empty compound statement
2757 for the body of a constructor.
2759 1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
2761 * tree.c (cp_build_qualified_type_real): If we're asking for the
2762 same quals we already have, just return.
2764 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2766 * cp-tree.def (SUBOBJECT): New tree node.
2767 * cp-tree.h (CLEANUP_P): New macro.
2768 (SUBOBJECT_CLEANUP): Likewise.
2769 (keep_next_level): Add parameter.
2770 (get_temp_regvar): Don't declare.
2771 (emit_base_init): Remove parameter.
2772 (expand_aggr_init): Rename to build_aggr_init.
2773 (expand_vec_init): Rename to build_vec_init.
2774 (do_pushlevel): Remove.
2775 (do_poplevel): Likewise.
2776 (finish_cleanup): New function.
2777 (finish_subobject): Likewise.
2778 (stmts_are_full_exprs_p): New variable.
2779 * decl.c (keep_next_level): Add parameter.
2780 (cp_finish_decl): Use build_aggr_init, not
2781 expand_aggr_init. Use finish_expr_stmt to expand the code.
2782 (expand_static_init): Use tree-generating, not RTL-generating,
2783 functions to handle the initialization.
2784 (start_function): Remove dead code. Always have a momentary
2785 obstack inside the function, even before hitting the first curly
2787 (cplus_expand_expr_stmt): Move calls to
2788 expand_{start,end}_target_temps into semantics.c.
2789 (cp_function): Add stmts_are_full_exprs_p.
2790 (push_cp_function_context): Save it.
2791 (pop_cp_function_context): Restore it.
2792 * decl2.c (get_temp_regvar): Move to init.c.
2793 (do_static_initialization): Use build_{aggr,vec}_init.
2794 (do_static_destruction): Fix typo in comment.
2795 * dump.c (dequeue_and_dump): Handle INIT_EXPR.
2796 * except.c (expand_throw): Use create_temporary_var.
2797 * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
2798 * init.c (expand_vec_init_try_block): Remove.
2799 (expand_vec_init_catch_clause): Likewise.
2800 (get_temp_regvar): New function.
2801 (begin_init_stmts): Likewise.
2802 (finish_init_stmts): Likewise.
2803 (perform_member_init): Use build_{aggr,vec}_init. Build up tree
2805 (emit_base_init): Likewise. Remove unused parameter.
2806 (expand_virtual_init): Likewise.
2807 (expand_cleanup_for_base): Use finish_subobject.
2808 (expand_aggr_vbase_init_1): Simplify.
2809 (construct_virtual_bases): Use tree-generating functions to build
2811 (expand_aggr_init): Likewise. Rename to build_aggr_init.
2812 (expand_default_init): Likewise.
2813 (expand_aggr_init_1): Likewise.
2814 (expand_vec_init): Rename to build_vec_init.
2815 * method.c (do_build_copy_constructor): Use tree-generating
2816 functions. Don't call clear_last_expr.
2817 (do_build_assign_ref): Likewise.
2818 (synthesize_method): Call clear_last_expr here.
2819 * parse.y (base_init): Don't call clear_last_expr here.
2820 (nodecls): Likewise.
2821 * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
2822 * semantics.c (do_pushlevel): Move to here.
2823 (do_poplevel): Likewise.
2824 (stmts_are_full_exprs_p): New variable.
2825 (finish_expr_stmt): Handle logic for temoprary cleanup here.
2826 (finish_for_stmt): Use finish_expr_stmt.
2827 (finish_cleanup): New function.
2828 (finish_function_try_block): Fix indentation.
2829 (finish_subobject): New function.
2830 (setup_vtbl_ptr): Call keep_next_level here.
2831 (finish_stmt_expr): Handle a block with no scope inside the
2832 statement-expression.
2833 (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle
2835 * tree.c (search_tree): Handle INIT_EXPR.
2837 * typeck.c (build_modify_expr): Don't build an RTL_EXPR.
2838 * typeck2.c (store_init_value): Change expand_aggr_init to
2839 build_aggr_init in comment.
2841 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2843 * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
2845 1999-08-25 Nathan Sidwell <nathan@acm.org>
2847 * decl2.c (handle_class_head): Be graceful about additional
2848 scope qualifiers. Adjust comments to reflect reality.
2850 1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
2852 * call.c (build_conditional_expr): Fix typo.
2853 * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
2854 lvalue before trying to mess with the sides.
2856 * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
2858 Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
2860 * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
2862 1999-08-23 Jason Merrill <jason@yorick.cygnus.com>
2864 * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
2865 Return arbitrary pointer or NULL.
2866 (check_eh_spec): Call __throw_type_match_rtti_2.
2867 * tinfo.h (*::dcast): Return int. Add valp parm.
2868 * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers.
2869 * tinfo2.cc (__throw_type_match_rtti_2): Likewise.
2870 (__throw_type_match_rtti): Now just a wrapper.
2872 * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
2873 (init_exception_processing): Don't initialize them.
2875 1999-08-23 Paul Burchard <burchard@pobox.com>
2877 * decl.c (check_default_argument): Fix typo.
2879 1999-08-22 Mark Mitchell <mark@codesourcery.com>
2881 * cp-tree.def (STMT_EXPR): Fix typo in node name.
2883 * dump.c (dump_next_stmt): New function.
2884 (dequeue_and_dump): Use it.
2886 * pt.c (tsubst_copy): Make sure to initialize return value for a
2887 STMT_EXPR, even when processing_template_decl.
2888 * semantics.c (finish_stmt_expr): A statement-expression whose
2889 last statement is not an expression-statement has type `void'.
2891 1999-08-20 Mark Mitchell <mark@codesourcery.com>
2893 * semantics.c (finish_stmt_expr): Fix typo in comment.
2894 * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
2896 * init.c (build_vec_delete_1): Make the children of a permanent
2897 BIND_EXPR permanent.
2898 * pt.c (register_specialization): Don't register a specialization
2901 1999-08-18 Andrew Haley <aph@cygnus.com>
2903 * method.c (process_overload_item): Call build_mangled_C9x_name ()
2904 for all integer parameter types larger than long long.
2906 1999-08-19 Mark Mitchell <mark@codesourcery.com>
2908 * pt.c (redeclare_class_template): Merge default template
2909 arguments in both directions.
2911 * typeck.c (common_type): Undo 1999-08-18 change. Remove
2912 compiler_error message.
2914 1999-08-19 Jason Merrill <jason@yorick.cygnus.com>
2916 * cp-tree.h: Declare flag_use_repository.
2917 * pt.c (do_decl_instantiation): Don't complain about duplicate
2918 instantiation with -frepo.
2919 (do_type_instantiation): Likewise.
2921 * pt.c (push_template_decl_real): Complain about everything
2922 that isn't a valid template.
2924 * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
2927 1999-08-19 Mark Mitchell <mark@codesourcery.com>
2929 * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
2930 * decl2.c (build_expr_from_tree): Handle it.
2931 * error.c (dump_expr): Likewise.
2932 * pt.c (for_each_template_parm): Likewise.
2933 (tsubst_copy): Likewise.
2934 * tree.c (search_tree): Likewise.
2935 * semantics.c (finish_pseudo_destructor_call): Create it.
2937 1999-08-18 Mark Mitchell <mark@codesourcery.com>
2939 * search.c (setup_class_bindings): Robustify.
2940 * typeck.c (common_type): Use same_type_p, not pointer equality,
2943 * cp-tree.h (build_lang_field_decl): Remove.
2944 * class.c (build_vtable): Replace calls to build_lang_field_decl
2945 with build_lang_decl.
2946 (prepare_fresh_vtable): Likewise.
2947 (finish_struct_1): Likewise.
2948 (init_class_processing): Likewise.
2949 * decl.c (push_using_decl): Likewise.
2950 (init_decl_processsing): Likewise.
2951 (grokvardecl): Likewise.
2952 (build_ptrmemfunc_type): Likewise.
2953 (grokdeclarator): Likewise.
2954 (build_enumerator): Likewise.
2955 * decl2.c (grok_x_components): Likewise.
2956 (do_class_using_decl): Likewise.
2957 * except.c (call_eh_info): Likewise.
2958 * init.c (init_init_processing): Likewise.
2959 * rtti.c (expand_class_decl): Likewise.
2960 * tree.c (build_base_fields): Likewise.
2961 (build_vbase_pointer_fields): Likewise.
2962 * lex.c (build_lang_decl): Build declarations on the permanent
2963 obstack if we're building statmeent trees.
2964 (retrofit_lang_decl): Handle both the full lang_decl and also the
2965 smaller lang_decl_flags here.
2966 (build_lang_field_decl): Remove.
2967 * pt.c (push_template_decl_real): Issue errors for variable
2968 declarations that are not static members.
2970 1999-08-18 Richard Henderson <rth@cygnus.com>
2972 * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
2975 1999-08-17 Mark Mitchell <mark@codesourcery.com>
2977 * cp-tree.h (back_end_hook): New variable.
2978 * decl2.c (back_end_hook): Define it.
2979 (finish_file): If it's non-NULL, call it.
2981 * decl.c (add_decl_to_level): New function.
2982 (push_local_binding): Use it.
2983 (find_binding): Fix typo in comment.
2984 (pushdecl): Use add_decl_to_level. Put templates on the
2985 corresponding namespace-scope binding levels.
2986 * dump.c (dequeue_and_dump): Print the specializations of a
2988 * pt.c (push_template_decl_real): Don't push a template multiple
2991 1999-08-17 Mark Mitchell <mark@codesourcery.com>
2993 * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
2994 (CALL_DECLARATOR_QUALS): Likewise.
2995 (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
2996 * decl.c (grokdeclarator): Adjust to use them.
2997 * decl2.c (grokfield): Likewise.
2998 (reparse_absdcl_as_casts): Likewise.
2999 * lex.c (make_call_declarator): Likewise.
3000 (set_quals_and_spec): Likewise.
3001 * pt.c (tsubst): Likewise.
3002 * tree.c (mapcar): Remove special hack to handle third operand of
3005 1999-08-16 Mark Mitchell <mark@codesourcery.com>
3007 * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
3008 * class.c (build_vtable): Use build_lang_field_decl to build the
3009 VAR_DECLs for vtables.
3010 (prepare_fresh_vtable): Likewise.
3011 * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
3012 CAN_HAVE_FULL_LANG_DECL_P.
3013 (push_using_decl): Use build_lang_decl to build USING_DECLs.
3014 (grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
3015 * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
3016 (build_lang_field_decl): Likewise.
3017 (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
3020 * cp-tree.def (STMT_EXPR): New tree node.
3021 * cp-tree.h (STMT_EXPR_STMT): New macro.
3022 (store_return_init): Change prototype.
3023 (finish_named_return_value): New function.
3024 (expand_stmt): Likewise.
3025 (expand_body): Likewise.
3026 (begin_stmt_tree): Likewise.
3027 (finish_stmt_tree): Likewise.
3028 (expanding_p): New variable.
3029 (last_expr_type): Likewise.
3030 (building_stmt_tree): New macro.
3031 * decl.c (start_function): Use building_stmt_tree, not
3032 processing_template_decl, where appropriate.
3033 (store_parm_decls): Likewise.
3034 (store_return_init): Move most of the body to semantics.c.
3035 (finish_function): Use building_stmt_tree.
3036 (finish_stmt): Clear last_expr_type here.
3037 (cp_function): Add expanding_p, last_tree, last_expr_type.
3038 (push_cp_function_context): Save them.
3039 (pop_cp_function_context): Restore them.
3040 * decl2.c (setup_vtbl_ptr): Move to semantics.c.
3041 * error.c (dump_expr): Handle STMT_EXPR.
3042 * except.c (expand_start_catch_block): Use building_stmt_tree.
3044 * expr.c (cplus_expand_expr): Handle STMT_EXPR.
3045 (do_case): Move add_tree call to semantics.c.
3046 * parse.y (return_init): Use finish_named_return_value.
3047 (for.init.statement): Use finish_expr_stmt.
3048 * parse.c: Regenerated.
3049 * pt.c (do_pushlevel): Move to semantics.c.
3050 (do_poplevel): Likewise.
3051 (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
3052 (tsubst_expr): Don't expand all the way to RTL here. Handle
3053 RETURN_INIT and CTOR_INITIALIZER.
3054 (instantiate_decl): Call expand_body after tsubst'ing into
3056 * semantics.c (expand_stmts): New function.
3057 (expanding_p): New variable.
3058 (last_expr_type): Likewise.
3059 (finish_expr_stmt): Use building_stmt_tree.
3060 (begin_if_stmt): Likewise.
3061 (finish_if_stmt_cond): Likewise.
3062 (finish_then_clause): Likewise.
3063 (begin_else_clause): Likewise.
3064 (finish_else_clause): Likewise.
3065 (begin_while_stmt): Likewise.
3066 (finish_while_stmt_cond): Likewise.
3067 (finish_while_stmt): Likewise.
3068 (finish_do_body): Likewise.
3069 (finish_do_stmt): Likewise.
3070 (finish_return_stmt): Likewise.
3071 (begin_for_stmt): Likewise.
3072 (fnish_for_init_stmt): Likewise.
3073 (finish_for_cond): Likewise.
3074 (finish_for_expr): Likewise.
3075 (finish_for_stmt): Likewise.
3076 (finish_break_stmt): Likewise.
3077 (finish_continue_stmt): Likewise.
3078 (finish_switch_cond): Likewise.
3079 (finish_switch_stmt): Likewise.
3080 (finish_case_label): Call add_tree here if necessary.
3081 (finish_goto_statement): Use building_stmt_tree.
3082 (begin_try_block): Likewise.
3083 (begin_function_try_block): Likewise.
3084 (finish_try_block): Likewise.
3085 (finish_function_try_block): Likewise.
3086 (finish_handler_sequence): Likewise.
3087 (finish_function_handler_sequence): Likewise.
3088 (begin_handler): Likewise.
3089 (finish_handler_parms): Likewise.
3090 (finish_handler): Likewise.
3091 (begin_compound_stmt): Likewise.
3092 (finish_compound_stmt): Likewise.
3093 (finish_asm_stmt): Likewise.
3094 (finish_label_stmt): Likewise.
3095 (finish_named_return_value): New function.
3096 (setup_vtbl_ptr): Moved here from decl2.c.
3097 (do_pushlevel): Moved here from pt.c.
3098 (do_poplevel): Likewise.
3099 (begin_stmt_expr): Use building_stmt_tree.
3100 (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR,
3101 when building_stmt_tree.
3102 (begin_stmt_tree): New function.
3103 (finish_stmt_tree): Likewise.
3104 (expand_stmt): Likewise.
3105 (expand_body): Likewise.
3106 * tree.c (build_cplus_method_type): Make sure the argument types
3107 end up on the same obstack as the METHOD_TYPE.
3108 (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
3109 THROW_EXPR, STMT_EXPR.
3110 (mapcar): Break out common cases. Handle COMPOUND_EXPR,
3111 MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than
3112 sorry, if an unsupported node is encountered.
3113 * typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
3114 (c_expand_return): Don't call add_tree here.
3116 1999-08-15 Mark Mitchell <mark@codesourcery.com>
3118 * pt.c (check_default_tmpl_args): Don't check in local scopes.
3119 (tsubst_decl): Make sure the declaration is on a saveable
3120 obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
3122 (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
3124 1999-08-14 Jason Merrill <jason@yorick.cygnus.com>
3126 Speed up Koenig lookup.
3127 * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm
3128 to return namespaces we've looked at.
3129 * decl2.c (lookup_using_namespace): Likewise.
3130 (add_function): Don't call ovl_member.
3131 (lookup_arg_dependent): Initialize k.namespaces to the list of
3132 namespaces seen in unqualified lookup.
3133 * call.c (equal_functions): Move here from tree.c.
3134 (joust): Use it to handle duplicate candidates.
3135 * tree.c (ovl_member): Use ==.
3137 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3139 * cp-tree.def (DECL_STMT): Make it smaller.
3140 * cp-tree.h (lang_decl_flags): Move saved_tree to ...
3141 (lang_decl): ... here. Add next.
3142 (DECL_SAVED_TREE): Adjust accordingly.
3143 (DECL_IMPLICIT_TYPEDEF_P): New macro.
3144 (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
3145 (DECL_STMT_DECL): Likewise.
3146 (create_implicit_typedef): New function.
3147 (maybe_push_decl): Likewise.
3148 (tsubst_default_argument): New function.
3149 (at_function_scope_p): Likewise.
3150 (add_decl_stmt): Likewise.
3151 (push_permanent_obstack): Likewise.
3152 * call.c (convert_default_arg): Use tsubst_default_argument.
3153 * class.c (add_method): Use push_permanent_obstack.
3154 (build_self_reference): Create a TEMPLATE_DECL for the
3155 self-reference, if necessary.
3156 * decl.c (pseudo_global_level_p): Only look at the current binding
3158 (push_binding): Use push_permanent_obstack.
3159 (create_implicit_typedef): New function.
3161 (duplicate_decls): Use push_permanent_obstack.
3162 (maybe_push_decl): New function.
3163 (start_decl): Use it. Remove dead code. Use add_decl_stmt.
3164 (start_decl_1): Remove dead code.
3165 (cp_finish_decl): Remove DECL_STMT handling here. Don't use
3166 pseudo_global_level_p.
3167 (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
3169 (grokdeclarator): Likewise, for TYPE_DECLs. Don't use
3170 pseudo_global_level_p.
3171 * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
3173 (get_sentry): Use push_permanent_obstack.
3174 * dump.c (dequeue_and_dump): Enable DECL_STMT.
3175 * except.c (call_eh_info): Use push_permanent_obstack.
3176 (build_eh_type_ref): Likewise.
3177 (do_pop_exception): Likewise.
3178 (expand_eh_spec): Likewise.
3179 (alloc_eh_object): Likewise.
3180 (expand_throw): Likewise.
3181 * init.c (build_java_class_ref): Likewise.
3182 * lex.c (get_time_identifier): Likewise.
3183 (free_lang_decl_chain): Correct type.
3184 (retrofit_lang_decl): Adjust accordingly.
3185 (build_lang_field_decl): Likewise.
3186 * lex.h (free_lang_decl_chain): Likewise.
3187 * parse.y (lang_extdef): Don't use pseudo_global_level_p.
3188 * parse.c: Regenerated.
3189 * pt.c (tsubst_default_arguments): New function.
3190 (retrieve_local_specialization): Likewise.
3191 (register_local_specialization): Likewise.
3192 (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use
3193 pseudo_global_level_p to determine whether or not a template is
3195 (lookup_template_class): Likewise. Use create_implicit_typedef.
3196 (instantiate_class_template): Call tsubst_default_arguments for
3197 member functions, if appropriate.
3198 (tsubst_default_argument): New function.
3199 (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs.
3200 * search.c (at_function_scope_p): New function.
3201 * semantics.c (finish_asm_stmt): Use push_permanent_obstack.
3202 (finish_label_stmt): Likewise.
3203 (add_decl_stmt): New function.
3204 (begin_class_definition): Likewise.
3205 (finish_typeof): Likewise.
3206 * tree.c (copy_template_template_parm): Likewise.
3207 (copy_to_permanent): Likewise.
3208 (push_permanent_obstack): Define.
3209 (mark_addressable): Use it.
3210 * typeck.c (mark_addressable): Likewise.
3212 1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
3214 * cp-tree.h (init_cplus_unsave): New.
3215 (cplus_unsave_expr_now): New.
3216 * lex.c (init_parse): Call init_cplus_unsave.
3217 * tree.c (init_cplus_unsave): New.
3218 (cplus_unsave_expr_now): New.
3220 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3222 * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and
3223 decl_constant_value to simplify array bounds.
3225 1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
3227 * lang-options.h: Add -fms-extensions.
3228 * cp-tree.h: Declare flag_ms_extensions.
3229 * decl2.c: Define it.
3230 * class.c (instantiate_type): Don't complain about taking the address
3231 of a bound member function if -fms-extensions.
3232 * typeck.c (build_unary_op): Likewise.
3233 * decl.c (grokdeclarator): Or about implicit int.
3234 * init.c (resolve_offset_ref): Or about implicit '&'.
3236 1999-08-11 Mark Mitchell <mark@codesourcery.com>
3238 * cp-tree.h (minimal_parse_mode): Remove.
3239 (finish_label_stmt): New function.
3240 * decl.c (saved_scope): Remove minimal parse mode.
3241 (maybe_push_to_top_level): Don't save it.
3242 (pop_from_top_level): Don't restore it.
3243 (define_label): Split out template-handling code to semantics.c.
3244 (start_decl): Don't use minimal_parse_mode.
3245 (cp_finish_decl): Likewise.
3246 (start_function): Don't increment it.
3247 (store_return_init): Don't use it.
3248 (finish_function): Don't decrement it.
3249 * parse.y (label_colon): Use finish_label_stmt throughout.
3250 * parse.c: Regenerated.
3251 * pt.c (minimal_parse_mode): Don't define it.
3252 (tsubst_expr): Use finish_label_stmt.
3253 * semantics.c (finish_label_stmt): New function.
3255 * dump.c (queue): Be careful when computing bitmasks.
3256 (dequeue_and_dump): Describe binfos as binfos, not as
3259 * parse.y (pedantic): Give it itype. Adjust usage accordingly
3261 * parse.c: Regenerated.
3263 * Make-lang.in (CXX_SRCS): Remove sig.c.
3264 * Makefile.in (CXX_OBJS): Remove sig.o.
3266 * cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
3267 (CPTI_SIGNATURE_TYPE): Likewise.
3268 (CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
3269 (opaque_type_node): Likewise.
3270 (signature_type_node): Likewise.
3271 (sigtable_entry_type): Likewise.
3272 (flag_handle_signatures): Likewise.
3273 (lang_type): Remove is_signature, is_signature_pointer,
3274 is_signature_reference, has_opaque_typedecls,
3275 sigtables_has_been_generated. Adjust dummy. Remove signature,
3276 signature_pointer_to, signature_reference_to.
3277 (IS_SIGNATURE): Remove.
3278 (SET_SIGNATURE): Remove.
3279 (CLEAR_SIGNATURE): Remove.
3280 (IS_SIGNATURE_POINTER): Remove.
3281 (IS_SIGNATURE_REFERENCE): Remove.
3282 (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
3283 (SIGTABLE_HAS_BEEN_GENERATED): Remove.
3284 (CLASSTYPE_SIGNATURE): Remove.
3285 (SIGNATURE_TYPE): Remove.
3286 (SIGNATURE_METHOD_VEC): Remove.
3287 (SIGNATURE_POINTER_TO): Remove.
3288 (SIGNATURE_REFERENCE_TO): Remove.
3289 (lang_decl_flags): Remove is_default_implementation. Rename
3290 memfunc_pointer_to to saved_tree.
3291 (IS_DEFAULT_IMPLEMENTATION): Remove.
3292 (DECL_MEMFUNC_POINTER_TO): Remove.
3293 (DECL_MEMFUNC_POINTING_TO): Remove.
3294 (DECL_SAVED_TREE): Adjust definition.
3295 (tag_types): Remove signature_type_node.
3296 (SIGNATURE_FIELD_NAME): Remove.
3297 (SIGNATURE_FIELD_NAME_FORMAT): Likewise.
3298 (SIGNATURE_OPTR_NAME): Likewise.
3299 (SIGNATURE_SPTR_NAME): Likewise.
3300 (SIGNATURE_POINTER_NAME): Likewise.
3301 (SIGNATURE_POINTER_NAME_FORMAT): Likewise.
3302 (SIGNATURE_REFERENCE_NAME): Likewise.
3303 (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
3304 (SIGTABLE_PTR_TYPE): Likewise.
3305 (SIGTABLE_NAME_FORMAT): Likewise.
3306 (SIGTABLE_NAME_FORMAT_LONG): Likewise.
3307 (SIGTABLE_TAG_NAME): Likewise.
3308 (SIGTABLE_VB_OFF_NAME): Likewise.
3309 (SIGTABLE_VT_OFF_NAME): Likewise.
3310 (finish_base_specifiers): Change prototype.
3311 (build_signature_pointer_type): Remove.
3312 (build_signature_reference_type): Remove.
3313 (build_signature_pointer_constructor): Remove.
3314 (build_signature_method_call): Remove.
3315 (build_optr_ref): Likewise.
3316 (append_signature_fields): Likewise.
3317 (signature_error): Likewise.
3318 * call.c (build_this): Remove signature support.
3319 (build_over_call): Likewise.
3320 (build_new_method_call): Likewise.
3321 * class.c (add_implicitly_declared_members): Likewise.
3322 (finish_struct_1): Likewise.
3323 (finish_struct): Likewise.
3324 * cvt.c (cp_convert_to_pointer): Likewise.
3325 (convert_to_pointer_force): Likewise.
3326 (ocp_convert): Likewise.
3327 * decl.c (sigtable_decl_p): Remove.
3328 (init_decl_processing): Remove support for signatures.
3329 (cp_finish_decl): Likewise.
3330 (grokdeclarator): Likewise.
3331 (grokparms): Likewise.
3332 (xref_tag): Likewise.
3333 (start_function): Likewise.
3334 (start_method): Likewise.
3335 * decl2.c (finish_sigtable_vardecl): Remove.
3336 (flag_handle_signatures): Remove.
3337 (lang_f_options): Remove handle-signatures.
3338 (grokfield): Remove support for signatures.
3339 (grokbitfield): Likewise.
3340 (finish_file): Likewise.
3341 (reparse_absdcl_as_casts): Likewise.
3342 * error.c (dump_type_real): Likewise.
3343 (dump_function_decl): Likewise.
3344 * friend.c (make_friend_class): Likewise.
3345 * gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
3346 * hash.h: Regenerated.
3347 * init.c (build_new_1): Remove support for signatures.
3348 * lang-options.h: Remove -fhandle-signatures,
3349 -fno-handle-signatures.
3350 * lex.c (init_parse): Remove support for signatures.
3351 (yyprint): Likewise.
3352 * lex.h (rid): Remove RID_SIGNATURE.
3353 * method.c (build_decl_overload_real): Remove support for
3355 (hack_identifier): Likewise.
3356 * parse.y (base_class): Likewise.
3357 (base_class.1): Likewise.
3358 (access_specifier): Likewise.
3359 * search.c (lookup_member): Likewise.
3360 * semantics.c (finish_qualified_object_call_expr): Likewise.
3361 (finish_template_type_parm): Likewise.
3362 (begin_class_definition): Likewise.
3363 (finish_base_specifier): Likewise.
3365 * tree.c (build_cplus_method_type): Remove support for signatures.
3366 * typeck.c (require_complete_type): Likewise.
3367 (c_sizeof): Likewise.
3368 (c_alignof): Likewise.
3369 (build_object_ref): Likewise.
3370 (build_component_ref): Likewise.
3371 (build_indirect_ref): Likewise.
3372 (build_c_cast): Likewise.
3373 (build_modify_expr): Likewise.
3374 (convert_for_initialization): Likewise.
3375 * typeck2.c (signature_error): Remove.
3376 (store_init_value): Remove support for signatures.
3377 (digest_init): Likewise.
3378 (build_x_arrow): Likewise.
3379 (build_functional_cast): Likewise.
3380 * xref.c (GNU_xref_decl): Likewise.
3382 1999-08-10 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3384 * lex.c (do_identifier): Remove unnecessary lookup of class field.
3386 1999-08-09 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3388 * decl2.c (set_decl_namespace): Do not complain about non-matching
3389 decls if processing a template.
3391 1999-08-09 Mark Mitchell <mark@codesourcery.com>
3393 * decl.c (build_ptrmemfunc_type): Handle qualified
3394 pointer-to-member types here.
3395 * tree.c (cp_build_qualified_type_real): Simplify handling here.
3397 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3399 * lex.c (lang_identify): Likewise.
3401 1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
3403 * Makefile.in: Update dependencies.
3404 * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
3406 * decl.c: Include "function.h"
3407 (cleanup_label, return_label): Delete declarations.
3408 (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX.
3409 (finish_function): Rename last_parm_insn variable to
3410 fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX.
3411 * decl2.c: Include "function.h".
3412 (rtl_expr_chain): Delete declaration.
3413 * method.c: Include "function.h"
3414 * tree.c (build_vbase_pointer_fields): Don't initialize
3415 DECL_SAVED_INSNS with NULL_RTX.
3416 * typeck.c: Include "function.h"
3418 1999-08-09 Jason Merrill <jason@yorick.cygnus.com>
3420 * semantics.c (begin_function_try_block, finish_function_try_block,
3421 finish_function_handler_sequence): New fns.
3422 * parse.y (function_try_block): Use them.
3423 * pt.c (instantiate_decl): Likewise.
3425 * cp-tree.h: Declare in_function_try_handler.
3426 * decl.c: Define it.
3427 (start_function): Clear it.
3428 (struct cp_function, push_cp_function_context): Save it.
3429 (pop_cp_function_context): Restore it.
3430 * parse.y (function_try_block): Set and clear it.
3431 * except.c (expand_end_catch_block): Rethrow if we reach the end
3432 of a function-try-block handler in a ctor or dtor.
3433 * typeck.c (c_expand_return): Complain about returning from a
3434 function-try-block handler of a ctor.
3436 * parse.y (function_try_block): Call end_protect_partials
3437 before expand_start_all_catch.
3439 1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
3441 * decl.c (struct binding_level): Add eh_region field.
3442 (push_binding_level): Set it.
3443 (define_label): Complain about jumping into an EH block.
3445 * ptree.c (print_lang_type): Print the real type of a PMF.
3446 Print what exceptions a fn type throws.
3448 1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3450 * class.c (count_fields, add_fields_to_vec): Add static prototype.
3452 * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
3453 get_id_2, composite_pointer_type, dump_node_to_file): Constify a
3456 * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
3459 * decl2.c (finish_static_data_member_decl, grokfield): Constify a
3462 * dump.c (queue_and_dump_index, dump_int, dump_string,
3463 dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
3465 (dump_stmt): Add static prototype.
3467 * errfn.c (cp_thing): Constify a char*.
3469 * error.c (dump_unary_op, dump_binary_op, aggr_variety,
3470 dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
3471 dump_expr): Constify a char*.
3473 * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
3474 read_line_number): Add static prototype.
3475 (opname_tab, assignop_tab, operator_name_string): Constify a char*.
3476 (real_yylex): Move label `letter' into the scope where it is used.
3478 * method.c (build_mangled_template_parm_index, build_overload_int,
3479 build_decl_overload_real, get_id_2): Constify a char*.
3481 * search.c (check_final_overrider): Make static.
3483 * typeck.c (composite_pointer_type): Constify a char*.
3485 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
3487 * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
3488 we're looking at a class.
3490 * decl.c (lookup_name_real): Set the complain flag if we're
3491 looking for a namespace member.
3493 * lex.c (real_yylex): We can have a number with no digits.
3495 * cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
3497 * search.c (binfo_from_vbase): New fn.
3498 * cp-tree.h: Declare it.
3499 * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
3500 from pointer to member of virtual base.
3501 * typeck.c (get_delta_difference): Likewise.
3503 1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
3505 * pt.c (tsubst): Use build_index_type to build in-template array
3506 index type. Fixes g++.oliva/dwarf1.C.
3507 * decl.c (grokdeclarator): Likewise, just for consistency, as it
3508 doesn't seem to trigger the bug without it.
3510 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
3512 * typeck2.c (add_exception_specifier): Use complete_type.
3514 1999-08-06 Mark Mitchell <mark@codesourcery.com>
3516 * error.c (dump_expr): Handle EXACT_DIV_EXPR.
3517 (dump_binary_op): Bulletproof.
3518 * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
3519 * tree.c (search_tree): Don't enumerate all the nodes of classes
3520 `1', `2', and `<'; handle them generically. Don't be sorry about
3521 "unrecognized tree codes"; just abort.
3522 (no_linkage_check): Don't do linkage checks for templates.
3524 * tree.c (cp_build_qualified_type_real): Handle
3525 pointer-to-member-function types correctly.
3527 1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
3529 * decl.c (pushdecl): Only give an error for shadowing a parm
3530 from *this* function.
3532 Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
3534 * typeck2.c: Update URLs and mail addresses.
3536 1999-08-04 Nathan Sidwell <nathan@acm.org>
3538 * cp-tree.h (empty_except_spec): New global var.
3539 (compexcepttypes): Remove prototype.
3540 (comp_except_specs): Prototype new global function.
3541 (add_exception_specifier): Prototype new global function.
3542 * decl.c (empty_except_spec): Define new global var.
3543 (duplicate_decls): Use comp_except_specs, reword error message.
3544 (init_decl_processing): Initialize empty_except_spec.
3545 Adjust build_exception_variant calls.
3546 * parse.y (exception_specification_opt): Use empty_except_spec.
3547 (ansi_raise_identifier): Call check_for_new_type.
3548 (ansi_raise_identifiers): Use add_exception_specifier.
3549 * pt.c (tsubst): Use add_exception_specifier to build exception
3551 * search.c (check_final_overrider): New static function, broken
3552 out of get_matching_virtual. Check throw specifiers, reword
3554 (get_matching_virtual): Use check_final_overrider.
3555 * tree.c (build_exception_variant): Use comp_except_specs.
3556 * typeck.c (compexcepttypes): Remove.
3557 (comp_except_types): New static function, helper for
3558 comp_except_specs. Compare two types as exception specifiers.
3559 (comp_except_specs): New global function, compare two exception
3561 (comptypes): Adjust for comp_except_specs.
3562 * typeck2.c (add_exception_specifier): New global function.
3564 * class.c (check_for_override): Reword error message.
3566 1999-08-03 Nathan Sidwell <nathan@acm.org>
3568 * call.c (convert_arg_to_ellipsis): Use pod_type_p.
3569 * cp-tree.h (struct lang_type): Added non_pod_class flag.
3570 (CLASSTYPE_NON_POD_P): New macro to access it.
3571 * class.c (finish_struct_1): Determine non-PODness.
3572 Check for arrays of pointers (-Weffc++).
3573 Remove array inspection duplicated code.
3574 * tree.c (pod_type_p): Detect non-pod non-aggregate types.
3575 Use CLASSTYPE_NON_POD_P.
3577 1999-08-03 Nathan Sidwell <nathan@acm.org>
3579 * class.c (duplicate_tag_error): Preserve template information.
3581 1999-08-03 Nathan Sidwell <nathan@acm.org>
3583 * decl.c (start_enum): Show location of previous definition.
3584 * parse.y (enumlist_opt): New reduction.
3585 (structsp): Simplify enum rules to use enumlist_opt.
3587 1999-08-03 Jason Merrill <jason@yorick.cygnus.com>
3589 * lex.c (yyprint): Handle PFUNCNAME.
3591 * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
3592 build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
3594 1999-08-03 Mumit Khan <khan@xraylith.wisc.edu>
3596 * decl.c (start_decl): Set attributes before duplicate_decls call.
3598 1999-08-02 Mark Mitchell <mark@codesourcery.com>
3600 * Make-lang.in (CXX_SRCS): Add dump.c.
3601 * Makefile.in (CXX_OBJS): Add dump.o.
3602 (dump.o): New target.
3603 * cp-tree.h (DECL_CONV_FN_P): Document.
3604 (DECL_OVERLOADED_OPERATOR_P): New function.
3605 (TYPE_PTRMEM_CLASS_TYPE): New macro.
3606 (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
3607 (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
3608 (ASM_VOLATILE_P): New macro.
3609 (STMT_LINENO): Likewise.
3610 (cp_namespace_decls): New function.
3611 (dump_node_to_file): New function.
3612 * decl.c (cp_namespace_decls): New function.
3613 (walk_namespaces_r): Use it.
3614 (wrapup_globals_for_namespace): Likewise.
3615 * decl2.c (flag_dump_translation_unit): New variable.
3616 (lang_decode_option): Handle -fdump-translation-unit.
3617 (finish_file): If flag_dump_translation_unit is set, dump the
3620 * lang-options.h: Add -fdump-translation-unit.
3621 * pt.c (tsubst_template_parms): Robustify.
3622 (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
3623 (tsubst_expr): Use STMT_LINENO.
3624 * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
3625 for invalid cv-qualifiers even while building templates.
3627 1999-08-02 Richard Henderson <rth@cygnus.com>
3629 * call.c: Include defaults.h instead of expr.h.
3632 * typeck.c: Include defaults.h.
3634 1999-08-02 Mark Mitchell <mark@codesourcery.com>
3636 * lex.c (errorcount, sorrycount): Don't declare.
3637 * repo.c (errorcount, sorrycount): Likewise.
3638 * typeck2.c (errorcount, sorrycount): Likewise.
3640 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
3642 * call.c (convert_default_arg, build_over_call): Change all uses of
3643 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
3644 Ensure expr.h is included.
3645 * decl.c (grokparams): Ditto.
3646 * pt.c (tsubst_decl): Ditto.
3647 * typeck.c (convert_arguments): Ditto.
3649 1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
3651 * class.c (mark_overriders): Fix order of args to overrides.
3652 (warn_hidden): Likewise. Fix for having virtual and non-virtual
3653 functions with the same name.
3655 1999-08-02 Richard Henderson <rth@cygnus.com>
3657 * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
3659 1999-08-01 Mark Mitchell <mark@codesourcery.com>
3661 * call.c (build_conditional_expr): Fix typo in comment.
3663 1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
3665 * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
3666 case_stack; use in_control_zone_p.
3667 * typeck.c (c_expand_return): Likewise.
3669 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
3671 * except.c (catch_clauses): Delete declaration.
3673 1999-07-30 Mark Mitchell <mark@codesourcery.com>
3675 * call.c (build_conditional_expr): Call convert_from_reference to
3676 avoid reference/non-reference type confusion. Fix typo.
3678 1999-07-30 Richard Henderson <rth@cygnus.com>
3680 * typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
3681 * cp-tree.h (initializer_constant_valid_p): Remove.
3683 1999-07-28 Mark Mitchell <mark@codesourcery.com>
3685 * call.c (conditional_conversion): Don't build BASE_CONVs for
3686 conversions between things that have the same type.
3687 (build_conditional_expr): Tweak.
3688 (convert_like): Some BASE_CONVs really do require the generation
3691 * init.c (perform_member_init): Don't go through build_modify_expr
3692 for simple initializations.
3694 1999-07-27 Jason Merrill <jason@yorick.cygnus.com>
3696 * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
3697 * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
3698 virtual functions and MI. Simplify.
3700 * method.c: Remove prototype for largest_union_member.
3701 * pt.c (determine_specialization): Fix uninitialized warning.
3702 * lex.c (real_yylex): Likewise.
3704 1999-07-27 Mark Mitchell <mark@codesourcery.com>
3706 * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
3709 * cp-tree.h (BINFO_VIRTUALS): Document new format.
3710 * class.c (modify_one_vtable): Change prototype accordingly.
3711 (modify_all_vtables): Likewise.
3712 (modify_all_direct_vtables): Likewise.
3713 (modify_all_indirect_vtables): Likewise.
3714 (build_vtable_entry_for_fn): New function.
3715 (set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
3716 (modify_vtable_entry): Likewise.
3717 (add_virtual_function): Likewise.
3718 (build_vtbl_initializer): New function.
3719 (finish_vtbls): Simplify for new BINFO_VIRTUALS format.
3720 (fixup_vtable_deltas1): Likewise.
3721 (fixup_vtable_deltas): Likewise.
3722 (override_one_vtable): Likewise.
3723 (finish_struct_1): Likewise.
3725 * error.c (dump_expr): Likewise.
3726 * search.c (get_abstract_virtuals_1): Likewise.
3727 (get_abstract_virtuals): Likewise.
3728 (expand_upcast_fixups): Likewise.
3729 * tree.c (debug_binfo): Likewise.
3730 * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
3731 __pure_virtual here.
3733 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3735 * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
3736 as per 1999-07-26 change.
3738 * typeck.c (c_sizeof): Don't allow non-static data members.
3739 (expr_sizeof): Likewise.
3741 1999-07-26 Jason Merrill <jason@yorick.cygnus.com>
3743 * input.c (feed_input): Only touch lineno and input_filename
3744 if !USE_CPPLIB. Save the old values before setting the new ones.
3746 * input.c (feed_input): Add file, line parms.
3747 * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
3748 (real_yylex): Check linemode before input_redirected().
3750 * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
3751 from op new to warning.
3753 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3755 * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
3756 * call.c: All uses changed.
3757 * typeck.c: Likewise.
3759 1999-07-26 Nathan Sidwell <nathan@acm.org>
3761 * exception.cc (__cplus_type_matcher): Match __eh_matcher
3764 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3766 * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
3767 (ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
3768 (strip_top_quals): Declare.
3769 (ncp_convert): Likewise.
3770 (type_after_usual_arithmetic_converions): Likewise.
3771 (composite_pointer_type): Likewise.
3772 * call.c (strip_top_quals): Don't make it static.
3773 (promoted_arithmetic_type_p): New function.
3774 (conditional_conversion): Likewise.
3775 (null_ptr_cst_p): Allow `false' as a NULL pointer constant.
3776 (standard_conversion): Use same_type_p. Don't build BASE_CONVs
3777 for converting a type to itself.
3778 (reference_binding): Honor LOOKUP_NO_TEMP_BIND.
3779 (implicit_conversion): Make sure the from and to types are
3781 (add_builtin_candidate): Correct handling of ?: operator.
3782 (add_builtin_candidates): Improve documentation.
3783 (build_conditional_expr): New function.
3784 (can_convert): Implement in terms of can_convert_arg.
3785 (ncp_convert): New function.
3786 * typeck.c (type_after_usual_arithmetic_conversions): New
3787 function, split out from common_type.
3788 (composite_pointer_type): New function, split out from
3789 build_conditional_expr.
3790 (common_type): Use type_after_usual_arithmetic_conversions.
3791 Remove redundant attribute merging.
3792 (comptypes): Tidy. Handle COMPLEX_TYPE.
3793 (build_binary_op_nodefault): Use null_ptr_cst_p.
3794 (build_conditional_expr): Remove.
3795 (convert_for_assignment): Use new conversion functions.
3797 * cp-tree.h (abstract_virtuals_error): Change declaration.
3798 * typeck2.c (abstract_virtuals_error): Check to see if an error
3799 ocurred, and return a boolean value accordingly.
3800 (build_functional_cast): Adjust accordingly.
3801 * class.c (finish_struct_1): Likewise.
3802 * cvt.c (ocp_convert): Likewise.
3803 * decl.c (cp_finish_decl): Likewise.
3804 (grokparams): Likewise.
3805 (grok_op_properties): Likewise.
3806 (start_function): Likewise.
3807 * init.c (build_new_1): Likewise.
3809 * pt.c (unify): Don't get confused by pointers-to-member functions.
3811 * search.c (build_cplus_new): Robustify.
3813 1999-07-24 Richard Henderson <rth@cygnus.com>
3815 * gxx.gperf (__builtin_va_arg): New.
3816 * parse.y (VA_ARG): New token.
3817 (unary_expr): Recognize it.
3819 Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com)
3821 * g++FAQ.texi: Deleted per Joe Buck's request.
3822 * Makefile.in: Corresponding changes.
3824 1999-07-23 Jason Merrill <jason@yorick.cygnus.com>
3826 * lex.c: Sync with C frontend.
3827 (whitespace_cr): New fn.
3828 (skip_white_space): Use it.
3829 (init_parse): Reorder.
3830 (yyprint): Support CONSTANT.
3831 (pragma_getc, pragma_ungetc): Bring back.
3832 (read_line_number): Change in_system_header directly.
3833 (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
3834 (parse_float): Update to C version.
3835 (yylex): Handle '$' under the letter case.
3836 Remove looking_for_typename handling.
3837 Support hex floating point constants.
3838 Follow C's lead for choosing type of integer constants.
3839 Rearrange stuff to match C frontend.
3840 (yyungetc, reinit_parse_for_block, yylex): Support indent_level.
3841 * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
3843 1999-07-23 Mark Mitchell <mark@codesourcery.com>
3845 * call.c (reference_binding): Tweak.
3846 (mayble_handle_implicit_object): Use direct_reference_binding to
3847 create the right implicit conversion sequence.
3849 1999-07-22 Mark Mitchell <mark@codesourcery.com>
3851 * pt.c (convert_nontype_argument): Don't call decl_constant_value
3852 if we're converting to a reference type.
3854 * call.c (NEED_TEMPORARY_P): New macro.
3855 (standard_conversion): Set it, for derived-to-base conversions.
3856 (reference_related_p): New function.
3857 (reference_compatible_p): Likewise.
3858 (convert_class_to_reference): Likewise.
3859 (direct_reference_binding): Likewise.
3860 (reference_binding): Rework for standards-compliance.
3861 (convert_like): Adjust accordingly.
3862 (maybe_handle_ref_bind): Simplify; the right conversion sequences
3863 are now built up in reference_binding.
3864 (initialize_reference): New function.
3865 * cp-tree.h (ICS_USER_FLAG): Document.
3866 (ICS_THIS_FLAG): Likewise.
3867 (ICS_BAD_FLAG): Likewise.
3868 (NEED_TEMPORARY_P): Likewise.
3869 (cp_lvalue_kind): New type.
3870 (real_lvalue_p): Return it.
3871 * error.c (dump_expr): Provide more accurate representation for
3873 * init.c (expand_default_init): Do not try to perform implicit
3874 conversions for a brace-enclosed initializer.
3875 * search.c (lookup_conversions): Document.
3876 * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate
3878 (real_lvalue_p): Adjust accordingly.
3879 (lvalue_p): Likewise.
3880 (build_cplus_new): Don't allow the creation of an abstract class.
3881 * typeck.c (convert_for_initialization): Use initialize_reference.
3883 1999-07-21 Gavin Romig-Koch <gavin@cygnus.com>
3885 * lex.c (real_yylex) : Correct the test for overflow when lexing
3888 1999-07-20 Jason Merrill <jason@yorick.cygnus.com>
3890 * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL,
3891 not DECL_BUILT_IN, to determine if a function is internally declared.
3892 (duplicate_decls): Likewise. Improve handling of builtins.
3893 (push_overloaded_decl): Remove special handling of builtins.
3895 * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P.
3897 * decl.c (grokdeclarator): Pull out decl_constant_value in
3900 * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm.
3901 * cp-tree.h, pt.c, semantics.c: Adjust.
3902 * method.c (largest_union_member): Remove.
3904 * lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
3906 * lex.c (token_getch, token_put_back): New fns.
3907 (real_yylex): Use them.
3909 * lex.c (lang_init): Generalize.
3910 (lang_init_options): Tell cpplib this is C++.
3911 (nextchar): Remove. Replace uses with put_back.
3912 (skip_white_space): Handle linemode here. Optimize for cpplib.
3913 (extend_token_buffer_to): New fn.
3914 (extend_token_buffer): Use it.
3915 (read_line_number, check_newline): Just deal with tokens.
3916 (real_yylex): More cpplib optimizations. Simplify. Don't produce
3917 EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here.
3918 * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING.
3919 * parse.y (PAREN_STAR_PAREN): Remove.
3920 * input.c: Don't use the putback machinery with cpplib.
3921 (sub_getch): Fold back into getch.
3922 (getch): Don't handle linemode here.
3923 (feed_input): Unget any text in the token buffer.
3925 * lex.c (set_typedecl_interface_info, set_vardecl_interface_info,
3926 nextyychar, nextyylval): Remove.
3928 1999-07-20 Michael Tiemann <tiemann@holodeck.cygnus.com>
3929 Jason Merrill <jason@yorick.cygnus.com>
3931 * lex.c (indent_level): New variable.
3932 (init_parse): Set cpp_token to CPP_DIRECTIVE.
3933 (consume_string): Make this smart about USE_CPPLIB.
3934 (yyungetc): Use put_back function.
3935 (pragma_getc, pragma_ungetc): Functions deleted.
3936 (check_newline): Rewrite to be intelligent about USE_CPPLIB.
3937 Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and
3939 (real_yylex): Rewrite to be intelligent about USE_CPPLIB.
3940 Also, clean up cases where we redundantly set token_buffer[0].
3941 (read_line_number): New fn.
3942 * input.c (feed_input): Use integrated cpplib if USE_CPPLIB.
3943 (end_input): Call cpp_pop_buffer if USE_CPPLIB.
3944 (sub_getch): Conditionalize out code that's not appropriate if
3946 (put_back): Rewrite in case USE_CPPLIB is defined.
3947 (input_redirected): Ditto.
3949 Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
3951 * cp-tree.h: Delete lots of declarations of tree nodes; replaced by
3952 c_global_trees and accessor macros defined in c-common.h.
3953 (cp_tree_index): New enumeration.
3954 (cp_global_trees): Declare new array. Add accessor macros for it, and
3955 delete declarations of tree nodes replaced by it.
3956 (builtin_function): Delete macro, add declaration for new function.
3958 * decl.c: Delete definitions for tree nodes that were replaced by
3959 cp_global_trees and c_global_trees.
3960 (init_decl_processing): Call c_common_nodes_and_builtins; delete code
3961 to generate the common builtins here.
3962 (builtin_function): New function.
3963 * decl2.c (abort_fndecl): Delete declaration.
3964 * except.c (expand_builtin_return_address): Delete declaration.
3965 (builtin_return_address_fndecl): Delete variable.
3966 (const_ptr_type_node): Delete declaration.
3967 * lex.c (cons_up_default_function): Delete declaration of
3969 * parse.y (void_list_node): Delete declaration.
3970 * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
3972 (const_string_type_node): Delete declaration.
3973 * search.c (abort_fndecl): Delete declaration.
3974 * Makefile.in: Update dependencies.
3976 1999-07-19 Mark Mitchell <mark@codesourcery.com>
3978 * pt.c (check_default_tmpl_args): Move test for missing default
3979 arguments here, from ...
3980 (end_template_parm_list): Here.
3982 1999-07-18 Mark Mitchell <mark@codesourcery.com>
3984 * decl.c (lookup_nested_type): Remove.
3985 (pushtag): Don't call it.
3987 Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com)
3989 * Makefile.in (INTERFACE): Bump to 2.
3991 1999-07-17 Alexandre Oliva <oliva@dcc.unicamp.br>
3993 * typeck2.c (my_friendly_abort): Updated URL with bug reporting
3994 instructions to gcc.gnu.org. Removed e-mail address.
3996 1999-07-17 Mark Mitchell <mark@codesourcery.com>
3998 * pt.c (determine_specialization): Tighten error-checking.
3999 (end_template_parm_list): Likewise.
4001 1999-07-14 Mark Mitchell <mark@codesourcery.com>
4003 * pt.c (check_default_tmpl_args): Handle friends defined in the
4004 class just like member functions defined in the class.
4006 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
4007 Jason Merrill <jason@yorick.cygnus.com>
4009 * cp-tree.h (struct lang_decl): Added field for storing sorted
4010 FIELD_DECLs (used in TYPE_DECLs).
4011 (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
4012 (DECL_SORTED_FIELDS): New macro.
4013 * class.c (method_name_cmp): New function.
4014 (finish_struct_methods): Modified to support sorting and searching
4016 (finish_struct_anon): Changed code in inner loop to use ELT rather
4017 than UELT (which required an extra indirection for every reference).
4018 (field_decl_cmp): New function to support sorting FIELD_DECLs.
4019 (finish_struct_1): Sort fields.
4020 * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
4021 (lookup_fnfields_1): Search sorted methods in METHOD_VEC.
4022 Also, switch to using array indexing rather than a changing pointer.
4023 * ptree.c (print_lang_decl): Handle TYPE_DECLs that have
4026 1999-07-09 Jason Merrill <jason@yorick.cygnus.com>
4028 * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
4029 casts in system headers or extern "C" blocks.
4031 * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
4034 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
4036 * decl2.c (write_virtuals): Deleted declaration.
4037 * cp-tree.h (write_virtuals): Deleted extern declaration.
4038 * class.c (finish_struct_1): Removed #if 0'd code that mentions
4040 * semantics.c (begin_class_definition): Rewrite code to not depend
4043 * lex.c (cp_pragma_interface): New function.
4044 (cp_pragma_implementation): Likewise.
4045 (handle_cp_pragma): Call them.
4047 * typeck.c (comptypes): Simplify C code in look_hard.
4049 * xref.c (PALLOC): Use xcalloc, not calloc.
4050 (SALLOC): Use xmalloc, not malloc.
4052 * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
4054 * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
4057 * decl.c (duplicate_decls): If a redeclaration doesn't match the
4058 initial declaration, then don't save the inline info and by all
4059 means don't mark the function as a builtin function.
4061 * decl.c (lookup_name_real): Set NONCLASS to 1 if
4062 CURRENT_CLASS_TYPE is 0.
4064 * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
4067 * ptree.c (print_lang_type): Added vtable-needs-writing.
4069 Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
4071 * decl2.c (mark_vtable_entries): Fix check for rtti offset.
4073 1999-07-06 Gavin Romig-Koch <gavin@cygnus.com>
4075 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4076 Merged into c-common.
4078 1999-07-05 Dave Brolley <brolley@cygnus.com>
4080 * lex.c (errorcount): Declare it.
4081 (finish_parse): Update errorcount for when using CPPLIB.
4083 1999-07-05 Mark Mitchell <mark@codesourcery.com>
4085 * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
4087 (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
4088 * decl.c (push_class_binding): Use it.
4089 (lookup_name_real): Likewise.
4091 1999-07-02 Gavin Romig-Koch <gavin@cygnus.com>
4093 * cp-tree.h (widest_integer_literal_type_node,
4094 widest_unsigned_literal_type) : New.
4095 * decl.c (widest_integer_literal_type_node,
4096 widest_unsigned_literal_type) : New.
4097 (init_decl_processing): Handle/use the two new types.
4098 * lex.c (real_yylex): Same.
4099 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4102 1999-07-01 Mark Mitchell <mark@codesourcery.com>
4104 * decl.c (grokdeclarator): Don't give names "for linkage purposes"
4105 to anonymous cv-qualified types.
4107 1999-07-01 Gavin Romig-Koch <gavin@cygnus.com>
4109 * lex.c (real_yylex) : Change integer literal overflow handling to
4112 * lex.c (real_yylex): Improve 'integer constant out of range' messages.
4114 1999-06-28 Richard Henderson <rth@cygnus.com>
4116 * decl.c (cp_finish_decl): Fix typo in cp_warning_at call.
4118 1999-06-28 Jason Merrill <jason@yorick.cygnus.com>
4120 * error.c (dump_type_real): Handle TREE_LIST again.
4122 * typeck.c (comp_target_parms): Don't complain about
4123 converting from () to (...) if !flag_strict_prototype.
4125 * decl.c (grokdeclarator): Update the names of all variants when
4128 1999-06-21 Mark Mitchell <mark@codesourcery.com>
4130 * init.c (expand_aggr_vbase_init): Rename to
4131 construct_virtual_bases. Conditionalize construction here,
4133 (emit_base_init): Here.
4135 1999-06-19 Mark Mitchell <mark@codesourcery.com>
4137 * semantics.c (finish_asm_statement): Apply decay conversions to
4140 * decl.c (expand_static_init): When building an anonymous function
4141 for use with atexit, compute its body before and after entering
4144 * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
4147 1999-06-18 Mark Mitchell <mark@codesourcery.com>
4149 * init.c (expand_aggr_vbase_init): Add flag parameter.
4150 (build_partial_cleanup_for): Remove, inlining into ..
4151 (expand_cleanup_for_base): ... here. Take flag parameter.
4152 (emit_base_init): Pass the in_chrg parameter to
4153 emit_aggr_vbase_init.
4154 (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.
4156 1999-06-16 Mark Mitchell <mark@codesourcery.com>
4158 * decl2.c (import_export_decl): Use same_type_p, rather than
4159 relying on pointer-equality for types.
4161 * method.c (do_build_copy_constructor): Simplify.
4163 * call.c (build_method_call): Remove bogus code for two-argument
4165 * init.c (build_new_1): Expand on comment, and remove dead code.
4167 * init.c (expand_cleanup_for_base): New function, split out
4169 (emit_base_init): Here.
4170 (expand_aggr_vbase_init): Use it.
4172 1999-06-15 Mark Mitchell <mark@codesourcery.com>
4174 * cp-tree.h (class_cache_firstobj): Declare.
4175 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4176 * class.c (permanent_obstack): Remove declaration.
4177 (class_cache_firstobj): Make it global.
4178 (add_method): Don't use permanent_obstack directly.
4179 (pushclass): Only free the class_cache_obstack if we know how far
4181 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4182 * decl.c: Remove dead comment.
4183 (saved_scope): Add class_cache_firstobj.
4184 (push_to_top_level): Save it.
4185 (pop_from_top_level): Restore it.
4186 (push_class_level_binding): Use push_cache_obstack, not
4187 maybe_push_cache_obstack.
4188 * search.c (push_class_decls): Likewise.
4190 1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
4192 * pt.c (tsubst_friend_function): Push into namespace of friend
4193 function before pushdecl'ing it.
4195 1999-06-14 Nathan Sidwell <nathan@acm.org>
4197 * call.c (build_new_op): Remove REF_BIND from all operands.
4199 1999-06-13 Alexandre Oliva <oliva@dcc.unicamp.br>
4201 * init.c (build_new_1): Look up operator delete even if there was
4202 no explicit new placement.
4204 1999-06-08 Nathan Sidwell <nathan@acm.org>
4206 * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
4208 (build_throw): ... here. Call it.
4209 (process_start_catch_block): Call it.
4211 1999-06-07 Mark Mitchell <mark@codesourcery.com>
4213 * search.c (convert_pointer_to_single_level): Reimplement without
4216 1999-06-06 Mark Mitchell <mark@codesourcery.com>
4218 * method.c (is_back_referenceable_type): Back-reference bools when
4221 1999-06-07 Dave Brolley <brolley@cygnus.com>
4223 * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
4224 * input.c (putback_buffer): New structure type.
4225 (putback): Replaces putback_char member.
4226 (putback): Replaces putback_char static variable.
4227 (feed_input): Use putback.
4228 (end_input): Use putback.
4229 (sub_getch): Use putback.
4230 (put_back): Use putback.
4232 1999-06-05 Mark Mitchell <mark@codesourcery.com>
4234 * decl.c (grokdeclarator): Fix typo in last change.
4236 1999-06-04 Jason Merrill <jason@yorick.cygnus.com>
4238 * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
4239 (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
4241 1999-06-04 Nathan Sidwell <nathan@acm.org>
4243 * except.c (build_throw): Check throw expression validity.
4245 1999-06-03 Mark Mitchell <mark@codesourcery.com>
4247 * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
4248 just because flag_signed_bitfields is false.
4250 1999-06-03 Nathan Sidwell <nathan@acm.org>
4252 * semantics.c (begin_class_definition): Update the struct's
4254 * class.c (finish_struct): ... rather than here.
4256 * decl.c (make_typename_type): Don't rely on uninitialized
4259 1999-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4261 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4263 1999-05-31 Mark Mitchell <mark@codesourcery.com>
4265 * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
4266 and friends rather than messing with current_obstack directly.
4267 (cp_build_qualified_type_real): Rework ARRAY_TYPE
4268 allocation to match practice throughout the rest of the
4271 1999-05-30 Mark Mitchell <mark@codesourcery.com>
4273 * lex.c (make_lang_type): Create TYPE_BINFO for
4274 TEMPLATE_TYPE_PARMs just like for non-template types.
4276 * decl.c (start_decl): Move checks on initialization to ...
4277 (cp_finish_decl): Here. Tidy formatting slightly.
4279 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4281 * decl.c (add_binding): Don't complain about a redeclaration of a
4282 semantically identical typedef in a local scope.
4284 1999-05-28 Nathan Sidwell <nathan@acm.org>
4286 * decl.c (complete_array_type): Allocate off same obstack. Fix
4287 DO_DEFAULT comment to match reality.
4289 * friend.c (make_friend_class): Fix diagnostic typo.
4291 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4293 * decl.c (lookup_namespace_name): Handle getting a
4295 (expand_static_init): Don't call pushdecl for implicitly declared
4296 `atexit' used to register destructors.
4298 1999-05-25 Mark Mitchell <mark@codesourcery.com>
4300 * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
4303 * cp-tree.h (NAMESPACE_LEVEL): Reformat.
4304 (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes
4305 by combining TEMPLATE_INFO and LEVEL into a single union.
4306 (DECL_TEMPLATE_INFO): Reformat.
4307 (DECL_SAVED_TREE): Document.
4308 (DECL_TEMPLATE_INJECT): Remove.
4309 * class.c (finish_struct): Remove code to deal with
4310 DECL_TEMPLATE_INJECT.
4312 * decl.c (maybe_process_template_type_declaration): Handle all new
4313 types in templates uniformly.
4314 * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
4316 * pt.c (lookup_template_class): Inject template instantiations of
4317 forward-declarations.
4318 (instantiate_class_template): Remove code processing
4319 DECL_TEMPLATE_INJECT.
4321 * pt.c (lookup_template_class): Tweak lookup to find member
4324 * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
4326 * semantics.c (finish_asm_stmt): Make strings permanent if they're
4329 1999-05-25 Jason Merrill <jason@yorick.cygnus.com>
4331 * typeck.c (casts_away_constness, casts_away_constness_r): Strip both
4332 parts of pointer to data member types.
4334 1999-05-24 Mark Mitchell <mark@codesourcery.com>
4336 * decl2.c (mark_vtable_entries): Don't make a copy of a function,
4337 and then make it look like `abort'. Just use `abort' instead.
4339 * typeck.c (build_static_cast): Don't allow static_casts that cast
4341 (casts_away_constness_r): New function.
4342 (casts_away_constness): Likewise.
4344 * decl.c (lookup_tag): Remove code no longer needed after
4345 name-lookup improvements.
4346 * decl2.c (handle_class_head): Make error-recovery more robust.
4347 * friend.c (make_friend_class): Reject templated typename types.
4348 * lex.c (is_global): A template parameter isn't global.
4349 * parse.y (class_head): Robustify.
4350 * parse.c: Regenerated.
4352 1999-05-22 Mark Mitchell <mark@codesourcery.com>
4354 * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
4355 INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs.
4357 * cp-tree.h (push_nested_namespace): Declare.
4358 (pop_nested_namespace): Likewise.
4359 * decl.c (push_nested_namespace): New function.
4360 (pop_nested_namespace): Likewise.
4361 * pt.c (instantiate_class_template): Use them.
4363 * tree.c (mapcar): Handle NON_LVALUE_EXPR.
4365 * cp-tree.h (cplus_expand_constant): Declare.
4366 * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
4367 converted from one pointer-to-object type to another.
4368 * expr.c (cplus_expand_constant): Don't make it static.
4369 * typeck.c (build_component_ref): Don't crash when presented with
4370 a component which is a TEMPLATE_DECL.
4371 (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a
4372 cast from a pointer-to-member constant to its own type does not
4373 result in a valid non-type template argument.
4375 1999-05-21 Mark Mitchell <mark@codesourcery.com>
4376 Nathan Sidwell <nathan@acm.org>
4378 * Make-lang.in (cc1plus): Make it depend on gxx.gperf.
4379 * cp-tree.h: Fix typo in documentation on pointers-to-members.
4380 (cp_build_qualified_type): Make it a macro.
4381 (cp_build_qualified_type_real): Declare.
4382 * decl.c (grokdeclarator): Remove misleading comment. Avoid
4383 problem with template parameters and restrict-qualification.
4384 * gxx.gperf: Replace NORID with RID_UNUSED throughout.
4385 * hash.h: Regenerated.
4386 * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
4388 (NORID): Remove definition.
4389 * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
4390 (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs.
4391 (fn_type_unification): Check that the function type resulting from
4392 the deduction is legal.
4393 (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
4394 (unify): Use cp_build_qualified_type_real.
4395 * tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
4396 (cp_build_qualified_type): Rename to ...
4397 (cp_build_qualified_type_real): Add additional COMPLAIN parameter
4398 and modify appropriately.
4400 * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
4401 reveal optimization opportunities.
4403 * pt.c (tsubst): Don't issue error messages when we're not
4404 complaining, even if we see a qualified function type.
4405 (check_cv_quals_for_unify): Don't allow a qualified function
4408 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
4410 * class.c (instantiate_type): Downgrade errors for object-dependent
4411 memfn refs to pedwarn.
4413 1999-05-20 Mark Mitchell <mark@codesourcery.com>
4415 * decl.c (grokdeclarator): Don't treat [] as indicating a
4416 zero-sized array in a typedef.
4418 * call.c (build_object_call): Don't look at DECL_NAME for a type.
4419 (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
4420 (typeck.c): Or TYPE_MAIN_VARIANT for a type.
4422 * pt.c (for_each_template_parm): Rework to match documentation.
4423 Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
4425 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
4427 * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
4429 * class.c (finish_base_struct): Allow non-COM bases for COM classes
4430 except at the leftmost position.
4431 (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
4432 Pass the binfo's class, not the most derived, to skip_rtti_stuff.
4433 * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
4435 * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
4436 (build_cplus_new): Make sure that what we return is of the right type.
4438 1999-05-20 Mark Mitchell <mark@codesourcery.com>
4440 * cp-tree.h (make_ptrmem_cst): New function.
4441 * expr.c (cplus_expand_constant): Split out from ...
4442 (cplus_expand_expr): Here. Use cplus_expand_constant.
4443 (init_cplus_expand): Set lang_expand_constant.
4444 * pt.c (convert_nontype_argument): Use make_ptrmem_cst.
4446 * tree.c (make_ptrmem_cst): Define.
4447 * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
4448 * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.
4450 1999-05-19 Mark Mitchell <mark@codesourcery.com>
4452 * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
4454 * decl2.c (start_static_storage_duration_function): Fix comment.
4455 (finish_file): Create static storage duration functions lazily.
4457 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
4459 Implement anonymous structs.
4460 * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
4461 * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
4462 * class.c (finish_struct_1): Remove redundant check for anon struct.
4463 * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
4464 (check_tag_decl): Check for anonymous struct here.
4465 * decl2.c (build_anon_union_vars): Catch anon struct at file scope.
4466 * init.c (sort_member_init, emit_base_init): Handle getting fields
4467 as well as names in current_member_init_list.
4468 (perform_member_init): Handle getting an anon aggr.
4469 * method.c (do_build_assign_ref): Don't descend into anon aggrs.
4470 (do_build_copy_constructor): Likewise.
4472 1999-05-19 Mark Mitchell <mark@codesourcery.com>
4474 * tree.c (cp_build_qualified_type): Don't allow qualified function
4477 Wed May 19 02:50:53 1999 Arvind Sankar <arvinds@mit.edu>
4479 * gxxint.texi: Fix typo.
4481 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
4483 * call.c (find_scoped_type, resolve_scope_to_name): Lose.
4484 * class.c (finish_struct_1): Use CLASS_TYPE_P.
4485 * ptree.c (print_lang_type): Likewise.
4486 * typeck.c (build_modify_expr, c_expand_asm_operands): Use
4488 * typeck2.c (digest_init): Likewise.
4490 1999-05-18 Jason Merrill <jason@yorick.cygnus.com>
4492 * call.c (joust): Compare the types of the conv ops, not the
4493 target types of the conversions.
4495 Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
4497 * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
4500 1999-05-17 Mark Mitchell <mark@codesourcery.com>
4502 * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation.
4503 * decl.c (grokfndecl): Don't allow inline declarations of friend
4504 template specializations, or friend template specializations with
4506 * pt.c (tsubst): Handle substitution into array types that does
4507 not yield a fixed upper bound, even when not processing a
4509 (tsubst_copy): Deal with the fact that the second operand to a
4510 TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC.
4511 * search.c (marked_pushdecls_p): Don't descend into
4512 TEMPLATE_TYPE_PARMs and the like.
4513 (unmarked_pushdecls_p): Likewise.
4515 * call.c (build_over_call): Don't throw away
4516 initializations/copies of empty classes; use MODIFY_EXPR and
4517 INIT_EXPR as for non-empty classes.
4518 * class.c (finish_struct_1): Put the padding byte for an empty
4519 class on the TYPE_NONCOPIED_PARTS list for the class.
4521 1999-05-16 Mark Mitchell <mark@codesourcery.com>
4523 * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
4524 indicate a reference to a field that is a qualified name.
4526 1999-05-16 Jason Merrill <jason@yorick.cygnus.com>
4528 * decl2.c (finish_objects): Don't use .?tors.* if we don't have
4529 ASM_OUTPUT_CONSTRUCTOR.
4531 * friend.c (do_friend): Add attrlist arg. Remove support for
4532 getting a non-decl as 'decl'.
4533 * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or
4535 (grokdeclarator): Adjust.
4536 * cp-tree.h: Adjust.
4538 1999-05-16 Mark Mitchell <mark@codesourcery.com>
4540 * cp-tree.h (permanent_p): New function.
4541 * init.c (build_new_1): Use mapcar, not copy_node, to copy a
4542 possibly complex tree node.
4543 * tree.c (mapcar): Adjust comments, and follow coding standards in
4545 (permanent_p): New function.
4547 1999-05-13 Per Bothner <bothner@cygnus.com>
4549 * class.c (push_lang_context): Turn off DECL_IGNORED_P for
4550 primitive Java types, if we actually see `extern "Java"'.
4552 1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
4554 * lang-specs.h: Pass -$ to the preprocessor.
4556 1999-05-10 Jason Merrill <jason@yorick.cygnus.com>
4558 * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too.
4559 Don't bother wrapping an OFFSET_TYPE around unknown_type_node.
4560 (resolve_offset_ref): Don't handle a raw baselink.
4561 * cvt.c (build_expr_type_conversion): Likewise.
4562 * typeck.c (decay_conversion, build_c_cast, convert_for_assignment,
4563 convert_for_initialization): Likewise.
4564 * class.c (instantiate_type): Handle seeing a baselink under an
4566 * error.c (dump_expr): Likewise.
4567 * pt.c (for_each_template_parm): Likewise.
4568 (resolve_overloaded_unification): Likewise.
4569 * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise.
4570 * typeck.c (expr_sizeof): Also complain about other permutations
4571 of overloaded functions.
4573 1999-05-07 Jason Merrill <jason@yorick.cygnus.com>
4575 * init.c (resolve_offset_ref): Don't return a raw method.
4577 * typeck.c (decay_conversion): Don't handle a raw method.
4578 Resolve all OFFSET_REFs.
4579 (get_member_function_from_ptrfunc): 0 is a valid vtable index.
4580 (build_binary_op_nodefault): Handle resolving overloaded fns. Use
4581 same_type_p for pmf bits. Don't use build_binary_op to compare
4582 raw pointers to methods.
4583 (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE,
4584 to decide when to call resolve_offset_ref.
4585 (build_c_cast, convert_for_initialization): Likewise.
4586 * cvt.c (build_expr_type_conversion): Likewise.
4588 1999-05-06 Nathan Sidwell <nathan@acm.org>
4590 * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class.
4592 1999-05-05 Mark Mitchell <mark@codesourcery.com>
4594 * decl2.c (start_objects): Don't let static constructors and
4595 destructors get inlined.
4597 * parse.y (nested_name_specifier): Make sure ordinary types are
4598 complete, just like template types.
4599 * parse.c: Regenerated.
4601 * pt.c (check_explicit_specialization): Improve error messages.
4603 1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
4605 * typeck.c (string_conv_p): Use same_type_p to check whether we
4606 try to convert between char and wchar_t.
4608 1999-05-03 Mark Mitchell <mark@codesourcery.com>
4610 * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous
4611 lookup to error_mark_node here.
4612 (lookup_member): Revise documentation. Add comments. Don't set
4613 the TREE_TYPE to error_mark_node here, and don't build up an extra
4614 TREE_LIST for ambiguous lookups.
4615 (setup_class_bindings): Adjust accordingly.
4616 (push_class_decls): Revise out-of-date comments.
4618 * typeck.c (build_const_cast): Tighten checks for legality.
4620 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
4622 * init.c (build_member_call): Lookup names coming from
4623 namespace-scoped LOOKUP_EXPR.
4625 1999-05-03 Jim Blandy <jimb@zwingli.cygnus.com>
4627 * gxxint.texi: Add documentation for 'I'.
4629 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
4631 * tinfo.cc (operator==): Qualify type_info with std::.
4633 1999-05-02 Mark Mitchell <mark@codesourcery.com>
4635 * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy.
4636 (DECL_COMDAT): Remove definition.
4638 1999-05-01 Mark Mitchell <mark@codesourcery.com>
4640 * decl.c (wrapup_globals_for_namespace): Fix thinko in previous
4643 1999-04-30 Mark Mitchell <mark@codesourcery.com>
4645 * class.c (build_vtable): Use build_lang_decl when building
4646 vtables, not just build_decl.
4647 (prepare_fresh_vtable): Likewise.
4648 * decl.c (wrapup_globals_for_namespace): Mark vtables as
4649 DECL_EXTERNAL when calling wrapup_global_declarations.
4650 * decl2.c (priority_info_s): Add initializations_p and
4651 destructions_p members.
4652 (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED,
4653 when deciding what vtables to write out.
4654 (ssdf_decls): New variable.
4655 (ssdf_decls_used): Likewise.
4656 (start_static_storage_duration_function): Deal with being called
4657 multiple times. Avoid inlining this function.
4658 (generate_inits_for_priority): Deal with reuse of priority map.
4659 (get_priority_info): Clear initializations_p and destructions_p.
4660 (do_static_initialization): Tweak comment.
4661 (do_static_destruction): Likewise. Fix condition on sentries for
4663 (generate_ctor_or_dtor_function): Call all of the static storage
4665 (generate_ctor_or_dtor_function_for_priority): Check
4666 initializations_p and destructions_p to see what priorities need
4667 initialization functions.
4668 (finish_file): Rework to generate multiple static storage duration
4669 functions, rather than just one.
4671 * typeck.c (build_const_cast): Tweak last change to handle
4672 templates correctly.
4674 * typeck.c (build_const_cast): Disallow use of const_cast to
4675 anything but a pointer or reference type.
4677 1999-04-30 Nathan Sidwell <nathan@acm.org>
4679 * decl.c (cp_finish_decl): Don't permit arrays of abstract or
4682 1999-04-29 Mark Mitchell <mark@codesourcery.com>
4684 * decl2.c (do_static_destruction): Remove obsolete FIXME comment.
4685 (finish_file): Indent comments properly.
4687 1999-04-29 Richard Henderson <rth@cygnus.com>
4689 * decl2.c (do_static_initialization): Call do_pending_stack_adjust.
4690 (do_static_destruction): Likewise.
4692 1999-04-29 Nathan Sidwell <nathan@acm.org>
4694 * cp-tree.h (TYPE_NOTHROW_P): New macro.
4695 * decl2.c (delete_sanity): Warn on deleting void *.
4696 * init.c (build_new_1): Use TYPE_NOTHROW_P.
4697 * typeck.c (c_expand_return): cp_pedwarn on returning NULL from
4698 throwing operator new.
4700 1999-04-28 Nathan Sidwell <nathan@acm.org>
4702 * cp-tree.h (build_component_addr): Remove prototype.
4703 * typeck.c (build_component_addr): Make static. Remove MSG
4705 (build_component_addr): Remove MSG parameter, clean up
4707 (build_x_function_call): Use cp_error.
4708 (build_unary_op): Adjust call of build_component_addr.
4710 1999-04-28 Mark Mitchell <mark@codesourcery.com>
4712 * pt.c (tsubst_friend_class): Check for NULL.
4714 Wed Apr 28 11:42:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4716 * search.c (binfo_for_vtable): Initialize bfvi.var.
4718 1999-04-27 Nathan Sidwell <nathan@acm.org>
4720 * rtti.c (build_x_typeid): Check rtti is enabled.
4722 1999-04-26 Mark Mitchell <mark@codesourcery.com>
4724 * search.c (is_subobject_of_p): Make sure we're looking at the
4727 1999-04-26 Marc Espie <espie@cvs.openbsd.org>
4729 * Make-lang.in (cplib2.ready): Don't depend on phony targets.
4731 1999-04-23 Mark Mitchell <mark@codesourcery.com>
4733 * decl2.c (finish_file): Tweak handling of extern inlines so that
4734 they are not unnecessarily put out.
4736 * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
4737 such as base classes.
4739 1999-04-22 Brendan Kehoe <brendan@cygnus.com>
4741 * tree.c (build_exception_variant): Fix typo: use the chain of U,
4742 not trying V, while cycling through U.
4744 1999-04-22 Mark Mitchell <mark@codesourcery.com>
4746 * cp-tree.h (lang_decl_flags): Remove returns_first_arg and
4747 preserves_first_arg. Enlarge dummy accordingly.
4748 (DECL_TINFO_FN_P): New macro.
4749 (SET_DECL_TINFO_FN_P): Likeiwse.
4750 (DECL_RETURNS_FIRST_ARG): Remove.
4751 (DECL_PRESERVES_THIS): Likewise.
4752 (DECL_INIT_PRIORITY): New macro.
4753 (finish_struct_1): Change prototype.
4754 (cat_namespace_levels): Remove prototype.
4755 (vtable_decl_p): New prototype.
4756 (vtype_decl_p): Likewise.
4757 (sigtable_decl_p): Likewise.
4758 (walk_globals_pred): New typedef.
4759 (walk_globals_fn): Likewise.
4760 (walk_globals): New prototype.
4761 (walk_namespaces_fn): New typedef.
4762 (walk_namespaces): New prototype.
4763 (wrapup_globals_for_namespace): Likewise.
4764 (walk_vtables): Remove prototype.
4765 (walk_sigtables): Likewise.
4766 (instantiate_pending_templates): New prototype.
4767 * class.c (finish_struct_1): Don't return a value.
4768 * decl.h (pending_statics): Remove declaration.
4769 * decl.c (walk_namespaces_r): New function.
4770 (walk_globals_r): Likewise.
4771 (vtable_decl_p): Likewise.
4772 (vtype_decl_p): Likewise.
4773 (sigtable_decl_p): Likewise.
4774 (walk_namespaces): Likewise.
4775 (walk_globals_data): New type.
4776 (walk_globals): New function.
4777 (wrapup_globals_for_namespace): Likewise.
4778 (expand_static_init): Remove assertion. Remove redundancy in
4779 conditional. Don't put static data members in static_aggregates
4781 (finish_function): Remove redundancy in conditional. Don't set
4782 DECL_RETURNS_FIRST_ARG.
4783 (cat_namespace_levels): Remove.
4784 * decl2.c: Include splay-tree.h and varray.h.
4785 (priority_info_s): New structure.
4786 (finish_vtable_vardecl): Change prototype. Adjust for new calling
4788 (prune_vtable_vardecl): Likewise.
4789 (finish_sigtable_vardecl): Likewise.
4790 (setup_initp): Remove.
4793 (start_static_storage_duration_function): New function.
4794 (generate_inits_for_priority): Likewise.
4795 (finish_static_storage_duration_function): Likewise.
4796 (get_priority_info): Likewise.
4797 (do_static_initialization): Likewise.
4798 (do_static_destruction): Likewise.
4799 (do_static_initialization_and_destruction): Likewise.
4800 (generate_ctor_or_dtor_function): Likewise.
4801 (generate_ctor_and_dtor_functions_for_priority): Likewise.
4802 (pending_statics): Make it a varray.
4803 (pending_statics_used): New variable.
4804 (saved_inlines): Make it a varray.
4805 (saved_inlines_used): New variable.
4806 (finish_static_data_member): Change method of updating
4808 (mark_inline_for_output): Remove #if 0'd code. Change method of
4809 updating saved_inlines.
4810 (walk_vtables): Remove.
4811 (walk_sigtables): Likewise.
4812 (import_export_decl): Use DECL_TINFO_FN_P.
4813 (pending_templates): Remove declaration.
4814 (maybe_templates): Likewise.
4815 (static_aggregates_initp): Likewise.
4816 (setup_initp): Likewise.
4817 (finish_objects): Simplify.
4818 (INITIALIZE_P_IDENTIFIER): New macro.
4819 (PRIORITY_IDENTIFIER): New macro.
4820 (SSDF_IDENTIFIER): New macro.
4821 (initialize_p_decl): New variable.
4822 (priority_decl): Likewise.
4823 (ssdf_decl): Likewise.
4824 (priority_info_map): Likewise.
4825 (finish_file): Recode output of static intializers and other
4826 file-scope finalization tasks.
4827 * error.c (OB_END_TEMPLATE_ID): New macro.
4828 (dump_type_real): Use it.
4829 (dump_decl): Likewise.
4830 (dump_function_name): Likewise.
4831 * lex.c (set_typedecl_interface_info): Adjust for new walk_globals
4833 (check_newline): Use walk_globals, not walk_vtables.
4834 * pt.c (pending_tempalte_expansions): Remove.
4835 (set_vardecl_interface_info): Likewise.
4836 (pending_templates): Make static.
4837 (maybe_templates): Likewise.
4838 (instantiate_class_template): Adjust call to finish_struct_1.
4839 (instantiate_pending_templates): New function.
4840 * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P.
4841 * tree.c (static_aggregates_initp): Remove.
4842 (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY
4844 * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h.
4846 * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes
4847 with the RTL code RETURN.
4848 * hash.h: Regenerated.
4849 * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD.
4850 * parse.y: Replace RETURN with RETURN_KEYWORD throughout.
4851 * parse.c: Regenerated.
4852 * pt.c: Include varray.h. Include rtl.h since varray.h requires
4854 (inline_parm_levels): New variable.
4855 (inline_parm_levels_used): Likewise.
4856 (maybe_begin_member_template_processing): Update them.
4857 (maybe_end_member_template_processing): Use them, rather than
4858 guessing how many levels to pop.
4860 * decl.c (make_typename_type): Tighten error-checking.
4862 1999-04-20 Mark Mitchell <mark@codesourcery.com>
4864 * cp-tree.h (build_binary_op): Remove unneeded parameter.
4865 * class.c (build_vrable_entry_ref): Adjust call to
4867 * decl.c (expand_static_init): Likewise.
4868 (grokdeclarator): Likewise.
4869 (finish_function): Likewise.
4870 * decl2.c (delete_sanity): Likewise.
4871 (do_dtors): Likewise.
4872 (do_ctors): Likewise.
4873 * error.c (dump_type_suffix): Likewise.
4874 * expr.c (cplus_expand_expr): Likewise.
4875 * init.c (resolve_offset_ref): Likewise.
4876 (build_new): Likewise.
4877 (build_new_1): Likewise.
4878 (build_vec_delete_1): Likewise.
4879 (expand_vec_init_catch_clause): Likewise.
4880 (build_delete): Likewise.
4881 * pt.c (tsubst): Likewise.
4882 * rtti.c (synthesize_tinfo_fn): Likewise.
4883 * search.c (expand_upcast_fixups): Likewise.
4884 (expand_direct_vtbls_init): Likewise.
4885 * typeck.c (get_member_function_from_ptrfunc): Likewise.
4886 (build_binary_op_nodefault): Likewise.
4887 (point_int_sum): Likewise.
4888 (pointer_diff): Likewise.
4889 (build_unary_op): Likewise.
4890 (build_modify_expr): Likewise.
4891 (get_delta_difference): Likewise.
4892 (build_ptrmemfunc): Likewise.
4893 (expand_ptrmemfunc_cst): Likewise.
4895 1999-04-20 Jason Merrill <jason@yorick.cygnus.com>
4897 * decl.c (grokfndecl): Always call cplus_decl_attributes.
4898 * decl2.c (grokfield): Pass attrlist to grokdeclarator.
4900 1999-04-19 Mark Mitchell <mark@codesourcery.com>
4902 * cp-tree.h (finish_static_data_member_decl): New function.
4903 * decl2.c (finish_static_data_member_decl): Split out from ...
4905 * pt.c (instantiate_class_template): Use it here instead of
4907 (tsubst_decl): Don't set DECL_ASSEMBLER_NAME;
4908 finish_static_data_member_decl will do that. Explicit set
4909 DECL_EXTERNAL to match non-template processing.
4911 1999-04-18 Mark Mitchell <mark@codesourcery.com>
4913 * cp-tree.h (finish_class_definition): Add parameter.
4914 * parse.y (structsp): Use it. Don't call pop_scope here.
4915 * parse.c: Regenerated.
4916 * semantics.c (finish_class_definition): Pop it here.
4918 1999-04-17 Mark Mitchell <mark@codesourcery.com>
4920 * decl.c (xref_tag): Revise handling of nested template
4922 * pt.c (check_explicit_specialization): Tweak handling of friend
4923 templates in template classes.
4924 (tsubst_friend_class): Handle friend declarations for nested
4925 member template classes.
4927 1999-04-16 Mark Mitchell <mark@codesourcery.com>
4929 * class.c (finish_struct): Remove unused variable.
4930 (pushclass): Likewise.
4931 (invalidate_class_lookup_cache): Likewise.
4932 * cp-tree.def (TYPENAME_TYPE): Improve documentation.
4933 * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME
4934 doesn't get obliterated.
4935 (make_typename_type): Handle template classes correctly.
4937 * cp-tree.h (TREE_NONLOCAL_FLAG): Remove.
4938 (storetags): Declare.
4939 * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG.
4940 (pushclass): Likewise. Use storetags to install tag declarations,
4942 (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG.
4943 * decl.c (storetags): Make it global.
4944 (push_class_binding): Set INHERITED_VALUE_BINDING_P for an
4945 implicit typename declaration.
4946 (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG.
4947 * method.c (hack_identifier): Likewise.
4948 * search.c (lookup_member): Likewise.
4950 * decl.c (warn_about_implicit_typename_lookup): New function.
4951 (lookup_name_real): Use it. Rework handling of implicit typename
4954 1999-04-15 Mark Mitchell <mark@codesourcery.com>
4956 * cp-tree.h (lookup_nested_field): Remove.
4957 * class.c (push_nested_class): Handle UNION_TYPEs.
4958 (pop_nested_class): Likewise.
4959 * decl.c (lookup_name_real): Don't call lookup_nested_field.
4960 (start_decl): Use push_nested_class, not just pushclass.
4961 (cp_finish_decl): Use pop_nested_class, not just popclass.
4962 * search.c (lookup_nested_field): Remove.
4964 * cp-tree.h (lang_type): Add documentation.
4965 * decl2.c (handle_class_head): Create template declarations here,
4967 * parse.y (class_head): Return whether or not we entered a new
4968 scope, as well as the type named.
4969 (named_class_head): Likewise.
4970 (named_complex_class_head_sans_basetype): Likewise.
4971 (structsp): Adjust accordingly. Pop scope when required.
4972 * parse.c: Regenerated.
4973 * pt.c (check_default_tmpl_args): Robustify.
4974 (redeclare_class_template): Likewise.
4975 (instantiate_class_template): An instantiation of an
4976 anonymous union is itself an anonymous union.
4977 * semantics.c (begin_class_definition): Don't create template
4980 1999-04-15 Jason Merrill <jason@yorick.cygnus.com>
4982 * parse.y (after_type_declarator_intern): New nonterminal.
4983 (after_type_declarator): Use it.
4984 (direct_after_type_declarator): Likewise. Move above
4985 nonnested_type to fix reduce/reduce conflict resolution.
4986 (declmods): Reducing from just 'attributes' has EMPTY precedence.
4987 * Makefile.in (CONFLICTS): Update.
4989 * decl.c (define_label): Downgrade error for jumping over a
4990 non-POD decl to pedwarn.
4992 1999-04-14 Mark Mitchell <mark@codesourcery.com>
4994 * cp-tree.h (popclass): Change declaration.
4995 (pop_nested_class): Likewise.
4996 (poplevel_class): Remove declaration.
4997 * call.c (convert_default_argument): Pass no arguments to
4999 * class.c (finish_struct_1): Likewise.
5000 (finish_struct): Likewise.
5001 (popclass): Remove argument. Simplify code accordingly.
5002 (pop_nested_class): Likewise.
5003 * decl.c (poplevel_class): Declare it here, and make it static.
5004 (poplevel): Handle class scopes.
5005 (poplevel_class): Don't take an rgument. Simplify.
5006 (pop_everything): Pass no arguments to pop_nested_class.
5007 (cp_finish_decl): Pass no arguments to popclass.
5008 (grokdeclarator): Pass no arguments to pop_nested_class.
5009 (finish_function): Likewise.
5010 * decl2.c (grokfield): Likewise.
5011 (pop_scope): Pass no arguments to popclass.
5012 * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
5013 * pt.c (instantiate_class_template): Move call to pushclass, and
5014 document. Pass no arguments to popclass.
5015 (regenerate_decl_from_template): Likewise.
5017 1999-04-14 Jason Merrill <jason@yorick.cygnus.com>
5019 * typeck.c (build_unary_op): Handle taking the address of a unique
5020 bound non-static member function.
5022 1999-04-13 Martin von Loewis <loewis@informatik.hu-berlin.de>
5024 * lang-options.h (-Wdeprecated): New flag.
5025 * decl2.c (warn_deprecated): New flag.
5026 (lang_decode_option): Deprecated this-is-variable,
5027 external-templates, alt-external-templates.
5028 Support -Wdeprecated.
5029 * errfn.c (cp_deprecated): New function.
5031 1999-04-13 Jason Merrill <jason@yorick.cygnus.com>
5033 * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
5034 of the decls themselves.
5036 * pt.c (tsubst_function_type): Copy attributes over.
5038 * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority
5040 * cp-tree.h: Add prototype.
5041 * decl.c (init_decl_processing): Set valid_lang_attribute.
5043 1999-04-13 Mark Mitchell <mark@codesourcery.com>
5045 * class.c (finish_struct_1): Look at the const-ness of the field's
5046 type, not the TREE_READONLY-ness of the declaration.
5047 * method.c (synthesize_method): Likewise.
5048 * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
5049 creating new declarations.
5051 1999-04-13 Mike Stump <mrs@wrs.com>
5053 * decl2.c (import_export_decl): Because vtables always reference
5054 virtual functions, even if they are inlined, don't allow
5055 -fno-implement-inlines to not emit them, instead, emit them with
5057 * decl.c (start_function): Likewise.
5059 1999-04-12 Jason Merrill <jason@yorick.cygnus.com>
5061 * cp-tree.h (struct lang_type): Add com_interface.
5062 (CLASSTYPE_COM_INTERFACE): New macro.
5063 * class.c (set_rtti_entry): COM interface classes have no RTTI
5064 entries in their vtables; adjust.
5065 (add_virtual_function, finish_base_struct, skip_rtti_stuff,
5066 modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
5067 finish_struct_1): Likewise.
5068 * decl2.c (mark_vtable_entries): Likewise.
5069 * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
5070 * search.c (get_abstract_virtuals_1, get_abstract_virtuals,
5071 expand_upcast_fixups): Likewise.
5072 * tree.c (debug_binfo): Likewise.
5074 * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
5075 * typeck.c (comptypes): If we get it, ignore attributes.
5076 * class.c (instantiate_type): Use BASELINK_P. Change complain
5077 parameter to flags; 2 means ignore attributes.
5078 * call.c (build_op_delete_call): Pass it.
5080 * decl.c (xref_tag): Only complain once about using a typedef-name
5081 with 'struct'. Downgrade to pedwarn.
5083 * decl.c (grokdeclarator): Allow [] syntax for zero-length array.
5085 * parse.y (absdcl_intern): New nonterminal.
5086 (absdcl, direct_abstract_declarator): Use it.
5088 * pt.c (lookup_template_class): Look through implict typename.
5090 1999-04-11 Mark Mitchell <mark@codesourcery.com>
5092 * friend.c (add_friend): Deal gracefully with error_mark_node.
5093 * method.c (build_overload_value): Handle pointers-to-members as
5094 template parameters.
5096 * decl.c (push_binding): Fix typo in comment.
5098 1999-04-10 Mark Mitchell <mark@codesourcery.com>
5100 * error.c (dump_type_real): If a typename is a template-id, put
5101 out the template arguments.
5102 (dump_expr): Handle TEMPLATE_ID_EXPR.
5103 * pt.c (lookup_template_class): Now that full arguments are
5104 available everywhere, remove code that tried to guess them.
5106 1999-04-09 Mark Mitchell <mark@codesourcery.com>
5108 * decl.c (make_typename_type): Complain if we don't find a type
5109 when trying to make a typename type for a non-template type.
5111 1999-04-09 Jason Merrill <jason@yorick.cygnus.com>
5113 * decl.c (start_decl): Pass attributes to grokdeclarator.
5114 (grokdeclarator): Handle attributes on constructor-syntax
5117 1999-04-08 Mark Mitchell <mark@codesourcery.com>
5119 * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands
5122 * search.c (template_self_reference_p): Tweak.
5124 1999-04-07 Mark Mitchell <mark@codesourcery.com>
5126 * init.c (build_offset_ref): Don't build yet another weird data
5127 structure to describe overloaded functions.
5129 1999-04-06 Mark Mitchell <mark@codesourcery.com>
5131 * cp-tree.h (BASELINK_P): New macro.
5132 (SET_BASELINK_P): Likewise.
5133 * init.c (build_member_call): Remove needless assignment in if
5135 * search.c (lookup_field_r): Fix handling when we are looking
5136 specifically for a type; these are not hidden by functions and
5138 (lookup_member): Use SET_BASELINK_P.
5139 * tree.c (is_overloaded_fn): Use BASELINK_P.
5140 (really_overloaed_fn): Likewise.
5141 (get_first_fn): Likewise.
5143 1999-04-05 Mark Mitchell <mark@codesourcery.com>
5145 * decl.c (lookup_name_current_level): Tweak, and improve
5148 * class.c (maybe_fixup_vptrs): Remove declaration.
5149 (build_class_init_list): Likewise.
5150 * decl.c (pushdecl_class_level): Call check_template_shadow here
5152 (push_class_level_binding): ... not here.
5153 * search.c (dfs_push_type_decls): Only avoid
5154 template-self-reference TYPE_DECLs if they are from base classes.
5156 1999-04-04 Mark Mitchell <mark@codesourcery.com>
5158 * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL
5161 1999-04-03 Jason Merrill <jason@yorick.cygnus.com>
5163 * class.c (maybe_fixup_vptrs, build_class_init_list): Lose.
5164 (finish_struct_1): Don't call build_class_init_list.
5166 1999-04-02 Mark Mitchell <mark@codesourcery.com>
5168 * tinfo.h (__class_type_info): Fix illegal declaration.
5170 * cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
5171 * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
5172 (IDENTIFIER_CLASS_VALUE): Improve documentation.
5173 (is_properly_derived_from): Declare.
5174 (invalidate_class_lookup_cache): Likewise.
5175 (maybe_maybe_note_name_used_in_class): Likewise.
5176 (note_name_declared_in_class): Likewise.
5177 (push_using_decl): Remove duplicate declaration.
5178 (id_in_current_class): Remove declaration.
5179 (push_class_binding): Change prototype.
5180 (clear_identitifer_class_values): Declare.
5181 * call.c (is_properly_derived_from): Make it global.
5182 (build_new_function_call): Be careful about updating candidates.
5183 (build_new_method_call): Handle COMPONENT_REFs. Don't crash when
5184 asked to make illegal calls.
5185 * class.c: Include splay-tree.h.
5186 (class_stack_node): Add names_used slot.
5187 (check_member_decl_is_same_in_complete_scope): Remove.
5188 (add_method): Fix comment. Push the declaration into class
5190 (finish_struct_1): When popping the class, pop the bindings too.
5191 Remove check for data member/function member conflict.
5192 (finish_struct): Remove calls to
5193 check_member_decl_is_same_in_complete_scope. Change calls to
5195 (pushclass): Clear names_used in the class stack entry.
5196 Use invalidate_class_lookup_cache to remove cached entries, rather
5197 than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE
5198 before entering a new class. Remove dead code. Don't mess with
5199 current_function_decl when pushing declarations.
5200 (invalidate_class_lookup_cache): New function, split out from ...
5201 (popclass): Here. Clean up names_used on our way out.
5202 (instantiate_type): Adjust.
5203 (build_self_reference): Don't push the declaration here.
5204 (maybe_note_name_used_in_class): New function.
5205 (note_name_declared_in_class): Likewise.
5206 * decl.c (add_binding): Change prototype.
5207 (find_class_binding_level): New function.
5208 (innermost_nonclass_level): Likewise.
5209 (current_binding_level): Update documentation.
5210 (inner_binding_level): Remove. Replace with current_binding_level
5212 (push_binding_level): Remove special handling of
5213 class_binding_level.
5214 (pop_binding_level): Likewise. Use find_class_binding_level.
5215 (suspend_binding_level): Likewise.
5216 (global_bindings_p): Use innermost_nonclass_level.
5217 (toplevel_bindings_p): Likewise.
5218 (namespace_bindings_p): Likewise.
5219 (pseudo_global_level_p): Likewise.
5220 (push_binding): Clear INHERITED_VALUE_BINDING_P.
5221 (add_binding): Check for illegal multiple declarations. Return a
5222 value indicating whether or not the new binding was legal.
5223 (push_local_binding): Skip over class binding levels. Check
5224 return value from add_binding.
5225 (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call
5226 note_name_declared_in_class.
5227 (pushlevel_class): Remove "fake out the rest of the compiler"
5229 (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
5230 (clear_identifier_class_values): New function.
5231 (pop_from_top_level): Use it.
5232 (pop_everything): Tweak.
5233 (maybe_process_template_type_declaration): Don't push the
5234 declaration for the template here.
5235 (pushtag): Don't push tag declarations into class scope here.
5236 (pushdecl): Apply DeMorgan's law for readability.
5237 (pushdecl_class_level): Remove special-case code for
5238 TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions.
5239 (push_class_level_bindng): Deal with inherited bindings.
5240 (lookup_name_real): Remove special-case code for
5241 TYPE_BEING_DEFINED, and some implicit typename magic.
5242 (grokdeclarator): Handle COMPONENT_REF for a template function.
5243 (build_enumerator): Don't call pushdecl_class_level here.
5244 (id_in_current_class): Remove.
5245 * decl2.c (grokfield): Don't call pushdecl_class_level or
5246 check_template_shadow.
5247 * errfn.c (cp_file_of): Don't declare.
5248 (cp_line_of): Likewise.
5249 * error.c (dump_decl): Handle an OVERLOAD.
5250 (cp_file_of): Likewise.
5251 (cp_line_of): Likewise.
5252 * init.c (build_member_call): Handle a COMPONENT_REF.
5253 * lex.c (do_identifier): Call maybe_note_name_used_in_class, not
5254 pushdecl_class_level.
5255 * method.c (hack_identifier): Build COMPONENT_REFs for references
5256 to member templates as well as member functions. Remove dead
5258 * parse.y (left_curly): Remove.
5259 (nonnested_type): Call maybe_note_name_used_in_class, not
5260 pushdecl_class_level.
5261 * parse.c: Regenerated.
5262 (nested_name_specifier_1): Likewise.
5263 * pt.c (check_explicit_specialization): Adjust, for robustness.
5264 (check_template_shadow): Handle OVERLOADs.
5265 (build_template_decl): Set DECL_CONSTRUCTOR_P on the
5266 TEMPLATE_DECL, if appropriate.
5267 * search.c (envelope_add_decl): Remove.
5268 (dfs_pushdecls): Likewise.
5269 (dfs_compress_decls): Likewise.
5270 (dfs_push_decls): New function.
5271 (dfs_push_type_decls): Likewise.
5272 (setup_class_bindings): Likewise.
5273 (template_self_reference_p): Likewise.
5274 (lookup_field_r): Use it.
5275 (looup_member): Remove old comment. Deal with ambiguity.
5276 (push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
5277 and remove envelope processing.
5278 * semantics.c (begin_class_definition): Let pushclass push
5279 declarations for base classes.
5280 (finish_member_declaration): Push declarations into class scope.
5281 * typeck.c (build_component_ref): Just put an OVERLOAD into the
5282 COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
5283 (build_x_function_call): Deal with OVERLOAD. Handle template-ids.
5284 * Makefile.in (class.o): Depend on splay-tree.h.
5286 Wed Mar 31 11:30:43 1999 Nathan Sidwell <nathan@acm.org>
5288 * cvt.c (convert_pointer_to_real): Use same_type_p.
5289 * typeck.c (comp_target_types): Use same_type_p.
5291 1999-03-31 Jason Merrill <jason@yorick.cygnus.com>
5293 * semantics.c (begin_inline_definitions,
5294 finish_inline_definitions): Rename from finish_default_args and
5295 begin_inline_definitions, respectively, to something that isn't a
5297 * parse.y (structsp): Adjust.
5299 * tree.c (hash_tree_cons): Remove obsolete via_* parms.
5300 (list_hash_lookup): Likewise.
5301 (hash_tree_chain): Adjust.
5302 * pt.c (tsubst): Adjust.
5303 (tsubst_arg_types): Use plain hash_tree_cons.
5304 * cp-tree.h (hash_tree_cons_simple): Lose.
5305 * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons.
5307 Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5309 * Makefile.in (hash.h): Generate using gperf language 'C', not
5310 'KR-C', so gperf uses the `const' keyword on strings.
5312 * gxx.gperf (resword): Const-ify a char*.
5314 1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
5316 * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
5317 CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
5318 CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
5319 CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
5320 CLASSTYPE_BINFO_AS_LIST): Remove cruft.
5321 * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
5324 1999-03-29 Jason Merrill <jason@yorick.cygnus.com>
5326 * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
5328 1999-03-28 Jason Merrill <jason@yorick.cygnus.com>
5330 * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops.
5332 1999-03-27 Mark Mitchell <mark@codesourcery.com>
5334 * cp-tree.h (add_friend): Declare.
5335 (add_friends): Likewise.
5336 * friend.c (add_friend): Make it global. Don't add to
5337 DECL_BEFRIENDING_CLASSES if the befriending class is a template.
5338 (add_friends): Make it global.
5339 (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
5340 befriending class is a template.
5341 * parse.y (component_decl_1): Fix typo in comment.
5342 * parse.c: Regenerated.
5343 * pt.c (instantiate_class_template): Use add_friend and
5344 add_friends rather that duplicating some of their functionality
5347 1999-03-27 Jason Merrill <jason@yorick.cygnus.com>
5349 * call.c (build_field_call): Unify 'this' and non-'this' cases.
5351 * typeck.c (build_indirect_ref): Check for 'this' sooner.
5353 Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5355 * call.c (op_error): Const-ify a char*.
5356 (add_candidate, source_type, add_warning): Add static prototype.
5357 (print_z_candidates): Const-ify a char*.
5359 * class.c (resolve_address_of_overloaded_function,
5360 fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
5361 (get_vtable_name, finish_struct_1): Const-ify a char*.
5363 * cvt.c (convert_to_reference): Likewise.
5365 * decl.c (redeclaration_error_message, record_builtin_type,
5366 record_unknown_type, member_function_or_else, bad_specifiers):
5368 (find_binding, select_decl, unqualified_namespace_lookup,
5369 lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
5370 Add static prototype.
5371 (warn_extern_redeclared_static, duplicate_decls, pushdecl,
5372 implicitly_declare, record_builtin_java_type, define_function,
5373 grok_op_properties, tag_name): Const-ify a char*.
5375 * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
5376 (define_function, finish_builtin_type): Const-ify a char*.
5377 (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
5378 cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
5379 (file_name_nondirectory): Const-ify a char*.
5380 (init_filename_times): Don't prototype.
5381 (compiler_error): Prototype.
5382 (yyerror, init_repo): Const-ify a char*.
5383 (build_srcloc): Don't prototype.
5384 (build_x_indirect_ref, build_indirect_ref, build_component_addr):
5386 (warn_for_assignment): Don't prototype.
5387 (convert_for_initialization, readonly_error, check_for_new_type,
5388 GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
5391 * decl2.c (acceptable_java_type, output_vtable_inherit,
5392 setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
5393 merge_functions, decl_namespace, validate_nonmember_using_decl,
5394 do_nonmember_using_decl): Add static prototype.
5395 (lang_f_options): Const-ify a char*.
5396 (finish_builtin_type): Likewise.
5397 (add_function, arg_assoc_namespace, arg_assoc_class): Add static
5400 * errfn.c: Include cp-tree.h.
5401 (cp_thing): Add static prototype.
5402 (compiler_error): Don't protoptype.
5403 (cp_compiler_error): Cast `compiler_error' to `errorfn' before
5404 passing it to `cp_thing'.
5406 * error.c (interesting_scope_p): Add static prototype.
5408 * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
5411 * init.c (compiler_error): Don't prototype.
5412 (member_init_ok_or_else): Const-ify a char*.
5413 (build_java_class_ref): Add static prototype.
5415 * lex.c (compiler_error): Don't prototype.
5416 (get_time_identifier, interface_strcmp, extend_token_buffer,
5417 handle_cp_pragma): Const-ify a char*.
5418 (is_global, init_filename_times): Add static prototype.
5419 (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
5420 (compiler_error): Change from fixed args to variable args.
5421 (yyerror): Const-ify a char*.
5423 * parse.y (cond_stmt_keyword): Const-ify a char*.
5424 (parse_decl): Add static prototype.
5426 * pt.c (template_args_equal, print_template_context): Likewise.
5427 (print_candidates, check_default_tmpl_args): Const-ify a char*.
5428 (instantiate_class_template): Likewise.
5430 * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
5432 * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
5433 expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
5435 * search.c (lookup_field_info, lookup_member): Likewise.
5436 (lookup_member): Cast the first argument of `bzero' to a PTR.
5438 * sig.c (compiler_error): Don't prototype.
5439 (build_signature_pointer_or_reference_nam): Const-ify a char*.
5440 (get_sigtable_name, build_member_function_pointer): Likewise.
5442 * tree.c (compiler_error): Don't prototype.
5443 (no_linkage_helper, build_srcloc): Add static prototype.
5444 (build_vbase_pointer_fields): Const-ify a char*.
5445 (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
5447 * typeck.c (compiler_error): Don't prototype.
5448 (convert_for_assignment): Const-ify a char*.
5449 (comp_cv_target_types): Add static prototype.
5450 (build_x_indirect_ref, build_indirect_ref, convert_arguments,
5451 build_component_addr, build_unary_op, convert_for_initialization):
5454 * typeck2.c (ack): Add static prototype and change from fixed args
5456 (readonly_error, check_for_new_type): Const-ify a char*.
5458 * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
5459 fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
5460 (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'.
5461 (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
5462 gen_assign, GNU_xref_member): Const-ify a char*.
5464 1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
5466 * gxxint.texi: Remove old discussion on copying virtual bases.
5468 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
5470 * Make-lang.in: Remove all references to g++.o/g++.c.
5471 Link g++ from gcc.o.
5473 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
5475 * decl2.c (comdat_linkage): Treat vtables like functions.
5477 1999-03-25 Mark Mitchell <mark@codesourcery.com>
5479 * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES.
5481 1999-03-25 Nathan Sidwell <nathan@acm.org>
5483 * decl.c (init_decl_processing): Add `signed' type as a synonym
5486 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
5488 * typeck.c (common_type): Handle cv-qual unification for pointers
5491 * decl.c (unqualified_namespace_lookup): Return error_mark_node
5493 (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
5494 * lex.c (do_identifier): If we got error_mark_node, call
5497 1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
5499 * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
5502 1999-03-24 Jason Merrill <jason@yorick.cygnus.com>
5504 * decl.c (lookup_name_real): Do nested field lookup regardless of
5507 1999-03-24 Mark Mitchell <mark@codesourcery.com>
5509 * cp-tree.h (lang_type): Remove has_assignment and
5510 has_real_assignment. Add befriending_classes.
5511 (TYPE_HAS_ASSIGNMENT): Remove.
5512 (TYPE_HAS_REAL_ASSIGNMENT): Likewise.
5513 (CLASSTYPE_BEFRIENDING_CLASSES): New macro.
5514 (lang_decl): Document.
5515 (DECL_BEFRIENDING_CLASSES): New macro.
5516 (FRIEND_NAME): Move declaration to more obvious location.
5517 (FRIEND_DECLS): Likewise.
5518 * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
5519 * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
5520 (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
5521 (grok_op_properties): Likewise.
5522 * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
5523 (add_friend): Likewise. Don't do weird things with assignment
5524 operators. Update DECL_BEFRIENDING_CLASSES.
5525 (add_friends): Don't do weird things with assignment operators.
5526 (make_friend_class): Likewise. Update
5527 CLASSTYPE_BEFRIENDING_CLASSES.
5528 * pt.c (instantiate_class_template): Don't set
5529 TYPE_HAS_ASSIGNMENT.
5530 (tsubst_copy): Substitute the TREE_TYPE for more unary
5532 * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
5533 * search.c (protected_accessible_p): New function.
5534 (friend_accessible_p): Likewise.
5535 (accessible_p): Use them.
5537 1999-03-23 Mark Mitchell <mark@codesourcery.com>
5539 * pt.c (convert_nontype_argument): Don't create things that aren't
5540 PTRMEM_CSTs when applying a qualification conversion to a
5543 1999-03-23 Mark Mitchell <mark@codesourcery.com>
5545 * Makefile.in (OBJS): Don't mention hash.o.
5546 (OBJDEPS): Likewise.
5548 1999-03-23 Jason Merrill <jason@yorick.cygnus.com>
5550 * decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
5551 * decl.c (expand_static_init): Make sure we don't add any after
5554 * decl.c (cp_finish_decl): Move intelligence about handling
5555 DECL_COMDAT for variables from here...
5556 * decl2.c (comdat_linkage): ...to here.
5557 (maybe_make_one_only): Tweak.
5558 (import_export_decl): Call comdat_linkage for variables, too.
5559 (finish_file): Handle template statics properly.
5561 1999-03-22 Mark Mitchell <mark@codesourcery.com>
5563 * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
5564 Document internals of pointer-to-member-functions.
5565 (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
5566 (PFN_FROM_PTRMEMFUNC): Likewise.
5567 (build_type_conversion): Remove unused parameter.
5568 (build_ptrmemfunc1): Declare.
5569 (expand_ptrmemfunc_cst): New function.
5570 (delta2_from_ptrmemfunc): Likewise.
5571 (pfn_from_ptrmemfunc): Likewise.
5572 * cvt.c (cp_convert_to_pointer): Remove unused parameter to
5573 build_type_conversion. Use TYPE_PTRMEM_P for readability.
5574 (convert_to_reference): Remove unused parameter to
5575 build_type_conversion.
5576 (ocp_convert): Likewise.
5577 (build_user_type_conversion): Likewise.
5578 * error.c (dump_expr): Handle NULL pointer-to-member functions.
5579 * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
5580 * method.c (build_overload_value): Don't go splitting CONSTRUCTORs
5581 open when handling pointer-to-member functions.
5582 * pt.c (convert_nontype_argument): Clean up error messages. Be
5583 more stringent with pointers-to-members.
5584 * typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
5585 (build_unary_op): Tidy ever-so-slightly.
5586 (build_conditional_expr): Remove extra parameter to
5587 build_type_conversion.
5588 (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
5590 (expand_ptrmemfunc_cst): Define.
5591 (delta2_from_ptrmemfunc): Likewise.
5592 (pfn_from_ptrmemfunc): Likewise.
5594 1999-03-19 Mark Mitchell <mark@codesourcery.com>
5596 * init.c (build_member_call): Handle template-id expressions
5598 * typeck.c (build_x_function_call): Likewise.
5600 1999-03-19 Chip Salzenberg <chip@perlsupport.com>
5602 * friend.c (make_friend_class): Avoid core dump when
5603 not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
5605 1999-03-18 Jason Merrill <jason@yorick.cygnus.com>
5607 * decl.c (start_function): Suppress normal linkage heuristics
5608 for #pragma interface under MULTIPLE_SYMBOL_SPACES.
5610 1999-03-19 Alexandre Oliva <oliva@dcc.unicamp.br>
5612 * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c.
5613 ($(srcdir)/cp/parse.c): Moved from ../Makefile.in.
5615 1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de>
5617 * parse.y (named_complex_class_head_sans_basetype):
5618 Do not push a scope for error_mark_node.
5619 (maybe_base_class_list): Likewise.
5621 * decl.c (start_decl): Check for error_mark_node as a type.
5622 Detected by g++.brendan/array-refs.C.
5623 (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C.
5624 (maybe_build_cleanup_1): Likewise. Detected by
5625 g++.jason/incomplete1.C.
5627 * tree.c (build_dummy_object): Use void_zero_node instead of the
5629 (is_dummy_object): Check for such a node.
5630 Detected by g++.bob/inherit1.C
5632 1999-03-16 Jason Merrill <jason@yorick.cygnus.com>
5634 * method.c (old_backref_index): Split out...
5635 (flush_repeats): From here. Rename back from try_old_backref.
5636 (build_mangled_name): Put back some old-style repeat handling.
5638 Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5640 * lex.c: Don't include setjmp.h.
5641 (parse_float): New static function.
5642 (pf_args): New struct.
5643 (real_yylex): Use them in call to `do_float_handler'.
5645 1999-03-15 Mark Mitchell <mark@markmitchell.com>
5647 * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
5648 * tree.c (layout_basetypes): Not here.
5649 * search.c (dfs_search): Remove; no longer used.
5651 1999-03-12 Mark Mitchell <mark@markmitchell.com>
5653 * decl2.c (validate_nonmember_using_decl): Issue sensible
5654 error-messages on bogus qualifiers.
5656 1999-03-14 Jason Merrill <jason@yorick.cygnus.com>
5658 * call.c (add_function_candidate): Fix uninitialized variable.
5660 * Makefile.in (search.o): Add dependency on varray.h.
5662 1999-03-13 Jason Merrill <jason@yorick.cygnus.com>
5664 * decl.c (duplicate_decls): Use same_type_p.
5665 * method.c (try_old_backref): Renamed from flush_repeats. Use
5666 same_type_p. Don't try to handle repeats. Return success.
5667 (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support
5668 calls from old-style code, too.
5669 (check_ktype): Use same_type_p.
5670 (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT.
5671 (build_qualified_name): Simplify logic.
5672 (process_overload_item): Strip typedefs and quals at the top.
5673 (build_mangled_name_for_type_with_Gcode): Remove call to
5674 type_canonical_variant.
5675 (build_mangled_name): Likewise. Remove support for old-style
5676 repeats, which have been disabled since 2.7.2. Don't mess with
5678 (build_decl_overload_real): Don't mess with TREE_USED.
5680 1999-03-13 Nathan Sidwell <nathan@acm.org>
5682 * error.c (cp_printers): Add 'F' escape character.
5683 (dump_type_real): Remove TREE_LIST (fnargs) printing.
5684 Functionality moved to dump_parameters.
5685 (dump_type_suffix): Use dump_parameters and dump_exception_spec.
5686 (dump_function_decl): Extend meaning of V parameter. Use
5687 dump_parameters and dump_exception_spec.
5688 (dump_parameters): New static function.
5689 (dump_exception_spec): New static function.
5690 (fndecl_as_string): Change argument semantics. Use
5691 dump_function_decl directly.
5693 * sig.c (build_signature_table_constructor): Use cp_error.
5695 1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de>
5697 * semantics.c (finish_switch_cond): Handle error cases gracefully.
5698 Detected by g++.law/enum5.C.
5700 * typeck.c (build_modify_expr): Check for errors after resolving
5701 offsets. Detected by g++.brendan/static1.C.
5703 * decl.c (complete_array_type): Ignore initial_value if it is an
5704 error. Detected by g++.benjamin/17930.C.
5706 * typeck2.c (process_init_constructor): Return error if one argument
5707 is in error. Detected by g++.benjamin/13478.C.
5709 1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
5711 * decl.c (select_decl): Allow class templates when we need types.
5712 * decl2.c (ambiguous_decl): Likewise.
5714 1999-03-12 Mark Mitchell <mark@markmitchell.com>
5716 * lex.c (do_identifier): Correct call to enforce_access.
5717 * search.c (accessible_p): Tweak comment.
5719 1999-03-10 Mark Mitchell <mark@markmitchell.com>
5721 * semantics.c (begin_class_definition): Call build_self_reference.
5722 (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
5724 * search.c (assert_canonical_unmarked): Fix typo in prototype.
5726 * search.c (dfs_canonical_queue): New function.
5727 (dfs_assert_unmarked_p): Likewise.
5728 (assert_canonical_unmarked): Likewise.
5729 (access_in_type): Use it.
5730 (accessible_p): Likewise. Walk the whole tree when umarking.
5732 * sig.c (build_signature_table_constructor): Use accessible_p
5733 instead of compute_access.
5735 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
5737 * call.c (add_builtin_candidates): Handle overloaded conversion ops.
5739 1999-03-09 Mark Mitchell <mark@markmitchell.com>
5741 * cp-tree.h (flag_access_control): Declare.
5742 (TREE_VIA_PPUBLIC): Document.
5743 (DECL_NONSTATIC_MEMBER_P): New macro.
5744 (enforce_access): Return an indication of whether or not access
5746 (build_self_reference): Change prototype.
5747 (compute_access): Replace with ...
5748 (accessible_p): New function.
5749 (dfs_walk): Change prototype.
5750 (dfs_unmark): Likewise.
5751 (markedp): Likewise.
5752 * call.c (enforce_access): Use accessible_p.
5753 * class.c (build_self_reference): Insert the declaration into the
5754 list of members for this type, and make it public.
5755 * decl.c (xref_basetypes): Avoid ill-timed recursion.
5756 * init.c (build_offset_ref): Use lookup_member, not three separate
5757 name-lookups. Call enforce_access rather than checking for
5758 illegal accesses here.
5759 (resolve_offset_ref): Likewise.
5760 * lex.c (do_identifier): Likewise.
5761 * method.c (hack_identifier): Likewise.
5762 * parse.y (self_reference): Remove.
5763 (opt_component_decl_list): Don't use it.
5764 * parse.c: Regenerated.
5765 * pt.c (print_candidates): Generalize to handle lists of
5766 overloaded functions.
5767 (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's
5769 (get_template_base): Use new calling convention for dfs_walk.
5770 * search.c: Include varray.h. Add prototypes.
5771 (dfs_walk): Accept a data pointer to pass to the work functions.
5772 All callers changed. All work functions changed.
5773 (breadth_first_search): Rename to bfs_walk, and make consistent
5775 (dfs_walk_real): New function.
5776 (canonical_binfo): New function.
5777 (context_for_name_lookup): Likewise.
5778 (shared_marked_p): Likewise.
5779 (shared_unmarked_p): Likewise.
5780 (lokup_field_queue_p): Likewise.
5781 (lookup_field_r): Generalize to handle both functions and fields.
5782 (lookup_field): Just call lookup_member.
5783 (lookup_fnfields): Likewise.
5784 (lookup_member): Move body of lookup_field here and generalize.
5785 (dfs_accessible_queue_p): Likewise.
5786 (dfs_accessible_p): Likewise.
5787 (dfs_access_in_type): Likewise.
5788 (access_in_type): Likewise.
5789 (compute_access): Remove, and replace with ...
5790 (accessible_p): New function.
5791 (vbase_types): Remove.
5792 (vbase_decl_ptr_intermediate): Likewise.
5793 (vbase_decl_ptr): Likewise.
5794 (vbase_init_result): Likewise.
5795 (closed_envelopes): Likewise.
5796 (bvtable): Likewise.
5798 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
5800 * call.c (add_function_candidate): Check for proper number of args
5801 before checking the validity of those args.
5803 1999-03-06 Jason Merrill <jason@yorick.cygnus.com>
5805 * cp-tree.h (struct lang_type): Add anon_union field.
5806 (ANON_UNION_TYPE_P): Use it instead of examining type.
5807 (SET_ANON_UNION_TYPE_P): New macro.
5808 * decl.c (check_tag_decl): Use it.
5810 * search.c (compute_access): Handle non-type contexts earlier, and
5813 * tree.c (build_exception_variant): Use copy_to_permanent.
5815 * decl2.c (setup_initp): Give statics with no priority the default
5817 (do_dtors, do_ctors, finish_file): Remove special handling of
5818 non-prioritized statics.
5820 1999-03-05 Mark Mitchell <mark@markmitchell.com>
5822 * cp-tree.h (ANON_UNION_TYPE_P): Robustify.
5823 * decl.c (make_typename_type): Don't issue an error if an
5824 immediate lookup fails; it migt be resolved later.
5825 * friend.c (is_friend): Add comment.
5826 * search.c (breadth_first_search): Add POSTFN and DATA
5827 parameters. Tidy. All callers changed.
5828 (lookup_field_queue_p): New function.
5829 (lookup_field_r): Likewise.
5830 (lookup_field_post): Likewise.
5831 (lookup_field): Use them, via breadth_first_search, instead of
5833 (compute_access): Robustify.
5834 (lookup_fnfield_info): New structure.
5836 1999-03-05 Jason Merrill <jason@yorick.cygnus.com>
5838 * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again.
5840 1999-03-03 Jason Merrill <jason@yorick.cygnus.com>
5842 * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
5845 * decl2.c (import_export_class): Also return if
5846 CLASSTYPE_INTERFACE_ONLY is set.
5848 1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de>
5850 * decl.c (push_overloaded_decl): Only overwrite the old binding if
5852 * decl2.c (do_local_using_decl): Fix loop termination.
5854 1999-03-02 Mark Mitchell <mark@markmitchell.com>
5856 * cp-tree.h (determine_specialization): Don't declare.
5857 * pt.c (determine_specialization): Make it static. Eliminate
5858 complain parameter. Note that decl is always non-NULL now, and
5859 simplify accordingly.
5861 * decl.c (maybe_push_to_top_level): Always call
5862 push_cp_function_context.
5863 (pop_from_top_level): Always call pop_cp_function_context.
5865 1999-02-26 Nathan Sidwell <nathan@acm.org>
5867 * typeck.c (complete_type_or_else): Add VALUE arg, for helpful
5869 * cp-tree.h (complete_type_or_else): Added VALUE parameter.
5870 * init.c (build_new_1): Extra arg to complete_type_or_else.
5871 (build_delete): Likewise.
5872 * typeck.c (require_complete_type): Likewise.
5873 (pointer_int_sum): Likewise.
5874 (pointer_diff): Likewise.
5875 (build_component_ref): Likewise.
5877 * typeck2.c (incomplete_type_error): Always use cp_error.
5878 Show declaration of undefined type, if appropriate.
5879 Deal with UNKNOWN_TYPE nodes.
5881 * typeck.c (require_complete_type): Use TYPE_SIZE as
5882 size_zero_node to mean incomplete type.
5883 (require_complete_type_in_void): New function.
5884 (build_compound_expr): Call complete_type_in_void for LHS.
5885 (build_c_cast): Call complete_type_in_void for void cast.
5886 * cvt.c (ocp_convert): Call complete_type_in_void for void cast.
5887 * decl.c (cplus_expand_expr_stmt): Void expression checks moved to
5888 require_complete_type_in_void. Call it.
5889 * cp-tree.h (require_complete_type_in_void): Prototype new function.
5891 * typeck.c (convert_arguments): Use alternative format for
5892 function decls. Don't require_complete_type here. Simplify
5893 diagnostic printing.
5894 (convert_for_initialization): Don't require_complete_type on RHS yet.
5895 * call.c (convert_arg_to_ellipsis): Call require_complete_type.
5897 * call.c (build_over_call): Cope with qualified void return type.
5898 * semantics.c (finish_call_expr): Likewise.
5899 * typeck.c (build_function_call_real): Likewise.
5900 (c_expand_return): Likewise.
5901 * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
5903 * call.c (print_z_candidates): Use alternate print format, to be
5904 consistent with (pt.c) print_candidates.
5905 * method.c (hack_identifier): List candidate members.
5906 * search.c (lookup_field): Build ambiguous list, and show it, if
5909 1999-02-26 Mark Mitchell <mark@markmitchell.com>
5911 * typeck.c (decay_conversion): Don't confuse constant array
5912 variables with their initializers.
5914 * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when
5916 * pt.c (regenerate_decl_from_template): Tweak for clarity.
5917 (instantiate_decl): Mark a decl instantiated before regenerating
5918 it to avoid recursion.
5919 * tree.c (mapcar): Don't call decl_constant_value unless we know
5920 something is TREE_READONLY_DECL_P.
5922 * class.c (check_for_override): Don't stop checking when we find
5923 the first overridden function. Delete #if 0'd code.
5924 * search.c (get_matching_virtual): Likewise.
5926 1999-02-25 Richard Henderson <rth@cygnus.com>
5928 * lang-specs.h: Define __FAST_MATH__ when appropriate.
5930 1999-02-24 Mike Stump <mrs@wrs.com>
5932 * typeck.c (convert_for_assignment): Allow boolean integral constant
5933 expressions to convert to null pointer.
5935 1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
5937 * decl.c (lookup_namespace_name): Resolve namespace aliases.
5939 * class.c (push_nested_class): Allow namespaces.
5941 * decl2.c (set_decl_namespace): Add friendp parameter.
5942 * decl.c (grokfndecl): Pass it.
5943 (grokvardecl): Likewise.
5944 * cp-tree.h: Change declaration.
5946 1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
5948 * pt.c (tsubst): Allow an array of explicit size zero.
5950 1999-02-23 Jason Merrill <jason@yorick.cygnus.com>
5952 * errfn.c: Change varargs code to look like toplev.c.
5954 * method.c (process_modifiers): Don't prepend 'U' for char or
5957 1999-02-20 Craig Burley <craig@jcb-sc.com>
5959 * Make-lang.in (cplib2.ready): Don't consider updating
5960 cplib2 stuff if the current directory isn't writable, as
5961 it won't work (such as during a `make install').
5963 Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
5965 * decl2.c (start_objects): Make file scope constructors and
5966 destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
5967 ASM_OUTPUT_DESTRUCTOR are defined.
5969 1999-02-19 Mark Mitchell <mark@markmitchell.com>
5971 * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
5972 (fn_type_unification): Adjust prototype.
5973 (lookup_fnfields_1): Declare.
5974 * call.c (add_template_candidate_real): Adjust call to
5975 fn_type_unification.
5976 * class.c (add_method): Don't allow duplicate declarations of
5977 constructors or destructors.
5978 (resolve_address_of_overloaded_function): Remove unused variable.
5979 Adjust call to fn_type_unification.
5980 * decl.c (grokfndecl): Be more robust in the face of illegal
5982 * decl2.c (check_classfn): Remove hokey handling of member
5984 * pt.c (determine_specialization): Improve comments. Adjust to
5985 handle template argument deduction as per the standard.
5986 (check_explicit_specialization): Fix comment spacing. Handle
5987 type-conversion operators correctly. Improve error-recovery.
5988 (fn_type_unification): Remove EXTRA_FN_ARG parameter.
5989 (get_bindings_real): Simplify handling of static members.
5990 * search.c (lookup_fnfields_1): Make it have external linkage.
5991 * typeck.c (compparms): Fix comment.
5992 (build_unary_op): Don't try to figure out which template
5993 specialization is being referred to when when the address-of
5994 operator is used with a template function.
5996 Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5998 * cp-tree.h (lvalue_or_else): Qualify a char* with the `const'
5999 keyword to match an analogous change at the top level.
6001 * tree.c (lvalue_or_else): Likewise.
6003 1999-02-17 Mark Mitchell <mark@markmitchell.com>
6005 * decl.c (xref_basetypes): Comment.
6006 * pt.c (instantiate_class_template): Use xref_basetypes.
6008 1999-02-16 Mark Mitchell <mark@markmitchell.com>
6010 * cp-tree.h (tsubst): Change prototype.
6011 (tsubst_expr): Likewise.
6012 (tsubst_copy): Likewise.
6013 (type_unification): Remove prototype.
6014 * call.c (convert_default_arg): Adjust call to tsubst_expr.
6015 * class.c (resolve_address_of_overloaded_function): Just use
6016 fn_type_unification.
6017 * decl.c (grokdeclarator): Adjust call to tsubst.
6018 * method.c (build_template_parm_names): Likewise.
6019 * pt.c (GTB_VIA_VIRTUAL): New macro.
6020 (GTB_IGNORE_TYPE): Likewise.
6021 (resolve_overloaded_unification): Add `complain' parameter.
6022 (try_one_overload): Likewise.
6023 (tsubst_template_arg_vector): Likewise.
6024 (tsubst_template_parms): Likewise.
6025 (tsubst_aggr_type): Likewise.
6026 (tsubst_arg_types): Likewise.
6027 (tsubst_call_declarator_parms): Likewise.
6028 (unify): Remove explicit_mask.
6029 (type_unification_real): Likewise.
6030 (get_template_base_recursive): Likewise.
6031 (coerce_template_template_parms): Provide prototype.
6032 (tsubst_function_type): Likewise.
6033 (try_class_unification): New function.
6034 All callers changed to use new complain parameter.
6035 (get_template_base): Use try_class_unification.
6036 (unify): Adjust handling of classes derived from template types.
6037 (fn_type_unification): Substitute explicit arguments before
6040 1999-02-16 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6042 * decl.c (pushdecl): Remove dead code.
6044 1999-02-16 Jason Merrill <jason@yorick.cygnus.com>
6046 * decl2.c (finish_objects): Fix code I missed in previous change.
6048 1999-02-13 Jason Merrill <jason@yorick.cygnus.com>
6050 * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
6051 (grokdeclarator): Don't expect error_mark_node from grokfndecl.
6053 * pt.c (maybe_process_partial_specialization): Complain about
6054 'template <>' on non-specialization.
6056 1999-02-10 Jason Merrill <jason@yorick.cygnus.com>
6058 * decl.c (grokdeclarator): Catch wierd declarators.
6059 * decl2.c (finish_file): Don't abort because of namespace parsing
6061 (check_decl_namespace): Remove.
6063 1999-02-09 Mark Mitchell <mark@markmitchell.com>
6065 * cp-tree.h (get_template_base): Don't declare.
6066 (dfs_walk): Declare.
6067 (dfs_unmark): Likewise.
6068 (markedp): Likewise.
6069 * pt.c (unify): Remove duplicate declaration. Pass tparms and
6070 targs to get_template_base.
6071 (get_template_base_recursive): Move here from search.c. Check to
6072 see that the base found can be instantiated to form the desired
6074 (get_template_base): Likewise.
6075 (get_class_bindings): Simplify.
6076 * search.c (get_template_base_recursive): Move to pt.c.
6077 (get_template_base): Likewise.
6078 (markedp): Make it global.
6079 (dfs_walk): Likewise.
6080 (dfs_unmark): Likewise.
6082 1999-02-07 Jason Merrill <jason@yorick.cygnus.com>
6084 * pt.c (maybe_process_partial_specialization): Complain about
6085 specialization in wrong namespace.
6086 * tree.c (decl_namespace_context): New fn.
6088 1999-02-06 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6090 * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
6091 * pt.c (coerce_template_template_parms): Handle nested
6092 template template parameters.
6094 Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com)
6096 * typeck2.c: Update email addresses.
6098 1999-02-04 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6100 * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag
6103 1999-02-04 Jason Merrill <jason@yorick.cygnus.com>
6105 * lex.c (retrofit_lang_decl): Split out...
6106 (build_lang_decl): From here.
6107 * decl.c (pushdecl): Call it for functions generated by the middle
6108 end that don't have DECL_LANG_SPECIFIC.
6109 * cp-tree.h: Declare it.
6111 * decl2.c: Remove flag_init_priority. Always enable initp stuff.
6112 (start_objects, finish_objects): Only use special
6113 init_priority code if the user specified a priority.
6114 (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
6117 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
6119 * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and
6120 mkstemp.o. Get them from libiberty now.
6121 (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o.
6123 Tue Feb 2 22:38:48 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
6125 * decl2.c (lang_decode_option): Use read_integral_parameter.
6127 1999-02-01 Mark Mitchell <mark@markmitchell.com>
6129 * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
6130 before calling complete_type_or_else.
6132 Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6134 * input.c (inline): Don't define, its handled by system.h.
6136 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
6138 * decl2.c: Don't define flag_no_ident here. Don't process
6140 * cp-tree.h: Don't declare flag_no_ident here.
6141 * lang-specs.h: Map -Qn to -fno-ident.
6143 1999-01-28 Jason Merrill <jason@yorick.cygnus.com>
6145 * cp-tree.h (struct tree_binding): Replace scope field with a union.
6146 (BINDING_SCOPE): Adjust.
6147 * decl.c (BINDING_LEVEL): Adjust.
6149 1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
6151 * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
6154 * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
6157 * tree.c (equal_functions): Fix name in prototype.
6159 * decl.c (push_local_binding): Add FLAGS argument.
6160 (pushdecl, push_overloaded_decl): Pass it.
6161 * decl2.c (do_local_using_decl): Likewise.
6162 * cp-tree.h: Adjust prototype.
6163 * decl.c (poplevel): Fix logic.
6165 * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
6166 (poplevel): Handle that. Fix logic for removing TREE_LISTs.
6167 (cat_namespace_levels): Don't loop forever.
6169 1999-01-25 Richard Henderson <rth@cygnus.com>
6171 * typeck.c (build_reinterpret_cast): Fix typo in duplicated test.
6173 1999-01-25 Jason Merrill <jason@yorick.cygnus.com>
6175 * class.c (resolve_address_of_overloaded_function): Mark the
6176 chosen function used.
6178 * call.c (build_call): Make sure that a function coming in has
6179 been marked used already.
6180 * decl.c (expand_static_init): Call mark_used instead of
6182 * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
6183 alloc_eh_object, expand_throw): Likewise.
6184 * init.c (build_builtin_delete_call): Likewise.
6185 * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
6186 expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
6187 expand_generic_desc): Likewise.
6189 1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
6191 * tree.c (equal_functions): New function.
6192 (ovl_member): Call it.
6194 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6196 * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf.
6198 1999-01-25 Martin von Loewis <loewis@informatik.hu-berlin.de>
6200 * decl.c (decls_match): Return 1 if old and new are identical.
6201 (push_overloaded_decl): Set OVL_USED when PUSH_USING.
6203 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6205 * decl.c (start_function): Make member functions one_only on windows.
6206 * decl2.c (import_export_decl): Likewise.
6208 * decl.c (grokdeclarator): Don't complain about implicit int in
6209 a system header. Change same-name field check to not complain in
6210 a system header instead of within extern "C".
6212 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6214 * cp-tree.h (PUSH_GLOBAL): New macro.
6215 (PUSH_LOCAL): Likewise.
6216 (PUSH_USING): Likewise.
6217 (namespace_bindings_p): Declare.
6218 (push_overloaded_decl): Likewise.
6219 * decl.c (push_overloaded_decl): Don't make it static. Check for
6220 illegal declarations after using declarations here.
6221 (namespace_bindings_p): Likewise.
6222 (duplicate_decls): Don't consider declarations from different
6223 namespaces to be the same.
6224 (pushdecl): Use symbolic PUSH_ constants in calls to
6225 push_overloaded_decl.
6226 (push_overloaded_decl_1): Likewise.
6227 * decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
6228 (do_nonmember_using_decl): Check for illegal using declarations
6229 after ordinary declarations here.
6230 (do_local_using_decl): Call pushdecl to insert declarations.
6232 1999-01-21 Jason Merrill <jason@yorick.cygnus.com>
6234 * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo.
6236 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6238 * tree.c (build_cplus_array_type_1): Don't call build_array_type
6239 for types involving template parameters.
6241 * cp-tree.h (PARM_DECL_EXPR): Delete.
6242 (convert_default_arg): Change prototype.
6243 (check_default_argument): Declare.
6244 (search_tree): Likewise.
6245 * call.c (convert_default_arg): Take the function to which the
6246 default argument belongs as a parameter, and do any necessary
6247 instantiation here, instead of ...
6248 (build_over_call): Here.
6249 * decl.c (local_variable_p): New function.
6250 (check_default_argument): Likewise, split out and tidied from ...
6252 * error.c (dump_expr): Don't set PARM_DECL_EXPR.
6253 * pt.c (tsubst_call_declarator_parms): New function.
6254 (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing
6255 with CALL_EXPRs, rather than trying to be clever.
6256 (tsubst): Use tsubst_call_declarator_parms.
6257 * tree.c (search_tree): Don't make it static.
6258 * typeck.c (convert_arguments): Use new interface to
6259 convert_default_arg.
6261 1999-01-20 Mark Mitchell <mark@markmitchell.com>
6263 * error.c (dump_function_decl): Don't print the argument types for
6264 a function when the verbosity level is negative.
6266 * call.c (build_over_call): Check format attributes at call-time.
6268 * pt.c (tsubst_copy): Fix comment.
6269 (unify): Don't allow unification with variable-sized arrays.
6271 * semantics.c (finish_stmt_expr): When processing a template make
6272 the BIND_EXPR long-lived.
6274 1999-01-19 Jason Merrill <jason@yorick.cygnus.com>
6276 * decl2.c (finish_vtable_vardecl): Make vtables comdat here.
6277 (import_export_vtable): Not here.
6279 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6281 * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique
6282 non-static member function.
6284 1999-01-18 Nathan Sidwell <nathan@acm.org>
6286 * class.c (instantiate_type): Only diagnose illegal address of member
6287 function if complaining.
6289 * decl.c (lookup_name_real): Remove duplicate code.
6291 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6293 * tree.c (copy_template_template_parm): Use permanent_obstack.
6295 1999-01-18 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6297 * pt.c (unify): Remove restrictions on deduction of argument
6298 of template template parameters.
6300 1999-01-18 Nathan Sidwell <nathan@acm.org>
6302 * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
6304 * class.c (resolve_address_of_overloaded_function): Show list of
6305 all candidates, when none of them match.
6307 1999-01-18 Chip Salzenberg <chip@perlsupport.com>
6309 * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
6310 definition of 'casting away const' in reinterpret_cast<>.
6312 1999-01-18 Graham <grahams@rcp.co.uk>
6314 * cvt.c: Add include for decl.h, remove extern for
6315 static_aggregates which is now provided by decl.h.
6317 * Makefile.in (cvt.o): Add dependency for decl.h and missing
6318 dependencies for convert.h and flags.h.
6320 1999-01-18 Nathan Sidwell <nathan@acm.org>
6322 * decl2.c (do_dtors): Set current location to that of the
6323 decl, for sensible diagnostics and debugging.
6324 (check_classfn): Issue `incomplete type' error, if
6325 class is not defined.
6327 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6329 * cp-tree.h: Add prototype for bound_pmf_p.
6331 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6332 Manfred Hollstein <manfred@s-direktnet.de>
6334 * decl.c (grokdeclarator): Don't make 'main(){}' an error with only
6337 1999-01-16 Nathan Sidwell <nathan@acm.org>
6339 * cp-tree.h (struct lang_type): Added has_mutable flag.
6340 (CLASSTYPE_HAS_MUTABLE): New macro to access it.
6341 (TYPE_HAS_MUTABLE_P): New macro to read it.
6342 (cp_has_mutable_p): Prototype for new function.
6343 * class.c (finish_struct_1): Set has_mutable from members.
6344 * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if
6345 it contains a mutable.
6346 * typeck.c (cp_has_mutable_p): New function.
6348 1999-01-15 Mark Mitchell <mark@markmitchell.com>
6350 * pt.c (process_template_parm): Ignore top-level qualifiers on
6351 non-type parameters.
6353 * decl.c (start_function): Use current_function_parms in the call
6354 to require_complete_type_for_parms, not the probably empty
6357 1999-01-14 Jason Merrill <jason@yorick.cygnus.com>
6359 * semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
6361 * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
6362 that we don't suppress the other copies.
6363 * lex.c (handle_cp_pragma): Likewise.
6365 1999-01-13 Mark Mitchell <mark@markmitchell.com>
6367 * decl.c (grokdeclarator): Undo 1998-12-14 change.
6368 * tree.c (build_cplus_array_type_1): Likewise.
6369 * pt.c (instantiate_class_template): Remove misleading comment.
6370 (tsubst_aggr_type): Substitute if there are template parameters,
6371 regardless of whether or not they use template arguments.
6372 (unify): Likewise, but for unification.
6374 1999-01-12 Richard Henderson <rth@cygnus.com>
6376 * cp-tree.h (flag_permissive): Declare extern.
6378 1999-01-06 Mark Mitchell <mark@markmitchell.com>
6380 * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT
6382 (lang_type): Add is_partial_instantiation. Decrease width of
6384 (PARTIAL_INSTANTIATION_P): New macro.
6385 (OPERATOR_TYPENAME_P): Remove.
6386 * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not
6387 OPERATOR_TYPENAME_P.
6388 (grok_op_properties): Likewise.
6389 * friend.c (do_friend): Handle friends that are member functions
6391 * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT.
6392 * pt.c (instantiate_class_template): Rework for clarity. Avoid
6393 leaving TYPE_BEING_DEFINED set in obscure cases. Don't do
6394 any more partial instantiation than is absolutely necessary for
6395 implicit typename. Set PARTIAL_INSTANTIATION_P.
6396 (tsubst_decl): Use IDENTIFIER_TYPENAME_P.
6397 * semantics.c (begin_class_definition): Handle partial
6398 specializations of a type that was previously partially
6401 Wed Jan 6 03:18:53 1999 Mark Elbrecht <snowball3@usa.net.
6403 * g++spec.c (LIBSTDCXX): Provide default definition.
6404 (lang_specific_driver): Use LIBSTDCXX instead of "-lstdc++".
6406 Tue Jan 5 22:11:25 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6408 * Make-lang.in (g++.o): Depend on prefix.h.
6410 1999-01-04 Jason Merrill <jason@yorick.cygnus.com>
6412 * tree.c (bound_pmf_p): New fn.
6413 * typeck.c (build_c_cast): Use it.
6415 * decl.c (grok_op_properties): Use same_type_p.
6417 Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6419 * Makefile.in (cvt.o): Depend on toplev.h.
6421 * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes.
6423 * cvt.c: Include toplev.h.
6425 * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and
6428 * init.c (expand_vec_init): Initialize variable `itype'.
6430 * lex.c (yyerror): Cast the argument passed to a ctype function to
6433 * method.c (build_mangled_C9x_name): Wrap prototype and definition
6434 in "HOST_BITS_PER_WIDE_INT >= 64".
6436 * typeck.c (build_binary_op): Mark parameter `convert_p' with
6439 1998-12-22 Mark Mitchell <mark@markmitchell.com>
6441 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
6442 * tree.c (build_exception_variant): Don't crash on empty throw
6445 1998-12-18 DJ Delorie <dj@cygnus.com>
6447 * cvt.c (convert_to_reference): Check for both error_mark_node
6448 and NULL_NODE after call to convert_for_initialization.
6450 1998-12-17 Jason Merrill <jason@yorick.cygnus.com>
6452 * error.c (interesting_scope_p): New fn.
6453 (dump_simple_decl): Use it.
6454 (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
6455 (dump_expr, case OFFSET_REF): Print ->* if appropriate.
6457 1998-12-16 Mark Mitchell <mark@markmitchell.com>
6459 * class.c (resolve_address_of_overloaded_function): Do conversion
6460 to correct type here, rather than ...
6461 (instantiate_type): Here.
6463 * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
6464 (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
6465 (decl_template_parm_p): Remove.
6466 * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
6468 * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
6469 * pt.c (push_inline_template_parms_recursive): Set it.
6470 (decl_template_parm_p): Remove.
6471 (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
6472 (process_template_parm): Set it.
6474 Wed Dec 16 16:33:58 1998 Dave Brolley <brolley@cygnus.com>
6476 * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
6477 if configured with cpplib.
6479 1998-12-15 Mark Mitchell <mark@markmitchell.com>
6481 * decl.c (poplevel): Make sure ns_binding is initialized.
6483 * decl.c (finish_function): Undo inadvertent change in previous
6486 1998-12-14 Mark Mitchell <mark@markmitchell.com>
6488 * class.c (pushclass): Tweak handling of class-level bindings.
6489 (resolve_address_of_overloaded_function): Update pointer-to-member
6491 (instantiate_type): Likewise.
6492 * cvt.c (cp_convert_to_pointer): Likewise.
6493 * decl.c (pop_binding): Take the DECL to pop, not just the name.
6494 Deal with `struct stat' hack.
6495 (binding_level): Add to documentation.
6496 (push_binding): Clear BINDING_TYPE.
6497 (add_binding): New function.
6498 (push_local_binding): Use it.
6499 (push_class_binding): Likewise.
6500 (poplevel): Adjust calls to pop_binding.
6501 (poplevel_class): Likewise.
6502 (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
6503 declarations to current binding level.
6504 (push_class_level_binding): Likewise.
6505 (push_overloaded_decl): Adjust handling of OVERLOADs in local
6507 (lookup_namespace_name): Don't crash when confronted with a
6509 (lookup_name_real): Do `struct stat' hack in local binding
6511 (build_ptrmemfunc_type): Adjust documentation.
6512 (grokdeclarator): Don't avoid building real array types when
6513 processing templates unless really necessary.
6514 (finish_method): Adjust calls to pop_binding.
6515 * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
6516 not reparse_decl_as_expr.
6517 (build_expr_from_tree): Deal with a template-id as the function to
6518 call in a METHOD_CALL_EXPR.
6519 * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
6520 (maybe_adjust_types_For_deduction): Don't do peculiar things with
6522 (resolve_overloaded_unification): Handle COMPONENT_REFs. Build
6523 pointer-to-member types where necessary.
6524 * tree.c (build_cplus_array_type_1): Don't avoid building real
6525 array types when processing templates unless really necessary.
6526 (build_exception_variant): Compare the exception lists correctly.
6528 1998-12-13 Mark Mitchell <mark@markmitchell.com>
6530 * cp-tree.def (CPLUS_BINDING): Update documentation.
6531 * cp-tree.h (LOCAL_BINDING_P): New macro.
6532 (lang_identifier): Rename local_value to bindings.
6533 (tree_binding): Make `scope' of type `void*', not `tree'.
6534 (BINDING_SCOPE): Update documentation.
6535 (IDENTIFIER_LOCAL_VALUE): Remove.
6536 (IDENTIFIER_CLASS_VALUE): Document.
6537 (IDENTIFIER_BINDING): New macro.
6538 (IDENTIFIER_VALUE): Likewise.
6539 (TIME_IDENTIFIER_TIME): Likewise.
6540 (TIME_IDENTIFIER_FILEINFO): Likewise.
6541 (IMPLICIT_TYPENAME_P): Likewise.
6542 (set_identifier_local_value): Remove.
6543 (push_local_binding): New function.
6544 (push_class_binding): Likewise.
6545 * class.c (pushclass): Update comments; use push_class_binding.
6546 * decl.c (set_identifier_local_value_with_scope): Remove.
6547 (set_identifier_local_value): Likewise.
6548 (push_binding): New function.
6549 (pop_binding): Likewise.
6550 (binding_level): Update documentation. Remove shadowed.
6551 (BINDING_LEVEL): New macro.
6552 (free_binding_nodes): New variable.
6553 (poplevel): Adjust for new name-lookup scheme. Don't mess up
6554 BLOCK_VARs when doing for-scope extension. Remove effectively
6556 (pushlevel_class): Tweak formatting.
6557 (poplevel_class): Adjust for new name-lookup scheme.
6558 (print_binding_level): Likewise.
6559 (store_bindings): Likewise.
6560 (pushdecl): Likewise.
6561 (pushdecl_class_level): Likewise.
6562 (push_class_level_binding): Likewise.
6563 (push_overloaded_decl): Update comments. Adjust for new
6565 (lookup_name_real): Likewise.
6566 (lookup_name_current_level): Likewise.
6567 (cp_finish_decl): Likewise.
6568 (require_complete_types_for_parms): Likewise. Remove misleading
6570 (grok_parms): Likewise. Don't call
6571 require_complete_types_for_parms here.
6572 (grok_ctor_properties): Don't treat templates as copy
6574 (grop_op_properties): Or as assignment operators.
6575 (start_function): Document. Adjust for new name-lookup scheme.
6576 (finish_function): Likewise.
6577 * decl2.c (do_local_using_decl): Use push_local_binding.
6578 * lex.c (begin_definition_of_inclass_inline): New function, split
6580 (do_pending_inlines): Here, and ...
6581 (process_next_inline): Here.
6582 (get_time_identifier): Use TIME_IDENTIFIER_* macros.
6583 (init_filename_times): Likewise.
6584 (extract_interface_info): Likewise.
6585 (ste_typedecl_interface_info): Likewise.
6586 (check_newline): Likewise.
6587 (dump_time_statistics): Likewise.
6588 (handle_cp_pragma): Likewise.
6589 (do_identifier): Adjust for new name-lookup scheme.
6590 * parse.y (function_try_block): Return ctor_initializer_opt value.
6592 (fn.defpen): Pass appropriate values to start_function.
6593 (pending_inline): Use functor_try_block value, and pass
6594 appropriate values to finish_function.
6595 * pt.c (is_member_template): Update documentation; remove handling
6596 of FUNCTION_DECLs. As per name, this function should deal only in
6598 (decl_template_parm_p): Change name of olddecl parameter to decl.
6599 (check_template_shadow): Adjust for new name-lookup scheme.
6600 (lookup_template_class): Likewise.
6601 (tsubst_decl): Tweak so as not to confuse member templates with
6602 copy constructors and assignment operators.
6603 (unify): Handle UNION_TYPEs.
6604 * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
6605 (lang_print_xnode): Adjust for new name-lookup scheme.
6606 * typeck.c (mark_addressable): Likewise.
6607 (c_expand_return): Likewise.
6609 1998-12-08 Jason Merrill <jason@yorick.cygnus.com>
6611 * decl.c (grokdeclarator): Allow field with same name as class
6614 * decl.c (lookup_name_real): Don't limit field lookup to types.
6615 * class.c (check_member_decl_is_same_in_complete_scope): No error
6616 if icv and x are the same.
6617 * lex.c (do_identifier): Tweak error message.
6619 1998-12-10 Mark Mitchell <mark@markmitchell.com>
6621 * decl.c (start_enum): Use push_obstacks, not
6622 end_temporary_allocation.
6623 (finish_enum): Call pop_obstacks.
6625 1998-12-10 Mark Mitchell <mark@markmitchell.com>
6627 * class.c (instantiate_type): Return error_mark_node rather than
6630 1998-12-09 Mark Mitchell <mark@markmitchell.com>
6632 * cp-tree.h (most_specialized_instantiation): New function.
6633 (print_candidates): Likewise.
6634 * class.c (validate_lhs): Remove.
6635 (resolve_address_of_overloaded_function): New function, split out
6636 and then substantially reworked, from ...
6637 (instantiate_type): Use it. Simplify.
6638 * cvt.c (convert_to_reference): Complain when caller has indicated
6639 that's the right thing to do. Don't crash if instantiate_type
6641 * pt.c: Substitute `parameters' for `paramters' throughout.
6642 (print_candidates): Don't make it static.
6643 (most_specialized_instantiation): Split out from ...
6644 (most_specialized): Here.
6646 Wed Dec 9 15:33:01 1998 Dave Brolley <brolley@cygnus.com>
6648 * lex.c (lang_init_options): Initialize cpplib.
6649 * decl2.c (parse_options,cpp_initialized): Removed.
6650 (lang_decode_option): Move initialization of cpplib to
6653 1998-12-09 Mark Mitchell <mark@markmitchell.com>
6655 * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
6656 well as the TYPE_DECL, when a typedef name is assigned to a
6657 previously anonymous type.
6659 1998-12-08 Andrew MacLeod <amacleod@cygnus.com>
6661 * cp/except.c (call_eh_info): Use __start_cp_handler instead of
6662 __cp_eh_info for getting the eh info pointer. Add table_index to
6664 (push_eh_cleanup): Don't increment 'handlers' data field.
6665 (process_start_catch_block): Don't set the 'caught' field.
6667 * cp/exception.cc (CP_EH_INFO): New macro for getting the
6668 exception info pointer within library routines.
6669 (__cp_eh_info): Use CP_EH_INFO.
6670 (__start_cp_handler): Get exception info pointer, set caught field,
6671 and increment the handlers field. Avoids this being done by handlers.
6672 (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
6673 (uncaught_exception): Use CP_EH_INFO macro.
6675 Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com)
6677 * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
6679 Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
6681 * lex.c (check_newline): Add support for \ as `natural'
6682 characters in file names in #line to be consistent with #include
6683 handling. We support escape processing in the # 1 "..." version of
6684 the command. See also support in cp/lex.c.
6686 1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
6688 * cp/decl2.c: s/data/opts/ when initializing cpp_reader
6691 1998-12-07 Jason Merrill <jason@yorick.cygnus.com>
6693 * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
6695 * error.c (dump_simple_decl): Also print namespace context.
6696 (dump_function_decl): Likewise.
6698 * decl2.c (ambiguous_decl): Don't print old value if it's
6701 * decl.c (lookup_name_real): Fix handling of local types shadowed
6702 by a non-type decl. Remove obsolete code.
6703 * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
6705 * lang-options.h: Add -fpermissive.
6706 * decl2.c: Likewise.
6707 * cp-tree.h: Add flag_permissive.
6708 * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
6709 were specified, set flag_pedantic_errors.
6710 * call.c (build_over_call): Turn dropped qualifier messages
6712 * cvt.c (convert_to_reference): Likewise.
6713 * typeck.c (convert_for_assignment): Likewise.
6715 1998-12-05 Jason Merrill <jason@yorick.cygnus.com>
6717 * decl2.c (coerce_new_type): Use same_type_p.
6718 (coerce_delete_type): Likewise.
6720 * call.c (check_dtor_name): Return 1, not error_mark_node.
6722 1998-12-04 Jason Merrill <jason@yorick.cygnus.com>
6724 * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
6725 if MULTIPLE_SYMBOL_SPACES.
6727 * pt.c (check_template_shadow): New fn.
6728 * decl2.c (grokfield): Use it.
6729 * decl.c (pushdecl): Likewise.
6730 (pushdecl_class_level): Likewise.
6731 (start_method): Likewise.
6732 (xref_tag): Don't try to use 't' if we're defining.
6734 * call.c (check_dtor_name): Just return an error_mark_node.
6735 * pt.c (lookup_template_class): Complain about using non-template here.
6736 * parse.y (apparent_template_type): Not here.
6738 * pt.c (check_explicit_specialization): Complain about specialization
6741 * lang-options.h: Add -f{no-,}implicit-inline-templates.
6743 * pt.c (convert_nontype_argument): Don't assume that any integer
6744 argument is intended to be a constant-expression.
6746 1998-12-03 Mark Mitchell <mark@markmitchell.com>
6748 * class.c (handle_using_decl): Fix comment. Don't lookup
6749 constructors in base classes.
6750 (validate_lhs): Fix typo in comment.
6751 * search.c (lookup_field_1): Don't return a USING_DECL.
6753 * cp-tree.h (DECL_ACCESS): Improve documentation.
6755 * decl.c (expand_static_init): Don't set the initialization-done
6756 flag until the initialization is done.
6758 1998-12-02 Mark Mitchell <mark@markmitchell.com>
6760 * decl2.c (validate_nonmember_using_decl): Complain about using
6761 declarations for class members.
6763 1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
6765 * typeck2.c (process_init_constructor): Use same_type_p.
6767 * decl.c (check_tag_decl): Don't warn about null decl inside a
6770 * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
6772 (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
6773 (resolve_overloaded_unification): Strip baselinks.
6775 Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6777 * g++spec.c: Don't prototype xmalloc.
6779 1998-11-25 Jason Merrill <jason@yorick.cygnus.com>
6781 * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
6783 * decl.c (check_tag_decl): Do complain about null friend decl at
6786 1998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
6788 * lex.c (make_lang_type): Clear the whole struct lang_type, not
6789 only the first multiple of sizeof (int).
6791 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
6793 * decl.c (start_decl): An explicit specialization of a static data
6794 member is only a definition if it has an initializer.
6796 * except.c (expand_throw): Use cp_finish_decl for the throw temp.
6797 * cvt.c (build_up_reference): Pass DIRECT_BIND down into
6799 * init.c (expand_default_init): Check for DIRECT_BIND instead of
6802 * call.c (build_over_call): Use build_decl.
6804 * except.c (expand_throw): Just use convert, not
6805 build_reinterpret_cast.
6807 * lex.c (handle_generic_pragma): Use token_buffer.
6809 * decl.c (check_tag_decl): Don't complain about null friend decl.
6811 1998-11-24 Dave Pitts <dpitts@cozx.com>
6813 * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the
6815 * lex.c (check_newline): Use ISALPHA.
6816 (readescape): Use ISGRAPH.
6817 (yyerror): Use ISGRAPH.
6819 1998-11-24 Nathan Sidwell <nathan@acm.org>
6821 * search.c (get_abstract_virtuals): Do not use initial
6822 CLASSTYPE_ABSTRACT_VIRTUALS.
6823 * typeck2.c (abstract_virtuals_error): Show location of abstract
6825 * call.c (build_new_method_call): Use
6826 CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
6827 * class.c (finish_struct_bits): Don't bother working out whether
6828 get_abstract_virtuals will do anything, just do it.
6830 1998-11-24 Graham <grahams@rcp.co.uk>
6832 * typeck.c (build_component_ref): Remove unused statement.
6834 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
6836 * class.c (add_method): Catch invalid overloads.
6838 * class.c (add_method): Build up OVERLOADs properly for conversion ops.
6839 * search.c (lookup_conversions): Handle getting real OVERLOADs.
6840 (add_conversions): Likewise. Revert last change.
6841 * call.c (add_conv_candidate): Pass totype to add_candidate instead
6842 of fn. Don't add a new candidate if the last one was for the same
6844 (print_z_candidates): Handle getting a type as a function.
6845 (joust): If we got two conversion candidates to the same type,
6847 (build_object_call): Lose 'templates'.
6848 (build_user_type_conversion_1): Handle getting real OVERLOADs.
6850 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
6852 * typeck2.c (process_init_constructor): If there are elements
6853 that don't have initializers and they need to have constructors
6854 run, supply them with initializers.
6856 * class.c (finish_struct_1): A class with a 0-width bitfield is
6859 1998-11-23 Mark Mitchell <mark@markmitchell.com>
6861 * pt.c (instantiate_class_template): Don't try to figure out what
6862 specialization to use for a partial instantiation. Correct
6863 typos in a couple of comments. Avoid calling uses_template_parms
6866 1998-11-23 Benjamin Kosnik <bkoz@cygnus.com>
6868 * method.c (process_overload_item): Add call to
6869 build_mangled_C9x_name for intTI_type_nodes.
6870 (build_mangled_C9x_name): Add prototype, define.
6871 * decl.c (init_decl_processing): Add names for
6874 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
6876 * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
6878 * class.c (finish_struct_1): Set things up for 0-width bitfields
6879 like we do for others.
6881 * decl.c (check_tag_decl): New fn.
6882 (shadow_tag): Split out from here.
6883 * decl2.c (grok_x_components): Call it.
6885 1998-11-22 Jason Merrill <jason@yorick.cygnus.com>
6887 * decl.c: Lose warn_about_return_type.
6888 (grokdeclarator): Always complain about implicit int, except for
6891 * decl.c (tag_name): New fn.
6892 (xref_tag): Complain about using typedef-name after class-key.
6894 * init.c (expand_vec_init): Also keep going if from_array.
6896 * tree.c (is_overloaded_fn): Also handle the output of
6899 * decl.c (grokdeclarator): Use constructor_name when comparing
6900 field name against enclosing class.
6901 * class.c (finish_struct_anon): Likewise.
6903 1998-11-22 Mark Mitchell <mark@markmitchell.com>
6905 * decl.c (poplevel): Remove code to handle KEEP == 2.
6906 (finish_function): Don't confuse BLOCK-order when
6907 processing a destructor.
6909 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
6911 * decl.c (require_complete_types_for_parms): Call layout_decl
6912 after we've completed the type.
6914 1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de>
6916 * decl2.c (validate_nonmember_using_decl): Allow using templates
6917 from the global namespace.
6919 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
6921 Handle specifying template args to member function templates.
6922 * tree.c (build_overload): Always create an OVERLOAD for a template.
6923 * search.c (add_conversions): Handle finding an OVERLOAD.
6924 * decl2.c (check_classfn): Likewise.
6925 * lex.c (identifier_type): See through a baselink.
6926 * parse.y (do_id): Don't call do_identifier if we got a baselink.
6927 * class.c (instantiate_type, case TREE_LIST): Recurse.
6929 * decl.c (grokdeclarator): Allow a boolean constant for array
6930 bounds, odd as that sounds.
6932 * pt.c (unify): Be more strict about non-type parms, except for
6934 (UNIFY_ALLOW_INTEGER): New macro.
6936 1998-11-19 Manfred Hollstein <manfred@s-direktnet.de>
6938 * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir).
6940 1998-11-19 Jason Merrill <jason@yorick.cygnus.com>
6942 * semantics.c (begin_class_definition): Call
6943 maybe_process_partial_specialization before push_template_decl.
6944 Don't call push_template_decl for a specialization.
6945 * search.c (lookup_field): Do return a member template class.
6946 * decl2.c (handle_class_head): Handle member template classes.
6948 * decl.c (grokdeclarator): A parm type need not be complete.
6950 * pt.c (convert_nontype_argument): Fix thinko.
6952 1998-11-18 Mark Mitchell <mark@markmitchell.com>
6954 * cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
6955 (global_delete_fndecl): New variable.
6956 * decl.c (global_delete_fndecl): Define it.
6957 (init_decl_processing): Set it.
6958 * init.c (build_builtin_delete_call): Use it.
6959 * tree.c (mapcar): Recursively call mapcar for the type of EXPR
6962 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
6964 * decl.c (cplus_expand_expr_stmt): Always complain about unresolved
6967 * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue.
6968 * call.c (build_object_call): Also support references to functions.
6969 * typeck.c (convert_for_initialization): Don't decay a function
6970 if the target is a reference to function.
6972 * search.c (add_conversions): Get all the overloads from a class.
6974 * decl.c (grok_ctor_properties): Complain about any constructor
6975 that will take a single arg of the class type by value.
6977 * typeck2.c (build_functional_cast): Can't create objects of
6978 abstract classes this way.
6979 * cvt.c (ocp_convert): Likewise.
6981 * decl.c (grokfndecl): Member functions of local classes are not
6984 1998-11-18 Mark Mitchell <mark@markmitchell.com>
6986 * Make-lang.in (cc1plus): Add dependency on hash.o.
6988 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
6990 * search.c (get_abstract_virtuals): Complain about virtuals with
6992 * typeck2.c (abstract_virtuals_error): Remove handling for virtuals
6993 with no final overrider.
6994 * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
6995 on virtuals with no final overrider.
6997 * lex.c (reinit_parse_for_block): Add a space after the initial ':'.
6999 * class.c (finish_struct_1): Don't remove zero-width bit-fields until
7002 * friend.c (do_friend): Don't set_mangled_name_for_decl.
7004 * class.c (finish_struct_anon): Complain about non-fields.
7005 * decl2.c (build_anon_union_vars): Likewise.
7007 * decl.c (grokdeclarator): Normal data members can't have the same
7008 name as the class, either.
7009 * class.c (finish_struct_anon): Neither can members of an
7012 1998-11-17 Mark Mitchell <mark@markmitchell.com>
7014 * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses.
7015 (TYPE_BINFO): Likewise.
7016 (IS_AGGR_TYPE): Tweak.
7017 (SET_IS_AGGR_TYPE): New macro.
7018 (CLASS_TYPE_P): Tweak.
7019 (lang_type): Group mark bitfields together. Remove linenum.
7020 (CLASSTYPE_SOURCE_LINE): Remove macro.
7021 (CLASSTYPE_MARKED_N): New macro.
7022 (SET_CLASSTYPE_MARKED_N): Likewise.
7023 (CLEAR_CLASSTYPE_MARKED_N): Likewise.
7024 (CLASS_TYPE_MARKED_*): Use them.
7025 (SET_CLASSTYPE_MARKED_*): Likewise.
7026 (CLEAR_CLASSTYPE_MARKED_*): Likewise.
7027 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
7028 (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well.
7029 (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE.
7030 * class.c (class_cache_obstack): New variable.
7031 (class_cache_firstobj): Likewise.
7032 (finish_struct): Don't set CLASSTYPE_SOURCE_LINE.
7033 (pushclass): Free the cache, when appropriate.
7035 (maybe_push_cache_obstack): Use class_cache_obstack.
7036 * decl.c (include hash.h).
7037 (typename_hash): New function.
7038 (typename_compare): Likewise.
7039 (build_typename_type): Check the hash table to avoid creating
7041 (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE.
7042 (grokdeclarator): Use CLASS_TYPE_P.
7043 (xref_basetypes): Likewise.
7044 (start_function): Likewise. Don't put current_class_ref on the
7046 * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO
7048 * lex.c (note_got_semicolon): Use CLASS_TYPE_P.
7049 (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated
7050 fields for types other than class types. Do clear TYPE_ALIAS_SET
7051 for types other than class types, though.
7052 * method.c (build_overload_identifier): Use CLASS_TYPE_P and
7053 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7054 * pt.c (process_template_parm): Don't set
7055 CLASSTYPE_GOT_SEMICOLON.
7056 (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7057 Coerce arguments on the momentary obstack.
7058 (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7059 (instantiate_class_template): Calculate template arguments on the
7060 momentary obstack. Tidy.
7061 (tsubst_template_arg_vector): Use make_temp_vec.
7062 (tsubst_aggr_type): Put template arguments on the momentary
7064 (tsubst_decl): Likewise.
7065 (tsubst): Copy the array bounds index to the permanent obstack
7066 before building index types. Use new macros.
7067 (unify): Use new macros.
7068 (do_type_instantiation): Likewise.
7069 * search.c (lookup_fnfields_1): Use new macros.
7070 (dfs_pushdecls): Build envelopes on the cache obstack.
7071 (dfs_compress_decls): Use new macros.
7072 (push_class_decls): Build on the cache obstack.
7073 * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON.
7074 * sign.c (build_signature_pointer_or_reference_type): Use
7076 * tree.c (make_binfo): Check CLASS_TYPE_P.
7077 (copy_template_template_parm): Adjust.
7078 (make_temp_vec): Use push_expression_obstack.
7079 * typeck.c (complete_type): Use new macros.
7080 (comptypes): Likewise.
7082 1998-11-17 Jason Merrill <jason@yorick.cygnus.com>
7084 * pt.c (tsubst): Add diagnostics for invalid array, reference
7085 and pointer to member types.
7087 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7089 * typeck2.c (my_friendly_abort): Don't fatal twice in a row.
7091 * typeck.c (c_expand_start_case): Use build_expr_type_conversion.
7094 * parse.y (structsp): Fix cut-and-paste error.
7096 * init.c (build_new): Complain about non-integral size.
7098 * parse.y (unary_expr): Complain about defining types in sizeof.
7100 * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn.
7102 * rtti.c (build_x_typeid): Complain about typeid without
7103 including <typeinfo>.
7104 (get_typeid): Likewise. Complain about typeid of incomplete type.
7105 (get_tinfo_fn_dynamic): Likewise.
7106 (get_typeid_1): Not static anymore.
7107 * except.c (build_eh_type_type): Use get_typeid_1.
7109 * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to
7110 ambiguous or private bases. Fix warning for reference cast.
7112 1998-11-16 Mark Mitchell <mark@markmitchell.com>
7114 * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
7115 * decl.c (duplicate_decls): Remove special-case code to deal with
7116 template friends, and just do the obvious thing.
7117 * pt.c (register_specialization): Tweak for clarity, and also to
7118 clear DECL_INITIAL for an instantiation before it is merged with a
7120 (check_explicit_specialization): Fix indentation.
7121 (tsubst_friend_function): Handle both definitions in friend
7122 declaration and outside friend declarations.
7123 (tsubst_decl): Don't clear DECL_INITIAL for an instantiation.
7124 (regenerate_decl_from_template): Tweak accordingly.
7125 (instantiate_decl): Likewise.
7127 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7129 * decl.c (cplus_expand_expr_stmt): Promote warning about naked
7130 member function reference to error.
7131 * cvt.c (ocp_convert): Complain about converting an overloaded
7134 * init.c (build_offset_ref): Just return a lone static member
7137 * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs,
7140 * typeck.c (build_binary_op_nodefault): Improve error handling.
7142 * decl.c (grokfndecl): Complain about making 'main' a template.
7144 * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*.
7146 * call.c (build_method_call): Handle a BIT_NOT_EXPR around a
7147 TYPE_DECL in a template.
7149 1998-11-15 Jason Merrill <jason@yorick.cygnus.com>
7151 * typeck2.c (my_friendly_abort): Add URL in the other case, too.
7153 * decl.c (struct cp_function): Add named_label_uses.
7154 (push_cp_function_context): Save it.
7155 (pop_cp_function_context): Restore it.
7156 (define_label): Also complain about jumping into the scope of
7157 non-POD objects that don't have constructors.
7158 * tree.c (pod_type_p): New fn.
7160 * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner.
7161 * rtti.c (synthesize_tinfo_fn): Call import_export_decl here.
7162 (get_tinfo_fn): Not here.
7163 * repo.c (repo_get_id): Abort if we get called for an incomplete
7166 1998-11-13 Mark Mitchell <mark@markmitchell.com>
7168 * except.c (expand_throw): Make sure first argument to
7169 __cp_push_exception is of type `void*' to avoid spurious error
7172 1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
7174 * pt.c (try_one_overload): Take orig_targs again. Only check for
7175 mismatches against them; we don't care what a previous call found.
7176 (resolve_overloaded_unification): Adjust.
7178 * search.c (lookup_field): Don't return anything for a non-type
7179 field from a dependent type.
7180 * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
7181 in an array declarator.
7182 (start_decl): Push into the class before looking for the field.
7184 1998-11-08 Mark Mitchell <mark@markmitchell.com>
7186 * method.c (build_overload_value): Handle REFERENCE_TYPE.
7188 1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
7190 * decl.c (grokdeclarator): Allow namespace-scoped members if they
7193 1998-11-08 Jason Merrill <jason@yorick.cygnus.com>
7195 * pt.c (tsubst_decl): Don't mess with the global value of an
7196 un-mangled DECL_ASSEMBLER_NAME.
7198 1998-11-03 Christopher Faylor <cgf@cygnus.com>
7200 * decl.c (init_decl_processing): Remove CYGWIN conditional
7201 since CYGWIN is now able to deal with trapping signals.
7203 Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7205 * cp-tree.h: Don't include gansidecl.h.
7206 * exception.cc: Include gansidecl.h (since we don't include config.h)
7207 * g++spec.c: Don't include gansidecl.h.
7209 1998-11-06 Mark Mitchell <mark@markmitchell.com>
7211 * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease
7213 (DECL_DEFINED_IN_CLASS_P): New macro.
7214 (TEMPLATE_PARMS_FOR_INLINE): Document.
7215 (check_static_variable_definition): New function.
7216 * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if
7218 (check_static_variable_definition): Split out from ...
7219 (grokdeclarator): Here.
7220 * pt.c (check_default_tmpl_args): New function, split out from ...
7221 (push_template_decl_real): Here.
7222 (instantiate_template): Fix comment.
7224 1998-11-04 Mark Mitchell <mark@markmitchell.com>
7226 * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued.
7227 (CP_TYPE_VOLATILE_P): Likewise.
7228 (CP_TYPE_RESTRICT_P): Likewise.
7230 1998-11-03 Mark Mitchell <mark@markmitchell.com>
7232 * pt.c (tsubst): Use build_index_type, not build_index_2_type.
7234 1998-11-02 Jason Merrill <jason@yorick.cygnus.com>
7236 * class.c (instantiate_type): Be more helpful.
7238 * decl2.c (import_export_decl): Call import_export_class.
7240 * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
7241 * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
7242 * pt.c (tsubst_copy): Likewise.
7244 1998-11-02 Mark Mitchell <mark@markmitchell.com>
7246 * init.c (expand_vec_init): Fix off-by-one error.
7248 1998-11-02 Alexandre Oliva <oliva@dcc.unicamp.br>
7250 * parse.y (apparent_template_type): New type.
7251 (named_complex_class_head_sans_basetype): Use it.
7252 * Makefile.in (CONFLICTS): One new conflict.
7253 * parse.c: Regenerated.
7255 1998-11-01 Mark Mitchell <mark@markmitchell.com>
7257 * cp-tree.h (COMPARE_STRICT): New macro.
7258 (COMPARE_BASE): Likewise.
7259 (COMPARE_RELAXED): Likewise.
7260 (COMPARE_REDECLARATION): Likewise.
7261 (same_type_p): Likewise.
7262 (same_or_base_type_p): Likewise.
7263 * call.c (standard_conversion): Use them, in place of comptypes
7264 with numeric arguments.
7265 (reference_binding): Likewise.
7266 (convert_like): Likewise.
7267 (build_over_call): Likewise.
7268 (is_subseq): Likewise.
7269 (is_properly_derived_from): Likewise.
7270 (compare_ics): Likewise.
7272 * class.c (delete_duplicate_fields_1): Likewise.
7273 (resolves_to_fixed_type_p): Likewise.
7274 (instantiate_type): Likewise. Remove #if 0'd code.
7275 * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here.
7276 (pushdecl): Likewise.
7277 (lookup_name_real): Likewise.
7278 (grokdeclarator): Likewise. Check for illegal array declarations.
7279 (grokparms): Likewise.
7280 (grok_op_properties): Likewise.
7281 * decl2.c (check_classfn): Likewise.
7282 * friend.c (is_friend): Likewise.
7283 (make_friend_class): Likewise.
7284 * init.c (expand_aggr_init): Likewise.
7285 (expand_vec_init): Likewise.
7286 * pt.c (is_member_template_class): Remove declaration.
7287 (is_specialization_of): Use COMPARE_* and new macros.
7288 (comp_template_parms): Likewise.
7289 (convert_nontype_argument): Likewise.
7290 (coerce_template_template_parms): Likewise.
7291 (template_args_equal): Likewise.
7292 (lookup_template_class): Likewise.
7293 (type_unification_real): Likewise.
7295 (get_bindings_real): Likewise.
7296 * search.c (covariant_return_p): Likewise.
7297 (get_matching_virtual): Likewise.
7298 * sig.c (match_method_types): Likewise.
7299 * tree.c (vec_binfo_member): Likewise.
7300 (cp_tree_equal): Likewise.
7301 * typeck.c (common_type): Likewise.
7302 (comp_array_types): Likewise. Get issues involving unknown array
7304 (comptypes): Update comments. Use new flags.
7305 (comp_target_types): Use new macros.
7306 (compparms): Likewise.
7307 (comp_target_parms): Likewise.
7308 (string_conv_p): Likewise.
7309 (build_component_ref): Likewise.
7310 (build_indirect_ref): Likewise.
7311 (build_conditional_expr): Likewise.
7312 (build_static_cast): Likewise.
7313 (build_reinterpret_cast): Likewise.
7314 (build_const_cast): Likewise.
7315 (build_modify_expr): Likewise.
7316 (convert_for_assignment): Likewise.
7317 (comp_ptr_ttypes_real): Likewise.
7318 (ptr_reasonably_similar): Likewise.
7319 (comp_ptr_ttypes_const): Likewise.
7321 1998-10-31 Jason Merrill <jason@yorick.cygnus.com>
7323 * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error.
7325 1998-10-30 Mark Mitchell <mark@markmitchell.com>
7327 * decl2.c (delete_sanity): Pass integer_zero_node, not
7328 integer_two_node, to build_vec_delete.
7329 * init.c (build_array_eh_cleanup): Remove.
7330 (expand_vec_init_try_block): New function.
7331 (expand_vec_init_catch_clause): Likewise.
7332 (build_vec_delete_1): Don't deal with case that auto_delete_vec
7333 might be integer_two_node anymore.
7334 (expand_vec_init): Rework for initialization-correctness and
7335 exception-correctness.
7336 * typeck2.c (process_init_constructor): Make mutual exclusivity
7337 of cases more obvious.
7339 1998-10-29 Jason Merrill <jason@yorick.cygnus.com>
7341 * decl.c (lookup_name_real): OK, only warn if not lexing.
7342 Simplify suggested fix.
7344 * cp-tree.h (IDENTIFIER_MARKED): New macro.
7345 * search.c (lookup_conversions): Use breadth_first_search.
7346 (add_conversions): Avoid adding two conversions to the same type.
7347 (breadth_first_search): Work with base binfos, rather
7348 than binfos and base indices.
7349 (get_virtual_destructor): Adjust.
7350 (tree_has_any_destructor_p): Adjust.
7351 (get_matching_virtual): Adjust.
7353 * pt.c (push_template_decl_real): Generalize check for incorrect
7354 number of template parms.
7355 (is_member_template_class): #if 0.
7357 1998-10-29 Richard Henderson <rth@cygnus.com>
7359 * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
7362 1998-10-28 Zack Weinberg <zack@rabi.phys.columbia.edu>
7364 * lex.c: Call check_newline from lang_init always. After
7365 calling cpp_start_read, set yy_cur and yy_lim to read from the
7366 cpplib token buffer.
7368 1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
7370 * class.c (instantiate_type): Don't consider templates for a normal
7373 * class.c (finish_struct_1): Don't complain about non-copy
7374 assignment ops in union members.
7376 * class.c (build_vtable): Don't pass at_eof to import_export_vtable.
7377 (prepare_fresh_vtable): Likewise.
7378 (finish_struct_1): Don't call import_export_class.
7379 * decl2.c (finish_vtable_vardecl): Do import/export stuff.
7380 (finish_prevtable_vardecl): Lose.
7381 (finish_file): Don't call it.
7382 * pt.c (instantiate_class_template): Likewise.
7383 * cp-tree.h: Remove it.
7385 * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
7386 * decl.c (finish_function): Not here.
7387 (start_function): Do set DECL_INITIAL.
7389 * pt.c (push_template_decl_real): Complain about default template
7390 args for enclosing classes.
7392 * call.c (add_function_candidate): Treat conversion functions
7393 as coming from the argument's class.
7394 * cp-tree.h (DECL_CONV_FN_P): New fn.
7395 (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE.
7396 * class.c (add_method): Use DECL_CONV_FN_P.
7397 * decl2.c (check_classfn): Likewise.
7398 * error.c (dump_function_name): Likewise.
7399 (dump_function_decl): Likewise.
7400 * pt.c (fn_type_unification): Likewise.
7401 * search.c (add_conversions): Likewise.
7403 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7405 * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL.
7406 * method.c (hack_identifier): Also check for using RESULT_DECL
7409 1998-10-27 Mark Mitchell <mark@markmitchell.com>
7411 * decl.c (grokdeclarator): Use type_quals, rather than constp,
7414 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7416 * call.c (standard_conversion): instantiate_type here.
7417 (reference_binding): And here.
7418 (implicit_conversion): Not here.
7419 (build_op_delete_call): No need to cons up an OVERLOAD.
7420 * cvt.c (cp_convert_to_pointer): instantiate_type here.
7421 (convert_to_reference): And here.
7422 * decl.c (grok_reference_init): Not here.
7423 (grokparms): Or here.
7424 * typeck2.c (digest_init): Or here.
7425 * typeck.c (decay_conversion): Take the address of overloaded
7427 (require_instantiated_type): Lose.
7428 (convert_arguments): Don't handle unknown types here.
7429 (build_c_cast): Likewise.
7430 (build_binary_op): Gut.
7431 (build_conditional_expr): Don't require_instantiated_type.
7432 (build_modify_expr): Likewise.
7433 (build_static_cast): Don't instantiate_type.
7434 (build_reinterpret_cast): Likewise.
7435 (build_const_cast): Likewise.
7436 (convert_for_initialization): Likewise.
7437 (build_ptrmemfunc): Use type_unknown_p.
7438 (convert_for_assignment): Also do default_conversion on overloaded
7439 functions. Hand them off to ocp_convert.
7441 1998-10-26 Mark Mitchell <mark@markmitchell.com>
7443 * error.c (dump_decl): Deal with TEMPLATE_DECLs that are
7444 VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
7446 * class.c (finish_struct_1): Use build_cplus_array_type to build
7448 * decl.c (init_decl_processing): Likewise.
7449 * except.c (expand_end_eh_spec): Likewise.
7450 * search.c (expand_upcast_fixups): Simplify very slightly.
7452 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7454 * decl.c (grokdeclarator): Complain about a variable using
7455 constructor syntax coming back null from start_decl.
7457 * friend.c (make_friend_class): Complain about trying to make
7458 a non-class type a friend.
7460 * decl.c (grokfndecl): Set DECL_INITIAL for a defn here.
7461 (start_function): Not here.
7463 1998-10-26 Brendan Kehoe <brendan@cygnus.com>
7465 * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
7467 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7469 * typeck2.c (process_init_constructor): Only skip anonymous fields
7470 if they are bitfields.
7472 * cp-tree.def (TYPEOF_TYPE): New code.
7473 * error.c (dump_type_real): Handle it.
7474 * pt.c (tsubst): Likewise.
7475 * tree.c (search_tree): Likewise.
7476 * semantics.c (finish_typeof): New fn.
7477 * parse.y (typespec): Use it.
7478 * cp-tree.h: Declare it.
7480 1998-10-26 Manfred Hollstein <manfred@s-direktnet.de>
7482 * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional.
7484 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7486 * typeck.c (convert_arguments): Don't handle pmf references
7489 * init.c (build_member_call): Don't try to convert to the base type
7490 if it's ambiguous or pedantic.
7492 * typeck2.c (check_for_new_type): Only depend on pedantic for
7495 1998-10-25 Mark Mitchell <mark@markmitchell.com>
7497 * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all
7498 non-converting constructors.
7500 1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
7502 * gxxint.texi: Correct documentation for n, N, Q, and B.
7504 1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
7506 * parse.y (condition): Convert VAR_DECL from reference to indirect
7509 1998-10-23 Andrew MacLeod <amacleod@cygnus.com>
7511 * exception.cc (__cp_pop_exception): Free the original exception
7512 value, not the potentially coerced one.
7514 1998-10-23 Mark Mitchell <mark@markmitchell.com>
7516 * Makefile.in (hash.h): Run gperf when necessary.
7518 * cp-tree.h (CP_TYPE_READONLY): Remove.
7519 (CP_TYPE_VOLATILE): Likewise.
7520 (CP_TYPE_QUALS): New macro.
7521 (CP_TYPE_CONST_P): Likewise.
7522 (CP_TYPE_VOLATILE_P): Likewise.
7523 (CP_TYPE_RESTRICT_P): Likewise.
7524 (CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
7525 (cp_build_type_variant): Rename to ...
7526 (cp_build_qualified_type): New function.
7527 (c_apply_type_quals_to_decl): Declare.
7528 (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
7529 (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
7530 (cp_type_qual_from_rid): New function.
7531 (compparms): Remove unused parameter. All callers changed.
7532 (cp_type_quals): New function.
7533 (at_least_as_qualified_p): Likewise.
7534 (more_qualified_p): Likewise.
7536 * call.c (standard_conversion): Replace calls to
7537 cp_build_type_variant with cp_build_qualified_type. Use
7538 CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
7539 compare them. Use CP_TYPE_* macros to check qualifiers.
7540 (reference_binding): Likewise.
7541 (implicit_conversion): Likewise.
7542 (add_builtin_candidates): Likewise.
7543 (build_over_call): Likewise.
7544 * class.c (overrides): Compare all qualifiers, not just `const',
7545 on method declarations.
7546 * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
7547 (convert_pointer_to_real): Likewise.
7548 (type_promotes_to): Likewise.
7549 * decl.c (check_for_uninitialized_const_var): New function.
7550 (init_decl_processing): More CP_TYPE_QUALS conversion, etc.
7551 (cp_finish_decl): Use check_for_uninitialized_const_var.
7552 (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to
7554 (grok_ctor_properties): Likewise.
7555 (grok_op_properties): Likewise.
7556 (start_function): Likewise.
7557 (rever_static_member_fn): Likewise.
7558 * decl2.c (grok_method_quals): Likewise.
7559 (grokfield): Likewise.
7560 * error.c (dump_readonly_or_volatile): Rename to ...
7561 (dump_qualifiers): New function. Handle `restrict'.
7562 (dump_type_real): Use it.
7563 (dump_aggr_type): Likewise.
7564 (dump_type_prefix): Likewise.
7565 (dump_type_suffix): Likewise.
7566 (dump_function_decl): Likewise.
7567 (cv_as_string): Likewise.
7568 * gxx.gperf: Add __restrict and __restrict__.
7569 * gxxint.texi: Document `u' as used for `__restrict', and a few
7570 other previously undocumented codes.
7571 * hash.h: Regenerated.
7572 * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
7573 (build_member_call): Likewise.
7574 (build_new_1): Likewise.
7575 * lex.c (init_parse): Add entry for RID_RESTRICT.
7576 (cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
7577 (cp_type_qual_from_rid): Define.
7578 * lex.h (enum rid): Add RID_RESTRICT.
7579 * method.c (process_modifiers): Deal with `restrict'.
7580 * parse.y (primary): More CP_TYPE_QUALS conversion, etc.
7581 * parse.c: Regenerated.
7582 * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
7583 (tsubst_aggr_type): Likewise.
7585 (check_cv_quals_for_unify): Likewise.
7587 * rtti.c (init_rtti_processing): Likewise.
7588 (build_headof): Likewise.
7589 (get_tinfo_var): Likewise.
7590 (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling.
7591 (expand_class_desc): Likewise.
7592 (expand_attr_desc): Likewise.
7593 (synthesize_tinfo_fn): Likewise.
7594 * search.c (covariant_return_p): Likewise. Fix `volatile' handling.
7595 (get_matching_virtual): Likewise.
7596 (expand_upcast_fixups): Likewise.
7597 * sig.c (build_signature_pointer_or_reference_name): Take
7598 type_quals, not constp and volatilep.
7599 (build_signature_pointer_or_reference_type): Likewise.
7600 (match_method_types): More CP_TYPE_QUALS conversion, etc.
7601 (build_signature_pointer_constructor): Likewise.
7602 (build_signature_method_call): Likewise.
7603 * tree.c (build_cplus_array_type): Likewise.
7604 (cp_build_type_variant): Rename to ...
7605 (cp_build_qualified_type): New function. Deal with `__restrict'.
7606 (canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
7607 (build_exception_variant): Likewise.
7609 * typeck.c (qualif_type): Likewise.
7610 (common_type): Likewise.
7611 (comptypes): Likewise.
7612 (comp_cv_target_types): Likewise.
7613 (at_least_as_qualified_p): Define.
7614 (more_qualified_p): Likewise.
7615 (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
7616 (compparms): Likewise.
7617 (inline_conversion): Likewise.
7618 (string_conv_p): Likewise.
7619 (build_component_ref): Likewise.
7620 (build_indirect_ref): Likewise.
7621 (build_array_ref): Likewise.
7622 (build_unary_op): Likewise.
7623 (build_conditional_expr): Likewise.
7624 (build_static_cast): Likewise.
7625 (build_c_cast): Likewise.
7626 (build_modify_expr): Likewise.
7627 (convert_For_assignment): Likewise.
7628 (comp_ptr_ttypes_real): Likewise.
7629 (cp_type_quals): New function.
7631 1998-10-23 Jason Merrill <jason@yorick.cygnus.com>
7633 * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
7634 (CP_TYPE_VOLATILE): Likewise.
7635 * decl.c (grokdeclarator): Use them.
7636 * tree.c (canonical_type_variant): Likewise.
7638 1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de>
7640 * parse.y (named_class_head): Push into class while parsing the
7642 * decl2.c (push_scope, pop_scope): New functions.
7643 * cp-tree.h: Declare them.
7644 * init.c (build_new_1): Delay cleanup until end of full expression.
7646 1998-10-21 Jason Merrill <jason@yorick.cygnus.com>
7648 * typeck.c (build_component_ref): Use of a type here is an error.
7650 1998-10-19 Jason Merrill <jason@yorick.cygnus.com>
7652 Revamp references to member functions.
7653 * method.c (hack_identifier): Call build_component_ref for a
7654 reference to a member function.
7655 * typeck.c (build_component_ref): Only return a single function
7656 if it's static. Otherwise, return a COMPONENT_REF.
7657 (build_x_function_call): Handle a COMPONENT_REF.
7658 (build_unary_op): Handle all unknown-type things.
7659 * decl2.c (arg_assoc): Handle COMPONENT_REF.
7660 * class.c (instantiate_type): Complain if the function we get is a
7661 nonstatic member function. Remove code for finding "compatible"
7663 * pt.c (tsubst_copy): Handle NOP_EXPR.
7664 * tree.c (build_dummy_object): New fn.
7665 (maybe_dummy_object): New fn.
7666 (is_dummy_object): New fn.
7667 * cp-tree.h: Declare them.
7668 * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
7669 * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
7670 * init.c (build_member_call): Use maybe_dummy_object and
7672 (build_offset_ref): Use maybe_dummy_object.
7673 (resolve_offset_ref): Use is_dummy_object.
7674 * typeck.c (build_x_function_call): Call build_dummy_object.
7675 (unary_complex_lvalue): Call is_dummy_object.
7677 * typeck.c (build_component_addr): Make sure field is a field.
7679 * call.c (build_new_op): Delete obsolete code.
7681 * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
7683 1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
7685 * decl2.c (validate_nonmember_using_decl): Fix using-directives of
7686 std if std is ignored.
7688 1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
7690 * decl.c (grokvardecl): Fix thinko.
7692 * decl.c (grokdeclarator): Embedded attrs bind to the right,
7695 * parse.y (fn.def2): Fix 'attrs' format.
7697 1998-10-18 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
7699 * Makefile.in (CONFLICTS): Update.
7700 * parse.y (expr_or_declarator_intern): New rule.
7701 (expr_or_declarator, direct_notype_declarator, primary,
7702 functional_cast): Use it.
7703 (notype_declarator_intern): New rule.
7704 (notype_declarator, complex_notype_declarator): Use it.
7706 1998-10-17 Jason Merrill <jason@yorick.cygnus.com>
7708 * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate.
7709 (grokvardecl): Likewise.
7711 Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7713 * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR).
7714 (add_method): Likewise for arguments 1 & 2 of `bcopy'.
7716 * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN.
7718 * pt.c (process_partial_specialization): Cast 1st argument of
7721 * tree.c (build_base_fields): Cast `base_align' to (int) when
7722 comparing against one.
7724 1998-10-16 Mark Mitchell <mark@markmitchell.com>
7726 * decl.c (lookup_name_real): Handle template parameters for member
7727 templates where said parameters have the same name as the
7730 * decl.c (expand_static_init): Build cleanups before entering the
7731 anonymous function used to do them to avoid access-checking
7734 * decl.c (grokfndecl): Add back call to cplus_decl_attributes
7735 accidentally removed by previous change, and make DECL_RTL here.
7736 * class.c (add_method): Don't make DECL_RTL here.
7738 * pt.c (for_each_template_parm): Don't examine uninstantiated
7741 1998-10-16 Dave Brolley <brolley@cygnus.com>
7743 * lex.c (real_yylex): Fix unaligned access of wchar_t.
7745 1998-10-16 Mark Mitchell <mark@markmitchell.com>
7747 * class.c (add_method): Fix documentation to reflect previous
7748 changes. Check for duplicate method declarations here.
7749 * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL
7750 correctly; such things never match.
7751 (grokfndecl): Don't look for duplicate methods here.
7752 * decl2.c (check_classfn): Don't assume names are mangled.
7753 Don't add bogus member function declarations to a class before the
7754 class type is complete.
7755 (grokfield): Reformat error message.
7756 * method.c (set_mangled_name_for_decl): Don't mangle names while
7757 processing_template_decl.
7759 1998-10-16 Jason Merrill <jason@yorick.cygnus.com>
7761 * typeck.c (build_indirect_ref): Complain about a pointer to data
7763 * typeck2.c (build_m_component_ref): Don't indirect a pointer to
7765 * init.c (resolve_offset_ref): Don't undo the above.
7767 * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros.
7768 (struct lang_decl_flags): Add `bitfield'.
7769 * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of
7771 * decl2.c (grokbitfield, grok_alignof): Likewise.
7772 * init.c (build_offset_ref): Likewise.
7773 * typeck.c (build_component_addr, expr_sizeof): Likewise.
7774 * cvt.c (build_up_reference): Don't crash if taking the address
7775 returns error_mark_node.
7777 * decl.c (grokfndecl): Also check ctype when checking for ::main().
7779 1998-10-15 Jason Merrill <jason@yorick.cygnus.com>
7781 * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
7783 (grokdeclarator): Instead of here.
7784 * friend.c (do_friend): Lose special handling of ::main and
7786 * cp-tree.h (DECL_MAIN_P): Check for C linkage.
7788 * spew.c (yylex): Clear looking_for_typename if we got
7791 1998-10-15 Mark Mitchell <mark@markmitchell.com>
7793 * class.c (maybe_warn_about_overly_private_class): Improve error
7794 messages for class with only private constructors.
7796 * cp-tree.def (TYPENAME_TYPE): Add to documentation.
7797 * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
7798 (build_typename_type): New function.
7799 * decl.c (build_typename_type): Broken out from ...
7800 (make_typename_type): Use it.
7801 * search.c (lookup_field): Likewise.
7803 1998-10-14 Benjamin Kosnik <bkoz@rhino.cygnus.com>
7805 * pt.c (convert_nontype_argument): Check against type_referred_to.
7806 * decl.c (grokvardecl): Check for declarator name before building
7807 DECL_ASSEMBLER_NAME.
7809 1998-10-14 Mark Mitchell <mark@markmitchell.com>
7811 * pt.c (lookup_template_class): Add comment.
7812 (instantiate_class_template): Don't mark the _TYPE node for
7813 member class templates as an instantiation.
7815 1998-10-14 Jason Merrill <jason@yorick.cygnus.com>
7817 * decl.c (grokfndecl): Fix my thinko.
7819 1998-10-13 Jason Merrill <jason@yorick.cygnus.com>
7821 * tinfo2.cc (fast_compare): Remove.
7822 (before): Just use strcmp.
7823 * tinfo.cc (operator==): Just use strcmp.
7825 1998-10-13 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
7827 * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
7830 1998-10-13 Mark Mitchell <mark@markmitchell.com>
7832 * cp-tree.h (specializations_of_same_template_p): Remove.
7833 * search.c (get_template_base): Don't use it.
7834 (get_template_base_recursive): Likewise.
7835 * pt.c (specializations_of_same_template_p): Remove.
7836 (unify): Don't use it.
7837 (lookup_template_class): Find the correct parent when setting
7838 CLASSTYPE_TI_TEMPLATE.
7840 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
7842 * tinfo.cc (operator==): Always compare names.
7844 1998-10-12 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
7846 * decl.c (start_function): Fix cut-and-paste error.
7848 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
7850 * inc/typeinfo: Add #pragma interface.
7851 (operator!=): Just call operator==.
7852 * tinfo.cc: Add #pragma implementation.
7853 (operator==): Move from inc/typeinfo and tinfo2.cc.
7854 Check __COMMON_UNRELIABLE instead of _WIN32.
7856 * typeck2.c (my_friendly_abort): Add URL.
7858 1998-10-12 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
7860 * decl.c (start_method): Added extra parameter for attributes.
7861 * cp-tree.h (start_method): Update prototype.
7862 * parse.y (fn.def2): Update start_method parameter list.
7864 1998-10-11 Mark Mitchell <mark@markmitchell.com>
7866 * cp-tree.h (specializations_of_same_template_p): Declare.
7867 * pt.c (specializations_of_same_template_p): New function.
7869 * search.c (get_template_base): Use it.
7870 (get_template_base_recursive): Likewise.
7872 1998-10-10 Manfred Hollstein <manfred@s-direktnet.de>
7874 * decl2.c (start_objects): Add new variable `joiner' and
7875 initialize it properly.
7877 1998-10-09 Mark Mitchell <mark@markmitchell.com>
7879 * search.c (expand_upcast_fixups): Tweak to match 1998-10-07
7880 change to vtable types.
7882 * cvt.c (ocp_convert): Avoid infinite recursion caused by
7885 1998-10-08 Jason Merrill <jason@yorick.cygnus.com>
7887 * pt.c (resolve_overloaded_unification): New fn.
7888 (try_one_overload): Likewise.
7889 (unify): Don't fail on unknown type.
7890 (type_unification_real): Likewise. Use resolve_overloaded_unification
7891 to handle an overloaded argument.
7892 (template_args_equal): Split out...
7893 (comp_template_args): From here.
7894 (determine_specialization): Also allow a template with more
7895 parms than were explicitly specified.
7896 * cp-tree.h: Add template_args_equal.
7897 * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code.
7899 Thu Oct 8 15:58:30 1998 Anthony Green <green@cygnus.com>
7901 * semantics.c (finish_asm_stmt): Revert my 1998-09-28
7904 Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com)
7906 * typeck.c (unsigned_type): Only return TItype nodes when
7907 HOST_BITS_PER_WIDE_INT is >= 64 bits.
7908 (signed_type): Likewise.
7909 * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
7910 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7911 (init_decl_processing): Only create TItype nodes when
7912 HOST_BITS_PER_WIDE_INT is >= 64 bits.
7913 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare
7914 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7916 Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7918 * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
7919 (gxx.gperf): Update comments describing invocation flags.
7920 (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
7922 1998-10-07 Mark Mitchell <mark@markmitchell.com>
7924 * class.c (finish_struct_1): Add commentary on previous change.
7926 * cp-tree.h (vtbl_ptr_type_node): New variable.
7927 * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
7928 already of the right type.
7929 (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
7930 Simplify code to grow vtable.
7931 * decl.c (vtbl_ptr_type_node): Define.
7932 (init_decl_processing): Initialize it.
7934 1998-10-06 Mark Mitchell <mark@markmitchell.com>
7936 * cp-tree.def (PTRMEM_CST): New tree node.
7937 * cp-tree.h (ptrmem_cst): New type.
7938 (lang_type): Remove local_typedecls.
7939 (dummy): Increase to 12 bits from 11.
7940 (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
7941 (PTRMEM_CST_CLASS): New macro.
7942 (PTRMEM_CST_MEMBER): Likewise.
7943 (current_access_specifier): New variable.
7944 (current_class_type): Remove duplicate declaration.
7945 (finish_struct): Change prototype.
7946 (unreverse_member_declarations): New function.
7947 (pushdecl_class_level): Change prototype.
7948 (grok_enum_decls): Remove.
7949 (fixup_anonymous_union): New function.
7950 (grok_x_components): Change prototype.
7951 (tsubst_chain): Remove.
7952 (finish_member_template_decl): Likewise.
7953 (check_explicit_specialization): Fix indentation.
7954 (finish_class_definition): Change prototype.
7955 (finish_member_class_template): Likewise.
7956 (finish_member_declaration): New function.
7957 (check_multiple_declarators): Likewise.
7958 * class.c (class_stack_node_t): New type.
7959 (current_class_base): Remove.
7960 (current_class_stack): Change type.
7961 (current_access_specifier): New variable.
7962 (grow_method): Remove.
7963 (check_member_decl_is_same_in_complete_scope): Break out from
7965 (make_method_vec): New function.
7966 (free_method_vec): Likewise.
7967 (add_implicitly_declared_members): Break out from finish_struct_1.
7968 (free_method_vecs): New variable.
7969 (add_method): Rework for direct use from parser.
7970 (handle_using_decl): Watch for NULL_TREE while iterating through
7971 CLASSTYPE_METHOD_VEC.
7972 (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
7973 just do some error-checking.
7974 (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
7975 (finish_struct_1): Simplify. Use add_implicitly_declared_members.
7976 (finish_struct): Change prototype. Simplify; fields and methods
7977 are already set up at this point.
7978 (init_class_processing): Set up current_class_stack.
7979 (pushclass): Save current_access_specifier.
7980 (popclass): Restore it.
7981 (currently_open_class): Simplify.
7982 (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
7983 * decl.c (saved_scope): Add access_specifier.
7984 (maybe_push_to_top_level): Save it.
7985 (pop_from_top_level): Restore it.
7986 (maybe_process_template_type_declaration): Use
7987 finish_member_declaration.
7988 (pushtag): Likewise.
7989 (pushdecl_class_level): Don't return a value.
7990 (fixup_anonymous_union): Break out from grok_x_components.
7991 (shadow_tag): Use it.
7992 (xref_tag): Complain about using an elaborated type specifier to
7993 reference a template type parameter or typedef name.
7994 (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
7995 (current_local_enum): Remove.
7996 (build_enumerator): Call finish_member_declaration.
7997 (grok_enum_decls): Remove.
7998 * decl2.c (grok_x_components): Simplify.
7999 (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
8000 (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
8001 (merge_functions): Add to comment.
8002 (arg_assoc_type): Prototype.
8003 (arg_assoc): Pass as many arguments as there are parameters.
8004 * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of
8006 * expr.c (cpls_expand_expr): Remove dead code. Handle
8008 * friend.c (do_friend): Lookup friends when in nested classes.
8010 * init.c (build_offset_ref): Do lookup even for classes that are
8011 only partially defined.
8012 (decl_constant_value): Remove dead code.
8013 * method.c (build_overload_value): Remove hack where by TYPE was
8014 not a TYPE. Handle PTRMEM_CST.
8015 (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
8017 * parse.y (components, notype_components, component_decl,
8018 component_decl_1, component_declarator, component_declarator0):
8019 Now all are itype rather than ttype. Rework to add members to
8021 (typesqpecqual_reserved): Use check_multiple_declarators.
8022 (structsp): Update class to finish_class_definition.
8023 (do_xref_defn): Unsplit into named_class_head.
8024 (access_specifier): Set current_access_specifier.
8025 * pt.c (set_current_access_from_decl): New function.
8026 (finish_member_template_decl): Don't take the parameters.
8027 (comp_template_args): Make more robust.
8028 (lookup_template_class): Don't use current_local_enum.
8029 (for_each_template_parm): Handle PTRMEM_CST.
8030 (instantiate_class_template): Use set_current_access_from_decl,
8031 finish_member_declaration and unreverse_member_declarations. Set
8032 lineno/input_filename before generating implicit member functions.
8033 (type_unification_real): Don't assume back-unification happens
8034 only for the last argument.
8035 (regenerate_decl_from_template): Call pushclass a bit earlier.
8036 (tsubst_chain): Remove.
8037 (tsubst_enum): Use set_current_access_from_decl.
8038 (set_mangled_name_for_template_decl): Fix indentation.
8039 * search.c (lookup_fnfields_1): Change iteration through
8040 CLASSTYPE_METHOD_VEC.
8041 (dfs_pushdecls): Likewise.
8042 (dfs_compress_decls): Likewise.
8043 (add_conversions): Likewise.
8044 * semantics.c (finish_class_definition): Don't take components.
8045 Change call to finish_struct.
8046 (finish_member_declaration): New function.
8047 (finish_member_class_template): Don't take template parameters.
8048 Change call to grok_x_components. Call finish_member_template_decl.
8049 (check_multiple_declarators): New function.
8050 * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
8051 a passed in fieldlist.
8052 * tree.c (search_tree): Handle PTRMEM_CST.
8054 * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
8055 INTEGER_CSTs, for pointer-to-data members.
8057 * call.c (resolve_args): Resolve template specializations, if
8060 Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8062 * Makefile.in (spew.o): Depend on toplev.h.
8064 * call.c (compare_ics): Initialize variables `deref_from_type2',
8065 `deref_to_type1' and `deref_to_type2'.
8067 * except.c (get_eh_type): Hide prototype and definition.
8068 (process_start_catch_block_old): Remove unused static prototype.
8070 * pt.c (tsubst_decl): Initialize variable `argvec'.
8072 * spew.c: Include toplev.h.
8074 1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
8076 * pt.c (instantiate_decl): Do save and restore file position.
8078 1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
8080 * method.c (build_decl_overload_real): Clear
8081 numeric_output_need_bar after __.
8083 1998-10-05 Nathan Sidwell <nathan@acm.org>
8085 * call.c (build_new_method_call): Issue 'incomplete type' error,
8086 if class is not defined.
8088 1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8090 * call.c (build_object_call): Move declaration of variable
8091 `fn' into the scope where it is used. Don't access variable
8092 `fn' when it is uninitialized, instead use `fns'.
8094 1998-10-04 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
8096 * errfn.c (cp_thing): Print buf as a string not as a printf format
8097 to avoid problems with the operator%. Consequently, `%%' sequences
8098 in format are copied as `%' in buf.
8100 1998-10-04 Jason Merrill <jason@yorick.cygnus.com>
8102 * pt.c (pop_tinst_level): Call extract_interface_info.
8103 (instantiate_decl): Don't save and restore file position.
8105 * decl.c (cp_finish_decl): Make statics in extern inlines and
8106 templates common, if possible and the target doesn't support weak
8109 * decl.c (grokdeclarator): Remove redundant calls to
8110 build_type_variant and some duplicated code.
8111 * sig.c (build_signature_reference_type): Only take the type parm.
8112 (build_signature_pointer_type): Likewise.
8113 * tree.c (build_cplus_method_type): Adjust.
8114 * cp-tree.h: Update.
8116 1998-10-04 Mark Mitchell <mark@markmitchell.com>
8118 * call.c (build_over_call): Make pedwarns about dropped qualifiers
8119 into full-fledged errors.
8120 * cvt.c (convert_to_reference): Likewise.
8121 * typeck.c (convert_for_assignment): Likewise.
8123 * search.c (expand_upcast_vtables): In addition to unsetting
8124 TREE_READONLY, remove top-level const type qualifier.
8126 1998-10-03 Mark Mitchell <mark@markmitchell.com>
8128 * class.c (current_class_ptr, current_class_ref): Clarify
8130 * cvt.c (ocp_convert): Don't expect fold to remove all trivial
8131 NOP type conversions.
8132 * decl.c (decls_match): Use comptypes directly; ignore
8133 qualifiers on the DECL.
8134 (duplicate_decls): Remove qualifier checks on DECL.
8135 (grokdeclarator): Make the type built up include top-level
8137 * decl2.c (do_dtors): Fix spelling error.
8138 * error.c (dump_simple_decl): Don't look at qualifiers on the decl
8139 when printing type information.
8140 * init.c (build_new_1): Add documentation. Deal with the fact
8141 that type of allocated memory now contains qualifiers.
8142 * lex.c (is_global): Improve error-recovery.
8143 * sig.c (build_member_function_pointer): Don't cast away const
8144 on fields of sigtable_entry_type.
8145 * tree.c (lvalue_type): Don't look at top-level qualifiers on
8147 * typeck.c (decay_conversion): Likewise.
8148 (build_component_ref): Make sure the type of the COMPONENT_REF
8149 contains top-level qualifiers, as appropriate. Improve
8151 (build_indirect_ref): Simplify. Don't strip top-level qualifiers.
8152 (build_array_ref): Likewise.
8153 (build_unary_op): Improve error-recovery.
8154 (unary_complex_lvalue): Make taking the address a bound member
8155 function an error, not a sorry.
8156 (build_conditional_expr): Look at the type qualifiers, not the
8157 qualifiers on the expression itself.
8159 1998-10-03 Jason Merrill <jason@yorick.cygnus.com>
8161 * decl2.c (merge_functions): Remove duplicates.
8163 * decl2.c: Add -f{no-,}implicit-inline-templates.
8164 (import_export_decl): Check it.
8166 * decl.c (lookup_name_real): Template parms also take precedence
8167 over implicit typename. Only warn if yylex.
8169 * typeck.c (build_conditional_expr): Only fold if ifexp is an
8172 * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
8175 1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
8177 * cp-tree.h (FORMAT_VBASE_NAME): New macro.
8178 * class.c (build_vbase_pointer): Use it.
8179 * rtti.c (expand_class_desc): Likewise.
8180 * tree.c (build_vbase_pointer_fields): Likewise.
8182 Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
8184 * decl.c (start_decl): Add invocation of
8185 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8186 (start_function): Add invocation of
8187 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8189 * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with
8190 HANDLE_GENERIC_PRAGMAS.
8192 1998-09-28 Anthony Green <green@cygnus.com>
8194 * semantics.c (finish_asm_stmt): Always permit volatile asms.
8196 1998-09-28 Mark Mitchell <mark@markmitchell.com>
8198 * decl.c (grokdeclarator): Tighten checks for invalid
8199 destructors. Improve error-messages and error-recovery.
8200 * decl2.c (check_classfn): Don't assume that mangled destructor
8201 names contain type information.
8203 1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
8205 * search.c (get_base_distance): Remove assert.
8207 * decl2.c (build_anon_union_vars): Don't process a field with no
8209 (finish_anon_union): Also complain about local anon unions with no
8212 1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
8214 * decl.c (lookup_namespace_name): If the name is a namespace,
8215 return it immediately.
8217 Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8219 * cp-tree.h (define_case_label): Remove unused parameter.
8220 (check_java_method): Likewise.
8221 (grokclassfn): Likewise.
8222 (expand_aggr_init): Likewise.
8223 (build_x_delete): Likewise.
8224 (maybe_end_member_template_processing): Likewise.
8225 (unshare_base_binfos): Add prototype.
8226 (string_conv_p): Likewise.
8227 (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
8229 * cvt.c (build_up_reference): Remove unused parameter
8230 `checkconst', all callers changed.
8231 (build_type_conversion): Mark parameter `code' with
8233 (build_expr_type_conversion): Initialize variable `conv'.
8235 * decl.c (push_namespace): Initialize variable `d'.
8236 (define_case_label): Remove unused parameter `decl', all callers
8239 * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
8240 `argc' with ATTRIBUTE_UNUSED.
8241 (grokclassfn): Remove unused parameter `cname', all callers
8243 (check_java_method): Likewise for parameter `ctype'.
8244 (copy_assignment_arg_p): Mark parameter `virtualp' with
8246 (finish_prevtable_vardecl): Likewise for parameter `prev'.
8248 * expr.c (extract_init): Likewise for parameters `decl' and `init'.
8250 * init.c (expand_aggr_init_1): Remove unused parameter
8251 `alias_this', all callers changed.
8252 (expand_aggr_init): Likewise.
8253 (expand_default_init): Likewise.
8254 (build_new_1): Initialize variable `susp'.
8255 (build_x_delete): Remove unused parameter `type', all callers
8258 * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
8260 (readescape): Use (unsigned) value in shift.
8261 (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when
8262 comparing to a signed quantity.
8264 * pt.c (maybe_end_member_template_processing): Remove unused
8265 parameter `decl', all callers changed.
8266 (check_explicit_specialization): Add braces around empty body in
8268 (current_template_args): Initialize variable `args'.
8269 (lookup_template_class): Likewise for variable `prev_local_enum'.
8270 (tsubst_decl): Likewise for variable `r'.
8271 (set_mangled_name_for_template_decl): Initialize variable
8274 * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
8275 Likewise for variable `i'.
8276 (yylex): Initialize variable `trrr'.
8278 * typeck.c (compparms): Mark variable `strict' with
8281 * xref.c (simplify_type): Cast argument of ctype function to
8284 1998-09-24 Mark Mitchell <mark@markmitchell.com>
8286 * cp-tree.h (language_lvalue_valid): Remove.
8287 * decl.c (grokdeclarator): Don't disallow references to functions.
8288 * tree.c (lvalue_p_1): New function, combining duplicated
8291 (real_lvalue_p): Likewise.
8292 * typeck.c (language_lvalue_valid): Remove.
8293 (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
8294 they don't have TREE_READONLY set.
8295 * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
8297 1998-09-24 Benjamin Kosnik <bkoz@loony.cygnus.com>
8299 * spew.c (yylex): Give diagnostic.
8300 * hash.h (is_reserved_word): Add export.
8301 * gxx.gperf: Likewise.
8302 * lex.h (rid): Add RID_EXPORT.
8303 * lex.c (init_parse): Likewise.
8305 Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
8307 * friend.c (do_friend): Make warning a full sentence.
8309 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8311 * parse.y (component_decl_list): Improve error-recovery.
8313 1998-09-22 Benjamin Kosnik <bkoz@loony.cygnus.com>
8315 * decl.c (make_typename_type): Move error to point where name
8316 variable can be used by dump_type.
8318 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8320 * decl.c (grokfndecl): Improve error-recovery.
8321 * decl2.c (grokfield): Likewise.
8322 * pt.c (finish_member_template_decl): Likewise.
8324 1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de>
8326 * method.c (hack_identifier): Finding multiple members is always
8329 1998-09-21 Per Bothner <bothner@cygnus.com>
8331 * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o.
8333 Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
8335 * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
8337 1998-09-20 Mark Mitchell <mark@markmitchell.com>
8339 * class.c (maybe_warn_about_overly_private_class): Reformat.
8341 1998-09-17 Andrew MacLeod <amacleod@cygnus.com>
8343 * exception.cc (__cplus_type_matcher): Realign some code.
8345 1998-09-16 Mark Mitchell <mark@markmitchell.com>
8347 * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
8348 (tinfo2.o): Likewise.
8349 (exception.o): Likewise.
8351 (opnew.o): Likewise.
8352 (opnewnt.o): Likewise.
8353 (opvnew.o): Likewise.
8354 (opvnewnt.o): Likewise.
8355 (opdel.o): Likewise.
8356 (opdelnt.o): Likewise.
8357 (opvdel.o): Likewise.
8358 (opvdelnt.o): Likewise.
8360 1998-09-16 Richard Henderson <rth@cygnus.com>
8362 * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
8364 1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
8366 * call.c (build_field_call): Handle static data members too.
8368 * typeck.c (comptypes): When comparing pointer types, check
8369 whether referred types match even in strictest modes.
8371 1998-09-15 Mark Mitchell <mark@markmitchell.com>
8373 * cp-tree.h: Revert previous change.
8374 (finish_struct_methods): Remove declaration.
8375 * class.c: Revert previous change.
8376 (maybe_warn_about_overly_private_class): New function.
8377 (finish_struct_methods): Declare here, and make static. Remove
8378 unnecessary parameters. Tidy slightly. Use
8379 maybe_warn_about_overly_private_class.
8380 (finish_struct_1): Adjust. Remove check for private constructors,
8382 (finish_struct): Adjust.
8384 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8386 * except.c (expand_start_catch_block): No need to check for new
8388 (process_start_catch_block_old): Deleted.
8389 (process_start_catch_block): Add call to start_decl_1().
8390 (expand_end_catch_block): Add call to end_catch_handler().
8391 * exception.cc (__cplus_type_matcher): Only check the exception
8392 language if there is an exception table.
8394 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8396 * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
8397 as used to prevent conflicts with virtual function tables.
8399 1998-09-14 Mark Mitchell <mark@markmitchell.com>
8401 * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
8402 (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
8403 * class.c (maybe_class_too_private_p): New function.
8404 (finish_struct_methods): Use it.
8405 (finish_struct_1): Likewise.
8406 (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
8409 * pt.c (check_specialization_scope): Fix spelling error.
8410 (check_explicit_specialization): Remove code to handle explicit
8411 specializations in class scope; they are now correctly diagnosed
8414 1998-09-10 Mark Mitchell <mark@markmitchell.com>
8416 * decl.c (pushdecl): Don't copy types if the
8417 DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
8420 1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
8422 * class.c (get_enclosing_class): New function.
8423 (is_base_of_enclosing_class): Likewise.
8424 * cp-tree.h (get_enclosing_class): Declare.
8425 (is_base_of_enclosing_class): Likewise.
8426 * pt.c (coerce_template_parms): Use them.
8428 1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
8430 * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
8431 null to decide whether to use it.
8433 * error.c (dump_type_real): Handle NAMESPACE_DECL.
8434 * parse.y (base_class.1): Avoid crash on error.
8436 1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
8438 * decl.c (make_typename_type): If context is a namespace, the code
8441 1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
8443 * parse.y (nomods_initdcl0): Set up the parser stack correctly.
8445 1998-09-08 Mark Mitchell <mark@markmitchell.com>
8447 * cp-tree.h (anonymous_namespace_name): Declare.
8448 * decl.c: Define it.
8449 (push_namespace): Use anonymous_namespace_name, rather than local
8451 * error.c (dump_decl): If a namespace is named
8452 anonymous_namespace_name, call it {anonymous}.
8454 * decl.c (grokparms): Distinguish between references and pointers
8457 1998-09-08 Richard Henderson <rth@cygnus.com>
8458 Mark Mitchell <mark@markmitchell.com>
8460 * pt.c (process_partial_specialization): Consistently allocate
8461 and zero tpd.parms based on ntparms. Use tpd2.parms, not
8462 tpd.parms, where appropriate.
8464 Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
8466 * Makefile.in (INCLUDES): Update after recent toplevel gcc
8469 1998-09-05 Mark Mitchell <mark@markmitchell.com>
8471 * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
8472 * class.c (finish_struct): Remove hackery to deal with explicit
8473 specializations in class scope.
8474 * decl.c (grokfndecl): Improve error-recovery.
8475 * decl2.c (grokfield): Likewise.
8476 * pt.c (check_specialization_scope): New function.
8477 (begin_specialization): Call it.
8478 (process_partial_specialization): New function, split out from
8479 push_template_decl. Check partial specializations more
8481 (push_template_decl): Call it.
8482 (check_explicit_specialization): Don't attempt to handle explicit
8483 specializations in class scope.
8484 (template_parm_data): Document. Add current_arg and
8485 arg_uses_template_parms.
8486 (mark_template_parm): Set it.
8487 (tsubst_arg_types): Remove unused variable.
8488 * semantics.c (begin_class_definition): Tweak.
8490 1998-09-04 Mark Mitchell <mark@markmitchell.com>
8492 * inc/typeinfo (type_info::type_info(const char*)): Make
8495 * cp-tree.h (hash_tree_cons_simple): New macro.
8496 * pt.c (tsubst_arg_types): New function. Use hash_tree_cons.
8497 (coerce_template_parms): Use make_temp_vec, instead of
8498 make_tree_vec. Document this behavior.
8499 (lookup_template_class): Likewise.
8500 (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
8501 Remove dead code (and add assertion to check its deadness). Fix
8502 bug w.r.t. exception specifications.
8504 1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
8506 * decl2.c (import_export_vtable): Always make artificials comdat.
8507 (import_export_decl): Likewise.
8508 * pt.c (mark_decl_instantiated): Likewise.
8510 1998-09-03 Mark Mitchell <mark@markmitchell.com>
8512 * cp-tree.h (finish_globally_qualified_member_call_expr):
8514 (finish_qualified_call_expr).
8515 * semantics.c: Likewise.
8516 * parse.y (primary): Use it.
8517 * method.c (hack_identifier): Remove redundant code.
8519 * init.c (resolve_offset_ref): Call convert_from_reference to
8520 handle members of reference type. Improve error recovery.
8522 1998-09-03 Benjamin Kosnik <bkoz@cygnus.com>
8524 * cp-tree.h: Declare warn_nontemplate_friend.
8525 * decl2.c (lang_decode_option): Set.
8526 * lang-options.h: Add -Wnon-template-friend.
8527 * friend.c (do_friend): Use to toggle non-template function warning.
8529 1998-09-03 Mark Mitchell <mark@markmitchell.com>
8531 * decl.c (finish_enum): Don't resolve CONST_DECLs to their
8532 corresponding INTEGER_CSTs when processing_template_decl.
8533 * pt.c (tsubst_enum): Tweak accordingly.
8535 1998-09-03 Benjamin Kosnik <bkoz@rhino.cygnus.com>
8537 * decl.c (pushdecl_class_level): Add warning here.
8540 1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
8542 * cvt.c (convert_pointer_to_real): Tidy.
8543 * search.c (get_base_distance_recursive): Simplify.
8544 (get_base_distance): Likewise.
8546 * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
8549 Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
8551 * lex.c (check_newline): Call HANDLE_PRAGMA before
8552 HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
8553 if unknown pragmas are encountered.
8554 (handle_sysv_pragma): Interpret return code from
8555 handle_pragma_token (). Return success/failure indication rather
8556 than next unprocessed character.
8557 (pragma_getc): New function: retrieves characters from the
8558 input stream. Defined when HANDLE_PRAGMA is defined.
8559 (pragma_ungetc): New function: replaces characters back into the
8560 input stream. Defined when HANDLE_PRAGMA is defined.
8562 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
8564 * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
8565 * class.c (build_vtable_entry_ref): Likewise.
8567 1998-09-01 Mark Mitchell <mark@markmitchell.com>
8569 * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
8570 * decl2.c (import_export_decl): Likewise.
8571 * pt.c (instantiate_decl): Use it.
8573 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
8575 * decl.c (lookup_name_real): Also do implicit typename thing for
8576 artificial TYPE_DECLs.
8577 * search.c (lookup_field): Likewise.
8578 (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
8579 * semantics.c (begin_constructor_declarator): Use enter_scope_of.
8580 (enter_scope_of): Extract type from implicit typename.
8581 (begin_class_definition): Likewise.
8582 * lex.c (identifier_type): Handle implicit typename when checking
8585 * cp-tree.h: Declare flag_strict_prototype.
8586 * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
8588 * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
8589 specified, set it to the value of pedantic.
8591 1998-09-01 Mark Mitchell <mark@markmitchell.com>
8593 * decl2.c (arg_assoc): Handle template-id expressions as arguments.
8595 1998-08-31 Mark Mitchell <mark@markmitchell.com>
8597 * decl.c (finish_enum): Handle member enums of classes declared in
8600 * decl2.c (grok_x_components): Strip attributes before calling
8603 1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
8605 * cp-tree.h, decl2.c: Remove support for -fall-virtual,
8606 -fenum-int-equivalence and -fno-nonnull-objects.
8607 * class.c (check_for_override): Remove support for -fall-virtual.
8608 (finish_struct_1): Likewise.
8609 * call.c (build_new_op): Remove support for -fenum-int-equivalence.
8610 * typeck.c (build_binary_op_nodefault): Likewise.
8611 * cvt.c (ocp_convert): Likewise.
8612 * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
8613 * class.c (build_vbase_path): Likewise.
8615 Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
8617 * Makefile.in (INTERFACE): New, set to 1.
8619 1998-08-30 Mark Mitchell <mark@markmitchell.com>
8621 * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
8622 comparing with global_namespace.
8623 (dump_aggr_type): Likewise.
8625 * decl.c (grokfndecl): Issue error on declaration of friend
8626 templates with explicit template arguments.
8628 * pt.c (convert_template_argument): New function, split out
8630 (coerce_template_parms): Here.
8631 (tsubst): Attempt better error-recovery.
8633 1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com>
8635 * pt.c (decl_template_parm_p): Add checks for
8636 TEMPLATE_TEMPLATE_PARM.
8638 1998-08-28 Mark Mitchell <mark@markmitchell.com>
8640 * lex.c (do_identifier): Fix thinko in previous change.
8642 1998-08-28 Jason Merrill <jason@yorick.cygnus.com>
8644 * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
8645 * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
8647 1998-08-28 Richard Henderson <rth@cygnus.com>
8649 Add support for discarding unused virtual functions.
8650 * lang-options.h: Add -fvtable-gc.
8651 * cp-tree.h: Add flag_vtable_gc.
8652 * decl2.c (output_vtable_inherit): New fn.
8653 (finish_vtable_vardecl): Call it.
8654 * class.c (build_vtable_entry_ref): New fn.
8655 (build_vtbl_ref): Call it.
8657 1998-08-28 Mark Mitchell <mark@markmitchell.com>
8659 * cp-tree.h (build_enumerator): Take the enumeration type as a
8661 * decl.c (finish_enum): Don't set the TREE_TYPE for the
8662 enumeration constant values if we're processing_template_decls.
8663 Don't set the type for the CONST_DECLs either; that's done in
8665 (build_enumerator): Take the enumeration type as a
8667 * lex.c (do_identifier): Don't resolve enumeration constants while
8668 processing template declarations, even if they happen to be
8669 TEMPLATE_PARM_INDEXs.
8671 * parse.y (current_enum_type): New variable.
8672 (primary): Don't allow statement-expression in local classes just
8673 as we don't in global classes.
8674 (structsp): Use current_enum_type.
8675 (enum_list): Likewise.
8676 * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
8677 finish_enum; they no longer occur.
8679 * cp-tree.h (finish_base_specifier): New function.
8680 * parse.y (base_class): Use it.
8681 * semantics.c (finish_base_specifier): Define it.
8683 * parse.y (structsp): Warn on use of typename outside of template
8686 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
8688 * lex.c (handle_cp_pragma): Remove #pragma vtable.
8689 * lang-options.h: Remove +e options.
8690 * decl2.c (lang_decode_option): Likewise.
8691 (import_export_vtable): Don't check write_virtuals.
8692 (finish_vtable_vardecl, finish_file): Likewise.
8693 * search.c (dfs_debug_mark): Likewise.
8694 * semantics.c (begin_class_definition): Likewise.
8695 * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
8697 * call.c (build_over_call): Check flag_elide_constructors.
8698 * decl2.c: flag_elide_constructors defaults to 1.
8699 * typeck.c (convert_arguments): Remove return_loc parm.
8700 (build_function_call_real): Adjust.
8702 * search.c: Tear out all mi_matrix and memoize code.
8703 (lookup_field, lookup_fnfields): Use scratch_tree_cons.
8704 * lang-options.h: Remove documentation for -fhandle-exceptions,
8705 -fmemoize-lookups and -fsave-memoized.
8706 * cp-tree.h: Lose mi_matrix and memoize support.
8707 * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
8708 * class.c: Lose struct class_level.
8709 (pushclass, popclass): Lose memoize support.
8710 * init.c (build_offset_ref): Likewise.
8712 Never change BINFO_INHERITANCE_CHAIN.
8713 * init.c (emit_base_init): Change modification of
8714 BINFO_INHERITANCE_CHAIN to an assert.
8715 * search.c (get_base_distance_recursive): Likewise.
8716 (get_base_distance): Likewise.
8717 (lookup_member): Likewise.
8718 (convert_pointer_to_single_level): Likewise.
8719 (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs.
8720 (lookup_fnfields): Likewise.
8721 * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
8722 (unshare_base_binfos): Don't call propagate_binfo_offsets.
8723 (layout_basetypes): Call propagate_binfo_offsets instead of
8724 unshare_base_binfos.
8725 * decl.c (xref_basetypes): Call unshare_base_binfos.
8726 * pt.c (instantiate_class_template): Likewise.
8727 * tree.c (reverse_path): Remove 'copy' parm; always make a
8729 * class.c (build_vbase_path): Just call it.
8730 * search.c (compute_access): Likewise. Don't re-reverse.
8732 1998-08-27 Mark Mitchell <mark@markmitchell.com>
8734 * class.c (build_vbase_path): Use reverse_path.
8735 (finish_base_struct): Move warnings for inaccessible bases to
8737 (modify_one_vtable): Remove check of TREE_USED (binfo).
8738 (fixup_vtable_deltas1): Likewise.
8739 * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
8740 (xref_tag): Remove binfos parameter.
8741 (make_binfo): Remove chain parameter.
8742 (reverse_path): Add copy parameter.
8743 * decl.c (init_decl_processing): Change calls to xref_tag.
8744 (xref_tag): Remove binfos parameter.
8745 (xref_basetypes): Change calls to make_binfo.
8746 * decl2.c (grok_x_components): Change calls to xref_tag.
8747 (handle_class_head): Likewise.
8748 * friend.c (do_friend): Likewise.
8749 * lex.c (make_lang_type): Change calls to make_binfo.
8750 * parse.y (structsp): Change calls to xref_tag.
8751 (named_complex_class_head_sans_basetype): Likewise.
8752 (named_class_head): Likewise.
8753 * rtti.c (init_rtti_processing): Likewise.
8754 * search.c (compute_access): Change calls to reverse_path.
8755 (dfs_get_vbase_types): Change calls to make_binfo.
8756 (get_vbase_types): Remove dead code.
8757 * tree.c (unshare_base_binfos): Change calls to make_binfo.
8758 (layout_basetypes): Warn here about inaccessible bases.
8759 (make_binfo): Remove chain parameter.
8760 (reverse_path): Add copy parameter.
8762 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
8764 * class.c: #if 0 complete_type_p.
8765 * init.c (build_java_class_ref, build_new_1): Remove unused locals.
8766 * method.c (process_overload_item): Likewise.
8767 * typeck.c (comp_target_types): Likewise.
8769 Stop sharing binfos for indirect virtual bases.
8770 * tree.c (propagate_binfo_offsets): Unshare vbases, too.
8771 (layout_basetypes): Likewise.
8772 (unshare_base_binfos): Copy vbases, too.
8773 * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
8774 BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
8775 (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
8776 CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
8777 * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
8778 reference to BINFO_VIA_PUBLIC.
8779 (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
8780 (push_class_decls): Use them.
8781 (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
8782 (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
8784 1998-08-27 Mark Mitchell <mark@markmitchell.com>
8786 * decl.c (build_enumerator): Set DECL_CONTEXT for the
8789 1998-08-26 Mark Mitchell <mark@markmitchell.com>
8791 * cp-tree.h (finish_enum): Change prototype.
8792 * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
8793 VALUES parameter. Don't try to compute mins/maxs if
8794 processing_template_decl.
8795 * parse.y (structsp): Use new calling sequence for finish_enum.
8796 * pt.c (tsubst_enum): Likewise. Take the new type as input.
8797 (lookup_template_class): Remove unused variables. Tweak.
8798 Register enums on instantiation list before substituting
8799 enumeration constants.
8800 (tsubst_decl): Remove unused variables.
8801 (regenerate_decl_from_template): Likewise.
8803 * decl.c (duplicate_decls): Don't obliterate the
8804 DECL_TEMPLATE_INFO for a template if we're not replacing it with
8807 * lex.c (do_identifier): Fix typo in comment.
8809 Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8811 * errfn.c: Remove stdarg.h/varargs.h.
8814 1998-08-25 Brendan Kehoe <brendan@cygnus.com>
8816 * pt.c (tsubst_copy): Only do typename overloading on an
8817 IDENTIFIER_NODE that happens to look like a typename if it actually
8818 has a type for us to use.
8820 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
8822 * typeck.c (comp_cv_target_types): Split out...
8823 (comp_target_types): From here. Don't allow cv-qual changes under
8824 a pointer if nptrs == 0. Fix OFFSET_TYPE handling.
8825 (build_ptrmemfunc): Pass 1 to nptrs.
8826 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
8828 1998-08-25 Mark Mitchell <mark@markmitchell.com>
8830 * search.c (dependent_base_p): Don't compare a binfo to
8831 current_class_type; use the TREE_TYPE of the binfo instead.
8833 * cp-tree.h (CLASS_TYPE_P): Revise definition.
8835 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
8837 * decl.c (duplicate_decls): Don't complain about different
8838 exceptions from an internal decl even if pedantic.
8840 * typeck.c (convert_for_assignment): Converting from pm of vbase
8841 to derived is an error, not a sorry.
8843 * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
8844 * class.c (fixed_type_or_null): Rename from
8845 resolves_to_fixed_type_p. Return the dynamic type of the
8846 expression, if fixed, or null.
8847 (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type
8848 does not match the static type.
8849 (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use
8850 resolves_to_fixed_type_p again.
8852 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8854 * pt.c (tsubst_decl): Move special case code for dealing with
8855 tricky friend templates here from ...
8856 (regenerate_decl_from_template): Here.
8858 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8860 * decl.c (start_decl): Remove redundant linkage check.
8862 1998-08-24 Gavin Romig-Koch <gavin@cygnus.com>
8864 * typeck.c (c_expand_return): Handle the case that valtype
8865 is wider than the functions return type.
8867 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8869 * cp-tree.h (CLASS_TYPE_P): New macro.
8870 * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
8871 * pt.c (process_template_parm): Undo previous change.
8873 1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
8875 * cp-tree.h: Declare.
8876 * pt.c (decl_template_parm_p): New function.
8877 * decl.c (pushdecl): Check decls for redeclaring template parms.
8878 (xref_tag): Make redeclaration an error, print decl.
8879 * decl2.c (grokfield): Check field_decls for redeclaration as well.
8881 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8883 * parse.y (primary): Fix up the type of string constants.
8885 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8887 * typeck.c (convert_for_initialization): Move check for odd uses
8888 of NULL to avoid duplicate warnings.
8890 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8892 * tree.c (lvalue_type): Fix for arrays.
8893 * typeck.c (string_conv_p): New fn.
8894 (convert_for_assignment): Use it.
8895 (build_unary_op): Use lvalue_type.
8896 * call.c (standard_conversion, convert_like): Use string_conv_p.
8897 (add_function_candidate): Use lvalue_type.
8898 * cvt.c (convert_to_reference): Likewise.
8899 * decl2.c (lang_decode_option): Ignore -traditional.
8900 * decl.c (init_decl_processing): flag_writable_strings inhibits
8903 1998-08-24 Andrew MacLeod <amacleod@cygnus.com>
8905 * lang-options.h (lang_options): Add fconst-strings to the list
8907 * decl2.c (lang_f_options, lang_decode_option): Likewise.
8909 1998-08-24 Nathan Sidwell <nathan@acm.org>
8911 * lex.c (real_yylex): Don't warn about long long constants if
8912 we're allowing long long.
8914 1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
8916 * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
8917 accessing bindings directly.
8919 * search.c (my_tree_cons): Reimplement.
8921 * lang-specs.h: Remove __HONOR_STD.
8922 * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
8924 1998-08-23 Mark Mitchell <mark@markmitchell.com>
8926 * decl.c (grokdeclarator): Complain about in-class initialization
8927 of aggregates and/or references.
8928 * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
8929 TEMPLATE_TYPE_PARMs.
8931 * decl2.c (grok_array_decl): Add comment.
8932 (mark_used): Don't instantiate an explicit instantiation.
8933 * friend.c (make_friend_class): Remove bogus comment. Fix check
8934 for partial specializations.
8935 * pt.c (check_explicit_specialization): Don't
8936 SET_DECL_EXPLICIT_INSTANTIATION here.
8937 (mark_decl_instantiated): Or here.
8938 (do_decl_instantiation): Do it here, instead. Add checks for
8939 duplicate explicit instantiations, etc. Tidy.
8940 (do_type_instantiation): Likewise.
8941 (instantiate_decl): Improve comments. Complain about explicit
8942 instantiations where no definition is available.
8944 * cp-tree.h (ansi_null_node): Remove.
8945 * call.c (build_over_call): Warn about converting NULL to an
8947 * cvt.c (build_expr_type_conversion): Likewise. Use
8948 null_ptr_cst_p instead of expanding it inline.
8949 * decl.c (ansi_null_node): Remove.
8950 (init_decl_processing): Make null_node always have integral type.
8951 * except.c (build_throw): Warn about converting NULL to an
8953 * lex.c (init_parse): Remove handling of ansi_null_node.
8954 * pt.c (type_unification_real): Don't convert NULL to void* type.
8955 * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
8956 (convert_for_assignment): Warn about converting NULL to an
8958 (convert_for_initialization): Likewise.
8960 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
8962 * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
8963 * pt.c (coerce_template_parms): Use no_linkage_check.
8964 * decl.c (grokvardecl): Likewise.
8965 (grokfndecl): Likewise. Members of anonymous types have no linkage.
8967 * method.c (process_overload_item): Remove useless code.
8969 1998-08-20 Per Bothner <bothner@cygnus.com>
8971 Handle new'ing of Java classes.
8972 * init.c (build_class_classref): New function.
8973 (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject;
8974 constructor does not return this; don't need to exception-protect.
8976 * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag.
8977 * decl2.c (acceptable_java_type): Handle template-derived types.
8979 1998-08-20 Per Bothner <bothner@cygnus.com>
8981 * decl2.c (import_export_vtable): Suppress vtables for Java classes.
8983 1998-08-20 Mark Mitchell <mark@markmitchell.com>
8985 * decl.c (duplicate_decls): Always merge the old and new patterns
8986 for templates, regardless of whether or not the new one has
8987 DECL_INITIAL. Don't throw away specializations. Merge
8989 * pt.c (tsubst_decl): Use the right pattern when calculating the
8990 complete args for a new template instance.
8991 (do_decl_instantiation): Fix typo in comment.
8992 (regenerate_decl_from_template): Deal with tricky friend template
8994 (instantiate_decl): Likewise.
8996 Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com)
8998 * init.c (build_builtin_delete_call): Add missing assemble_external
9001 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
9003 * parse.y (notype_unqualified_id): Also accept ~A<int>.
9005 1998-08-19 Mark Mitchell <mark@markmitchell.com>
9007 * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
9009 * except.c (build_throw): Warn when NULL is thrown, even with
9010 -ansi. Use ansi_null_node, rather than integer_zero_node, in the
9013 * cp-tree.h (ansi_null_node): New variable.
9014 * decl.c (ansi_null_node): New variable.
9015 (init_decl_processing): Initialize its type.
9016 * lex.c (init_parse): Initialize its value. Use ansi_null_node
9017 for null_node in non-ANSI mode.
9018 * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
9019 place of null_node to avoid spurious errors.
9021 1998-08-17 Mark Mitchell <mark@markmitchell.com>
9023 * cp-tree.h (enter_scope_of): New function.
9024 * parse.y (complex_direct_notype_declarator): Use it.
9025 * semantics.c (enter_scope_of): New function.
9027 1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
9029 * decl.c (grokparms): No, here.
9031 * decl.c (grokdeclarator): Catch parm with pointer to array of
9032 unknown bound here...
9033 * method.c (process_overload_item): ...not here.
9035 * gxxint.texi: Remove obsolete documentation of overloading code.
9037 * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
9038 * class.c (finish_struct_bits): Likewise.
9040 * tree.c (lvalue_type): Fix for arrays.
9041 * typeck.c (build_unary_op): Use lvalue_type.
9042 * call.c (add_function_candidate): Likewise.
9043 * cvt.c (convert_to_reference): Likewise.
9045 * decl2.c (lang_decode_option): Ignore -traditional.
9047 * init.c (build_offset_ref): Don't mess with error_mark_node.
9048 * lex.c (do_scoped_id): Use cp_error.
9050 * rtti.c (get_tinfo_fn): Don't mess with the context for now.
9052 1998-08-17 Benjamin Kosnik <bkoz@loony.cygnus.com>
9054 * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
9056 Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com)
9058 * cp-tree.h (set_identifier_local_value): Provide prototype.
9060 * decl2.c (do_namespace_alias): Remove unused variables `binding'
9063 Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com>
9065 * Makefile.in: Rename BBISON to BISON so that it can be properly
9066 inherited from the parent makefile.
9068 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
9070 * lang-options.h: Add -finit-priority.
9071 * decl2.c: Likewise. Check flag_init_priority instead of
9074 * decl2.c (setup_initp): New fn.
9075 (start_objects, finish_objects, do_ctors): Handle init_priority.
9076 (do_dtors, finish_file): Likewise.
9078 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
9080 * pt.c (tsubst_copy): Hush warning.
9082 * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
9084 1998-08-12 Mark Mitchell <mark@markmitchell.com>
9086 * pt.c (print_template_context): Don't abort when instantiating a
9089 * decl.c (grokdeclarator): Issue errors on namespace qualified
9090 declarators in parameter lists or in class scope.
9092 1998-08-09 Mark Mitchell <mark@markmitchell.com>
9094 * pt.c (check_explicit_specialization): Don't abort on bogus
9095 explicit instantiations.
9097 1998-08-07 Mark Mitchell <mark@markmitchell.com>
9099 * typeck.c (require_complete_type): Use complete_type_or_else.
9100 (complete_type_or_else): Always return NULL_TREE on failure, as
9103 * pt.c (tsubst_aggr_type): Prototype.
9104 (tsubst_decl): New function, split out from tsubst. Set
9105 input_filename and lineno as appropriate.
9106 (pop_tinst_level): Restore the file and line number saved in
9108 (instantiate_class_template): Set input_filename and lineno as
9110 (tsubst): Move _DECL processing to tsubst_decl. Make sure the
9111 context for a TYPENAME_TYPE is complete.
9113 * decl2.c (grokbitfield): Issue errors on bitfields declared with
9115 (do_dtors): As in do_ctors, pretend to be a member of the same
9116 class as a static data member while generating a call to its
9119 * cvt.c (cp_convert_to_pointer): Handle NULL pointer
9120 conversions, even in complex virtual base class hierarchies.
9122 1998-08-06 Mark Mitchell <mark@markmitchell.com>
9124 * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
9125 (TYPE_TEMPLATE_INFO): Likewise.
9126 (SET_TYPE_TEMPLATE_INFO): Likewise.
9127 (ENUM_TI_TEMPLATE): Likewise.
9128 (ENUM_TI_ARGS): Likewise.
9129 (lookup_nested_type_by_name): Remove.
9130 * decl.c (maybe_process_template_type_declaration): Handle enums.
9131 (start_enum): Don't check for primary-template enum declarations
9133 (finish_enum): Clean up, document. Make sure template enum
9134 constants get the correct type.
9135 (build_enumerator): Copy initializers for template enumerations,
9137 (grok_enum_decls): Document.
9138 * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
9139 better. Build LOOKUP_EXPRs for local variables, even if they are
9141 * pt.c (tsubst_enum): Remove field_chain parameter.
9142 (template_class_depth): Include the depth of surrounding function
9144 (push_template_decl): Check for primary-template enum declarations
9145 here. Deal with enumeration templates.
9146 (lookup_template_class): Likewise.
9147 (for_each_template_parm): Likewise.
9148 (instantiate_class_template): Don't call tsubst_enum directly,
9149 call tsubst instead, to instantiate enums. Deal with all
9150 field_chain issues here, not in tsubst_enum.
9151 (lookup_nested_type_by_name): Remove.
9152 (tsubst_aggr_type): Revise handling of enumeration types.
9154 (tsubst_copy): Likewise.
9155 (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
9157 1998-08-04 Mark Mitchell <mark@markmitchell.com>
9159 * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
9160 uses template parameters.
9161 * method.c (build_template_parm_names): Use the full set of
9162 template arguments for tsubst'ing.
9163 (build_overload_identifier): Pass the full set of template
9164 arguments to build_template_parm_names, not just the
9166 * pt.c (TMPL_ARGS_DEPTH): Define using
9167 TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
9168 (NUM_TMPL_ARGS): New macro.
9169 (add_outermost_template_args): Deal with the case where the outer
9170 args will be completely discarded.
9171 (coerce_template_parms): Use the full set of template arguments
9172 for tsubst'ing. Simplify. Add some asserts. Improve
9174 (lookup_template_class): Pass the full set of template arguments
9175 to coerce_template_parms.
9176 (tsubst): Add assertion.
9177 (do_type_instantiation): Don't instantiate member template
9180 * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
9181 name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
9183 1998-08-03 Jason Merrill <jason@yorick.cygnus.com>
9185 * method.c (set_mangled_name_for_decl): Change return type to void.
9187 * decl.c (lookup_name_real): A namespace-level decl takes priority
9188 over implicit typename. Avoid doing the same lookup twice.
9190 * search.c (dependent_base_p): New fn.
9191 (dfs_pushdecls, dfs_compress_decls): Use it.
9193 * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
9194 virtual functions if the type doesn't have any.
9196 1998-08-03 Mark Mitchell <mark@markmitchell.com>
9198 * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
9199 uses template parameters.
9201 1998-08-02 Mark Mitchell <mark@markmitchell.com>
9203 * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument.
9204 * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
9205 * lex.c (do_identifier): Don't use a second argument, or a type,
9206 when building LOOKUP_EXPRs.
9207 (do_identifier): Likewise.
9208 (do_scoped_id): Likewise.
9209 * method.c (hack_identifier): Improve error message.
9210 * pt.c (lookup_template_function): Don't needlessly call
9211 copy_to_permanent or build_min.
9212 (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if
9214 (do_decl_instantiation): Improve error message.
9215 * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
9216 (build_min): Copy the type to the permanent obstack, too.
9218 1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
9220 * init.c (init_init_processing): Remove BI* handling.
9221 (build_builtin_call): Remove.
9222 (build_builtin_delete_call): New fn.
9223 (build_delete): Use it.
9225 1998-07-31 Mark Mitchell <mark@markmitchell.com>
9227 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
9228 (maybe_check_template_type): New function.
9229 * decl.c (maybe_process_template_type_declaration): New function,
9230 split out from pushtag Call maybe_check_template_type.
9231 (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P.
9232 (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9233 * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9234 * pt.c (template_class_depth_real): Generalization of ...
9235 (template_class_depth): Use it.
9236 (register_specialization): Use duplicate_decls for duplicate
9237 declarations of specializations.
9238 (maybe_check_template_type): New function.
9239 (push_template_decl_real): Fix comment.
9240 (convert_nontype_argument): Likewise.
9241 (lookup_template_class): Likewise. Avoid an infinite loop on
9243 (tsubst_friend_function): Fix comment.
9244 (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
9246 * semantics.c (begin_function_definition): Use
9247 reset_specialization to note that template headers don't apply
9248 directly to declarations after the opening curly for a function.
9250 1998-07-29 Jason Merrill <jason@yorick.cygnus.com>
9252 * decl.c (push_overloaded_decl): Use current_namespace instead of
9253 DECL_CONTEXT (decl) to determine where we go.
9255 * decl.c (lookup_name_real): Fix typo.
9257 1998-07-28 Mark Mitchell <mark@markmitchell.com>
9259 * friend.c (is_friend): Be lenient with member functions to deal
9260 with nested friends.
9262 1998-07-28 Jason Merrill <jason@yorick.cygnus.com>
9264 * class.c (finish_struct_1): Convert integer_zero_node to
9265 ssizetype before passing it to set_rtti_entry.
9266 * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
9267 of any size to a pointer.
9269 1998-07-27 Mark Mitchell <mark@markmitchell.com>
9271 * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
9272 (build_template_decl_overload): Remove.
9273 (set_mangled_name_for_decl): New function.
9274 (innermost_args): Remove is_spec parameter.
9275 (most_specialized, most_specialized_class): Remove declarations.
9276 (lookup_template_class): Add entering_scope parameter.
9277 (maybe_process_partial_specialization): New function.
9278 (finish_template_decl): Likewise.
9279 (finish_template_type): Likewise.
9280 * class.c (finish_struct): Clean up processing of member template
9282 * decl.c (pushtag): Fix formatting.
9283 (lookup_tag): Improve handling of pseudo-global levels.
9284 (make_typename_type): Adjust call to lookup_template_class.
9285 (shadow_tag): Use maybe_process_partial_specialization.
9286 (xref_tag): Improve handling of member friends.
9287 (start_function): Call push_nested_class before
9288 push_template_decl. Don't call push_template_decl for
9290 * decl2.c (grok_x_components): Don't call xref_tag for
9291 template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
9292 (grokclassfn): Use set_mangled_name_for_decl.
9293 (arg_assoc_class): Adjust call to innermost_args.
9294 (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
9295 * error.c (dump_function_name): Improve printing of template
9297 * friend.c (is_friend): Don't compare types of decls to determine
9298 friendship, unless flag_guiding_decls.
9299 (make_friend_class): Partial specializations cannot be friends.
9300 (do_friend): Use set_mangled_name_for_decl. Call
9301 push_template_decl_real instead of push_template_decl.
9302 * method.c (build_decl_overload_real): Remove prototype. Give it
9304 (build_overload_identififer): Adjust call to innermost_args.
9305 (build_template_decl_overload): Remove.
9306 (set_mangled_name_for_decl): New function.
9307 * parse.y (.finish_template_type): New non-terminal.
9308 (template_def): Use finish_template_decl. Use template_extdef
9310 (template_extdef, template_datadef): New non-terminals, containing
9311 only those rules for things which can be templates.
9313 (template_type, self_template_type): Use .finish_template_type.
9314 (named_class_head): Use maybe_process_partial_specialization.
9315 * pt.c (mangle_class_name_for_template): Remove context parameter.
9316 (get_class_bindings): Remove outer_args parameter.
9317 (complete_template_args): Remove.
9318 (add_outermost_template_args): New function.
9319 (register_specialization): Return the specialization.
9320 (unregister_specialization): New function.
9321 (tsubst_template_parms): Likewise.
9322 (most_specialized, most_specialized_class): Prototype here as
9324 (original_template): Rename to most_general_template.
9325 (tsubst_template_parms): New function.
9326 (set_mangled_name_for_template_decl): Likewise.
9327 (TMPL_ARGS_DEPTH): New macro.
9328 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
9329 (TMPL_ARGS_LEVEL): New macro.
9330 (SET_TMPL_ARGS_LEVEL): Likewise.
9331 (TMPL_ARG): Likewise.
9332 (SET_TMPL_ARG): Likewise.
9333 (TMPL_ARGS_DEPTH): Likewise.
9334 (finish_member_template_decl): Use finish_template_decl.
9335 (maybe_process_partial_specialization): New function, split out
9337 (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
9338 (maybe_begin_member_template_processing): Use new macros.
9339 (is_member_template): Likewise.
9340 (is_member_template_class): Likewise.
9341 (add_to_template_args): Likewise. Deal with multiple levels of
9343 (maybe_process_partial_specialization): New function.
9344 (retrieve_specialization): Add consistency check.
9345 (determine_specialization): Return full argument list.
9346 (check_explicit_specialization): Tweak friend handling. Use full
9347 argument lists. Simplify.
9348 (current_template_args): Use new macros.
9349 (push_template_decl_real): Change ill-named mainargs to specargs.
9350 Check that a partial specialization actually specializes at least
9351 one parameter. Improve friend handling. Modify for full
9353 (classtype_mangled_name): Don't mangle the names of
9355 (lookup_template_class): Add entering_scope parameter. Use it to
9356 avoid finding a template type when an instantiation is required.
9357 Simplify. Use full template arguments.
9358 (tsubst_friend_function): Use unregister_specialization. Use new
9359 macros. Use full template arguments.
9360 (tsubst_friend_class): Substitute, using tsubst_template_parms,
9361 into the template parameters before passing them to
9362 redeclare_class_template.
9363 (instantiate_class_template): Simplify. Use full template
9364 arguments. Adjust calls to get_class_bindings. Use
9365 SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
9366 (innermost_args): Use new macros.
9367 (tsubst_aggr_type): New function, split out from tsubst.
9368 (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
9369 conventions for lookup_template_class. Refine handling of partial
9370 instantiations. Remove calls to complete_template_args.
9371 Simplify. Add consistency checks. Use set_mangled_name_for_decl
9372 and set_mangled_name_for_template_decl.
9373 (tsubst_copy): Use tsubst_aggr_type.
9374 (instantiate_template): Use full template arguments.
9375 (more_specialized): Improve formatting.
9376 (more_specialized_class): Adjust calls to get_class_bindings.
9377 (get_bindings_real): Don't call complete_template_args.
9378 (most_specialized): Don't overwrite input; create a new list.
9379 (most_specialized_class): Use most_general_template.
9380 (regenerate_decl_from_template): Use unregister_specialization.
9381 Use full template arguments.
9382 (instantiate_decl): Use full template arguments.
9383 (set_mangled_name_for_template_decl): New function.
9384 * semantics.c (begin_class_definition): Use
9385 maybe_process_partial_specialization.
9386 (finish_member_class_template): New function.
9387 (finish_template_decl): Likewise.
9388 (finish_template_type): Likewise.
9389 (typeck.c): Don't crash after issuing a compiler_error.
9390 * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
9392 1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
9394 * typeck2.c (build_functional_cast): Handle default-initialization.
9396 * call.c (build_over_call): Pass 1 to popclass.
9398 * parse.y (direct_notype_declarator): Add precedence declaration
9399 to notype_unqualified_id case.
9400 * Makefile.in (EXPECT): Adjust.
9402 * tree.c (ovl_member): Fix for single function in OVL.
9404 1998-07-27 Dave Brolley <brolley@cygnus.com>
9406 * c-lex.c (yylex): Fix boundary conditions in character literal and
9407 string literal loops.
9409 1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
9411 * decl.c (lookup_name_real): OK, do return the from_obj value
9412 unless got_object depends on template parms.
9414 * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
9416 * pt.c (coerce_template_parms): Also complain about local enums.
9418 * cp-tree.h: Add prototype for set_identifier_local_value.
9419 * decl.c (set_identifier_local_value_with_scope): Make static,
9421 * search.c (covariant_return_p): Likewise.
9422 * except.c (build_terminate_handler, alloc_eh_object): Likewise.
9424 * call.c (build_method_call): Only pull out the type of a destructor
9425 if it's a template type parm.
9426 * decl.c (lookup_name_real): Never return the from_obj value.
9428 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
9430 * except.c (process_start_catch_block_old): Call start_decl_1 for
9432 * decl.c (start_decl_1): Avoid duplicate error.
9434 * init.c (expand_default_init): Only perform the initialization if
9435 it will do something.
9437 1998-07-23 H.J. Lu (hjl@gnu.org)
9439 * parse.y (base_class): Check for invalid base class.
9441 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
9443 * decl2.c (import_export_template): Fold in...
9444 (import_export_class): ...to here. Handle dllimport/export.
9446 * class.c (build_vtable): Pass at_eof to import_export_vtable.
9447 (prepare_fresh_vtable): Likewise.
9448 * decl2.c (import_export_class): Split out...
9449 (finish_prevtable_vardecl): From here.
9450 * class.c (finish_struct_1): Call import_export_class if at_eof.
9452 * decl.c (start_function): #if 0 mysterious code I wrote and have
9454 * rtti.c (get_tinfo_fn): If this is for a class type, set
9457 1998-07-22 Jason Merrill <jason@yorick.cygnus.com>
9459 * inc/exception: Change terminate and unexpected to ().
9461 * parse.y (named_class_head_sans_basetype_defn): A
9462 named_class_head_sans_basetype followed by '{' or ':' is a defn.
9464 1998-07-21 Jason Merrill <jason@yorick.cygnus.com>
9466 * tree.c (canonical_type_variant): New fn to handle arrays.
9467 * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
9468 * pt.c (unify, default case): Also fold arg. Fix array bounds case.
9469 * method.c (process_overload_item): Use build_overload_value for
9472 1998-07-20 Dave Brolley <brolley@cygnus.com>
9474 * lex.c (mbchar.h): #include it.
9475 (GET_ENVIRONMENT): New macro.
9476 (init_parse): Set character set based on LANG environment variable.
9477 (real_yylex): Handle multibyte characters in character literals.
9478 (real_yylex): Handle multibyte characters in string literals.
9480 1998-07-19 Jason Merrill <jason@yorick.cygnus.com>
9482 * lex.c (do_identifier): Look for class value even if we don't
9483 have a global value. Do implicit declaration if parsing is 2.
9484 * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
9487 1998-07-19 Mark Mitchell <mark@markmitchell.com>
9489 * decl.c (pushtag): Revert previous change.
9490 * pt.c (lookup_template_class): Don't put out debugging
9491 information for types that use template parameters.
9493 * decl.c (pushtag): Don't put out debugging information for
9494 compiler-generated typedefs.
9496 * error.c (dump_type_real): Don't crash when presented with
9497 intQI_type_node or the like.
9499 * semantics.c (finish_translation_unit): Fix spelling error in
9502 1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
9504 * decl.c (lookup_name_real): Pull out single function here.
9505 (select_decl): Not here.
9506 (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
9508 * decl.c (qualify_lookup): Tweak again.
9510 * pt.c (lookup_template_class): Don't mess with the context of the
9512 * decl2.c (current_decl_namespace): Remove special handling for
9515 * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
9516 a member template specialization.
9518 * tree.c (ovl_member): Use decls_match to compare functions.
9519 * decl.c (decls_match): Check the context of a function.
9521 * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
9522 in Koenig lookup support rules.
9523 * semantics.c (finish_call_expr): Handle the new cases.
9525 * typeck.c (build_x_function_call): Handle overloaded methods.
9527 * decl.c (grokvardecl): Don't call build_static_name for extern "C".
9529 1998-07-16 Mark Mitchell <mark@markmitchell.com>
9531 * semantics.c (finish_object_call_expr): Revert previous change.
9532 * call.c (build_new_method_call): Likewise. Instead, convert
9533 TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
9535 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
9537 * decl.c (qualify_lookup): Handle templates.
9539 * decl2.c (do_using_directive): Don't pass ancestor.
9540 * decl.c (push_using_directive): Calculate ancestor.
9542 * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
9543 * decl.c (pushdecl): Move type shadowing handling from here...
9544 (duplicate_decls): ...to here.
9545 * decl.c (set_identifier_local_value_with_scope): New fn.
9547 (set_identifier_local_value, lookup_type_current_level): New fns.
9548 * decl2.c (do_local_using_decl): Handle types and binding level
9551 * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
9552 * decl.c (select_decl): Extract a lone function from an OVERLOAD.
9553 (lookup_namespace_name): Likewise.
9554 * typeck.c (build_unary_op): Not here anymore.
9556 * decl2.c (do_class_using_decl): Make sure we get an identifier.
9557 * class.c (handle_using_decl): Ignore TYPE_DECLs.
9559 * decl.c (qualify_lookup): New fn.
9560 (lookup_name_real): Use it.
9562 1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de>
9564 * decl2.c (add_using_namespace): When directly using a namespace
9565 that was indirect before, promote it.
9567 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
9568 LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
9569 LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
9570 * decl.c (select_decl): Replace two flag parameters by one.
9571 (unqualified_namespace_lookup): Likewise, pass flag.
9572 (lookup_flags): New function.
9573 (lookup_name_real): Compute flags, pass them.
9574 (lookup_namespace_name): Call with zero-flag.
9575 * decl2.c (ambiguous_decl): Add flag parameter, complain only
9577 (lookup_using_namespace, qualified_lookup_using_namespace):
9578 Add flag parameter, pass them through.
9579 * lex.c (do_scoped_id): Call with zero-flag.
9581 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
9583 * typeck.c (convert_for_assignment): Use comptypes.
9585 1998-07-16 Mark Mitchell <mark@markmitchell.com>
9587 * semantics.c (finish_object_call_expr): Move test for the
9588 function called being a TYPE_DECL to ...
9589 * call.c (build_new_method_call): Here.
9591 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
9593 * decl2.c (arg_assoc_class): Also look at template arguments, if any.
9594 (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
9596 * lex.c (looking_for_typename): Don't initialize.
9598 * decl2.c (ambiguous_decl): Clarify error message.
9600 * decl.c (push_using_directive): Iterate over namespaces used
9603 1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de>
9605 * decl2.c (add_using_namespace): Iterate over namespaces used
9608 * decl.c (lookup_name_real): Accept namespace aliases as locals.
9609 (cat_namespace_levels): Ignore aliases.
9610 (duplicate_decls): Ignore duplicate aliases.
9611 * decl2.c (do_namespace_alias): Process block level namespace
9612 aliases. Store alias with pushdecl. Remove odr errors.
9613 * parse.y (namespace_alias): New non-terminal.
9616 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
9618 * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
9619 Handle TEMPLATE_TYPE_PARM.
9620 (arg_assoc): Rewrite.
9622 * pt.c (complete_template_args): Don't look at the context unless
9625 * method.c (build_decl_overload_real): Fix namespace handling.
9627 * typeck.c (build_unary_op): Extract a lone function from an
9630 * call.c (build_scoped_method_call): Handle getting a namespace
9631 for basetype in a destructor call.
9632 (check_dtor_name): Handle enums.
9634 * parse.y (using_directive): New nonterminal.
9635 (extdef, simple_stmt): Use it.
9637 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
9639 * decl2.c (add_function): Move error message ...
9640 (arg_assoc_namespace): ... from here.
9642 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
9644 * parse.y (namespace_qualifier): Fix multiple level handling.
9645 * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
9646 (arg_assoc): Don't skip the first argument of a function.
9648 Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com)
9650 * search.c (my_tree_cons): Clean up.
9652 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
9654 * call.c (joust): Don't warn about "confusing" conversions to the
9657 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
9659 * class.c (push_nested_class): Complain about namespaces.
9660 * decl.c (start_decl): Enter the object's namespace.
9661 (cp_finish_decl): Leave it.
9662 (grokdeclarator): Likewise.
9663 * decl2.c (check_decl_namespace): New function.
9664 (finish_file): Call it.
9665 * parse.y (complex_direct_notype_declarator): Set complexity
9666 of namespace-qualified ids to -1, enter the namespace.
9668 * method.c (build_template_decl_overload): Expect _DECL as first
9669 parameter. Put context temporarily into current_namespace.
9670 * pt.c (check_explicit_specialization): Change caller.
9673 * init.c (build_offset_ref): Call mark_used and
9674 convert_from_reference for namespace members.
9676 Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
9678 * search.c (my_tree_cons): The bitfield is at index 2.
9680 Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com>
9682 * lang-options.h: Format changed to work with new --help support
9685 1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
9687 * decl2.c (build_expr_from_tree): Change calls of do_identifier.
9688 Do Koenig lookup in CALL_EXPR.
9689 (arg_assoc): Handle error_mark.
9690 * lex.c (is_global): New function.
9691 (do_identifier): Expect arguments for Koenig lookup.
9692 * parse.y (primary): Add rules for calls of unqualified function calls.
9693 (do_id): Change call of do_identifier.
9694 * pt.c (finish_stmt_expr): Likewise.
9695 * semantics.c (finish_id_expr): Likewise.
9696 (finish_call_expr): Add integer parameter to indicate
9697 argument-dependent lookup.
9699 * decl.c (struct binding_level): New field using_directives.
9700 (push_using_decl): Not sorry anymore.
9701 (push_using_directive): New function.
9702 (lookup_tag): Use CP_DECL_CONTEXT to iterate.
9703 (unqualified_namespace_lookup): New function, code from ...
9704 (lookup_name_real): ... here.
9705 * decl2.c (lookup_using_namespace): Pass using list instead of
9707 (validate_nonmember_using_decl): New function.
9708 (do_nonmember_using_decl): New function.
9709 (do_toplevel_using_decl): Use them.
9710 (do_local_using_decl): New function.
9711 (do_using_directive): Support block-level directives.
9712 * parse.y (simple_stmt): Support using declarations and
9714 (namespace_qualifier, namespace_using_decl): New non-terminals.
9716 * xref.c (classname): New function.
9717 (GNU_xref_hier): Change class and base parameters to tree.
9718 * decl.c (xref_baseypes): Change caller.
9719 * friend.c (make_friend_class): Likewise.
9721 1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
9723 * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
9726 * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
9727 template template parameter, record its use.
9728 (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
9729 its template arguments if exists.
9731 * pt.c (coerce_template_template_parms): New function equivalent
9732 to coerce_template_parms when IS_TMPL_PARM is true.
9733 (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter,
9734 all callers changed.
9736 (coerce_template_parms): Access ARGLIST properly when creating a
9737 new vector. Only accept implicit TYPE_DECL as valid argument for
9738 a template template parameter when it is a base class of
9739 current_class_type. Don't display error message when COMPLAIN is
9742 1998-07-12 Klaus Kaempf (kkaempf@progis.de)
9744 * repo.c (get_base_filename): Use file_name_nondirectory.
9745 (open_repo_file): Likewise.
9746 * cp-tree.h (file_name_nondirectory): Add prototype.
9748 1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
9750 * friend.c (do_friend): Pull the identifier out of declarator.
9751 Use cp_error and friends.
9752 * decl2.c (qualified_lookup_using_namespace): Fix call to
9754 * decl.c (lookup_name_real): Don't call complete_type on a namespace.
9755 (grokvardecl): Use DECL_CLASS_SCOPE_P.
9756 * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
9757 * class.c (warn_hidden): Fix for OVERLOAD.
9758 From grahams@rcp.co.uk:
9759 * cp-tree.h (DEFARG_NODE_CHECK): New macro.
9760 (DEFARG_LENGTH, DEFARG_POINTER): Use it.
9762 Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com)
9764 * g++.1 (-traditional): Remove duplicated documentation.
9766 1998-07-11 Mark Mitchell <mark@markmitchell.com>
9768 * method.c (flush_repeats): Add nrepeats parameter.
9769 (issue_nrepeats): Likewise.
9770 (is_back_referenceable_type): New function. Don't back-reference
9771 TEMPLATE_TYPE_PARMs as well as simple types like integers.
9772 (build_mangled_name_for_type): Likewise.
9773 (build_mangled_name_for_type_with_Gcode): Likewise.
9775 (nrepeats): Likewise.
9776 (Nrepeats): Likewise.
9777 (start_squangling): Don't clear the variables removed above.
9778 (end_squangling): Likewise.
9779 (flush_repeats): Tidy. Use nrepeats parameter rather than
9781 (issue_nrepeats): Likewise, but with nrepeats global. Use
9782 is_backreferenceable_type.
9783 (build_overload_nested_name): Tidy. Add comment. Use
9784 build_mangled_name_for_type.
9785 (build_underscore_int): Comment.
9786 (build_overload_scope_ref): Use build_mangled_name_for_type.
9787 (build_overload_int): Likewise.
9788 (build_template_template_parm_names): Tidy.
9789 (build_template_parm_names): Use build_mangled_name_for_type.
9790 (build_overload_identifier): Add comments.
9791 (build_mangled_name_for_type_with_Gcode): Split out from
9793 (build_mangled_name_for_type): Use it.
9794 (build_mangled_name): Rework to use build_mangled_name_for_type
9795 and to not use global nrepeats/Nrepeats. Tidy.
9796 (process_modifiers): Tidy.
9797 (check_btype): Use is_backreferenceable_type. Add comment.
9798 Rename `node' to `type'.
9799 (process_overload_item): Set numeric_output_need_bar here.
9800 Use build_mangled_name_for_type. Tidy.
9801 (build_decl_overload_real): Tidy. Don't use Nrepeats. Use
9802 build_mangled_name_for_type.
9804 * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
9807 1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com>
9809 * cp-tree.h (warn_long_long): Define.
9810 * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
9811 warning "ANSI C++ does not support `long long'".
9812 * decl2.c (warn_long_long): Define.
9813 (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
9815 1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
9817 * decl.c (xref_tag): Handle attributes between 'class' and name.
9818 * parse.y (aggr): Likewise.
9819 * semantics.c (finish_class_definition): Likewise.
9820 * Makefile.in (EXPECTED): Adjust.
9822 * cp-tree.h: Declare flag_optional_diags and warn_multichar.
9823 * decl2.c: Define them.
9824 (lang_decode_option): Handle them.
9825 * lang-options.h: Add -foptional-diags.
9826 * class.c (finish_struct): Don't complain about multiple meanings of
9827 name if -fno-optional-diags.
9828 * decl.c (pushdecl_class_level): Likewise.
9829 * lex.c (real_yylex): Check warn_multichar.
9831 1998-07-06 Jason Merrill <jason@yorick.cygnus.com>
9833 * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
9835 * tree.c (make_binfo): Fix length.
9837 1998-06-30 Benjamin Kosnik <bkoz@bliss.nabi.net>
9839 * decl2.c (lang_decode_option): Remove warn_template_debugging.
9840 * lang-options.h: Likewise.
9842 Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9844 * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
9845 (process_start_catch_block): Likewise for variables
9846 `false_label_rtx', `call_rtx' and `return_value_rtx'.
9848 1998-06-29 Brendan Kehoe <brendan@cygnus.com>
9850 * tree.c (build_srcloc): Make sure we allocate this node on the
9853 Sat Jun 27 23:34:18 1998 Fred Fish <fnf@ninemoons.com>
9855 * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
9856 (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
9857 (lang_specific_driver): Only add -lm automatically if need_math is
9860 Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com)
9862 * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o
9864 Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9866 * Makefile.in (EXPR_H): New dependency variable.
9867 (decl2.o): Depend on $(EXPR_H).
9868 (typeck.o): Likewise.
9872 1998-06-25 Benjamin Kosnik <bkoz@lisa.cygnus.com>
9874 * decl.c (start_enum): Put local enums on permanent_obstack.
9876 1998-06-25 Mark Mitchell <mark@markmitchell.com>
9878 * cp-tree.h (c_get_alias_set): Declare.
9879 * decl.c (init_decl_processing): Set lang_get_alias_set.
9881 1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
9883 * cp-tree.h (mark_all_runtime_matches): Add function prototype.
9884 * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
9885 flag for all function decls which are in the exception table.
9886 * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
9887 * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
9888 code is emitted for any referenced rtti function.
9890 1998-06-25 Dave Brolley <brolley@cygnus.com>
9892 * lang-specs.h: Use new | syntax to eliminate
9893 string concatenation.
9895 1998-06-25 Jason Merrill <jason@yorick.cygnus.com>
9897 * cp-tree.h (CP_DECL_CONTEXT): New macro.
9898 * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
9899 * method.c (build_overload_nested_name): Likewise.
9900 * sig.c (build_signature_pointer_or_reference_type): Don't set
9903 1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
9905 Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
9906 * cp-tree.h (FROB_CONTEXT): New macro.
9907 (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
9908 * decl.c (namespace_binding): Replace NULL_TREE with
9910 (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
9911 * decl2.c (is_namespace_ancestor, lookup_using_namespace):
9913 * decl.c (pushtag): Use FROB_CONTEXT.
9914 (pushdecl, make_typename_type, define_function, grokdeclarator):
9916 * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
9917 * pt.c (push_template_decl_real, lookup_template_class, tsubst):
9919 * decl2.c (decl_namespace): Return global_namespace if no context.
9920 * method.c (build_overload_nested_name): Expect null as context.
9921 * pt.c (mangle_class_name_for_template): Do nothing for null
9923 (lookup_template_class): Allow for null id_context.
9925 1998-06-25 Richard Henderson <rth@cygnus.com>
9927 * method.c (emit_thunk): Set current_function_is_thunk for the
9928 ASM_OUTPUT_MI_THUNK case as well.
9930 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
9932 * exception.cc (__cplus_type_matcher): Get a match_info pointer
9933 instead of an exception table entry as a parameter.
9935 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
9937 * parse.y (function_try_block): Don't call start_catch_handler.
9938 * except.c (call_eh_info): Remove coerced field from declaration.
9939 (build_eh_type_type_ref): New function to create an address of a
9940 rtti function for the new style exception tables.
9941 (expand_start_catch_block): Split function, this contains the
9943 (process_start_catch_block_old): New function to perform the rest
9944 of expand_start_catch_block under old style exceptions.
9945 (process_start_catch_block_old): New function to perform the rest
9946 of expand_start_catch_block under new style exceptions.
9947 (expand_end_catch_block): Only pop the false label off the stack under
9948 the old style of exceptions.
9949 * semantics.c (finish_try_block): Don't call start_catch_handler.
9950 * exception.cc (struct cp_eh_info): Add original_value field.
9951 (__cplus_type_matcher): Perform type matching on the original exception
9952 value, and if we have a match, set the current value.
9953 (__cp_push_exception): Set the original exception value.
9955 1998-06-23 Jason Merrill <jason@yorick.cygnus.com>
9957 * call.c (joust): Fix confusing conversion warning.
9959 * call.c (build_op_delete_call): Add placement parm. Check
9960 LOOKUP_SPECULATIVELY.
9961 * cp-tree.h, decl2.c, init.c: Adjust.
9962 * decl.c (finish_function): Use it.
9964 * pt.c (tsubst): Diagnose creating void fields or variables.
9966 Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9968 * call.c (build_scoped_method_call): Remove unused variable `tmp'.
9970 * cp-tree.h (check_dtor_name): Add prototype.
9972 * init.c (expand_member_init): Remove unused variables
9973 `ptr_type_node', `parm' and `rval'.
9975 * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
9977 (lang_print_xnode): Likewise.
9979 * typeck2.c (enum_name_string): Cast argument to sprintf to long
9980 and use %ld specifier.
9982 * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
9983 specifier in call to fprintf.
9984 (GNU_xref_member): Cast argument to sprintf to int.
9986 Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
9988 * typeck2.c (pop_init_level): Warn about implicit zero initialization
9991 Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9993 * cp-tree.h: Prototype function `check_java_method'.
9995 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
9997 * class.c (finish_struct): Make conflicting use of id a pedwarn.
9998 * decl.c (pushdecl_class_level): Likewise.
10000 1998-06-17 Mark Mitchell <mark@markmitchell.com>
10002 * pt.c (convert_nontype_argument): Issue an error when presented
10003 with an integer (real) constant that cannot be simplified to an
10004 INT_CST (REAL_CST).
10006 * cp-tree.h (c_get_alias_set): Remove declaration added in
10007 1998-06-13 change that should never have been checked in.
10009 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10011 * typeck.c (build_binary_op_nodefault): Change % in format strings
10014 * decl.c (grokvardecl): Don't build_static_name for decls that
10015 aren't at namespace scope.
10017 * init.c (perform_member_init): Catch default-initialization of
10020 1998-06-17 Mark Mitchell <mark@markmitchell.com>
10022 * errfn.c (cp_thing): Handle the `%%' formatting sequence.
10024 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10026 * method.c (hack_identifier): Complain about getting a namespace
10028 * typeck.c (decay_conversion): Remove check for namespaces.
10029 * typeck2.c (incomplete_type_error): Likewise.
10030 * parse.y (template_arg): Add PTYPENAME expansion.
10032 1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
10034 * decl.c (grokvardecl): Don't build external assembler names for
10035 TYPENAMEs in other namespaces as there is no declarator.
10036 * error.c (cp_file_of, cp_line_of): Don't extract file or line number
10037 info from DECL_CONTEXT if it is NULL.
10039 1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
10041 * call.c (check_dtor_name): Split out.
10042 (build_scoped_method_call): Use it.
10043 (build_method_call): Use it.
10044 * init.c (build_offset_ref): Use it.
10046 * typeck.c (build_static_cast): Fix handling of pointers to members.
10048 * decl.c (finish_function): Just return nothing from a constructor.
10049 * typeck.c (c_expand_return): Complain about returning a void
10050 expression from a destructor.
10052 1998-06-13 Mark Mitchell <mark@markmitchell.com>
10054 * class.c (alter_access): Accept a BINFO explaining how to get
10055 from the entity whose accessed is being altered to the type doing
10057 (handle_using_decl): New function containing code split out from ...
10058 (finish_struct_1): Here.
10060 * cp-tree.h (complete_type_or_else): Declare.
10061 * init.c (build_new_1, build_delete): Use it.
10062 * typeck.c (require_complete_type): Use complete_type, rather than
10063 expanding it inline.
10064 (complete_type_or_else): New function.
10065 (build_component_ref): Use it.
10066 (pointer_int_sum): Make sure the type pointed to is complete.
10067 (pointer_diff): Likewise.
10069 * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
10072 * search.c (get_matching_virtual): Note that member templates
10073 cannot override virtual functions.
10075 1998-06-12 Brendan Kehoe <brendan@cygnus.com>
10077 * pt.c (check_explicit_specialization): If DECLARATOR turned into
10078 an error_mark_node from lookup_template_function, return the same.
10079 (determine_specialization): Also make sure TEMPLATE_ID isn't an
10080 error_mark_node, before we try to read its operands.
10081 * decl.c (grokdeclarator): If we got an error_mark_node from
10082 check_explicit_specialization, just return it right back.
10084 1998-06-12 Mark Mitchell <mark@markmitchell.com>
10086 * class.c (instantiate_type): Don't treat template-ids that don't
10087 specify any template arguments as equivalent to ordinary
10088 identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to
10089 pointer-to-members for member templates. Tidy slightly.
10090 * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
10091 * init.c (build_offset_ref): Handle template-ids like ordinary
10092 identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
10093 offset part of the OFFSET_REF.
10094 * typeck.c (build_unary_op): Change check for unknown types to
10095 look for OFFSET_REFs, not SCOPE_REFs.
10097 1998-06-11 Mark Mitchell <mark@markmitchell.com>
10099 * pt.c (is_member_template_class): New function.
10100 (push_template_decl_real): Use it.
10102 1998-06-11 Benjamin Kosnik <bkoz@elmo.cygnus.com>
10104 * friend.c (do_friend): Add support for nested classes using
10105 member functions of the enclosing class as friends.
10107 1998-06-10 Mark Mitchell <mark@markmitchell.com>
10109 * call.c (convert_default_arg): Make global, not static.
10110 (convert_arg_for_ellipsis): Split out from ...
10111 (build_over_call): Here.
10112 * cp-tree.h (convert_default_arg); Declare.
10113 (convert_arg_to_ellipsis): Likewise.
10114 (do_member_init): Remove.
10115 * init.c (do_member_init): Remove; this code is dead.
10116 (expand_member_init): Remove much of this code; it is dead.
10117 * typeck.c (convert_arguments): Use convert_default_arg and
10118 convert_arg_for_ellipsis, rather than duplicating here.
10120 * call.c (convert_like): Don't fail silently if
10121 build_user_type_conversion fails. Always return error_mark_node
10124 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10126 * search.c (covariant_return_p): Complain about ambiguous base.
10128 * typeck.c (build_component_ref): Diagnose ref to nested type.
10130 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10132 * decl.c (grokparms): Check that INIT isn't an error_mark_node
10133 before giving error about invalid type for default arg.
10135 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10137 * call.c (build_method_call): Fix thinko.
10139 1998-06-10 Dave Brolley <brolley@cygnus.com>
10141 * decl2.c (lang_decode_option): New argc/argv interface.
10142 * cp-tree.h (lang_decode_option): New argc/argv interface.
10143 * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
10144 specified for cpplib-enabled compilers.
10145 * lex.c (lang_init): Don't check_newline for cpplib.
10146 (init_parse): Don't initialize cpplib here.
10148 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10150 * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
10151 piece before checking DECL_MUTABLE_P.
10153 1998-06-10 John Carr <jfc@mit.edu>
10155 * tree.c (debug_binfo): Make printf format match arguments.
10157 * error.c (OB_PUTI): Make printf format match arguments.
10159 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10161 * init.c (perform_member_init): Handle default-initialization.
10163 * except.c (build_throw): Handle throwing NULL.
10165 * typeck.c (build_x_function_call): Use resolve_offset_ref.
10167 * search.c (compute_access): Only strip an anonymous union
10170 * call.c (add_builtin_candidates): Tweak.
10172 * cvt.c (build_expr_type_conversion): Restore code for conversion
10174 * decl2.c (delete_sanity): Use it. Clean up.
10176 * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
10178 1998-06-10 Branko Cibej <branko.cibej@hermes.si>
10180 * typeck.c (c_expand_return): Don't warn about void expressions on
10181 return statements in functions returning void.
10183 1998-06-09 Mark Mitchell <mark@markmitchell.com>
10185 * pt.c (fn_type_unification): Revise documentation. Tidy.
10186 (type_unification): Likewise.
10188 1998-06-09 Andrew MacLeod <amacleod@cygnus.com>
10190 * semantics.c (finish_try_block): Rename expand_start_catch, and delete
10192 * parse.y (function_try_block): Rename expand_start_catch, and delete
10194 * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
10197 1998-06-09 Jason Merrill <jason@yorick.cygnus.com>
10199 * search.c (lookup_member): New fn.
10200 * class.c (finish_struct_1): Use it.
10201 * decl.c (lookup_name_real): Use it.
10203 Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10205 * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
10207 * cp-tree.h: Add prototype for `maybe_print_template_context' and
10208 `maybe_make_one_only'.
10210 * decl.c (auto_function): Remove unused variable `decl'.
10212 * decl2.c: Include dwarf2out.h and dwarfout.h.
10214 * lex.c: Remove redundant declarations of `set_float_handler' and
10217 1998-06-08 Andrew MacLeod <amacleod@cygnus.com>
10219 * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
10220 time flag. Call __cp_eh_info instead of __cp_exception_info.
10221 * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
10222 (__cp_exception_info): Return offset into cp_eh_info structure to
10223 match what use to be the start of this structure.
10224 (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
10225 (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
10227 (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
10228 __cp_eh_info instead of __cp_exception_info.
10230 1998-06-08 Jason Merrill <jason@yorick.cygnus.com>
10232 * decl.c (cp_finish_decl): Disable inlining of extern inlines
10233 with static variables.
10235 1998-06-08 Mark Mitchell <mark@markmitchell.com>
10237 * init.c (build_offset_ref): Correct previous change to use build,
10240 1998-06-07 Mark Mitchell <mark@markmitchell.com>
10242 * class.c (instantiate_type): Handle pointer-to-members where the
10243 member is a template.
10244 * init.c (build_offset_ref): Likewise.
10245 * typeck.c (build_unary_op): Likewise.
10247 1998-06-07 Richard Henderson <rth@cygnus.com>
10249 * lex.c (lang_init_options): New function.
10250 (lang_init): Remove flag_exceptions == 2 hack.
10252 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10254 * search.c (envelope_add_decl): Tweak for implicit typename.
10256 * call.c (joust): Also warn about confusing conversion op/constructor
10257 overload resolution.
10259 * spew.c (yylex): Also return the TYPE_DECL if got_object.
10260 Don't clear got_object after '~'.
10261 * call.c (build_scoped_method_call): Tweak destructor handling.
10262 (build_method_call): Likewise.
10263 * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
10264 TYPE_MAIN_VARIANT for destructors.
10265 * semantics.c (finish_object_call_expr): Complain about calling a
10268 1998-06-05 Per Bothner <bothner@cygnus.com>
10270 * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
10271 Define - update needed by gcc.c change.
10273 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10275 * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
10277 1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10279 * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
10280 * decl.c (lookup_name_real): Add namespaces_only parameter.
10281 If set, return only NAMESPACE_DECLs.
10282 (select_decl): Likewise.
10283 (identifier_type_value): Give additional parameter.
10284 (lookup_name_nonclass): Likewise.
10285 (lookup_name): Likewise.
10286 (find_binding): Skip namespace aliases.
10287 (binding_for_name): Likewise.
10288 (push_namespace): Check for namespace aliases.
10289 (lookup_name_namespace_only): New function.
10290 (begin_only_namespace_names, end_only_namespace_names): New functions.
10291 * decl2.c (set_decl_namespace): Skip namespace aliases.
10292 (do_using_directive): Likewise.
10293 (do_namespace_alias): Produce namespace aliases, fix alias
10295 * error.c (dump_decl): Support SCOPE_REF.
10296 * parse.y (extdef): Wrap lookup with namespace_only for namespace
10297 aliases and using declarations.
10299 1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
10301 * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
10303 * error.c (dump_expr): Clean up NEW_EXPR case.
10305 1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
10307 Suggested by Brendan Kehoe
10308 * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
10309 treat it as using ::decl.
10311 * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
10313 * tree.c (mapcar): Support NEW_EXPR.
10315 * error.c (dump_expr): Support NEW_EXPR.
10317 1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
10319 * method.c (make_thunk): Use overload machinery to make name.
10320 * search.c (covariant_return_p): New fn.
10321 (get_matching_virtual): Use it.
10323 * init.c (build_new_1): Fix check for void.
10325 1998-06-01 Per Bothner <bothner@cygnus.com>
10327 * cp-tree.h (TYPE_FOR_JAVA): New macro.
10328 * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
10329 java_int_type_node, java_long_type_node, java_float_type_node,
10330 java_double_type_node, java_char_type_node, java_boolean_type_node):
10331 New "primitive" types, with predefined names __java_byte etc.
10332 (record_builtin_java_type): New function.
10333 (init_decl_processing): Make Java types with record_builtin_java_type.
10334 (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
10335 (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
10336 (grokfndecl): Call check_java_method for Java classes.
10337 * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
10338 (process_overload_item): Match types against specific
10339 java_XX_type_node types, rather than using is_java_type.
10340 * class.c (finish_struct_1): Don't add default copy constructor
10341 or operator= if TYPE_FOR_JAVA.
10342 (pop_lang_conext): Restore strict_prototyp proper if Java.
10343 * decl2.c (acceptable_java_type, check_java_method): New functions.
10344 * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
10345 (tsubst): Move common statement after if statement.
10346 * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
10348 1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
10350 * pt.c (for_each_template_parm): Use first_rtl_op.
10352 * tree.c (build_cplus_array_type_1): Also check index_type for
10355 1998-05-31 Jason Merrill <jason@yorick.cygnus.com>
10357 * pt.c (tsubst): Always copy BINFO_BASETYPES.
10359 1998-05-29 scott snyder <snyder@d0sgif.fnal.gov>
10361 * tree.c (layout_basetypes): If we change TYPE_SIZE, change
10362 TYPE_SIZE_UNIT too.
10364 1998-05-29 Mark Mitchell <mark@markmitchell.com>
10366 * decl.c (grokdeclarator): Don't complain about in-class
10367 initialization of static consts if we don't really know the type
10370 1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
10372 * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
10373 * method.c (build_destructor_name): New fn.
10374 * decl2.c (maybe_retrofit_in_chrg): Split out...
10375 (grokclassfn): From here. Reorganize.
10376 * decl.c (grok_ctor_properties): Make sure ctors for types with
10377 vbases have the in_chrg parm.
10378 * pt.c (instantiate_class_template): Update
10379 TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call
10381 (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
10383 1998-05-28 Mark Mitchell <mark@markmitchell.com>
10385 * pt.c (instantiate_decl): Make test for whether or not static
10386 variables should be instantiated early match its comment.
10388 1998-05-28 Jason Merrill <jason@yorick.cygnus.com>
10390 * decl.c (start_decl): Always pedwarn about vacuously redeclaring
10392 (start_function): Call check_default_args.
10393 * decl2.c (grokfield): Don't call check_default_args.
10394 (check_default_args): Use cp_error_at.
10395 * lex.c (do_pending_defargs): Call check_default_args.
10397 1998-05-27 Brendan Kehoe <brendan@cygnus.com>
10399 * call.c (build_method_call): Make sure get_type_value returns
10400 something before we try to use its TYPE_MAIN_VARIANT.
10401 (build_scoped_method_call): Likewise.
10403 1998-05-27 Jason Merrill <jason@yorick.cygnus.com>
10405 * typeck2.c (digest_init): Complain about getting a TREE_LIST to
10406 initialize an array.
10408 * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
10411 * friend.c (do_friend): Clarify template warning.
10413 1998-05-27 Mark Mitchell <mark@markmitchell.com>
10415 * decl.c (shadow_label): Don't treat decls as identifiers.
10416 (maybe_push_to_top_level): Clear shadowed_labels.
10418 * pt.c (instantiate_decl): Reset lineno and filename after calling
10419 regenerate_decl_from_template.
10421 * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
10424 1998-05-27 Kevin Buhr <buhr@stat.wisc.edu>
10426 * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
10428 1998-05-26 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
10430 * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
10431 (convert_nontype_argument): Handle cases when nontype template
10432 parameters become classes after substitution.
10434 1998-05-26 Mark Mitchell <mark@markmitchell.com>
10436 * friend.c (is_friend): Use comptypes, rather than == to compare
10437 types. Modify for new representation of template friends.
10438 (make_friend_class): Likewise.
10439 * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak.
10440 (instantiate_class_template): Deal with template friends.
10442 * decl.c (store_parm_decls): Remove redundant call to
10443 expand_main_function.
10445 1998-05-26 Benjamin Kosnik <bkoz@loony.cygnus.com>
10447 * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
10450 1998-05-26 Per Bothner <bothner@cygnus.com>
10452 * language_as_string: Handle lang_java.
10454 1998-05-26 Jason Merrill <jason@yorick.cygnus.com>
10456 * decl.c (pushdecl): Don't copy the type_decl.
10458 1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10460 * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
10461 current_class_type.
10462 * decl.c (grokdeclarator): Put typedefs on the type's obstack.
10464 * parse.y (complex_direct_notype_declarator): Use $1 to access
10465 scope of notype_qualified_id.
10467 1998-05-26 Dave Brolley <brolley@cygnus.com>
10469 * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
10470 (init_parse): Initialize cpplib interface.
10472 * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
10473 empty continuation.
10475 1998-05-26 Mark Mitchell <mark@markmitchell.com>
10477 * decl.c (pushtag): Avoid crashing on erroneous input.
10479 1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10481 * decl.c (push_namespace): Only produce one unique name for
10482 anonymous namespaces.
10483 (get_unique_name): Remove.
10485 1998-05-25 Mark Mitchell <mark@markmitchell.com>
10487 * call.c (tourney): Don't do any extra comparisons.
10489 * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
10491 * cp-tree.h (processing_template_parmlist): Declare.
10492 * decl.c (pushtag): Don't call push_template_decl when we
10494 * pt.c (processing_template_parmlist): New variable.
10495 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
10496 (complete_template_args): Use it.
10497 (add_to_template_args): Likewise.
10498 (innermost_args): Likewise.
10499 (tsubst): Likewise.
10500 (begin_template_parm_list): Use processing_template_parmlist.
10501 (end_template_parm_list): Likewise.
10503 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
10504 * decl.c (grokdeclarator): Use it.
10505 * decl2.c (grok_x_components): Likewise.
10506 * init.c (initializing_context): Likewise.
10507 * method.c (do_build_copy_constructor): Likewise.
10508 (do_build_assign_ref): Likewise.
10509 * search.c (compute_access): Likewise.
10510 * typeck.c (build_component_ref): Likewise.
10512 * decl.c (grokdeclarator): Don't give a cv-qualified version of an
10513 unnamed type a typedef name "for linkage purposes".
10515 * pt.c (lookup_template_class): Don't look at
10516 IDENTIFIER_CLASS_VALUE when there's no current_class_type.
10518 * method.c (build_overload_int): Handle error cases gracefully.
10520 * pt.c (instantiate_decl): Handle static member variables
10523 * pt.c (tsubst): Use the tsubst'd type when producing new
10524 TEMPLATE_PARM_INDEX nodes.
10526 1998-05-24 Mark Mitchell <mark@markmitchell.com>
10528 * tree.c (cp_tree_equal): Handle pointers to member functions.
10530 * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make
10531 sure the type of the REF_BIND is a reference type.
10532 (maybe_handle_ref_bind, compare_ics): Rename reference_type to
10533 target_type for clarity.
10535 * parse.y (xcond): Move call to condition_conversion ...
10536 * semantics.c (finish_for_cond): Here.
10537 * parse.c: Regenerated.
10539 1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
10541 * decl.c (push_namespace): Namespaces have type void.
10542 * typeck2.c (incomplete_type_error): Complain about namespace
10543 used as expression.
10544 * typeck.c (decay_conversion): Likewise.
10546 1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
10548 * error.c (dump_expr): Support namespaces.
10550 1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
10552 * cp-tree.def: Add SRCLOC.
10553 * cp-tree.h: Add struct tree_srcloc and accessor macros.
10554 * tree.c (build_srcloc, build_srcloc_here): New fns.
10555 * pt.c (add_pending_template): Use build_srcloc_here.
10556 (push_tinst_level): Update last_template_error_tick before erroring.
10557 (instantiate_decl): Restore lineno and input_filename before
10558 calling add_pending_template.
10559 * decl2.c (finish_file): Set up lineno and input_filename for
10562 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
10564 * decl.c (lang_print_error_function): New fn.
10565 (init_decl_processing): Set print_error_function to use it.
10566 * errfn.c (cp_thing): Don't call maybe_print_template_context here.
10568 * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
10571 * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
10572 copy-initialization.
10574 * class.c (build_vtable_entry): Use int_fits_type_p.
10575 (build_vtable): Pass a signed offset to build_vtable_entry.
10576 (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
10577 set_rtti_entry): Likewise.
10579 1998-05-22 Per Bothner <bothner@cygnus.com>
10581 * cp-tree.h: Add comments documenting which LANG_FLAGS are used.
10582 (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used.
10584 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
10586 * pt.c (print_template_context): Use fprintf instead of cp_error.
10588 * pt.c (determine_specialization): Just return an error_mark_node.
10589 Also print the decl we want in error messages. If we complain,
10590 return error_mark_node.
10591 (tsubst_friend_function): Set lineno and input_filename so
10592 error messages will be useful.
10593 (instantiate_template): Just return an error_mark_node.
10594 (check_explicit_specialization): Don't mess with a returned
10597 * pt.c (print_template_context): Add new argument.
10598 (maybe_print_template_context): New fn.
10599 (push_tinst_level): Increment tinst_level_tick.
10600 (pop_tinst_level): Likewise.
10601 * errfn.c (cp_thing): Call maybe_print_template_context. Use
10602 xrealloc instead of xmalloc.
10604 * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
10606 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
10608 * pt.c (tsubst_friend_class): Don't call redeclare_class_template
10609 if the template we looked up is the same as the one we already
10612 Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
10614 * lex.c: (handle_sysv_pragma): FILE* parameter not used.
10615 (cpp_reader,parse_in): Add for cpplib.
10616 (check_newline): Call handle_sysv_pragma with new interface.
10617 (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
10619 * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
10620 (sub_getch): Call GETC for cpplib.
10622 * cp-tree.h: (get_directive_line): Different prototype for cpplib.
10623 (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
10625 * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib.
10627 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
10629 * decl2.c (maybe_make_one_only): New fn.
10630 (import_export_vtable): Use it.
10631 (import_export_decl): Likewise.
10632 * pt.c (mark_decl_instantiated): Likewise.
10634 1998-05-21 Mark Mitchell <mmitchell@usa.net>
10636 * decl2.c (find_representative_member): Rename to ...
10637 (build_anon_union_vars): New function.
10638 (finish_anon_union): Fix stupidity of previous change.
10640 1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
10642 * decl.c (grokfndecl): Handle definition of specialization in
10643 friend declaration.
10645 * error.c (dump_decl): Fix LOOKUP_EXPR handling.
10647 1998-05-20 Mark Mitchell <mmitchell@usa.net>
10649 * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
10650 to look for type declarations.
10651 (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
10652 * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
10653 (finish_member_class_template): Declare.
10654 * decl.c (pushtag): Put member class templates on the
10655 CLASSTYPE_TAGS list, just as for ordinary member classes.
10656 (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
10657 (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
10658 IDENTIFIER_NAMESPACE_VALUEs.
10659 * parse.y (component_decl): Move code to ...
10660 * semantics.c (finish_member_class_template): New function.
10661 Don't put member class templates on the list of components for a
10663 * parse.c: Regenerated.
10664 * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
10665 In fact, don't use DECL_CONTEXT at all here.
10667 1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
10669 * decl.c (record_unknown_type): New function.
10670 (init_decl_processing): Call it for the unknown and global type
10673 1998-05-20 Mark Mitchell <mmitchell@usa.net>
10675 * decl2.c (find_representative_member): New function.
10676 (finish_anon_union): Use it.
10678 * cp-tree.h (MAIN_NAME_P): New macro.
10679 (DECL_MAIN_P): Likwise.
10680 * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
10681 (grokfndecl): Use the new macros.
10682 (grokdeclarator): Likewise.
10683 (start_function): Likewise.
10684 (store_parm_decls): Likewise.
10685 (finsh_function): Likewise.
10686 * friend.c (do_friend): Likewise.
10687 * typeck.c (build_function_call_real): Likewise.
10688 (build_unary_op): Likewise.
10690 Wed May 20 02:16:01 1998 Jason Merrill <jason@yorick.cygnus.com>
10692 * decl2.c (start_objects, finish_objects, do_dtors,
10693 do_ctors): Split out from...
10694 (finish_file): ...here.
10696 Tue May 19 20:36:23 1998 Jason Merrill <jason@yorick.cygnus.com>
10698 * tree.c (is_overloaded_fn): Don't abort on placeholders from
10701 Tue May 19 15:16:22 1998 Brendan Kehoe <brendan@cygnus.com>
10703 * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
10705 * error.c (dump_expr): Handle an ARROW_EXPR.
10707 Tue May 19 15:13:39 1998 Mark Mitchell <mmitchell@usa.net>
10709 * decl.c (saveable_obstack): Declare.
10710 (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
10711 declare, if necessary.
10713 Tue May 19 14:50:27 1998 Mark Mitchell <mmitchell@usa.net>
10715 * call.c (compare_qual): Remove.
10716 (is_subseq): Tweak.
10717 (is_properly_derived_from): New function.
10718 (maybe_handle_ref_bind): Likewise.
10719 (maybe_handle_implicit_object): Likewise.
10720 (compare_ics): Modify substantially to bring into conformance with
10722 * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
10723 (comp_cv_qualification): Declare.
10724 (comp_cv_qual_signature): Likewise.
10725 * typeck.c (comp_cv_qualification): Likewise.
10726 (comp_cv_qual_signature): Likewise.
10728 Tue May 19 10:05:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10730 * Makefile.in (parse.o): Depend on toplev.h.
10732 * class.c (typecode_p): Remove prototype and definition.
10734 * cp-tree.h (currently_open_class, is_empty_class, member_p):
10737 * decl.c (push_overloaded_decl_top_level): Remove prototype and
10740 * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
10741 in call to `cp_thing'.
10742 (cp_warning): Likewise for function pointer `warning'.
10744 * except.c (do_function_call): Remove prototype and definition.
10745 (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
10747 * method.c (is_java_type): Add prototype and make it static.
10749 * parse.y: Include toplev.h.
10751 * pt.c (type_unification): Remove unused variable `arg'.
10752 (instantiate_decl): Likewise for `save_ti'.
10754 * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
10756 Tue May 19 02:43:25 1998 Jason Merrill <jason@yorick.cygnus.com>
10758 * init.c (build_member_call): Handle template_ids.
10759 * parse.y (primary): Add global_scope template_id.
10761 Mon May 18 23:22:52 1998 Jason Merrill <jason@yorick.cygnus.com>
10763 * decl2.c (get_sentry): Use end_temporary_allocation.
10764 Don't declare permanent_obstack.
10766 Mon May 18 12:28:44 1998 Mark Mitchell <mmitchell@usa.net>
10768 * parse.y (.finish_new_placement): New non-terminal.
10769 (unary_expr, new_type_id): Use it.
10770 * parse.c: Regenerated.
10772 Mon May 18 12:20:27 1998 Brendan Kehoe <brendan@cygnus.com>
10774 * pt.c (redeclare_class_template): Say where the original definition
10775 of the template-parameter's default argument appeared.
10777 Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com>
10779 * call.c (build_over_call): Tweak empty class handling.
10781 * decl.c (make_typename_type): Use currently_open_class.
10783 * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
10785 Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10787 * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
10788 for a type unless it is one.
10790 * class.c (finish_struct_1): Use OVL_CURRENT in error message.
10792 Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com)
10794 * Makefile.in (program_transform_name, objdir): Define.
10796 * Makefile.in (BISON): Use bison from the build tree if it exists.
10799 Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10801 * typeck.c (type_unknown_p): Return true for TREE_LIST also.
10803 * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
10805 Sun May 17 14:51:41 1998 Jason Merrill <jason@yorick.cygnus.com>
10807 * call.c (build_scoped_method_call): Likewise.
10809 Sun May 17 13:53:48 1998 Mark Mitchell <mmitchell@usa.net>
10811 * init.c (build_new_1): Call suspend_momentary around the creation
10812 of values that must be saved for exception handling.
10813 * parse.y (.build_new_placement): New non-terminal.
10814 (unary_expr, new_placement): Use it.
10815 * parse.c: Regenerated.
10817 Sun May 17 12:32:08 1998 Jason Merrill <jason@yorick.cygnus.com>
10819 * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
10822 * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
10825 * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
10827 Fri May 15 20:28:00 1998 Jason Merrill <jason@yorick.cygnus.com>
10829 * decl.c (start_decl): Revert problem change.
10831 * Makefile.in (CONFLICTS): Fix.
10833 Fri May 15 15:34:02 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
10835 * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
10837 Fri May 15 00:46:05 1998 Jason Merrill <jason@yorick.cygnus.com>
10839 * class.c (finish_struct_1): Use BINFO_SIZE.
10841 * decl.c (start_decl): Use 'tem'.
10843 Thu May 14 16:30:47 1998 Andrew MacLeod <amacleod@cygnus.com>
10845 * exception.cc: Include eh-common.h.
10846 (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL.
10847 (__cplus_type_matcher): First stab at new C++ runtime type matcher.
10848 (__cp_push_exception): Initialize eh_info struct as well.
10849 * except.c: Remove local structs and include eh-common.h.
10850 (init_exception_processing): Set language and version codes.
10851 (call_eh_info): Add presence of eh_info to runtime description of
10853 (expand_end_eh_spec): Call start_catch_block() and end_catch_block().
10854 * semantics.c (finish_try_block): Call start_catch_block() and
10856 * parse.y (function_try_block): Call start_catch_block() and
10859 Thu May 14 12:27:34 1998 Brendan Kehoe <brendan@cygnus.com>
10861 * typeck.c (original_type): New function.
10862 (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
10863 to see if they're actually the same.
10864 * cp-tree.h (original_type): Declare.
10866 Wed May 13 12:54:30 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10868 * Makefile.in (lex.o): Depend on output.h.
10870 * call.c (add_function_candidate): Remove unused variable `cand'.
10871 (add_conv_candidate): Likewise.
10872 (build_builtin_candidate): Likewise.
10874 * cp-tree.h: Add prototype for `types_overlap_p'.
10876 * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
10878 * decl2.c (merge_functions): Remove unused variables `tmp' and
10881 * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
10882 (code_as_string): Likewise.
10883 (language_as_string): Likewise.
10884 (parm_as_string): Likewise.
10885 (op_as_string): Likewise.
10886 (assop_as_string): Likewise.
10887 (cv_as_string): Likewise.
10889 * lex.c: Include output.h.
10891 * pt.c (type_unification): Cast first argument of `bzero' to a char*.
10893 * search.c (dfs_no_overlap_yet): Mark parameter `t' with
10896 * tinfo.cc (__class_type_info::dcast): Change the type of variable
10897 `i' from int to size_t.
10899 * typeck.c (language_lvalue_valid): Mark parameter `exp' with
10902 Tue May 12 21:37:49 1998 Jason Merrill <jason@yorick.cygnus.com>
10904 * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
10905 DECL_NAMESPACE_SCOPE_P.
10906 (lang_decl_name): Likewise.
10907 * pt.c (tsubst_friend_function, tsubst): Likewise.
10908 * decl.c (pushdecl, redeclaration_error_message, start_decl,
10909 cp_finish_decl, start_function): Likewise.
10910 * class.c (finish_struct_1): Likewise.
10911 * call.c (build_over_call): Likewise.
10912 (compare_ics): Use DERIVED_FROM_P.
10914 Tue May 12 07:24:18 1998 Mark Mitchell <mmitchell@usa.net>
10916 * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
10917 * method.c (build_mangled_name): Use it.
10918 (build_decl_overload_real): Likewise.
10920 * error.c (dump_simple_decl): New function, broken out from ...
10921 (dump_decl): Use it.
10923 Mon May 11 11:38:07 1998 Mark Mitchell <mmitchell@usa.net>
10925 * ptree.c (lang_print_xnode): Add missing `break'.
10927 * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
10929 * call.c (add_template_candidate): Adjust for changes to
10930 fn_type_unification.
10931 (add_template_candidate_real): Likewise.
10932 (add_template_conv_candidate): Likewise.
10933 (build_user_type_conversion_1): Likewise.
10934 (build_new_function_call): Likewise.
10935 (build_object_call): Likewise.
10936 (build_new_op): Likewise.
10937 (build_new_method_call): Likewise.
10938 * class.c (instantiate_type): Likewise.
10939 * cp-tree.h (unification_kind_t): New type.
10940 (fn_type_unification): Adjust prototype.
10941 (type_unificaiton): Likewise.
10942 * pt.c (UNIFY_ALLOW_NONE): New macro.
10943 (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
10944 (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
10945 (UNIFY_ALLOW_DERIVED): Likewise.
10946 (unify): Change prototype.
10947 (maybe_adjust_types_for_deduction): New function.
10948 (check_cv_quals_for_unify): Likewise.
10949 (determine_specialization): Adjust.
10950 (fn_type_unification): Likewise.
10951 (type_unification): Likewise.
10952 (type_unification_real): Likewise. Use
10953 maybe_adjust_types_for_deduction. Fix mishandling of
10954 back-unification of template functions passed as arguments. Pass
10955 appropriate combination of UNIFY_ALLOW_* to unify.
10956 (unify): Remove unused NTPARMS parameter. Use
10957 check_cv_quals_for_unify. Remove bogus code that allowed
10958 too-generous unification in order to adhere more closely to standard.
10959 (get_bindings_real): Adjust.
10960 (get_class_bindings): Likewise.
10962 * method.c (build_overload_identifier): Only use the innermost
10963 template arguments when mangling.
10964 * pt.c (tsubst_template_argument_vector): New function.
10965 (complete_template_args): Deal with the situation where the
10966 extra_args contain more than one level of arguments.
10967 (lookup_template_class): Deal with member template classes, which
10968 may have more than one level of arguments.
10969 (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
10970 Improve handling of member template classes. Use
10971 DECL_PRIMARY_TEMPLATE instead of inline expansion. Use
10972 tsubst_template_argument_vector where appropriate.
10973 (regenerate_decl_from_template): Break out from ...
10974 (instantiate_decl): Here.
10976 * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
10977 * parse.h: Regenerated.
10978 * parse.c: Really regenerated.
10980 * cp-tree.h (finish_unary_op_expr): New function.
10981 (finish_id_expr): Likewise.
10982 (begin_new_placement): Likewise.
10983 (finish_new_placement): Likewise.
10984 (finish_declarator): Likewise.
10985 (finish_translation_unit): Likewise.
10986 (finish_parmlist): Likewise.
10987 (begin_class_definition): Likewise.
10988 (finish_class_definition): Likewise.
10989 (finish_default_args): Likewise.
10990 (finish_inline_definitions): Likewise.
10991 * parse.y (GCC_ASM_KEYWORD): Remove.
10992 (TYPENAME_ELLIPSIS): Likewise.
10993 * parse.c: Regenerated.
10994 Use new functions in semantics.c in the actions for many rules.
10995 * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
10996 * hash.h: Regenerated.
10997 * semantics.c (finish_expr_stmt): Allow NULL expr.
10998 (finish_unary_op_expr): New function, containing
10999 code previously in parse.y.
11000 (finish_id_expr): Likewise.
11001 (begin_new_placement): Likewise.
11002 (finish_new_placement): Likewise.
11003 (finish_declarator): Likewise.
11004 (finish_translation_unit): Likewise.
11005 (finish_parmlist): Likewise.
11006 (begin_class_definition): Likewise.
11007 (finish_class_definition): Likewise.
11008 (finish_default_args): Likewise.
11009 (finish_inline_definitions): Likewise.
11011 Sun May 10 23:43:13 1998 Mark Mitchell <mmitchell@usa.net>
11013 * typeck.c (build_c_cast): Don't decay arrays and functions to
11014 pointer type when converting to a class type.
11016 Sun May 10 22:53:56 1998 Jason Merrill <jason@yorick.cygnus.com>
11018 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
11019 (DECL_CLASS_SCOPE_P): Likewise.
11021 Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org)
11023 * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
11024 * decl2.c (constructor_name_full): Likewise.
11026 Sun May 10 22:48:12 1998 Mike Stump <mrs@wrs.com>
11028 * tree.c (mapcar): Add OVERLOAD support.
11030 * init.c (resolve_offset_ref): We must use basetype_path before we
11031 destroy it with a call to convert_pointer_to.
11033 Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com>
11035 * class.c (currently_open_class): New fn.
11036 * decl.c (lookup_name_real): Use it.
11037 * search.c (lookup_field): Likewise.
11039 Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
11041 * cp-tree.def (OVERLOAD): New node.
11042 * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
11043 SET_IDENTIFIER_NAMESPACE_VALUE): Define.
11044 (NAMESPACE_BINDING): Remove.
11045 (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
11047 (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
11049 (tree_overload): New struct.
11050 (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
11051 (REAL_IDENTIFIER_TYPE_VALUE): Define.
11052 (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
11053 (lang_decl_flags): Remove in_namespace.
11054 (lang_decl): Remove chain.
11055 (DECL_CHAIN, DECL_NAMESPACE): Remove.
11056 (flag_honor_std): Declare extern.
11057 (identifier_type_value, pushdecl_namespace_level, push_using_decl,
11058 namespace_binding, set_namespace_binding,
11059 lookup_function_nonclass, cat_namespace_levels,
11060 set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
11061 scratch_ovl_cons, ovl_member, build_overload): Declare.
11062 (decl_list_length, get_namespace_id, current_namespace_id,
11063 overloaded_globals_p): Remove.
11064 (lookup_using_namespace, qualified_lookup_using_namespace): Change
11066 (push_scratch_obstack): New macro.
11067 * call.c (add_function_candidate): Special-case type of OVERLOAD node.
11068 (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
11070 (build_new_function_call): Iterate using OVL_CHAIN.
11071 Print DECL_NAME in when reporting ambiguities.
11072 (build_object_call): Iterate using OVL_NEXT for fns, convs.
11073 (build_new_op): Call lookup_function_nonclass.
11074 Iterate using OVL_NEXT.
11075 (build_op_delete_call): Change detection of members.
11076 Do not wrap TREE_LIST around fields and single global functions.
11077 (build_over_call): Don't push a class level if the context is a
11079 (build_new_method_call): Iterate using OVL_NEXT.
11080 * class.c (add_method): Chain overloaded members using
11081 build_overload. Remove copying of method.
11082 (grow_method): When iterating through the obstack, expect OVERLOAD
11083 nodes. Chain overload members.
11084 (finish_struct_methods): Chain overload members. Unpack OVERLOAD
11085 nodes in call to get_baselinks.
11086 (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
11087 (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle
11088 fdecls that are OVERLOAD nodes.
11089 (validate_lhs): New function.
11090 (instantiate_type): Do not copy OVERLOAD nodes. Remove dead
11091 code. Use DECL_NAME in error messages. Split code between global
11092 and member function processing.
11093 * decl.c (global_type_node): New static variable.
11094 (in_std): New global.
11095 (struct binding_level): New field usings.
11096 (resume_binding_level): Assert that we are not in a class.
11097 (toplevel_bindings_p): Just check for namespace_p or
11099 (resume_level): Remove.
11100 (find_binding): New function.
11101 (binding_for_name): Call it.
11102 (namespace_binding, set_namespace_binding): New functions.
11103 (push_namespace): Associate binding level with new namespace,
11104 resume_binding_level for existing namespace. Remove old code.
11105 Fake std by counting.
11106 (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
11107 (maybe_push_to_top_level): Save current namespace.
11108 (pop_from_top_level): Restore saved namespace.
11109 (pop_namespace): Call suspend_binding_level. Remove old code.
11110 (cat_namespace_levels): New function.
11111 (set_identifier_type_value_with_scope): For namespace bindings,
11112 set BINDING_TYPE, and use global_type_node.
11113 Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
11114 (identifier_type_value): New function.
11115 (pushtag): If no context, use current_namespace.
11116 (duplicate_decls): Don't process DECL_CHAIN.
11117 (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
11118 already set. Never reset it to NULL_TREE. Lookup global variables
11119 in their namespace. Push overloaded templates if they are on
11121 (pushdecl_namespace_level): New function.
11122 (pushdecl_top_level): Implement using pushdecl_namespace_level.
11123 (pushdecl_using_decl): New function.
11124 (overloaded_globals_p): Remove.
11125 (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
11126 them. Use namespace_binding and set_namespace_value.
11127 (redeclaration_error_message): Complain if the declarations come
11128 from different namespaces.
11129 (lookup_tag): On namespace level, look in the BINDING_TYPE.
11130 (lookup_namespace_name): Pass tree_bindings from stack. Remove
11132 (select_decl): New function.
11133 (lookup_name_real): Call it for qualified and unqualified lookup.
11134 Pass tree_bindings from the stack.
11135 If prefer_type is 1, also accept namespaces.
11136 (lookup_function_nonclass): New function.
11137 (init_decl_processing): Set the binding level of the global
11138 namespace to global_binding_level.
11139 Build a proper type list for __builtin_apply.
11140 Initialize std_node to "fake std" if flag_honor_std is set.
11141 Initialize global_type_node.
11142 Allocated bad_alloc in namespace std if flag_honor_std.
11143 (define_function): Set the DECL_CONTEXT to the current_namespace.
11144 (start_decl): A namespace is not considered as a context here. If
11145 the DECL_CONTEXT is a namespace, push the decl.
11146 (cp_finish_decl): Check for namespaces used as initializers.
11147 (grokfndecl): Add namespace parameter. Remove processing of
11149 (grokvardecl): Add namespace parameter.
11150 (grokdeclarator): Process SCOPEs that are namespaces. For
11151 mangling, temporarily set the DECL_CONTEXT on anonymous structs.
11152 (start_function): Check for contexts that are namespaces.
11153 Set context for declarations that have not been pushed.
11154 (store_parm_decls): Check for ::main only.
11155 (finish_function): Likewise.
11156 (start_method): Check for contexts that are namespaces.
11157 (start_method): Remove DECL_CHAIN processing.
11158 * decl2.c (flag_honor_std): Declare.
11159 (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
11160 (decl_namespace_list): New static global.
11161 (grok_x_components): Ignore namespaces as type contexts.
11162 (check_classfn): Expect OVERLOAD nodes.
11163 (grokfield): Remove DECL_CHAIN processing.
11164 (finish_file): Call cat_namespace_levels.
11165 (merge_functions): New function.
11166 (ambiguous_decl): Rewrite.
11167 (lookup_using_namespace): Produce tree_bindings.
11168 (qualified_lookup_using_namespace): Likewise.
11169 (set_decl_namespace, decl_namespace, current_decl_namespace,
11170 push_decl_namespace, pop_decl_namespace): New functions.
11171 (arg_lookup): New struct.
11172 (add_function, arg_assoc_namespace, arg_assoc_class,
11173 arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
11175 (get_namespace_id, current_namespace_id): Remove.
11176 (do_toplevel_using_decl): Rewrite.
11177 (do_class_using_decl): Complain about namespace qualifiers.
11178 (do_using_directive): Sorry if not on namespace level. Complain
11179 about unknown namespaces.
11180 * error.c (dump_aggr_type): Check for namespace contexts.
11181 * except.c (init_exception_processing): Push terminate into std.
11182 * friend.c (is_friend): A namespace is not a context, here.
11183 * init.c (expand_member_init): Remove DECL_CHAIN processing.
11184 (build_offset_ref): Process OVERLOAD nodes.
11185 * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
11186 * lex.c (identifier_type): Loop using OVL_CHAIN.
11187 (see_typename): Set looking_for_typename to 2.
11188 (real_yylex): Likewise.
11189 (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
11190 (do_scoped_id): Expect OVERLOAD nodes.
11191 Change calling convention for qualified_lookup_using_namespace.
11192 (build_lang_decl): Don't set in_namespace anymore.
11193 * method.c (typevec_size): New global.
11194 (build_overload_nested_name): Return if global_namespace.
11195 Otherwise, always expect a declaration context.
11196 (build_qualified_name): Likewise.
11197 Make sure we don't write beyond typevec_size.
11198 (build_decl_overload_real): Likewise.
11199 Allocate one extra slot for the namespace.
11200 (hack_identifier): Mark code dead.
11201 Process OVERLOAD and NAMESPACE_DECL nodes.
11202 * parse.y (program): Pop namespaces until in global namespace.
11203 (extdef): In a using-declaration, don't discard the identifier if
11204 there is no declaration.
11205 (left_curly): Ignore type contexts which are namespaces.
11206 (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
11208 * pt.c (template_class_depth): Expect types to be namespaces.
11209 (determine_specialization): Simplify by expecting OVERLOAD nodes.
11210 (push_template_decl): Push into namespace level.
11211 Reset ctx if it is a namespace.
11212 Set DECL_CONTEXT to current_namespace if not set already.
11213 Ignore real contexts that are namespaces.
11214 (mangle_class_name_for_template): Skip global_namespace.
11215 Mangle other namespaces as declarations.
11216 (lookup_template_function): Set type of OVERLOAD nodes to unknown.
11217 (lookup_template_class): Push into namespace of context.
11218 If the context is a namespace, set it to global_namespace.
11219 Use id_context for mangling.
11220 (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
11221 (tsubst_friend_function): Ignore namespace contexts.
11222 Push into namespace level.
11223 (tsubst): Handle NAMESPACE_DECL nodes.
11224 Remove DECL_CHAIN processing.
11225 (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
11226 * ptree.c (print_lang_identifier): Print bindings.
11227 (lang_print_xnode): Print OVERLOAD nodes.
11228 * rtti.c (init_rtti_processing): Push type_info into std.
11229 * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
11230 (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
11231 dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
11232 lookup_fnfields_here): Likewise.
11233 Process all nodes, instead of going through TREE_CHAIN.
11234 * sig.c (build_signature_pointer_or_reference_type): Set context
11235 to global_namespace.
11236 (build_signature_table_constructor): Expect OVERLOAD nodes.
11237 * spew.c (yylex): Save old setting of looking_for_typename.
11238 * tree.c (decl_list_length): Remove.
11239 (binding_init): New function.
11240 (count_functions): Rewrite.
11241 (is_overloaded_fn): Expect OVERLOAD nodes.
11242 (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
11243 (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
11244 ovl_member): New functions.
11245 * typeck.c (require_complete_type): Expect OVERLOAD nodes.
11246 (type_unknown_p): Likewise.
11247 (require_instantiated_type): Likewise.
11248 (build_component_ref): Declare code dead.
11249 (build_x_function_call): Create and expect OVERLOAD nodes.
11250 (build_function_call_real): Check for ::main only.
11251 (build_unary_op): Likewise. Expect OVERLOAD nodes.
11252 (convert_for_assignment): Check for TREE_LIST before accessing
11254 * decl.c (duplicate_decls): Check for namespace bindings instead
11255 of global bindings.
11256 (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
11257 lookup_name_current_level, start_decl, xref_tag,
11258 finish_enum): Likewise.
11259 * init.c (build_offset_ref): Likewise.
11260 * search.c (lookup_field): Likewise.
11261 (lookup_fnfields): Likewise.
11262 (dfs_debug_mark): Likewise.
11263 * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
11264 (poplevel_class, pop_from_top_level): Likewise.
11265 * decl2.c (finish_method): Likewise.
11266 * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
11267 * decl.c (record_builtin_type): Likewise.
11268 (init_decl_processing, grokfndecl): Likewise.
11269 * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
11270 (make_lang_type): Likewise.
11271 * parse.y (make_thunk): Likewise.
11272 * pt.c (tsubst): Likewise.
11273 * tree.c (debug_binfo): Likewise.
11274 * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
11275 tinfo2.cc, inc/new.h: Add std qualifications.
11276 * inc/new: Wrap with namespace std if __HONOR_STD.
11277 * inc/typeinfo: Likewise.
11279 Fri May 8 00:43:50 1998 Jason Merrill <jason@yorick.cygnus.com>
11281 * call.c (build_user_type_conversion_1): Handle second_conv
11282 properly for templates.
11284 Thu May 7 17:09:25 1998 Andrew MacLeod <amacleod@cygnus.com>
11286 * method.c (build_decl_overload_real): Set TREE_USED flag to
11287 zero for build_type_variants nodes as well.
11289 Wed May 6 19:27:09 1998 Jason Merrill <jason@yorick.cygnus.com>
11291 * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE.
11293 Wed May 6 16:49:48 1998 Jim Wilson <wilson@cygnus.com>
11295 * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o,
11296 except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o,
11297 rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o,
11298 xref.o): Add toplev.h dependencies.
11300 Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com)
11302 * errfn.c (cp_error, cp_warning): Remove declarations for
11303 error and warning respectively.
11305 Wed May 6 14:28:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11307 * error.c: Convert to using ctype macros defined in system.h.
11308 * method.c: Likewise.
11309 * xref.c: Likewise.
11310 * lex.c: Likewise. Also remove redundant system header stuff.
11312 Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
11314 * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
11315 expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c,
11316 search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c,
11317 xref.c: Add include of toplev.h.
11319 Wed May 6 02:33:39 1998 Jason Merrill <jason@yorick.cygnus.com>
11321 * tree.c (perm_manip): Also regenerate the RTL of an extern.
11322 (copy_to_permanent): Use end_temporary_allocation.
11324 Tue May 5 23:54:04 1998 Jason Merrill <jason@yorick.cygnus.com>
11326 * init.c (expand_vec_init): The initialization of each array
11327 element is a full-expression.
11329 Tue May 5 18:24:13 1998 Andrew MacLeod <amacleod@cygnus.com>
11331 * method.c (build_mangled_name): Add a call to build_type_variant
11332 to get the right type.
11334 Tue May 5 01:25:03 1998 Jason Merrill <jason@yorick.cygnus.com>
11336 * Makefile.in: Add .SUFFIXES.
11338 * cp-tree.def: Remove NAMESPACE_DECL.
11340 Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
11342 * call.c (build_over_call): Do evaluate arg even if it has empty
11344 * decl.c (start_function): Don't push a member function.
11346 Thu Apr 30 18:59:23 1998 Jim Wilson <wilson@cygnus.com>
11348 * Makefile.in (g++FAQ.info): Put -o option before input file.
11350 Thu Apr 30 13:05:33 1998 Andrew MacLeod <amacleod@cygnus.com>
11352 * gxxint.texi: Add info for squangling codes K and B.
11354 Tue Apr 28 13:22:01 1998 Mark Mitchell <mmitchell@usa.net>
11356 * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
11357 the expression in templates.
11358 (finish_stmt_expr): Likewise.
11360 1998-04-28 Brendan Kehoe <brendan@cygnus.com>
11362 * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int.
11364 Mon Apr 27 13:58:10 1998 Mark Mitchell <mmitchell@usa.net>
11366 * decl.c (maybe_push_to_top_level): Always clear
11367 current_template_parms and processing_template_decl.
11368 (pushtag): Remove check of current_class_type and some comments,
11369 since maybe_push_to_top_level no longer creates confusion.
11371 Sun Apr 26 12:10:18 1998 Mark Mitchell <mmitchell@usa.net>
11373 * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
11374 (DECL_CLASS_TEMPLATE_P): Likewise.
11375 (DECL_PRIMARY_TEMPLATE): Likewise.
11376 (PRIMARY_TEMPLATE_P): Use it.
11377 (push_template_decl_real): New function.
11378 (redeclare_class_template): Take new template parameters as
11380 (is_specialization_of): New function.
11381 (comp_template_args): Declare.
11382 * decl.c (pushtag): Handle friend template classes.
11383 (xref_tag): Likewise. Use new calling convention for
11384 redeclare_class_template.
11385 * decl2.c (grok_x_components): Handle friend templates.
11386 * friend.c (is_friend): Use is_specialization_of where
11387 appropriate. Deal with friend class templates.
11388 (make_friend_class): Let a class template be friends with itself.
11389 * pt.c (comp_template_args): Remove declaration.
11390 (tsubst_friend_class): New function.
11391 (push_template_decl_real): New function.
11392 (push_template_decl): Use it.
11393 (redeclare_class_template): Adjust for new calling convention.
11394 (comp_template_args): Give it external linkage.
11395 (instantiate_class_type): Use tsubst_friend_class to deal
11396 with friend templates.
11397 * typeck.c (comptypes): Use comp_template_args, rather than
11398 expanding it inline.
11399 * parse.y (component_decl): Handle a nested template type
11400 like other component type declarations.
11402 * pt.c (check_explicit_specialization): Handle overloaded
11403 constructors correctly.
11405 * pt.c (mabybe_get_template_decl_from_type_decl): New function.
11406 (lookup_template_class): Use it.
11408 Thu Apr 23 21:19:06 1998 Jason Merrill <jason@yorick.cygnus.com>
11410 * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops.
11411 * cp-tree.h: Add WRAPPER support.
11412 * call.c (add_candidate): Split out from add_*_candidate fns.
11413 (build_over_call): Take the candidate instead of function and args.
11414 Enforce access control here. Emit overload warnings here.
11415 (add_warning): New fn.
11416 (joust): Add WARN parm. If not set, call add_warning instead of
11417 printing a warning. Re-enable some warnings.
11418 (tourney): Pass it.
11419 (convert_like): Adjust.
11420 (build_new_op): Adjust.
11421 (build_new_function_call): Adjust.
11422 (build_user_type_conversion_1): Adjust.
11423 (USER_CONV_FN): Adjust.
11424 * tree.c (build_expr_wrapper, build_expr_ptr_wrapper,
11425 build_int_wrapper): New fns.
11427 Thu Apr 23 18:27:53 1998 Mark P. Mitchell <mmitchell@usa.net>
11429 * pt.c (unify): Fix typo in previous change.
11431 Thu Apr 23 09:32:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11433 * error.c (dump_type_real): Declare canonical_name.
11435 * typeck.c (comp_target_types): Fix PMFs.
11437 Wed Apr 22 13:24:48 1998 Mark Mitchell <mmitchell@usa.net>
11439 * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for
11440 the DECL_RESULTs of a member TEMPLATE_DECL, not just the
11443 * pt.c (tsubst): Decrease the template-level of
11444 TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a
11445 TEMPLATE_PARM_INDEX.
11446 (template_decl_level): New function.
11447 (unify): Make sure to record unifications for template
11448 parameters, even when the parameters exactly match the arguments.
11449 Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
11450 TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that
11451 aren't from the level we're currently working on.
11453 Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net>
11455 * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
11457 * decl2.c (check_member_template): Set DECL_IGNORED for member
11458 class templates, too.
11460 * decl2.c (grokfield): Remangle the name of a member TYPE_DECL.
11462 Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
11464 * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
11466 Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com)
11468 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare.
11469 * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
11470 (init_decl_processing): Handle TI types.
11471 * typeck.c (unsigned_type, signed_type): Handle TI types.
11473 Sat Apr 18 15:25:21 1998 Jim Wilson <wilson@cygnus.com>
11475 * g++spec.c (lang_specific_driver): New argument in_added_libraries.
11476 New local added_libraries. Increment count when add library to
11479 Fri Apr 17 21:25:00 1998 Mark Mitchell <mmitchell@usa.net>
11481 * cp-tree.h (type_as_string_real): New function.
11482 * pt.c (mangle_class_name_for_template): Use it.
11483 * error.c (dump_aggr_type): Change prototype.
11484 (dump_type_prefix): Likewise.
11485 (dump_type_suffix): Likewise.
11486 (dump_type_real): Convert from dump_type. If desired, the
11487 "canonica" name of a typedef, i.e., the name of the underlying
11488 type, can be printed.
11489 (dump_type): Call dump_type_real.
11491 Fri Apr 17 14:30:45 1998 Jason Merrill <jason@yorick.cygnus.com>
11493 * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks.
11495 * typeck.c (comp_target_types): Tweak pedantic case.
11496 (comp_target_parms): Tweak pedantic case. Clean up somewhat.
11497 Return -1 or 1 instead of 1 or 2.
11498 (compparms): Remove STRICT handling.
11499 (convert_for_assignment): Fix handling of pmfs.
11501 Fri Apr 17 14:04:16 1998 Mark Mitchell <mmitchell@usa.net>
11503 * typeck.c (comp_target_types): Handle references like pointers.
11504 (comp_target_parms): Note that return code from comp_target_types
11505 can be negative to indicate failure.
11507 Fri Apr 17 09:10:52 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
11509 * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG),
11510 which requires a working target compiler to build.
11512 Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com)
11514 * tree.c (avoid_overlap): Add prototype.
11516 * spew.c (num_tokens): Add prototype.
11517 (nth_noken, add_token, consume_token, debug_yychar): Likewise.
11519 * search.c (dfs_check_overlap): Add prototype.
11520 (dfs_no_overlap_yet): Likewise.
11522 * pt.c (original_template): Add prototype.
11523 (inline_needs_template_parms): Likewise.
11524 (push_inline_template_parms_recursive): Likewise.
11525 (retrieve_specialization, register_specialization): Likewise.
11526 (print_candidates, reduce_template_parm_level): Likewise.
11527 (build_template_decl, mark_template_parm): Likewise.
11528 (tsubst_friend_function, get_bindings_real): Likewise.
11530 * method.c (start_squangling): Add prototype.
11531 (end_squangling, check_ktype, issue_ktype): Likewise.
11532 (build_overloaded_scope_ref, check_btype): Likewise.
11533 (build_mangled_template_parm_index): Likewise.
11535 * lex.c (init_cpp_parse): Add prototype.
11536 (handle_cp_pragma, handle_sysv_pragma): Likewise.
11537 (reduce_cmp, token_cmp): Likewise.
11539 * except.c (call_eh_info): Add prototype.
11540 (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise.
11541 (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise.
11543 * decl2.c (is_namespace_ancestor): Add prototype.
11544 (namespace_ancestor, add_using_namespace): Likewise.
11545 (ambiguous_decl): Likewise.
11547 * decl.c (indent): Add prototype.
11549 * call.c (add_template_candidate_real): Add prototype.
11551 Fri Apr 17 01:57:12 1998 Jason Merrill <jason@yorick.cygnus.com>
11553 * decl2.c (build_expr_from_tree): Just return a PMF.
11555 Fri Apr 17 00:45:12 1998 Mark Mitchell <mmitchell@usa.net>
11557 * typeck2.c (process_init_constructor): Don't strip cv-qualifiers
11558 when doing initializations.
11560 * pt.c (unify): Use comptypes to compare type args.
11562 Fri Apr 17 00:24:22 1998 Jason Merrill <jason@yorick.cygnus.com>
11564 * decl.c (duplicate_decls): Fix check for when it's safe to free
11567 * pt.c (mangle_class_name_for_template): Don't pass a typedef type
11570 Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
11572 * pt.c (build_template_parm_index): Add prototype.
11574 * search.c (my_tree_cons): Don't clear words outside the
11575 newly allocated node.
11577 Wed Apr 15 15:34:44 1998 Dave Brolley <brolley@cygnus.com>
11579 * lex.c (init_parse): Now returns char* containing the filename.
11581 Wed Apr 15 13:20:06 1998 John Carr <jfc@mit.edu>
11582 Jeff Law <law@cygnus.com>
11584 * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer
11587 Sun Apr 12 22:31:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
11589 * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
11591 Fri Apr 10 12:16:49 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
11593 * decl.c (duplicate_decls): Don't warn for redundant decls if
11594 friend: let add_friend take care of it.
11596 Thu Apr 9 02:40:48 1998 Jason Merrill <jason@yorick.cygnus.com>
11598 * sig.c (build_signature_pointer_constructor): Don't set
11599 TREE_HAS_CONSTRUCTOR for a signature pointer.
11600 * cvt.c (ocp_convert): Don't force a temporary for internal structs.
11601 * init.c (resolve_offset_ref): Warn about implicit & on pmfs
11603 * typeck.c (build_unary_op): Only allow taking the address of a
11605 * typeck2.c (digest_init): Simplify.
11606 (store_init_value): Don't pedwarn about using { } for pmfs.
11608 Thu Apr 9 22:16:57 1998 Per Bothner <bothner@cygnus.com>
11610 * cp-tree.h (start_decl): Update prototype.
11611 * decl.c (start_decl): Like the C version, new parameters
11612 for the attributes. Call cplus_decl_attributes here,
11613 (pushdecl): Like C version, do build_type_copy if TYPE_DECL,
11614 (grokdeclarator): Pass NULL for new start_decl arguments.
11615 * pt.c (tsubst_expr): Likewise.
11616 * parse.y: Merge cplus_decl_attribute calls into start_decl calls.
11617 * typeck.c (common_type): Check TYPE_MAIN_VARIANT.
11618 * lex.c (build_lang_decl): Add lang_name_java.
11619 * class.c (push_lang_context): Add lang_name_java.
11620 * method.c (build_mangled_name): Check for is_java_type.
11622 Thu Apr 9 22:16:57 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
11624 * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
11625 * call.c (build_scoped_method_call): Check for TREE_CODE for
11626 VOID_TYPE instead of type == void_type_node.
11627 (build_method_call): Likewise.
11628 * decl.c (lookup_name_real): Likewise.
11629 (grokdeclarator): Likewise.
11630 (start_decl): Likewise.
11631 (grokparms): Likewise.
11632 (start_function): Likewise.
11633 (finish_function): Likewise.
11634 (start_method): Likewise.
11636 Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
11638 * lex.c (finput): New variable.
11639 (init_cpp_parse): Renamed from init_parse.
11640 (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished.
11641 (finish_parse): New function.
11642 * cp-tree.h (init_lex, init_parse): Remove declarations.
11644 Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
11646 * call.c (build_call): Still evaluate the actual argument.
11647 * class.c (is_empty_class): Update for -fnew-abi.
11649 * decl2.c: -fnew-abi implies -fsquangle.
11651 * method.c (do_build_assign_ref): Don't do anything to copy
11653 (do_build_copy_constructor): Likewise.
11654 * call.c (build_over_call): Likewise.
11656 Sat Apr 4 18:43:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11658 * tree.c (avoid_overlap): Return a value.
11660 Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com)
11662 * method.c (check_btype): Add missing argument to xrealloc.
11663 (check_ktype): Likewise.
11665 Fri Apr 3 02:22:59 1998 Jason Merrill <jason@yorick.cygnus.com>
11667 Implement empty base optimization.
11668 * class.c (finish_struct_1): Add vbase fields earlier. Set
11669 CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty.
11670 * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns.
11671 (types_overlap_p): New fn.
11672 * tree.c (avoid_overlap): New fn.
11673 (build_base_fields): Use it to avoid overlapping empty bases.
11674 * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi.
11676 * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
11678 Re-implement allocation of base class subobjects.
11679 * tree.c (unshare_base_binfos): New fn.
11680 (layout_basetypes): Use it. Now handles offsets of both virtual and
11681 non-virtual bases, after layout_type.
11682 (layout_vbasetypes): Remove.
11683 (build_base_fields): Generate FIELD_DECLs for each non-virtual base.
11684 (build_vbase_pointer_fields): Split out from old layout_basetypes.
11685 * class.c (finish_base_struct): Lose offset handling code.
11686 Move nonvdtor warning here. Don't mess with t_binfo anymore.
11687 (finish_struct_1): Don't mess with t_binfo anymore. Use fns above.
11688 * cp-tree.h: Adjust.
11690 Thu Apr 2 14:25:13 1998 Jason Merrill <jason@yorick.cygnus.com>
11692 * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff.
11693 * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise.
11694 * class.c (duplicate_tag_error): Likewise.
11695 (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN.
11696 * tree.c (layout_vbasetypes): Update from layout_record, remove
11697 var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE.
11698 (layout_basetypes): Likewise.
11700 Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com)
11702 * class.c, Make sure system.h is included just after config.h.
11703 Delete lingering stdio and errno references too.
11704 * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise.
11706 Wed Apr 1 15:38:36 1998 Jason Merrill <jason@yorick.cygnus.com>
11708 * friend.c (is_friend): Fix access control for local classes.
11710 * class.c (is_empty_class): New fn.
11711 * call.c (build_call): Don't pass empty class objects to a function.
11713 Wed Apr 1 14:58:35 1998 Mark Mitchell <mmitchell@usa.net>
11715 * call.c (build_over_call): Do name resolution for default
11716 arguments of function templates in the scope of the templates.
11718 Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com)
11720 * call.c: Include system.h. Remove includes, declarations and
11721 defines provided by system.h.
11722 * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
11723 * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
11724 * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
11725 * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
11726 * typeck2.c, xref.c: Likewise.
11727 * Makefile.in: Dependencies updated as appropriate.
11728 * Make-lang.in: Likewise.
11730 Mon Mar 30 12:15:00 1998 Mark Mitchell <mmitchell@usa.net>
11732 * pt.c (fn_type_unification): Allow incomplete unification without
11733 an immediate error message.
11735 Mon Mar 30 08:55:42 1998 Jason Merrill <jason@yorick.cygnus.com>
11737 * tree.c (member_p): New fn.
11738 * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for
11739 initializing class members.
11741 * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'.
11742 * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX.
11744 * call.c (build_method_call): Handle non-scoped destructors, too.
11745 * pt.c (tsubst_copy): Likewise.
11747 * pt.c (print_template_context): Split out...
11748 (push_tinst_level): ...from here.
11750 * friend.c (is_friend): Don't pass a type to decl_function_context.
11752 * typeck.c (convert_for_initialization): Always hand off
11753 conversions to class type.
11755 Sun Mar 29 20:01:59 1998 Jason Merrill <jason@yorick.cygnus.com>
11757 * friend.c (is_friend): Local classes have the same access as the
11758 enclosing function.
11760 Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com)
11762 * typeck.c (expand_target_expr): Delete dead function.
11764 * search.c: Put various prototypes inside #ifdef MI_MATRIX.
11766 * repo.c (save_string): Delete dead function.
11768 * method.c (thunk_printable_name): Delete dead function.
11770 * lex.c (yynextch): Delete dead function.
11772 * expr.c (tree_extract_aggr_init): #if 0 out.
11774 * except.c (do_unwind): Delete dead function.
11775 (easy_expand_asm): Likewise.
11777 * cvt.c (build_conversion_type_1): Delete dead function.
11779 * cp-tree.h (push_expression_obstack): Declare.
11781 * call.c (source_type): #if 0 out.
11783 * class.c (alter_access): Remove unused label. Add braces
11784 around empty else clause.
11786 * lex.c (yyprint): Fix argument to printf.
11788 Sat Mar 28 17:43:52 1998 Mark Mitchell <mmitchell@usa.net>
11790 * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
11792 * pt.c (instantiate_class_template): Make sure template
11793 arguments are permanent.
11794 * init.c (resolve_offset_ref): Don't go looking around in
11797 * semantics.c: Add routines to handle expressions, and some
11798 declaration processing.
11799 * parse.y: Use them.
11800 (current_class_depth): Move declaration to cp-tree.h.
11801 * parse.c: Regenerated.
11802 * cp-tree.h: Use them.
11803 (current_class_depth): Declare.
11804 * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr.
11806 Fri Mar 27 20:23:18 1998 Mark Mitchell <mmitchell@usa.net>
11808 * error.c (dump_decl): Be a bit more explicit with template
11809 type arguments, when verbose.
11811 Fri Mar 27 18:16:40 1998 Jason Merrill <jason@yorick.cygnus.com>
11813 * inc/exception: Reorder closing braces.
11815 Fri Mar 27 13:22:18 1998 Mark Mitchell <mmitchell@usa.net>
11817 * pt.c (redeclare_class_template): New function.
11818 * cp_tree.h (redeclare_class_template): Declare it.
11819 * decl.c (xref_tag): Use it.
11821 Thu Mar 26 11:16:30 1998 Jason Merrill <jason@yorick.cygnus.com>
11823 * call.c (build_over_call): Check IS_AGGR_TYPE, not
11824 TYPE_LANG_SPECIFIC.
11825 * typeck.c (convert_arguments): Likewise.
11827 * decl.c (grokdeclarator): Remove const and volatile from type after
11828 setting constp and volatilep.
11830 * class.c (finish_struct_1): Don't warn about bool bitfield larger
11833 Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
11835 * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
11837 Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
11839 * call.c (build_object_call): Complain about ambiguous operator(),
11840 rather that crashing.
11841 (build_new_op): Likewise.
11842 (build_op_delete_call): Likewise.
11844 Thu Mar 26 10:23:24 1998 Mark Mitchell <mmitchell@usa.net>
11846 * cvt.c (perform_qualification_conversions): Use comp_target_types
11847 instead of comp_ptr_ttypes.
11849 Wed Mar 25 16:10:50 1998 Mark Mitchell <mmitchell@usa.net>
11851 * cp-tree.h (enforce_access): Declare.
11852 * call.c (enforce_access): Make it extern, not static.
11853 * class.c (alter_access): Use enforce_access; modify code for ISO
11854 compliance, rather than ARM rules.
11856 Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11858 * cp-tree.h: Fix typo.
11860 Wed Mar 25 02:01:02 1998 Jason Merrill <jason@yorick.cygnus.com>
11862 * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
11863 if (aggregate_value_p (type)).
11865 * decl2.c (constructor_name_full): Handle TYPENAME_TYPE.
11867 Tue Mar 24 16:12:01 1998 Mark Mitchell <mmitchell@usa.net>
11869 * tree.c (mapcar): When dealing with a DECL, use it's constant
11871 * pt.c (lookup_template_class): Don't mangle the names of template
11872 classes whose arguments are unknown.
11874 * pt.c (tsubst_expr): Handle GOTO_STMT correctly.
11876 Tue Mar 24 12:21:55 1998 Benjamin Kosnik <bkoz@lisa.cygnus.com>
11878 * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1.
11880 Tue Mar 24 12:21:48 1998 Jim Wilson <wilson@cygnus.com>
11882 * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for
11883 boolean_type_node to 1.
11885 Tue Mar 24 10:23:47 1998 Mark Mitchell <mmitchell@usa.net>
11887 * error.c (dump_expr): Remove unused variable `l'.
11889 * pt.c (for_each_template_parm): New function, created by
11890 converting uses_template_parms.
11891 (tree_fn_t): New typedef.
11892 (uses_template_parms): Use it.
11893 (mark_template_parm): New function.
11894 (push_template_decl): Check that the argument list of a partial
11895 specialization uses all the template parameters.
11897 * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
11898 with it; we might want it for debugging.
11899 * cp-tree.h (type_unification): Change interface.
11900 * class.c (finish_struct_1): Skip nested template types, just like
11901 ordinary nested types.
11902 (instantiate_type): Use new interface to type_unification.
11903 * lex.c (init_lex): Add __sz as opname for sizeof.
11904 * method.c (build_overload_scope_ref): New function.
11905 (build_overload_int): Handle complex expressions. Set
11906 numeric_output_need_bar if necessary.
11907 (build_overload_value): Handle non-PARM_DECL nodes; this
11908 routine is now used by build_overload_int. Remove some
11909 assignments to numeric_output_need_bar. Use
11910 build_overload_scope_ref.
11911 (build_qualified_name): Note that some template mangled names end
11912 with digits, and set numeric_output_need_bar appropriately. Use
11913 build_underscore_int.
11914 * pt.c (unify): Change interface.
11915 (type_unification_real): Likewise.
11916 (determine_specialization): Use new interfaces.
11917 (tsubst): Deal gracefully with situations in which the argument
11918 vector is not fully filled.
11919 (fn_type_unification): Use new interfaces.
11920 (type_unification): Likewise. Remove NOP_EXPR hack.
11921 (type_unification_real): Likewise.
11922 (unify): Likewise. Deal with unification of complex expressions.
11924 Mon Mar 23 12:24:37 1998 Jason Merrill <jason@yorick.cygnus.com>
11926 * pt.c (complete_template_args): Initialize skip properly.
11928 * decl.c (make_typename_type): Revert.
11929 (make_implicit_typename): Remove.
11930 (lookup_name_real): Don't call it. Call lookup_field if we see a
11931 TYPE_DECL from a template base.
11932 * search.c (lookup_field): Do implicit typename stuff.
11934 Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
11935 Geoff Noer <noer@cygnus.com>
11937 * Makefile.in: Various fixes for building cygwin32 native toolchains.
11938 * Make-lang.in: Likewise.
11940 Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11942 * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify.
11944 Fri Mar 20 10:42:07 1998 Jason Merrill <jason@yorick.cygnus.com>
11946 * decl.c (make_implicit_typename): Rewrite removed code.
11947 (make_typename_type): Call it if the type we look up comes from
11948 a base that uses template parms.
11950 * pt.c (complete_template_args): Rewrite.
11951 (tsubst, FUNCTION_DECL): Use it.
11953 Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org)
11955 * semantics.c (finish_asm_stmt): Fix combine strings. Call
11956 c_expand_asm_operands () if output_operands, input_operands or
11957 clobbers is not NULL_TREE.
11959 Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11961 * pt.c (complete_template_args): New function.
11962 (get_bindings): Deal with specializations of function templates
11963 with return type containing parameters from outer class
11965 (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level,
11966 substitute arguments and compose a new type.
11968 Thu Mar 19 19:01:48 1998 Mark Mitchell <mmitchell@usa.net>
11970 * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new
11973 Thu Mar 19 11:51:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11975 * decl.c (make_implicit_typename): Lose useless code.
11977 * call.c (standard_conversion): Handle A* -> const A* properly.
11979 * pt.c (get_bindings_real): Rename from get_bindings. Add
11980 check_rettype parm.
11981 (get_bindings): Pass 1.
11982 (get_bindings_overload): Pass 0.
11984 Wed Mar 19 09:08:12 1998 Mark Mitchell <mmitchell@usa.net>
11986 * pt.c (check_explicit_specialization): When reverting a static
11987 member function, also remove the `this' parameter from
11988 last_function_parms.
11990 Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com>
11992 * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
11993 a function context.
11995 * decl.c (store_bindings): Use free_binding_vecs.
11996 (pop_from_top_level): Likewise.
11998 Wed Mar 18 12:41:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12000 * decl.c (make_implicit_typename): Only change the type of a
12003 Wed Mar 18 10:09:51 1998 Mark Mitchell <mmitchell@usa.net>
12005 * semantics.c: New file, containing routines to perform the
12006 semantic phase of parsing.
12008 * pt.c (tsubst_expr): Likewise.
12009 * cp-tree.h: Declare the various functions in semantics.c.
12010 Provide macros to access _STMT tree nodes.
12011 * cp-tree.def: Add ASM_STMT tree node.
12012 * Makefile.in, Make-lang.in: Add dependencies on and for
12015 Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com>
12017 * pt.c (push_template_decl): Only check primary templates.
12019 * pt.c (check_explicit_specialization): Complain about default args
12020 in explicit specialization.
12022 * parse.y (nomods_initdcl0): Also call cp_finish_decl for a
12023 constructor_declarator.
12025 Tue Mar 17 14:44:54 1998 Mark Mitchell <mmitchell@usa.net>
12027 * typeck2.c (build_x_arrow): Don't crash when an aggregate type
12028 has no overloaded operator ->.
12030 * call.c (build_field_call): Don't crash when presented with a
12031 field that is actually a nested type.
12033 * decl.c (pushtag): Deal with friend class injection in local
12036 * call.c (build_object_call): Don't crash if OBJ is a
12037 pointer-to-member-function.
12039 Tue Mar 17 11:40:26 1998 Jason Merrill <jason@yorick.cygnus.com>
12041 * pt.c (push_template_decl): Complain about template with C linkage,
12042 anonymous template class.
12044 Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
12046 * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
12047 * search.c: Likewise.
12049 * lex.c (do_pending_defargs): Only call
12050 maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
12052 * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
12054 Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
12056 * parse.y: Deal with CONSTRUCTORS in new_initializers.
12058 Mon Mar 16 10:54:21 1998 Mark Mitchell <mmitchell@usa.net>
12060 * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
12061 closely mimics the behavior in parse.y.
12062 (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing
12063 into a compound statement.
12065 Sun Mar 15 02:07:26 1998 Jason Merrill <jason@yorick.cygnus.com>
12067 * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro.
12068 * pt.c (inline_needs_template_parms): New fn.
12069 (original_template): New fn.
12070 (push_inline_template_parms_recursive): New fn.
12071 (maybe_begin_member_template_processing): Use them.
12072 (maybe_end_member_template_processing): Likewise.
12073 (is_member_or_friend_template): Rename to is_member_template.
12074 Member functions of local classes are never member templates.
12076 Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12078 * lex.c (do_identifier): Handle TEMPLATE_DECL that was
12079 added in the class scope to catch redefinition error.
12081 * pt.c (reduce_template_parm_level): Also copy
12082 the DECL_TEMPLATE_PARMS field.
12084 Sun Mar 15 10:54:08 1998 Mark Mitchell <mmitchell@usa.net>
12086 * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a
12087 reduced-level template type parameter.
12089 Sun Mar 15 12:26:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
12091 * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider.
12092 (DECL_NEEDS_FINAL_OVERRIDER_P): New macro.
12093 * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P.
12094 * decl.c (duplicate_decls): Propagate it.
12095 * typeck2.c (abstract_virtuals_error): Use two loops to emit
12096 abstract virtual functions and virtual functions which need a
12097 final overrider separately.
12099 Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
12101 * lang-specs.h: Properly put brackets around array elements in
12104 * typeck.c (build_binary_op_nodefault): Correctly place parens around
12105 && and || in expression.
12107 Thu Mar 12 09:26:04 1998 Manfred Hollstein <manfred@s-direktnet.de>
12109 * call.c (default_parm_conversions): Remove prototype definition.
12110 (build_method_call): Remove unused variable result.
12112 * cvt.c (ocp_convert): Remove unused variable conversion.
12114 * decl2.c (ambiguous_decl): Add explicit parameter definition for name.
12116 * except.c (do_unwind): #if 0 definition of unused variables fcall
12119 * expr.c (extract_scalar_init): #if 0 prototype and function
12122 * init.c (expand_aggr_init_1): Remove unused variable init_type.
12123 (build_new_1): Remove unused variable t.
12125 * pt.c (instantiate_class_template): Remove unused variable newtag;
12126 cast called function return value to void.
12127 (do_decl_instantiation): Remove unused variables name and fn.
12129 * tree.c (get_type_decl): Add default return to shut up compiler from
12130 complaining control reaches end of non-void function.
12132 * typeck.c (build_x_conditional_expr): Remove unused variable rval.
12134 Thu Mar 12 09:12:15 1998 Manfred Hollstein <manfred@s-direktnet.de>
12136 * call.c (default_parm_conversions): Remove prototype definition.
12137 (build_method_call): Remove unused variable result.
12138 (build_over_call): Add default case in enumeration switch.
12140 Thu Mar 12 08:39:13 1998 Manfred Hollstein <manfred@s-direktnet.de>
12142 * decl2.c (lang_decode_option): Change j's type to size_t.
12144 * tree.c (layout_vbasetypes): record_align and desired_align are of
12145 type unsigned int; const_size and nonvirtual_const_size likewise.
12147 Wed Mar 11 07:25:20 1998 Mark Mitchell <mmitchell@usa.net>
12149 * parse.y (new_initializer): Make sure all initializers are
12152 Tue Mar 10 07:32:36 1998 Mark Mitchell <mmitchell@usa.net>
12154 * decl2.c (import_export_decl): Mark tinfo functions for
12155 cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN.
12157 Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com)
12159 * method.c: Fix typo.
12161 Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12163 * method.c: Include "system.h" to get stdlib.h, stdio.h,
12164 ctype.h, string.h, etc.
12165 (issue_nrepeats): Add default case in enumeration switch.
12166 (check_btype): Likewise.
12167 (process_overload_item): Likewise.
12169 * Makefile.in (method.o): Depend on system.h.
12171 Wed Mar 4 22:26:53 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12173 * lex.c (do_scoped_id): Fix parenthesizing.
12175 Wed Mar 4 12:11:53 1998 Michael Tiemann <tiemann@axon.cygnus.com>
12177 * rtti.c (get_tinfo_fn_dynamic): If this function is called an
12178 FLAG_RTTI is unset, initialize type info machinery and continue
12179 with FLAG_RTTI enabled.
12180 (get_typeid): Likewise.
12182 Wed Mar 4 11:47:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12184 * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
12187 Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
12189 * pt.c (finish_member_template_decl): Deal more gracefully with
12190 invalid declarations.
12192 Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
12194 * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c,
12195 cp-tree.h: Clean up more old overloading code, old RTTI code, and
12196 some formatting quirks.
12198 * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
12199 method.c, pt.c, ptree.c, typeck.c: Remove support for
12200 -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
12202 * Makefile.in: Adjust.
12204 * pt.c (unify): Don't allow reduced cv-quals when strict.
12206 * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from
12207 *type_unification* and unify.
12209 Mon Mar 2 12:11:06 1998 Jason Merrill <jason@yorick.cygnus.com>
12211 * parse.y (explicit_template_type): Remove TEMPLATE keyword.
12212 (nested_name_specifier): And add it before this use.
12213 (typename_sub0): And this use. Also add use without the keyword.
12214 (typename_sub1): Likewise.
12215 * pt.c (instantiate_class_template): Don't actually instantiate
12216 anything if our type uses template parms.
12218 Mon Mar 2 11:04:59 1998 Jim Wilson <wilson@cygnus.com>
12220 * decl.c (start_function): Don't call temporary_allocation for a
12223 Sun Mar 1 21:06:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12225 * pt.c (instantiate_class_template): Don't mess with friends if
12226 our type uses template parms.
12228 Sat Feb 28 12:06:44 1998 Jason Merrill <jason@yorick.cygnus.com>
12230 * parse.y (nested_name_specifier): Use explicit_template_type.
12231 (typename_sub): Allow a template_type, an explicit_template_type,
12232 or an implicit template type at the end.
12233 * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL.
12234 * decl.c (make_typename_type): Handle template-id where the name
12235 is a TEMPLATE_DECL.
12236 * call.c (build_scoped_method_call): Handle member template
12238 * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member
12239 destructor is represented by the type.
12241 * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro.
12242 * parse.y (nested_name_specifier): Add 'template' case.
12243 (explicit_template_type): New rule.
12244 (typename_sub): Use it.
12245 * decl.c (make_typename_type): Handle getting a template-id for NAME.
12246 * pt.c (tsubst): Likewise.
12248 Fri Feb 27 11:17:50 1998 Jason Merrill <jason@yorick.cygnus.com>
12250 * pt.c (add_to_template_args): Fix thinko.
12251 (instantiate_class_template): Call it later.
12253 * pt.c (get_class_bindings): Add outer_args parm.
12254 (most_specialized_class): Likewise.
12255 (instantiate_class_template): Pass it.
12256 (more_specialized_class): Likewise.
12257 (lookup_template_class): Get context from template if none
12259 (finish_member_template_decl): Don't do anything with a
12260 partial specialization.
12261 * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of
12263 * class.c (finish_struct): Member class templates have already been
12264 checked for name clashes.
12265 * decl.c (pushdecl_with_scope): Handle pushing at class level.
12267 Fri Feb 27 02:25:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12269 * pt.c (tsubst, TEMPLATE_DECL): Support member class templates.
12270 (tsubst, *_PARM): Support multiple levels of template classes.
12271 (instantiate_class_template): Look up the pattern from the
12273 (lookup_template_class): Handle getting a template for d1.
12274 (push_template_decl): Correct setting of 'primary'.
12275 (reduce_template_parm_level): Add 'levels' parm.
12276 (finish_member_template_decl): Support member class templates.
12277 (template_class_depth): Handle multiple levels.
12278 * parse.y (component_decl_1, fn.def2): Remove member template case.
12279 (component_decl): Add member template cases.
12280 * decl2.c (check_member_template): We now handle member template
12282 * decl.c (pushtag): Handle member templates.
12283 * method.c (do_inline_function_hair): Don't touch
12284 IDENTIFIER_GLOBAL_VALUE.
12285 * init.c (build_offset_ref): If name isn't an identifier, just
12287 * spew.c (yylex): Handle PTYPENAME like TYPENAME.
12289 * typeck.c (get_delta_difference): Do adjust for conversions to
12290 and from virtual base.
12292 Wed Feb 25 09:51:29 1998 Jason Merrill <jason@yorick.cygnus.com>
12294 * typeck.c (get_delta_difference): Give hard error for conversion
12297 * cp-tree.h: Tweak formatting.
12299 Wed Feb 25 00:35:33 1998 Jason Merrill <jason@yorick.cygnus.com>
12301 * decl.c (push_namespace): Handle redeclaration error.
12303 * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro.
12304 (IDENTIFIER_NAMESPACE_BINDINGS): New macro.
12305 (NAMESPACE_BINDING): New macro.
12306 (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING.
12309 * pt.c (push_template_decl): Use innermost_args.
12311 * decl.c (get_unique_name): Tweak from earlier in the name.
12313 Tue Feb 24 22:15:04 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
12315 * cp-tree.def: Add CPLUS_BINDING node.
12316 * cp-tree.h (tree_binding): New struct.
12317 (BINDING_SCOPE, BINDING_VALUE): New macros.
12318 (current_namespace, global_namespace): Declare extern.
12319 (struct lang_decl_flags): New field in_namespace.
12320 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros.
12321 (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros.
12322 (TREE_INDIRECT_USING): New macro.
12323 * decl2.c (current_namespace, global_namespace): Declare. The
12324 value is a NAMESPACE_DECL now, not a TREE_LIST.
12325 (is_namespace_ancestor, namespace_ancestor): New static functions.
12326 (add_using_namespace, ambiguous_decl): Likewise.
12327 (lookup_using_namespace): New support function for lookup_name.
12328 (qualified_lookup_using_namespace): New support function for
12329 do_scoped_id and lookup_namespace_name.
12330 (get_namespace_id): Mark as obsolete.
12331 (current_namespace_id): Likewise.
12332 (do_namespace_alias): Implement.
12333 (do_using_directive): Implement as call to add_using_namespace.
12334 * decl.c (binding_for_name): New function.
12335 (push_namespace, pop_namespace): Implement.
12336 (push_decl): Don't install a FUNCTION_DECL in the global branch.
12337 (lookup_namespace_name): Implement using qualified lookup.
12338 (lookup_name_real): For global scoping, lookup in
12339 global_namespace. For namespace scoping, lookup in given
12340 namespace. For unscoped lookup, iterate over namespace,
12341 considering using directives.
12342 (init_decl_processing): Initialize global_namespace.
12343 (grokvardecl): Build assembler name as static name for globals.
12344 (grokdeclarator): Remove old namespace mangling.
12345 (xref_tag): When installing a global binding for the
12346 tag, make sure we have an identifier.
12347 * method.c (build_overload_nested_name): Mangle namespaces.
12348 (build_qualified_name): Likewise.
12349 (build_decl_overload_real): Likewise.
12350 * lex.c (build_lang_decl): Set namespace for new declaration to
12352 (do_scoped_id): Find global names in global or current
12353 namespace, or using qualified namespace lookup, depending on
12355 * init.c (build_member_call): When scope is namespace, use
12356 build_x_function_call instead.
12357 (build_offset_ref): When scope is namespace, collapse processing
12358 to lookup_namespace_name instead.
12359 * error.c (dump_decl): Support NAMESPACE_DECL.
12360 * decl.c (pushdecl): Bind globals to current namespace.
12361 (push_overloaded_decl): Likewise.
12362 (lookup_tag): Likewise.
12363 (lookup_name_current_level): Likewise.
12364 (xref_tag): Likewise.
12365 (start_function): Likewise.
12366 * lex.c (do_identifier): Likewise.
12367 (identifier_typedecl_value): Likewise.
12368 (real_yylex): Likewise.
12369 * method.c (do_inline_function_hair): Likewise.
12370 * parse.y (unscoped): Likewise.
12371 * pt.c (check_explicit_specialization): Likewise.
12372 (lookup_template_class): Likewise.
12373 * rtti.c (call_void_fn): Likewise.
12374 * sig.c (build_sigtable): Likewise.
12375 * ptree.c (lang_print_xnode): New function.
12377 Tue Feb 24 01:40:24 1998 Jason Merrill <jason@yorick.cygnus.com>
12379 * pt.c (instantiate_class_template): Don't instantiate if pedantic
12380 and the args use template parms.
12382 * pt.c (push_tinst_level): If the instantiation uses template parms,
12384 * decl.c (xref_basetypes): Do call complete_type for basetypes
12385 that involve template parameters.
12387 Tue Feb 24 00:36:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12389 * typeck2.c (process_init_constructor): Fix labeled init check.
12391 Mon Feb 23 05:08:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12393 * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS
12394 argument to tsubst and friends.
12396 * pt.c (tsubst, FUNCTION_DECL): Tidy.
12398 * typeck.c (build_x_function_call): Handle static member function
12399 templates like non-templates. Handle friend templates like normal
12400 function templates.
12401 * pt.c (tsubst, *_PARM): Don't use orig_level.
12402 (get_bindings): Don't call add_to_template_args.
12403 (instantiate_template): Likewise.
12404 (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
12405 * ptree.c (print_lang_type): Print index/level for template parms.
12407 Mon Feb 23 02:52:29 1998 Mark Mitchell <mmitchell@usa.net>
12409 * Make-lang.in (cc1plus): Note that cc1plus depends on
12410 cp/cp-tree.h and cp/cp-tree.def.
12412 * cp-tree.def (TEMPLATE_CONST_PARM): Remove.
12413 (TEMPLATE_PARM_INDEX): New tree code, used to indicate a
12414 position in a template parameter list.
12415 * cp-tree.h (template_parm_index): New structure, used as the tree
12416 structure for a TEMPLATE_PARM_INDEX.
12417 (TEMPLATE_PARM_IDX): New macro.
12418 (TEMPLATE_PARM_LEVEL): Likewise.
12419 (TEMPLATE_PARM_DESCENDANTS): Likewise.
12420 (TEMPLATE_PARM_ORIG_LEVEL): Likewise.
12421 (TEMPLATE_PARM_DECL): Likewise.
12422 (TEMPLATE_TYPE_PARM_INDEX): Likewise.
12423 (TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
12424 (TEMPLATE_TYPE_DECL): Likewise.
12425 (TEMPLATE_CONST_IDX): Remove.
12426 (TEMPLATE_CONST_LEVEL): Likewise.
12427 (TEMPLATE_CONST_SET_INFO): Likewise.
12428 (TEMPLATE_TYPE_SET_INFO): Likewise.
12429 (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
12431 (TEMPLATE_TYPE_LEVEL): Likewise.
12432 * decl.c (decls_match): Call comp_template_parms, rather than
12433 expanding it inline.
12434 (duplicate_decls): If two template declarations are being merged,
12435 then their TEMPLATE_INFOs should be merged as well.
12436 (grokfndecl): Save template-id information when declaring a friend
12437 with explicit template arguments. Pass arguments to
12438 check_explicit_specialization via correct convention; at some
12439 point check_explicit_specialization changed, but these call-sites
12441 (grokdeclarator): Tidy up slightly.
12442 * decl2.c (check_classfn): Tidy up slightly. Don't assume that
12443 two template functions with the same DECL_ASSEMBLER_NAME the same,
12444 since the names are not yet mangled.
12445 * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
12446 TEMPLATE_CONST_PARM.
12447 (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the
12448 decl for a non-type parameter, rather than printing `<tparm ...>'.
12449 * friend.c (is_friend): Handle TEMPLATE_DECL friends.
12450 (do_friend): Deal with template friends.
12451 * lex.c (do_pending_inlines): Call
12452 maybe_begin_member_template_processing, rather than
12453 conditionally calling begin_member_template_processing.
12454 (process_next_inline): Likewise. Call
12455 maybe_end_member_template_processing, rather than
12456 conditionally calling end_member_template_processing.
12457 (do_pending_defargs): Likewise.
12458 (do_identifier): Use TEMPLATE_PARM_INDEX instead of
12459 TEMPLATE_CONST_PARM.
12460 * method.c (build_mangled_template_parm_index): New function.
12461 (build_overload_value): Use it.
12462 (build_overload_name): Likewise.
12463 * pt.c (finish_member_template_decl): Allow friend declarations.
12464 (template_class_depth): New function.
12465 (is_member_template): Rename, and modify, to become...
12466 (is_member_or_friend_template): New function.
12467 (end_member_template_processing): Rename, and modify, to become...
12468 (maybe_end_member_template_processing).
12469 (build_template_parm_index): New function.
12470 (reduce_template_parm_level): New function.
12471 (process_template_parm): Modify to use build_template_parm_index.
12472 (push_template_decl): Deal with friend templates.
12473 (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
12474 TEMPLATE_CONST_PARM.
12475 (tsubst_friend_function): New function.
12476 (instantiate_class_template): Generate the DECL_FRIENDLIST
12477 for a new instantiation by using tsubst_friend_function rather
12479 (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
12480 Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
12481 appropriate new macros. Use reduce_template_parm_level to
12482 generate lower-level template parameters. Handle tsubst'ing into
12483 TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget
12484 to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
12485 templates. Similarly for the template parameters for a new
12487 (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead
12488 of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them.
12489 (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
12490 (get_bindings): Call add_to_template_args if necessary.
12491 (instantiate_decl): Handle instantiations of friend templates.
12492 * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
12493 TEMPLATE_TYPE_PARM as a list of fields; it's not!
12494 * spew.c (yylex): Do a little manual constant propagation to
12497 Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com)
12499 * error.c: Include sys/types.h.
12501 Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com)
12503 * method.c (build_mangled_name): Start CPP directives in column zero.
12505 Thu Feb 19 10:36:48 1998 Jason Merrill <jason@yorick.cygnus.com>
12507 * typeck2.c (process_init_constructor): Sorry about non-trivial
12508 labeled initializers.
12509 * parse.y (initlist): Re-enable labeled initializers.
12511 Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12513 * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm,
12514 all callers changed. Rely on the new parameter instead of arg
12515 being a TREE_LIST when determine whether we are working inside
12516 template template parameter. Clean up is_type test.
12518 Thu Feb 19 10:04:12 1998 Jason Merrill <jason@yorick.cygnus.com>
12520 * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT.
12521 * typeck2.c (initializer_constant_valid_p): Allow conversions
12522 between pointers and references.
12524 1998-02-19 Brendan Kehoe <brendan@cygnus.com>
12526 * typeck.c (build_unary_op): Only warn about incr/decr a pointer
12527 if pedantic || warn_pointer_arith.
12529 Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12531 * pt.c (unify): Handle TEMPLATE_DECL.
12533 1998-02-18 Brendan Kehoe <brendan@cygnus.com>
12535 * cp-tree.h (strip_attrs): Remove decl.
12537 1998-02-18 Doug Evans <devans@cygnus.com>
12539 * decl.c (duplicate_decls): Call merge_machine_decl_attributes.
12540 Update olddecl's attributes too.
12541 (strip_attrs): Remove function.
12542 * typeck.c (common_type): Call merge_machine_type_attributes.
12544 Tue Feb 17 14:07:52 1998 Mark Mitchell <mmitchell@usa.net>
12546 * parse.y (initdcl0_innards): New grammar symbol.
12547 (nomods_initdecls, nomods_initdcl0): Change type from itype to
12548 none, since the resulting value is never used.
12549 (parse_decl): New function.
12550 (datadef): Remove redundant actions.
12551 (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards.
12552 * parse.c: Regenerated.
12554 Tue Feb 17 11:54:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12556 * parse.y (simple_stmt): Use getdecls() to check for decl.
12558 Sat Feb 14 11:50:51 1998 Manfred Hollstein <manfred@s-direktnet.de>
12560 * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
12562 (c++.install-common): Install c++filt properly as native or as cross
12564 (c++.uninstall): Add c++filt.
12566 Fri Feb 13 14:55:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12568 * call.c (standard_conversion): Fix multi-level ptr conversions.
12570 Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com>
12572 * init.c (build_new): Propagate error_mark_node up.
12574 Fri Feb 13 13:24:32 1998 Jason Merrill <jason@yorick.cygnus.com>
12576 * parse.y (simple_stmt): If the condition isn't a declaration,
12577 start the controlled block after the test.
12579 Fri Feb 13 02:26:10 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12581 * call.c (build_over_call): Convert builtin abs, labs and fabs to
12583 * decl.c (init_decl_processing): Re-enable abs, labs and fabs as
12586 Fri Feb 13 01:36:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12588 * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV.
12590 Fri Feb 13 00:21:59 1998 Jason Merrill <jason@yorick.cygnus.com>
12592 * cp-tree.h: Add access_protected_virtual_node.
12593 * class.c (init_class_processing): Initialize it.
12594 * decl.c (xref_basetypes): Use it.
12595 * parse.y (base_class_access_list): Likewise.
12597 * Make-lang.in (DEMANGLER_PROG): Add $(exeext).
12598 (c++.install-common): Install c++filt.
12600 Thu Feb 12 12:46:51 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
12602 * decl.c (shadow_tag): Give error for typedef-ing built-in types.
12604 Wed Feb 11 23:28:05 1998 Mark Mitchell <mmitchell@usa.net>
12606 * call.c (reference_binding): Use comptypes when comparing
12607 TYPE_MAIN_VARIANTS to handle non-canonical array/index types.
12609 Wed Feb 11 16:42:04 1998 Mark Mitchell <mmitchell@usa.net>
12611 * tree.c (is_overloaded_fn): Use really_overloaded_fn.
12612 (really_overloaded_fn): Move check here from is_overloaded_fn.
12613 (get_first_fn): Use really_overloaded_fn and is_overloaded_fn.
12615 Wed Feb 11 15:54:18 1998 Mark Mitchell <mmitchell@usa.net>
12617 * typeck.c (build_ptrmemfunc): Type-check pointer-to-member
12620 Mon Feb 9 22:23:31 1998 Mark Mitchell <mmitchell@usa.net>
12622 * cp-tree.h (push_template_decl): Return the decl passed in, or an
12623 equivalent duplicate.
12624 * decl.c (pushtag): Use the return value from push_template_decl.
12625 (duplicate_decls): When duplicating a template declaration, merge
12626 the DECL_TEMPLATE_RESULTs as well.
12627 (make_implicit_typename): Don't try to dive into typename types to
12628 find a context for making a new implicit typename.
12629 (start_decl): Use the return value from push_template_decl.
12630 (grokdeclarator): Complain about declarations list `const operator
12631 int'. Since we don't correctly handle in-class initializations of
12632 non-static data members, complain about this (now illegal)
12633 practice. Issue an error for initializations of non-const statics
12634 since that is illegal as well, and since we don't handle that case
12636 (start_function): Use the return value from push_template_decl.
12637 (start_method): Likewise.
12638 * decl2.c (grokfield): Likewise. Since the change to
12639 grokdeclarator ensures that all initialized fields are in fact
12640 static, remove a redundant test for TREE_PUBLIC.
12641 * parse.y (initlist): Disable labeled initializers since they do
12642 not work as per the documentation, and since they do not use the
12643 same syntax as the C front end.
12644 * pt.c (push_template_decl): Return the decl passed in, or an
12645 equivalent duplicate.
12646 (lookup_template_class): When searching in a nested context,
12647 use the right arguments.
12648 (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL.
12649 * typeck.c (build_component_ref): Assign the correct type to the
12650 result of build_vfn_ref.
12652 Tue Feb 10 23:56:46 1998 Jason Merrill <jason@yorick.cygnus.com>
12654 * pt.c (convert_nontype_argument): Fix typo.
12655 (check_explicit_specialization): Allow old-style specialization
12656 of class template members.
12658 Tue Feb 10 20:36:52 1998 Jason Merrill <jason@yorick.cygnus.com>
12659 Manfred Hollstein <manfred@s-direktnet.de>
12661 * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead
12662 when deciding to override DECL_ASSEMBLER_NAME.
12664 Tue Feb 10 15:30:55 1998 Andrew MacLeod <amacleod@torpedo.to.cygnus.com>
12666 * decl2.c (lang_f_options): Add -fsquangle to option processing list.
12667 * cp-tree.h (flag_do_squangling): Add declaration.
12668 * lang-options.h: Add -fsquangle and -fno-squangle.
12669 * method.c: Add macros and static variables for squangling.
12670 (build_overload_name): Rename to build_mangled_name, add logic for B
12671 compression, and split into process_modifiers and
12672 process_overload_item.
12673 (process_modifiers): New function, to handle constant, reference,
12675 (process_overload_item): New function, handles issue of type codes.
12676 (build_overload_name): New function, start squangling and call
12677 build_mangled_name.
12678 (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline.
12679 (start_squangling): New function to initialize squangling structs.
12680 (end_squangling): New function to destroy squangling structs.
12681 (nrepeats): Rename variable to Nrepeats.
12682 (issue_nrepeats): New function for issuing 'n' type repeats.
12683 (check_ktype): New function to check for type K name compression.
12684 (build_overload_nested_name): Add a check for K name compression.
12685 (build_qualified_name): Add a check for K name compression and don't
12686 use DECL_ASSEMBLER_NAME when squangling is on.
12687 (check_btype): New function, checks for B type compression.
12688 (build_static_name, build_decl_overload_real): Initiate squangling.
12689 (build_typename_overload, build_overload_with_type): Initiate
12692 Sun Feb 8 23:47:38 1998 scott snyder <sss@d0linux01.fnal.gov>
12694 * method.c (make_thunk): Avoid name buffer overflow.
12696 Sat Feb 7 16:48:54 1998 Jason Merrill <jason@yorick.cygnus.com>
12698 * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we
12699 don't define them yet.
12701 * parse.y (nomods_initdcl0): Add constructor_declarator case.
12703 Fri Feb 6 21:32:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
12705 * config-lang.in (diff_excludes): Use basename only.
12707 Thu Feb 5 19:10:40 1998 Jason Merrill <jason@yorick.cygnus.com>
12709 * tinfo2.cc: Add tinfo for signed char.
12711 Thu Feb 5 14:38:23 1998 Mike Stump <mrs@wrs.com>
12713 * search.c (compute_access): Handle protected constructors in derived
12714 classes as accessible.
12716 Wed Feb 4 01:26:49 1998 Jason Merrill <jason@yorick.cygnus.com>
12718 * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
12719 Call convert_from_reference sooner.
12721 Tue Feb 3 23:50:52 1998 Mark Mitchell <mmitchell@usa.net>
12723 * cvt.c (ocp_convert): Obtain the constant values from constant
12724 decls even if the destination type is the same as the type of the
12727 * decl2.c (finish_file): Make sure that static inlines with
12728 definitions are not marked DECL_EXTERNAL before returning.
12730 Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12732 * decl.c: Lose arg_looking_for_template.
12733 (lookup_name_real): Likewise.
12734 * parse.y: Lose processing_template_arg, template_arg1.
12735 (primary): Likewise.
12736 * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
12738 Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12740 * error.c (dump_decl): Fix type of default arguments for template
12741 template parameters and nontype template parameters.
12742 * parse.y (template_parm): Handle invalid default template
12743 template arguments here.
12745 * parse.y (template_parm): Use template_arg instead of PTYPENAME
12746 for default template template argument.
12747 * pt.c (coerce_template_parms): Merge default template argument
12748 codes. Can treat RECORD_TYPE as template name if it is implicitly
12749 created. Fix argument index in error message.
12750 * typeck.c (comptypes): Merge template argument comparison codes in
12751 TEMPLATE_TEMPLATE_PARM and RECORD_TYPE.
12753 Tue Jan 6 01:42:44 1998 Mumit Khan <khan@xraylith.wisc.edu>
12755 * lex.c (file_name_nondirectory): Also check for '/'.
12757 Mon Feb 2 11:24:22 1998 Mark Mitchell <mmitchell@usa.net>
12759 * parse.y (primary): Deal with statement-expressions in
12761 * pt.c (tsubst_copy): Handle BIND_EXPR.
12762 * tree.c (mapcar): Likewise.
12764 * call.c (add_template_candidate_real): Pass extra parameter to
12765 fn_type_unification.
12766 * cp-tree.h (fn_type_unification): Add parameter.
12767 * pt.c (fn_type_unification): Add additional parameter to deal with
12768 static member functions.
12769 (get_bindings): Deal with static member functions.
12771 * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro.
12772 (revert_static_member_fn): Declare.
12773 * decl.c (revert_static_member_fn): Remove declaration. Change
12774 linkage from internal to external.
12775 (cp_finish_decl): Deal with virtual functions in classes local to
12776 template functions.
12777 * decl2.c (finish_file): Don't forget to emit increment/decrement
12778 expressions in initializers for file-scope variables.
12779 * parse.y (typename_sub2): If the typename doesn't names a
12780 template, rather than a type, issue an error message.
12781 * pt.c (check_explicit_specialization): Handle specializations of
12782 static member functions.
12783 (coerce_template_parms): Handle offset references to lists of
12785 * search.c (note_debug_info_needed): Don't crash when handed a
12786 type which is being defined.
12787 * typeck.c (complete_type): Don't crash when handed NULL_TREE;
12788 that can happen with some illegal code.
12790 Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12792 * call.c (user_harshness): Initialize `code' to 0.
12793 (build_method_call): Initialize `candidates', `cp' and `len' to 0.
12794 (null_ptr_cst_p): Add parentheses around && within ||.
12795 (standard_conversion): Likewise.
12796 (z_candidate): Likewise.
12797 (build_user_type_conversion_1): Initialize `args' to NULL_TREE.
12798 (build_object_call): Likewise for `mem_args'.
12799 (build_new_op): Likewise for `mem_arglist'. Add `return' from
12800 default case in enumeration switch.
12802 * class.c (build_vtable_entry): Add explicit braces to avoid
12804 (build_class_init_list): Likewise.
12805 (finish_struct_1): Initialize `width' to 0.
12806 (instantiate_type): Initialize `name' to NULL_TREE. Add
12807 explicit braces to avoid ambiguous `else'.
12809 * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous
12812 * decl.c (grok_reference_init): Eliminate unused parameter, all
12814 (record_builtin_type): Initialize `tdecl' to NULL_TREE.
12815 (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE.
12816 (cp_finish_decl): Initialize `ttype' to NULL_TREE.
12817 (grokdeclarator): Add parentheses around && within ||. Add
12818 explicit braces to avoid ambiguous `else'.
12819 (grokparms): Initialize `type' to NULL_TREE.
12820 (xref_tag): Remove unused label `just_return'.
12821 (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE.
12822 (finish_function): Initialize `cond' and `thenclause' to NULL_TREE.
12823 (hack_incomplete_structures): Add parentheses around assignment
12824 used as truth value.
12826 * decl2.c (coerce_delete_type): Hide definition of `e3'.
12828 * error.c: Include <stdlib.h>.
12829 (dump_expr): Change the type of `i' to size_t. Remove unused
12832 * except.c (init_exception_processing): Remove unused variable `d'.
12833 (expand_throw): Likewise for `label'.
12835 * friend.c (add_friends): Add explicit braces to avoid ambiguous
12838 * init.c (sort_member_init): Initialize `last_field' to NULL_TREE.
12839 (sort_base_init): Likewise for `binfo'.
12840 (expand_member_init): Likewise for `rval'.
12841 (build_member_call): Add parentheses around assignment used as
12843 (build_offset_ref): Add explicit braces to avoid ambiguous `else'.
12844 (build_new): Initialize `nelts' to NULL_TREE. Initialize
12845 `old_immediate_size_expand' to 0.
12846 (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE.
12847 (build_vec_delete_1): Remove unused variable `block'.
12848 (expand_vec_init): Initialize `itype' to NULL_TREE.
12850 * lex.c: Include <strings.h> if we don't have <string.h>. Protect
12851 declaration of `index' and `rindex' with autoconf macros.
12852 (reinit_parse_for_expr): Remove unused variables
12853 `look_for_semicolon' and `look_for_lbrac'.
12854 (cons_up_default_function): Initialize `args' to NULL_TREE.
12855 (readescape): Initialize `firstdig' to 0.
12856 (real_yylex): Add parentheses around assignment used as truth value.
12858 * method.c: Include <strings.h> if we don't have <string.h>.
12859 Protect declaration of `index' with autoconf macro.
12861 * parse.y (primary): Add explicit braces to avoid ambiguous `else'.
12862 Initialize `type' to NULL_TREE.
12863 (structsp): Remove unused variable `id'.
12865 * pt.c (coerce_template_parms): Add explicit braces to avoid
12867 (lookup_template_class): Initialize `template' to NULL_TREE.
12868 (instantiate_class_template): Remove unused variable `name' and `e'.
12869 (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE.
12870 (do_poplevel): Initialize `saved_warn_unused' to 0.
12871 (type_unification): Remove unused varable `parm'.
12872 (unify): Likewise for `j'.
12874 * repo.c (init_repo): Add parentheses around assignment used as
12876 (finish_repo): Remove unused varable `p'.
12878 * search.c (get_binfo): Initialize `type' to NULL_TREE.
12879 (get_base_distance): Likewise.
12880 (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path'
12881 and `new_v' to NULL_TREE.
12882 (lookup_fnfields): Likewise for `rval_binfo_h'.
12883 (breadth_first_search): Add parentheses around assignment used as
12885 (get_template_base): Initialize `type' to NULL_TREE.
12887 * sig.c (append_signature_fields): Initialize `last_mfptr' to
12889 (build_signature_table_constructor): Likewise for
12890 `last_rhs_field', `pfn' and `vt_off'.
12891 (build_sigtable): Likewise for `init'.
12893 * tree.c (break_out_calls): Initialize `t2' to NULL_TREE.
12894 (propagate_binfo_offsets): Likewise for `delta'.
12895 (hash_tree_cons): Initialize hashcode to 0.
12896 (can_free): Likewise for `size'.
12897 (cp_tree_equal): Add explicit braces to avoid ambiguous `else'.
12899 * typeck.c (convert_sequence): Hide prototype.
12900 (common_type): Add explicit braces to avoid ambiguous `else'.
12901 (comp_target_types): Likewise.
12902 (build_x_function_call): Initialize `ctypeptr' to NULL_TREE.
12903 (build_function_call_real): Add explicit braces to avoid ambiguous
12905 (convert_arguments): Initialize `called_thing' to 0.
12906 (convert_for_initialization): Initialize `savew' and `savee' to 0.
12908 * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0.
12909 (digest_init): Initialize `old_tail_contents' to NULL_TREE.
12910 (build_x_arrow): Likewise for `last_rval'.
12912 * xref.c (GNU_xref_decl): Initialize `cls' to 0.
12914 Sun Feb 1 12:45:34 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
12916 * decl.c (init_decl_processing): Use set_sizetype.
12917 * decl2.c (sizetype): Don't declare.
12918 * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype.
12919 (c_sizeof_nowarn, build_binary_op_nodefault): Likewise.
12920 (build_component_addr, unary_complex_lvalue): Likewise.
12921 * rtti.c (expand_class_desc): Likewise.
12922 * class.c (get_vfield_offset): Likewise.
12924 Thu Jan 29 10:39:30 1998 Mark Mitchell <mmitchell@usa.net>
12926 * pt.c (convert_nontype_argument): Move check for is_overloaded_fn
12927 early to avoid bogus error. Handle overloaded function
12928 names provided as template arguments correctly.
12929 (coerce_template_parms): Don't mishandle overloaded functions when
12930 dealing with template template parameters.
12931 (lookup_template_class): Issue an error message, rather than
12932 crashing, when the TYPE_DECL provided is not a template type.
12934 Wed Jan 28 23:14:44 1998 Jason Merrill <jason@yorick.cygnus.com>
12936 * class.c (instantiate_type): Don't just return a known type if
12939 Wed Jan 28 11:04:07 1998 Mark Mitchell <mmitchell@usa.net>
12941 * class.c (instantiate_type): Remove handling of FUNCTION_DECL
12942 since that code could never be reached.
12944 * error.c (dump_decl): Avoid aborting in the midst of printing an
12945 error message about an illegal template declaration.
12947 * parse.y (structsp): Print an error message, rather than crashing,
12948 when a class-head does not name a class.
12950 * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE
12951 template arguments as a g++ extension.
12953 * cp-tree.def (ALIGNOF_EXPR): New tree code.
12954 * decl2.c (grok_alignof): If processing_template_decl, just store
12956 * typeck.c (c_alignof): Likewise.
12957 * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR.
12958 * error.c (dump_expr): Likewise.
12959 * pt.c (tsubst_copy): Likewise.
12960 * tree.c (cp_tree_equal): Likewise.
12961 * pt.c (uses_template_parms): Correctly determine whether or not a
12962 SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant
12963 folding can be done.
12965 * cp-tree.h (grok_enum_decls): Remove type parameter.
12966 * decl.c (grok_enum_decls): Likewise.
12967 * decl2.c (grok_x_components): Call grok_enum_decls
12968 unconditionally, since it will do nothing if there is no
12969 current_local_enum. Use the new calling sequence.
12970 * pt.c (tsubst_enum): Use the new calling sequence for
12973 * decl.c (start_function): Make member functions of local classes
12974 in extern inline functions have comdat linkage here...
12975 (grokdeclarator): Rather than here.
12977 Wed Jan 28 10:55:47 1998 Jason Merrill <jason@yorick.cygnus.com>
12979 * pt.c (convert_nontype_argument): Use decl_constant_value.
12981 Tue Jan 27 16:42:21 1998 Mark Mitchell <mmitchell@usa.net>
12983 * call.c (add_template_candidate_real): New function.
12984 (add_template_candidate): Use it.
12985 (add_template_conv_candidate): Likewise.
12986 (joust): Pass extra argument to more_specialized.
12987 * class.c (instantiate_type): Handle a single FUNCTION_DECL.
12988 (is_local_class): Remove.
12989 (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
12990 * cp-tree.h (is_local_class): Remove.
12991 (perform_array_to_pointer_conversion): Likewise.
12992 (finish_member_template_decl): Add.
12993 (check_explicit_specialization): Return a tree, not an int.
12994 (more_specialized): Take additional argument.
12995 (get_bindings): Likewise.
12996 (TI_PENDING_SPECIALIZATION_FLAG): New macro.
12997 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
12998 (perform_array_to_pointer_conversion): Remove.
12999 * decl.c (saved_scope): Add processing_specialization,
13000 processing_explicit_instantiation fields.
13001 (maybe_push_to_top_level): Save them.
13002 (pop_from_top_level): Restore them.
13003 (grokfndecl): Use new return value from
13004 check_explicit_specialization.
13005 (start_decl): Don't check flag_guiding_decls before pushing
13007 (cp_finish_decl): Remove previous (bogus) change.
13008 (grok_declarator): Use decl_function_context rather than
13010 * decl2.c (finish_file): Pass extra argument to get_bindings.
13011 (build_expr_from_tree): Let build_x_component_ref check
13012 validity of arguments rather than doing it here.
13013 * lex.c (cons_up_default_function): Remove code fooling with
13014 processing_specialization, processing_explicit_instantiation
13015 flags, as that is now done in {maybe_push_top,pop_from}_top_level.
13016 * method.c (build_overload_identifier): Mangle local classes in
13017 template functions correctly.
13018 * parse.y (finish_member_template_decl): Move to pt.c.
13019 * pt.c (finish_member_template_decl): Moved here from parse.y.
13020 (print_candidates): New function.
13021 (determine_specialization): Change interface. Properly look for
13022 most specialized versions of template candidates.
13023 (check_explicit_specialization): Fully process explicit
13025 (push_template_decl): Avoid looking at CLASSTYPE fields in
13027 (determine_overloaded_function): Remove.
13028 (convert_nontype_argument): Change name from
13029 convert_nontype_parameter. Use determine_overloaded_function
13030 instead of instantiate_type.
13031 (mangle_class_name_for_template): Handle type contexts as well as
13033 (classtype_mangled_name): Likewise.
13034 (lookup_template_class): Likewise.
13035 (tsubst): Likewise.
13036 (more_specialized): Take explict template arguments as a
13038 (most_specialized): Likewise.
13039 (get_bindings): Likewise. Check that return types match before
13040 proclaiming a function a match.
13041 (do_decl_instantiation): Remove code searching for function to
13042 instantiate; that is now done in check_explicit_specialization.
13043 (add_maybe_template): Pass extra argument to get_bindings.
13044 * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
13046 * typeck.c (build_component_ref): Check for invalid arguments.
13048 Tue Jan 27 01:44:02 1998 Jason Merrill <jason@yorick.cygnus.com>
13050 * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
13051 return_target and call_target are equivalent.
13053 * pt.c (type_unification_real): Just accept function parms that
13054 don't use any template parms.
13056 Sun Jan 25 03:30:00 1998 Jason Merrill <jason@yorick.cygnus.com>
13058 * decl.c (cp_finish_decl): When bailing on a comdat variable, also
13059 unset DECL_NOT_REALLY_EXTERN.
13061 * parse.y (typename_sub*): Fix std::.
13063 Sat Jan 24 12:13:54 1998 Jason Merrill <jason@yorick.cygnus.com>
13065 * error.c (dump_decl): Fix type default template args.
13066 (dump_type): Hand TEMPLATE_DECL off to dump_decl.
13068 Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
13070 * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
13071 (file_name_nondirectory): Use.
13073 Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13075 * pt.c (coerce_template_parms): Don't access elements of ARGLIST
13076 that are not really present. Substitute default arguments in
13077 template template arguments. Correctly convert TEMPLATE_DECL to
13078 TEMPLATE_TEMPLATE_PARM.
13079 (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM
13080 are no longer treated specially here.
13081 * parse.y (template_template_parm): Fix copy error.
13082 * decl.c (grokdeclarator): Warn about missing `typename' for nested
13083 type created from template template parameters.
13084 * parse.y (bad_parm): Likewise
13086 * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM.
13087 (push_nested_class): Likewise.
13088 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code.
13089 * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro.
13090 (copy_template_template_parm): Declare.
13091 * decl.c (arg_looking_for_template): New variable.
13092 (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM.
13093 Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM
13094 node if arg_looking_for_template is nonzero.
13095 (pushdecl): Handle TEMPLATE_TEMPLATE_PARM.
13096 (grok_op_properties, xref_tag, xref_basetypes): Likewise.
13097 (grokdeclarator): Handle TEMPLATE_DECL.
13098 * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM.
13099 * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM.
13100 (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM.
13101 (dump_decl): Handle unnamed template type parameters.
13102 Handle template template parameters.
13103 (dump_function_name): Handle template template parameters.
13104 * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef):
13105 Handle TEMPLATE_TEMPLATE_PARM.
13106 * method.c (build_template_template_parm_names): New function.
13107 (build_template_parm_names): Handle TEMPLATE_DECL.
13108 (build_overload_nested_name, build_overload_name):
13109 Handle TEMPLATE_TEMPLATE_PARM.
13110 * parse.y (maybe_identifier): New nonterminal.
13111 (template_type_parm): Use it.
13112 (template_template_parm, template_arg1): New nonterminal.
13113 (template_parm): Add template_template_parm rules.
13114 (template_arg): Set processing_template_arg.
13115 (template_arg1): Rules moved from template_arg.
13116 (primary, nonnested_type): Set arg_looking_for_template if we are
13117 processing template arguments.
13118 * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL.
13119 (process_template_parm): Handle template template parameters.
13120 (coerce_template_parms, comp_template_args): Likewise.
13121 (mangle_class_name_for_template, lookup_template_class): Likewise.
13122 (uses_template_parms): Handle TEMPLATE_DECL and
13123 TEMPLATE_TEMPLATE_PARM.
13124 (current_template_args): Handle TEMPLATE_DECL.
13125 (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM.
13126 * search.c (dfs_walk, dfs_record_inheritance):
13127 Handle TEMPLATE_TEMPLATE_PARM.
13128 * tree.c (copy_template_template_parm): New function.
13129 (mapcar): Handle TEMPLATE_TEMPLATE_PARM.
13130 * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM.
13132 Mon Jan 19 22:40:03 1998 Mark Mitchell <mmitchell@usa.net>
13134 * decl.c (start_decl): Don't allow duplicate definitions of static
13137 * call.c (build_user_type_conversion_1): Handle user-defined
13138 template conversion operators correctly.
13140 * decl2.c (build_expr_from_tree): Issue an error message if the
13141 object in a COMPONENT_REF is a TEMPLATE_DECL.
13143 * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs.
13145 * class.c (is_local_class): New function.
13146 * cp-tree.h (is_local_class): Declare it.
13147 (last_tree): Likewise.
13148 (begin_tree): Likewise.
13149 (end_tree): Likewise.
13150 (lookup_template_class): Change prototype.
13151 * decl.c (cp_finish_decl): Check for NULL where necessary.
13152 Consider FUNCTION_DECLS to declare objects with top-level binding,
13153 when calling make_decl_rtl.
13154 (grokdeclarator): Give members of local classes internal linkage.
13155 (start_function): Remove declaration of last_tree.
13156 (finish_function): Set flag_keep_inline_functions around call to
13157 rest_of_compilation if we are processing a member function in a
13159 (start_method): Call push_template_decl for member functions of
13160 local classes in template functions.
13161 * decl2.c (import_export_decl): Don't give external linkage to
13162 instantiations of templates with internal linkage.
13163 * parse.y (last_tree): Remove declaration.
13164 (template_type): Pass extra parameter to lookup_template_class.
13165 (self_template_type): Likewise.
13166 (structsp): Move call to reset_specialization into left_curly.
13167 (left_curly): Call reset_specialization, and begin_tree.
13168 * pt.c (saved_trees): New variable.
13169 (mangle_class_name_for_template): Change prototype. Use
13170 additional function context to name local classes in templates
13172 (classtype_mangled_name): Pass the context.
13173 (push_template_decl): Handle local classes and templates, and
13174 member functions for such classes.
13175 (convert_nontype_parameter): Fix handling of pointer-to-member
13177 (lookup_template_class): Handle local classes in templates.
13178 (tsubst): Likewise. Don't assume that template instantiations
13179 have external linkage; pay attention to the template declaration.
13180 (mark_decl_instantiated): Likewise.
13181 (begin_tree): New function.
13182 (end_tree): Likewise.
13184 * decl.c (xref_basetypes): Don't call complete_type for basetypes
13185 that involve template parameters; that can lead to infinite
13186 recursion unnecessarily.
13188 * pt.c (register_specialization): Do not register specializations
13189 that aren't ready to be registered yet.
13190 (check_explicit_specialization): Handle explicit specialization of
13191 constructors and destructors.
13192 (build_template_decl): New function.
13193 (push_template_delc): Handle out-of-class specializations of
13196 * pt.c (check_explicit_specialization): Set up the template
13197 information before registering the specialization.
13198 (coerce_template_parms): Fix thinko.
13199 (tsubst): Handle specializations of member templates correctly.
13201 * class.c (finish_struct_methods): Remove calls to
13202 check_explicit_specialization from here.
13203 (finish_struct): And insert them here.
13204 * cp-tree.h (perform_qualification_conversions): New function.
13205 (perform_array_to_pointer_conversion): Likewise.
13206 (begin_explicit_instantiation): Likewise.
13207 (end_explicit_instantiation): Likewise.
13208 (determine_specialization): Renamed from
13209 determine_explicit_specialization.
13210 (comp_template_parms): New function.
13211 (processing_explicit_instantiation): New variable.
13212 * cvt.c (perform_qualification_conversions): New function.
13213 (perform_array_to_pointer_conversion): Likewise.
13214 * decl.c (duplicate_decls): Don't consider template functions
13215 alike unless they have the same parameters. Refine handling of
13216 instantiation/specialization mismatches.
13217 (start_decl): Don't call pushdecl for template specializations,
13218 since they don't affect overloading.
13219 (start_function): Likewise.
13220 (grokfndecl): Call check_explicit_specialization a little later.
13221 Don't call duplicate_decls for memberm template specializations.
13222 (grokdeclarator): Don't update template_count for classes that are
13223 themselves specializations. Remove use of `2' as parameter to
13224 grokfndecl since that value isn't used.
13225 * lex.c (cons_up_default_function): Save and restore
13226 processing_explicit_instantiation around calls to grokfield.
13227 * parse.y (finish_member_template_decl): New function.
13228 (component_decl_1): Use it.
13229 (fn.def2): Likewise.
13230 (template_arg_list_opt): New nonterminal.
13231 (template_type): Use it.
13232 (self_template_type): Likewise.
13233 (template_id): Likewise.
13234 (object_template_id): Likewise.
13235 (notype_template_declarator): Likwise.
13236 (begin_explicit_instantiation): Likewise.
13237 (end_explicit_instantiation): Likewise.
13238 (explicit_instantiation): Use them.
13239 * pt.c (coerce_template_parms): Add parameters.
13240 (processing_explicit_instantiation): New variable.
13241 (convert_nontype_parameter): New function.
13242 (determine_overloaded_function): Likewise.
13243 (begin_explicit_instantiation): Likewise.
13244 (end_explicit_instantiation): Likewise.
13245 (retrieve_specialization): Likewise.
13246 (register_specialization): Likewise.
13247 (processing_explicit_specialization): Removed.
13248 (determine_specialization): Handle specializations of member
13249 functions of template class instantiations.
13250 (check_explicit_specialization): Refine to conform to standard.
13251 (comp_template_parms): New function.
13252 (coerce_template_parms): Call convert_nontype_parameter.
13253 (tsubst): Refine handling of member templates. Use
13254 register_specialization.
13255 (instantiate_template): Use retrieve_specialization.
13256 (do_decl_instantiation): Likewise.
13257 (instantiate_decl): Likewise.
13258 (type_unification): Improve handling of explict template
13260 * tree.c (mapcar): Return error_mark_node, rather than aborting,
13261 on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
13262 * typeck.c (build_unary_op): Call determine_specialization, rather
13263 than determine_explicit_specialization.
13265 Mon Jan 19 13:18:51 1998 Jason Merrill <jason@yorick.cygnus.com>
13267 * cvt.c (build_up_reference): A TARGET_EXPR has side effects.
13269 Fri Jan 16 11:40:50 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13271 * error.c (dump_decl): For enum tags, output the tag, not its value.
13273 1998-01-13 Brendan Kehoe <brendan@cygnus.com>
13275 * decl.c (init_decl_processing): Only call init_rtti_processing
13278 Mon Jan 12 01:35:18 1998 Jason Merrill <jason@yorick.cygnus.com>
13280 * init.c (build_new_1): Split out from build_new.
13281 (build_new): Just return a NEW_EXPR.
13282 * expr.c (cplus_expand_expr): Handle NEW_EXPR.
13284 * decl2.c (get_temp_regvar): Tweak.
13286 * cp-tree.h (TREE_CALLS_NEW): Comment out.
13287 * class.c (resolves_to_fixed_type_p): Remove use.
13288 * method.c (build_opfncall): Likewise.
13289 * call.c (build_new_op): Likewise.
13291 Wed Jan 7 23:47:13 1998 Jason Merrill <jason@yorick.cygnus.com>
13293 * exception.cc (__eh_alloc, __eh_free): New fns.
13294 (__cp_push_exception, __cp_pop_exception): Use them.
13295 (__uncatch_exception): Call terminate here if no exception.
13296 * except.c (build_terminate_handler): New fn.
13297 (expand_start_catch_block): Use it.
13298 (expand_exception_blocks): Likewise.
13299 (alloc_eh_object): New fn.
13300 (expand_throw): Use it. Protect exception init with terminate.
13301 * typeck.c (build_modify_expr): Remove code that ignores trivial
13304 Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13306 * call.c (add_builtin_candidate): Add default case in enumeration
13308 (build_new_op): Likewise.
13309 (convert_like): Likewise.
13310 * cvt.c (build_expr_type_conversion): Likewise.
13311 * tree.c (real_lvalue_p): Likewise.
13312 (lvalue_p): Likewise.
13313 (cp_tree_equal): Likewise.
13314 * typeck.c (comptypes): Likewise.
13315 (build_component_ref): Likewise.
13316 (build_function_call_real): Likewise.
13317 (build_binary_op_nodefault): Likewise.
13318 (build_unary_op): Likewise.
13319 (build_modify_expr): Likewise.
13320 * typeck2.c (initializer_constant_valid_p): Likewise.
13322 Sun Dec 21 15:59:00 1997 Nick Clifton <nickc@cygnus.com>
13324 * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas.
13326 Thu Dec 18 14:51:50 1997 Mark Mitchell <mmitchell@usa.net>
13328 * pt.c (coerce_template_parms): Make sure to digest_init if
13331 * decl.c (duplicate_decls): Make the newdecl virtual if the
13332 olddecl was, just as is done with other attributes of olddecl.
13334 Thu Dec 18 14:43:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13336 * typeck.c (unary_complex_lvalue): Ignore op0 when taking the
13337 address of an OFFSET_REF.
13339 * cp-tree.def: Add AGGR_INIT_EXPR.
13340 * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
13341 AGGR_INIT_EXPR where appropriate.
13342 * expr.c (cplus_expand_expr): Likewise. Simplify.
13344 * decl2.c (finish_file): Remove call to register_exception_table.
13346 Wed Dec 17 17:08:52 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13348 * pt.c (instantiate_class_template): Don't do injection when
13349 processing_template_decl is true, as pollutes current_binding_level
13352 Wed Dec 17 21:17:39 1997 Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de>
13354 * pt.c (maybe_fold_nontype_arg): Add prototype.
13356 Tue Dec 16 10:31:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13358 * tree.c (mapcar): Handle TRY_CATCH_EXPR et al.
13359 * error.c (dump_expr): Likewise.
13361 Mon Dec 15 12:22:04 1997 Jason Merrill <jason@yorick.cygnus.com>
13363 * typeck.c (build_function_call_real): Remove "inline called before
13364 definition" pedwarn.
13366 * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg.
13368 Sun Dec 14 22:34:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13370 * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
13372 * pt.c (type_unification_real): Change __null to type void* with
13375 Sun Dec 14 20:38:35 1997 Mark Mitchell <mmitchell@usa.net>
13377 * call.c (implicit_conversion): Don't call
13378 build_user_type_conversion_1 with a NULL expr, since it will
13381 * pt.c (unify): Don't try to unify array bounds if either array is
13384 Fri Dec 12 16:09:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13386 * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at):
13387 Replace extern decls with casts.
13389 * decl.c (expand_start_early_try_stmts): Don't mess with a sequence.
13390 Update last_parm_cleanup_insn.
13391 (store_after_parms): Remove.
13392 * cp-tree.h: Adjust.
13394 Thu Dec 11 22:18:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13396 * decl2.c (comdat_linkage): Also set DECL_COMDAT.
13397 (finish_file): Check DECL_COMDAT instead of weak|one_only.
13398 (import_export_vtable): Use make_decl_one_only instead of
13399 comdat_linkage for win32 tweak.
13400 (import_export_decl): Likewise.
13401 * pt.c (mark_decl_instantiated): Likewise.
13403 * decl2.c (finish_file): Lose handling of templates in pending_statics.
13405 Thu Dec 11 21:12:09 1997 Jason Merrill <jason@yorick.cygnus.com>
13407 * decl2.c (finish_file): Lose call to expand_builtin_throw.
13408 * except.c (expand_builtin_throw): Remove.
13409 * cp-tree.h: Remove ptr_ptr_type_node.
13410 * decl.c: Likewise.
13412 Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
13414 * decl.c (ptr_ptr_type_node): Define.
13415 (init_decl_processing): Initialize it.
13416 * cp-tree.h: Declare it.
13417 * exception.cc (__cp_exception_info): Use __get_eh_info.
13418 (__cp_push_exception): Likewise.
13419 (__cp_pop_exception): Likewise.
13421 From Scott Snyder <snyder@d0sgif.fnal.gov>:
13422 * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
13424 (init_exception_processing): Removed saved_pc initialization.
13426 Wed Dec 10 11:04:45 1997 Jason Merrill <jason@yorick.cygnus.com>
13428 * pt.c (instantiate_decl): Defer all templates but inline functions.
13430 Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com>
13432 * init.c (expand_vec_init): Don't fold a list of parameters.
13434 * decl.c (copy_args_p): Handle copy elision for types with virtual
13436 * call.c (build_over_call): Likewise.
13438 Sun Dec 7 22:38:12 1997 Mark Mitchell <mmitchell@usa.net>
13440 * pt.c (lookup_template_function): Copy the template arguments,
13441 not just the list containing them, to the permanent obstack.
13443 Sun Dec 7 15:53:06 1997 Jason Merrill <jason@yorick.cygnus.com>
13445 * except.c (expand_start_catch_block): suspend_momentary for the
13448 * error.c (dump_decl): Handle LOOKUP_EXPR.
13450 Sun Dec 7 15:45:07 1997 Mark Mitchell <mmitchell@usa.net>
13452 * rtti.c (build_dynamic_cast): Copy the cast-to type to the
13453 permanent obstack if we are processing a template decl.
13454 * typeck.c (build_static_cast): Likewise.
13455 (build_const_cast): Likewise.
13456 (build_reinterpret_cast): Likewise.
13458 * pt.c (coerce_template_parms): Coerce some expressions, even
13459 when processing_template_decl.
13461 Sun Dec 7 01:46:33 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13463 * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
13464 handling of pointer difference expressions.
13466 * typeck.c (comp_target_types): Comparison of function/method types
13467 is independent of nptrs.
13469 Sun Dec 7 01:40:27 1997 Mark Mitchell <mmitchell@usa.net>
13471 * pt.c (tsubst): Avoid creating pointer to reference and
13472 reference to reference types.
13474 Sat Dec 6 01:29:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13476 * parse.y (do_id): New nonterminal.
13477 (template_id): Use it.
13479 Fri Dec 5 01:17:34 1997 Jason Merrill <jason@yorick.cygnus.com>
13481 * parse.y (template_id): do_identifier for PFUNCNAMEs, too.
13482 * spew.c (yylex): Don't do_identifier here.
13483 * decl2.c (build_expr_from_tree): Revert last change.
13485 * decl2.c (build_expr_from_tree): Expand the name for a method call.
13486 * parse.y (object_template_id): Don't try to take the DECL_NAME.
13488 Wed Dec 3 20:02:39 1997 Jason Merrill <jason@yorick.cygnus.com>
13490 * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for
13492 * call.c (build_op_delete_call): Adjust.
13494 * except.c (expand_end_catch_block): Lose rethrow region.
13495 (expand_start_catch_block): Likewise.
13496 (expand_end_catch_block): Don't expand_leftover_cleanups.
13498 Wed Dec 3 13:24:04 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13500 * pt.c (tsubst): Remove tree_cons call (places redundant info into
13501 DECL_TEMPLATE_INSTANTIATION).
13503 Wed Dec 3 11:44:52 1997 Jason Merrill <jason@yorick.cygnus.com>
13505 * tree.c (is_overloaded_fn): Handle getting a fn template.
13506 (really_overloaded_fn): Likewise.
13507 * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better.
13508 * pt.c (check_explicit_specialization): Tweak.
13509 (determine_explicit_specialization): Tweak.
13511 * tree.c, cp-tree.h (get_target_expr): New fn.
13513 Wed Dec 3 08:47:27 1997 Paul Eggert <eggert@twinsun.com>
13515 * pt.c (check_explicit_specialization): Fix misspelling in
13516 diagnostic: `preceeded'.
13517 * typeck.c (get_delta_difference): Fix misspelling in diagnostic:
13520 1997-12-02 Mark Mitchell <mmitchell@usa.net>
13522 * pt.c (determine_explicit_specialization): Avoid an internal
13523 error for bad specializations.
13525 * method.c (build_overload_value): Handle SCOPE_REF.
13527 Tue Dec 2 19:18:50 1997 Mike Stump <mrs@wrs.com>
13529 * class.c (prepare_fresh_vtable): Enable even more complex MI
13532 Tue Dec 2 01:37:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13534 * exception.cc (__check_eh_spec): Optimize a bit.
13536 * exception.cc (__cp_pop_exception): Lose handler arg.
13537 * except.c (do_pop_exception): Likewise.
13538 (push_eh_cleanup): Let the cleanup mechanism supply the handler.
13539 (expand_end_catch_block): Likewise.
13541 Fri Nov 28 01:58:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13543 * pt.c (check_explicit_specialization): Complain about using a
13544 template-id for a non-specialization.
13546 Fri Nov 28 12:35:19 1997 Scott Christley <scottc@net-community.com>
13548 * repo.c: Prototype rindex only if needed.
13549 * xref.c: Likewise.
13551 Fri Nov 28 01:56:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13553 * error.c (dump_decl): Handle TEMPLATE_ID_EXPR.
13555 Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com>
13557 * typeck.c (build_const_cast): Handle references here instead of
13558 handing off to convert_to_reference.
13560 * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
13561 TerminateFunctionCall.
13562 (init_exception_processing): Likewise. Terminate et al are now
13563 the fns, not ADDR_EXPRs.
13564 (various): Lose redundant assemble_external calls.
13565 (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/.
13567 * cp-tree.h (struct lang_decl_flags): Add comdat.
13568 (DECL_COMDAT): New macro.
13569 * decl.c (duplicate_decls): Propagate it.
13570 (cp_finish_decl): Handle it.
13571 * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs.
13573 * class.c: Remove static pending_hard_virtuals.
13574 (add_virtual_function): Take pointers to pending_virtuals
13575 and pending_hard_virtuals.
13576 (finish_struct_1): Pass them. Declare pending_hard_virtuals.
13578 Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com>
13580 * decl2.c (import_export_vtable): If we support one_only but not
13581 weak symbols, mark instantiated template vtables one_only.
13582 (import_export_decl): Likewise for tinfo functions.
13583 (finish_vtable_vardecl): Also write out vtables from explicitly
13584 instantiated template classes.
13585 * pt.c (mark_class_instantiated): Revert last change.
13587 * except.c (expand_throw): Call mark_used on the destructor.
13589 Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com)
13591 * lex.c (lang_init): Enable flag_exceptions by default if no
13592 command line switch was specified.
13594 1997-11-26 Mark Mitchell <mmitchell@usa.net>
13596 * pt.c (unify): Handle `void' template parameters in
13599 Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
13601 * rtti.c (build_dynamic_cast): Handle template case here.
13602 (build_dynamic_cast_1): Not here.
13604 * typeck2.c (digest_init): Make copies where appropriate.
13606 * decl2.c (delete_sanity): resolve_offset_ref.
13608 * except.c: Call terminate without caching so many bits.
13610 * except.c (expand_start_catch_block): Fix catching a reference
13613 Tue Nov 25 11:28:21 1997 Jason Merrill <jason@yorick.cygnus.com>
13615 * init.c (build_new): Copy size to the saveable obstack.
13617 * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the
13618 TRY_CATCH_EXPR for now.
13620 Mon Nov 24 12:15:55 1997 Jason Merrill <jason@yorick.cygnus.com>
13622 * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
13623 has DECL_LANG_SPECIFIC.
13625 * exception.cc (struct cp_eh_info): Add handlers field.
13626 (__cp_push_exception): Initialize it.
13627 (__cp_pop_exception): Decrement it. Don't pop unless it's 0.
13628 (__throw_bad_exception): Remove.
13629 * except.c (call_eh_info): Add handlers field.
13630 (get_eh_handlers): New fn.
13631 (push_eh_cleanup): Increment handlers.
13633 Fri Nov 21 12:22:07 1997 Jason Merrill <jason@yorick.cygnus.com>
13635 * except.c (expand_start_eh_spec): Use the try/catch code.
13636 (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of
13637 doing everything inline.
13638 (init_exception_processing): throw_type_match now takes
13639 const void pointers.
13640 * exception.cc (__check_eh_spec): New fn.
13641 * inc/exception: Neither terminate nor unexpected return.
13642 * decl.c: Make const_ptr_type_node public.
13643 * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly.
13645 * except.c (expand_start_catch_block): We only need the rethrow
13646 region for non-sjlj exceptions.
13647 (expand_end_catch_block): Likewise. Use outer_context_label_stack.
13649 Thu Nov 20 14:40:17 1997 Jason Merrill <jason@yorick.cygnus.com>
13651 * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
13652 (various.o): Likewise.
13653 * inc/new: Add placement deletes. Add throw specs for default new.
13654 * new.cc (set_new_handler): Move here from libgcc2.
13655 * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
13656 (new): Move from libgcc2. Throw bad_alloc.
13657 * new2.cc: Move the rest of the op news and op deletes from libgcc2.
13658 * decl.c (init_decl_processing): Update exception specs on new and
13661 * method.c (build_decl_overload_real): Don't mess with global
13664 * init.c (build_new): Check for null throw spec, not nothrow_t.
13666 * decl.c (duplicate_decls): Don't complain about different exceptions
13667 from an internal declaration.
13669 * call.c (build_op_delete_call): Fix check for member fns again.
13671 * decl2.c (import_export_decl): Interface hackery affects
13672 virtual synthesized methods.
13674 Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13676 * decl.c (start_decl): Don't just complain about a mismatched
13679 * decl.c (make_implicit_typename): Handle case where t is not
13680 actually from context.
13681 * tree.c (get_type_decl): Lose identifier case.
13682 * spew.c (yylex): Lose useless call to identifier_typedecl_value.
13683 * parse.y (nonnested_type): Just use lookup_name.
13684 (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
13686 Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
13688 * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
13689 T was built in C language context (for example, by
13690 output_func_start_profiler).
13692 Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
13694 * decl.c (make_implicit_typename): New fn.
13695 (lookup_name_real): Use it. Use current_class_type as the context.
13697 Mon Nov 17 23:42:03 1997 Bruno Haible <haible@ilog.fr>
13699 * pt.c (do_poplevel): Don't prohibit jumps into this contour.
13701 Mon Nov 17 02:01:28 1997 Jason Merrill <jason@yorick.cygnus.com>
13703 * friend.c (do_friend): Warn about non-template friends in templates.
13705 * call.c (build_op_delete_call): Fix handling of inherited delete.
13707 * search.c (dfs_record_inheritance): Ignore template type parms.
13709 Sat Nov 15 00:30:51 1997 Jason Merrill <jason@yorick.cygnus.com>
13711 * call.c (build_new_op): Fix copy error.
13712 (build_op_new_call): New fn.
13713 (build_op_delete_call): New fn.
13714 * cp-tree.h: Declare them.
13715 * init.c (build_new): Use them. Support placement delete.
13716 (build_x_delete): Use build_op_delete_call.
13717 (build_delete): Likewise.
13718 * decl2.c (delete_sanity): Likewise.
13719 (coerce_delete_type): Don't complain about placement delete.
13721 Thu Nov 13 01:52:36 1997 Jason Merrill <jason@yorick.cygnus.com>
13723 * call.c (build_new_function_call): Remove unused 'obj' parm.
13724 * cp-tree.h, typeck.c: Adjust.
13726 * init.c (build_new): Make the cleanup last longer.
13727 (expand_vec_init): Call do_pending_stack_adjust.
13729 Wed Nov 12 11:04:33 1997 Jason Merrill <jason@yorick.cygnus.com>
13731 * pt.c (do_type_instantiation): Fix typo.
13732 (mark_class_instantiated): If we support one_only but not weak
13733 symbols, don't mark this as known.
13735 * init.c (build_new): Handle vec delete in EH cleanup.
13737 Wed Nov 12 08:11:55 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13739 * call.c (build_method_call): Call complete_type before checking
13742 Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com)
13744 * decl.c (add_block_current_level): Delete.
13745 * init.c (build_vec_delete_1): Delete build_block and
13746 add_block_current_level calls.
13748 Wed Nov 12 00:48:16 1997 Jason Merrill <jason@yorick.cygnus.com>
13750 * init.c (build_new): Handle freeing allocated memory when the
13751 constructor throws.
13753 * call.c (build_new_method_call): Fix flags arg.
13755 * pt.c (do_type_instantiation): Don't try to instantiate
13757 (mark_decl_instantiated): If we support one_only but not
13758 weak symbols, mark this one_only.
13759 * decl2.c (import_export_vtable): Don't defer handling of vtables
13760 if MULTIPLE_SYMBOL_SPACES.
13762 Tue Nov 11 12:02:12 1997 Jason Merrill <jason@yorick.cygnus.com>
13764 * except.c (expand_end_catch_block): Lose call to __sjpopnthrow.
13766 Tue Nov 11 02:53:44 1997 Jason Merrill <jason@lasher.cygnus.com>
13768 * except.c (do_pop_exception): Return a value.
13770 Mon Nov 10 20:25:31 1997 Jason Merrill <jason@yorick.cygnus.com>
13772 * call.c (build_new_method_call): Handle getting a
13773 TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field
13774 if we got template parms.
13775 * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR,
13777 * decl2.c (build_expr_from_tree): Tweak last change.
13778 * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE.
13779 (maybe_fold_nontype_arg): Split out from tsubst_copy.
13780 * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR.
13782 Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
13784 * pt.c (tsubst_copy): Handle explicit template arguments in
13786 * typeck.c (build_x_function_call): Likewise.
13787 * decl2.c (build_expr_from_tree): Lookup function name if it
13790 * pt.c (tsubst): Instantiate template functions properly when
13791 template parameter does not appear in function arguments and return
13793 (comp_template_args): Handle member templates required by tsubst.
13795 Mon Nov 10 20:08:38 1997 Jason Merrill <jason@yorick.cygnus.com>
13797 * decl.c (grokdeclarator): Tweak conditions for pedwarn in
13800 Mon Nov 10 20:08:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13802 * pt.c (coerce_template_parms): Tweak error message.
13804 * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
13805 return type defaults to `int', even if there are storage-class
13808 Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13810 Complete nested exception support.
13811 * except.c (do_pop_exception): Split out...
13812 (push_eh_cleanup): From here. Handle the EH region by hand.
13813 (expand_start_catch_block): Add a new level for the catch parm.
13814 Move the rethrow region outside the two cleanup regions.
13815 Protect the initializer for the catch parm with terminate.
13816 (expand_end_catch_block): Likewise. End the region for the eh_cleanup.
13817 * exception.cc (__cp_pop_exception): Now takes two parms. Handle
13818 popping off the middle of the stack.
13819 * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
13820 WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
13821 (build_cplus_new): Only wrap CALL_EXPRs.
13822 * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
13823 the constructor call.
13825 Sun Nov 9 18:00:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13827 * Make-lang.in (c++.distdir): Make inc subdirectory.
13829 Fri Nov 7 11:57:28 1997 Jason Merrill <jason@yorick.cygnus.com>
13831 * decl2.c (finish_file): Put back some code.
13833 Thu Nov 6 11:28:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13835 * decl2.c (finish_file): Remove redundant code.
13836 * method.c (emit_thunk): Don't let the backend defer generic thunks.
13838 Wed Nov 5 23:52:50 1997 Jason Merrill <jason@yorick.cygnus.com>
13840 * except.c (call_eh_info): Split out...
13841 (push_eh_info): From here.
13842 (expand_builtin_throw): Use it.
13843 (expand_start_catch_block): Move region start back.
13845 Tue Nov 4 13:45:10 1997 Doug Evans <devans@canuck.cygnus.com>
13847 * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
13848 (real_yylex): Record wide strings using target endianness, not host.
13850 1997-11-03 Brendan Kehoe <brendan@lisa.cygnus.com>
13852 * repo.c (rindex): Add decl unconditionally.
13853 (get_base_filename, open_repo_file): Don't cast rindex.
13854 * xref.c (rindex): Add decl unconditionally.
13855 (index): Remove unused decl.
13856 (open_xref_file): Don't cast rindex.
13858 Sun Nov 2 15:04:12 1997 Jason Merrill <jason@yorick.cygnus.com>
13860 * class.c (build_vbase_path): Propagate the result type properly.
13862 1997-11-01 Brendan Kehoe <brendan@lisa.cygnus.com>
13864 * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
13865 remaining use of saved_throw_type with a call to get_eh_type.
13867 1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
13869 * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
13870 (file_name_nondirectory): New function, doing the same as the macro.
13871 (set_typedecl_interface_info): Use it instead of the macro.
13872 (check_newline): Likewise.
13873 (handle_cp_pragma): Likewise.
13875 * repo.c (get_base_filename): Cast result of rindex to char*.
13876 (open_repo_file): Likewise.
13877 * xref.c (open_xref_file): Likewise.
13878 * error.c (dump_char): Make its arg int, not char.
13880 * except.c (push_eh_info): Pass the number of fields - 1 down, not
13881 the exact number of fields.
13883 Fri Oct 31 01:47:57 1997 Jason Merrill <jason@yorick.cygnus.com>
13885 Support for nested exceptions.
13886 * tinfo2.cc (__is_pointer): New fn.
13887 * exception.cc (struct cp_eh_info): Define.
13888 (__cp_exception_info, __uncatch_exception): New fns.
13889 (__cp_push_exception, __cp_pop_exception): New fns.
13890 * except.c: Lose saved_throw_{type,value,cleanup,in_catch}.
13892 (init_exception_processing): Likewise. __eh_pc is now external.
13893 (push_eh_info): New fn.
13894 (get_eh_{info,value,type,caught}): New fns.
13895 (push_eh_cleanup): Just call __cp_pop_exception.
13896 (expand_start_catch_block): Use push_eh_info. Start the eh region
13898 (expand_end_eh_spec): Use push_eh_info.
13899 (expand_throw): Call __cp_push_exception to set up the exception info.
13900 Just pass the destructor or 0 as the cleanup. Call __uncatch_exception
13902 (expand_builtin_throw): Don't refer to empty_fndecl.
13904 Thu Oct 23 02:01:30 1997 Jason Merrill <jason@yorick.cygnus.com>
13906 * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl.
13908 1997-10-22 Brendan Kehoe <brendan@cygnus.com>
13910 * method.c (build_template_parm_names, build_decl_overload_real):
13911 Add static to definitions.
13912 * pt.c (add_to_template_args, note_template_header,
13913 processing_explicit_specialization, type_unification_real): Likewise.
13914 ({determine,check}_explicit_specialization): Use a single string for
13917 Mon Oct 20 12:06:34 1997 Jason Merrill <jason@yorick.cygnus.com>
13919 * except.c (expand_exception_blocks): Call do_pending_stack_adjust.
13920 (expand_end_catch_block): Likewise.
13921 (expand_end_eh_spec): Likewise.
13923 Mon Oct 20 11:44:20 1997 Mark Mitchell <mmitchell@usa.net>
13925 * decl.c (duplicate_decls): Handle template specializations
13927 * error.c (dump_function_name): Fix printing of specializations of
13928 member functions that are not member templates.
13929 * cp-tree.h (processing_specialization): Make global.
13930 * pt.c (processing_specialization): Likewise.
13931 * lex.c (cons_up_default_function): Save and restore
13932 processing_specialization to avoid confusion.
13934 Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
13936 * decl.c (init_decl_processing): Give null_node unknown* type.
13937 * typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
13938 (common_type): Likewise.
13939 * error.c (args_as_string): Recognize null_node.
13941 Sun Oct 19 09:13:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13943 * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
13944 (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
13946 * decl.c (init_decl_processing): Call using_eh_for_cleanups.
13948 * Make-lang.in (g++): Include prefix.o.
13950 Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
13952 * pt.c (determine_explicit_specialization): Initialize "dummy"
13953 to keep Purify quiet.
13955 Thu Oct 16 00:14:48 1997 Jason Merrill <jason@yorick.cygnus.com>
13957 * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here.
13958 (build_overload_int): Not here.
13960 Wed Oct 15 00:35:28 1997 Mike Stump <mrs@wrs.com>
13962 * class.c (build_type_pathname): Remove.
13963 (prepare_fresh_vtable): Fix problem with complex MI vtable names.
13965 1997-10-14 Brendan Kehoe <brendan@lisa.cygnus.com>
13967 * parse.y (unary_expr): Give a pedwarn if someone tries to use the
13968 &&label GNU extension.
13970 Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
13972 * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it,
13973 so as to avoid incorrect manglings.
13974 * method.c (build_decl_overload_real): Don't mangle return types
13977 Tue Oct 14 11:46:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13979 * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
13980 scratch_tree_cons): Define as macros for now.
13981 * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
13982 lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
13983 typeck2.c: Use them and the expression_obstack variants.
13985 Mon Oct 13 17:41:26 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13987 * decl.c (store_return_init): Allow classes with explicit ctors to
13988 be used with the named return values extension.
13990 Fri Oct 10 12:21:11 1997 Jason Merrill <jason@yorick.cygnus.com>
13992 * pt.c (instantiate_decl): Fix previous change.
13994 Thu Oct 9 12:08:21 1997 Jason Merrill <jason@yorick.cygnus.com>
13996 * pt.c (tsubst): Fix thinko.
13997 (instantiate_decl): Really use the original template.
13999 * call.c (build_new_method_call): Use simple constructor_name for
14002 Wed Oct 8 22:44:42 1997 Jeffrey A Law <law@cygnus.com>
14004 * method.c (build_underscore_int): Don't use ANSI specific
14007 Wed Oct 8 00:18:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14009 * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN
14010 for our key method; it might have been inlined by -O3.
14012 Tue Oct 7 23:00:12 1997 Mark Mitchell <mmitchell@usa.net>
14014 * decl.c (make_typename_type): Do not try to call lookup_field for
14015 non-aggregate types.
14017 Tue Oct 7 22:52:10 1997 Jason Merrill <jason@yorick.cygnus.com>
14019 * typeck.c (build_reinterpret_cast): Tweak.
14021 Tue Oct 7 22:45:31 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14023 * typeck.c (build_reinterpret_cast): Converting a void pointer
14024 to function pointer with a reinterpret_cast produces a warning
14025 if -pedantic is issued.
14027 Tue Oct 7 22:43:43 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14029 * typeck.c (c_expand_return): Don't warn about returning a
14030 reference-type variable as a reference.
14032 Tue Oct 7 21:11:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14034 * method.c (build_static_name): Fix typo.
14036 1997-10-07 Brendan Kehoe <brendan@lisa.cygnus.com>
14038 * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on
14039 OLDDECL before we try to do DECL_USE_TEMPLATE.
14041 Tue Oct 7 00:48:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14043 * decl.c (duplicate_decls): Don't warn about template instances.
14045 * typeck.c (mark_addressable): Lose ancient code that unsets
14048 * pt.c (do_decl_instantiation): Lose support for instantiating
14051 * call.c (build_new_function_call): Fix handling of null explicit
14053 (build_new_method_call): Likewise.
14055 Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net>
14057 * method.c (build_underscore_int): Fix typo.
14059 1997-10-06 Brendan Kehoe <brendan@lisa.cygnus.com>
14061 * tree.c (print_lang_statistics): #if 0 call to
14062 print_inline_obstack_statistics until its definition is checked in.
14064 Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14066 * decl2.c (finish_file): Move dump_tree_statistics to end.
14068 * pt.c (instantiate_decl): Look for the original template.
14069 (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
14070 of member templates.
14072 Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14074 * Makefile.in (g++FAQ.*): New rules.
14075 (CONFLICTS): Update.
14076 * g++FAQ.texi: Moved from libg++.
14078 * parse.y (PFUNCNAME): Only specify the type once.
14080 1997-10-01 Brendan Kehoe <brendan@lasher.cygnus.com>
14082 * lex.c (real_yylex): Clean up the code to fully behave the way
14083 the c-lex.c parser does for complex and real numbers.
14085 Tue Sep 30 08:51:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14087 * method.c (build_decl_overload_real): Reformat.
14089 Tue Sep 30 00:18:26 1997 Jason Merrill <jason@yorick.cygnus.com>
14091 * method.c (synthesize_method): If at_eof, determine our linkage.
14093 1997-09-29 Paul Eggert <eggert@twinsun.com>
14095 * lex.c (real_yylex): Treat `$' just like `_', except issue a
14096 diagnostic if !dollars_in_ident or if pedantic.
14098 * lang-specs.h (@c++): -ansi no longer implies -$.
14100 * decl2.c (lang_decode_option):
14101 -traditional and -ansi now do not mess with
14104 Mon Sep 29 19:57:51 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
14106 * Makefile.in (parse.o, decl.o): Also depend on
14107 $(srcdir)/../except.h $(srcdir)/../output.h.
14108 (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
14109 $(srcdir)/../except.h $(srcdir)/../output.h.
14110 (typeck.o, init.o): Also depend on $(srcdir)/../expr.h
14113 * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.
14115 * expr.c (cplus_expand_expr): Make it static.
14117 * decl2.c, init.c, typeck.c: Include "expr.h".
14118 (expand_expr): Use proper values when calling the function.
14120 Mon Sep 29 11:05:54 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14122 * lang-options.h: New -Wold-style-cast flag.
14123 * cp-tree.h (warn_old_style_cast): New variable.
14124 * decl2.c (warn_old_style_cast): Likewise.
14125 (lang_decode_option): Support -Wold-style-cast.
14126 (reparse_absdcl_as_casts): Produce old-style-cast warning.
14128 Mon Sep 29 09:20:53 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14130 * decl.c (cp_finish_decl): Allow expand_aggr_init to set
14131 TREE_USED, reset value based on already_used.
14133 * init.c (expand_member_init): Revert change.
14135 Mon Sep 29 08:57:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14137 * cp-tree.h, decl.c, decl2.c, pt.c:
14138 Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public.
14140 * decl2.c (lang_decode_option): Add missing ;.
14142 Sat Sep 27 16:22:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14144 * friend.c (do_friend): Disable injection for all template-derived
14146 * decl2.c (lang_decode_option): Handle -fguiding-decls.
14147 * parse.y (notype_template_declarator): New nonterminal.
14148 (direct_notype_declarator): Use it.
14149 (complex_direct_notype_declarator): Likewise.
14150 (object_template_id): Accept any kind of identifier after TEMPLATE.
14151 (notype_qualified_id): Don't add template declarators here.
14153 Sat Sep 27 16:21:58 1997 Mark Mitchell <mmitchell@usa.net>
14155 * call.c (add_template_candidate): Add explicit_targs parameter.
14156 (build_scoped_method_call): Use it.
14157 (build_overload_call_real): Likewise.
14158 (build_user_type_conversion_1): Likewise.
14159 (build_new_function_call): Likewise.
14160 (build_object_call): Likewise.
14161 (build_new_op): Likewise.
14162 (build_new_method_call): Likewise.
14163 (build_new_function_call): Handle TEMPLATE_ID_EXPR.
14164 (build_new_method_call): Likewise.
14166 * class.c (finish_struct_methods): Add specialization pass to
14167 determine which methods were specializing which other methods.
14168 (instantiate_type): Handle TEMPLATE_ID_EXPR.
14170 * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.
14172 * cp-tree.h (name_mangling_version): New variable.
14173 (flag_guiding_decls): Likewise.
14174 (build_template_decl_overload): New function.
14175 (begin_specialization): Likewise.
14176 (reset_specialization): Likewise.
14177 (end_specialization): Likewise.
14178 (determine_explicit_specialization): Likewise.
14179 (check_explicit_specialization): Likewise.
14180 (lookup_template_function): Likewise.
14181 (fn_type_unification): Add explicit_targs parameter.
14182 (type_unification): Likewise.
14184 * decl.c (duplicate_decls): Add smarts for explicit
14186 (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
14188 (grokfndecl): Call check_explicit_specialization.
14190 * decl2.c (lang_decode_option): Handle -fname-mangling-version.
14191 (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
14192 (check_classfn): Handle specializations.
14194 * error.c (dump_function_name): Print specialization arguments.
14196 * friend.c (do_friend): Don't call pushdecl for template
14199 * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.
14201 * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
14202 and -fno-guiding-decls.
14204 * lex.c (identifier_type): Return PFUNCNAME for template function
14207 * method.c (build_decl_overload_real): New function.
14208 (build_template_parm_names): New function.
14209 (build_overload_identifier): Use it.
14210 (build_underscore_int): New function.
14211 (build_overload_int): Use it. Add levels for template
14213 (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs.
14214 (build_overload_nested_names): Handle template type parameters.
14215 (build_template_decl_overload): New function.
14217 * parse.y (YYSTYPE): New ntype member.
14218 (nested_name_specifier): Use it.
14219 (nested_name_specifier_1): Likewise.
14220 (PFUNCNAME): New token.
14221 (template_id, object_template_id): New non-terminals.
14222 (template_parm_list): Note specializations.
14223 (template_def): Likewise.
14224 (structsp): Likewise.
14225 (fn.def2): Handle member template specializations.
14226 (component_decl_1): Likewise.
14227 (direct_notype_declarator): Handle template-ids.
14228 (component_decl_1): Likewise.
14229 (direct_notype_declarator): Handle template-ids.
14230 (primary): Handle TEMPLATE_ID_EXPR, and template-ids.
14232 * pt.c (processing_specializations): New variable.
14233 (template_header_count): Likewise.
14234 (type_unification_real): New function.
14235 (processing_explicit_specialization): Likewise.
14236 (note_template_header): Likewise.
14237 (is_member_template): Handle specializations.
14238 (end_template_decl): Call reset_specialization.
14239 (push_template_decl): Handle member template specializations.
14240 (tsubst): Likewise.
14241 (tsubst_copy): Handle TEMPLATE_ID_EXPR.
14242 (instantiate_template): Handle specializations.
14243 (instantiate_decl): Likewise.
14244 (fn_type_unification): Handle explicit_targs.
14245 (type_unification): Likewise. Allow incomplete unification
14246 without an error message, if allow_incomplete.
14247 (get_bindings): Use new calling sequence for fn_type_unification.
14249 * spew.c (yylex): Handle PFUNCNAME.
14251 * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
14252 (really_overloaded_fn): Likewise.
14253 (get_first_fn): Handle function templates.
14255 * typeck.c (build_x_function_call): Use really_overloaded_fn.
14256 Handle TEMPLATE_ID_EXPR.
14257 (build_x_unary_op): Likewise.
14258 (build_unary_op): Likewise.
14259 (mark_addressable): Templates whose address is taken are marked
14262 1997-09-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14264 * decl.c (init_decl_processing): Declare __builtin_constant_p as
14265 accepting any kind of type, not only int.
14267 Fri Sep 26 00:22:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14269 * search.c (get_matching_virtual): Notice virtual bases when sorrying
14270 about covariant returns.
14272 * parse.y (member_init): Also imply typename here. Remove ancient
14273 extension for initializing base members.
14275 Thu Sep 25 11:11:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14277 Handle multi-level typenames and implicit typename in base list.
14278 * parse.y (typename_sub{,[0-2]}): New rules.
14279 (structsp, rule TYPENAME_KEYWORD): Use typename_sub.
14280 (nonnested_type): New rule.
14281 (complete_type_name): Use it.
14282 (base_class.1): Use typename_sub and nonnested_type.
14283 (nested_name_specifier): Don't elide std:: here.
14284 * decl.c (make_typename_type): Handle getting a type for NAME.
14285 (lookup_name_real): Turn std:: into :: here.
14287 Rvalue conversions were removed in London.
14288 * call.c (is_subseq): Don't consider lvalue transformations.
14289 (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK.
14290 (joust): Re-enable ?: kludge.
14292 1997-09-22 Brendan Kehoe <brendan@lisa.cygnus.com>
14294 * decl.c (start_function): Up warning of no return type to be a
14297 Mon Sep 22 14:15:34 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14299 * init.c (expand_member_init): Don't set TREE_USED.
14300 * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
14301 set,don't clear TREE_USED wholesale.
14303 Sat Sep 20 15:31:00 1997 Jason Merrill <jason@yorick.cygnus.com>
14305 * call.c (build_over_call): Do require_complete_type before
14308 Thu Sep 18 16:47:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14310 * search.c (lookup_field): Call complete_type in all cases.
14312 * decl.c (finish_function): Just warn about flowing off the end.
14314 Wed Sep 17 10:31:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14316 * decl.c (grokparms): Don't bash a permanent list node if we're
14319 1997-09-17 Brendan Kehoe <brendan@lisa.cygnus.com>
14321 * Makefile.in (CONFLICTS): Fix s/r conflict count to 18.
14323 Tue Sep 16 14:06:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14325 * call.c (build_new_op): Give better error for syntactically
14326 correct, but semantically invalid, use of undeclared template.
14328 * call.c (compare_qual): Handle pmfs.
14330 * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
14331 after the exception spec.
14333 Mon Sep 15 11:52:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14335 * call.c (null_ptr_cst_p): Integer type, not integral type.
14337 * call.c (joust): Disable warnings until they can be moved to the
14340 Fri Sep 12 16:11:13 1997 Per Bothner <bothner@cygnus.com>
14342 * Makefile.in, config-lang.in: Convert to autoconf.
14344 Thu Sep 11 17:14:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14346 * decl.c (lookup_name_real): Add implicit 'typename' to types from
14349 * pt.c (most_specialized_class): Fix typo.
14350 (tsubst): Move constant folding to TREE_VEC case.
14352 Thu Sep 11 10:08:45 1997 Mark Mitchell <mmitchell@usa.net>
14354 * pt.c (do_poplevel): Don't warn about unused local variables
14355 while processing_template_decl since we don't always know whether
14356 or not they will need constructing/destructing.
14358 * pt.c (uses_template_parms): Check the values of an enumeration
14359 type to make sure they don't depend on template parms.
14361 * decl.c (make_typename_type): Don't lookup the field if the
14362 context uses template parms, even if we're not
14363 processing_template_decl at the moment.
14365 * pt.c (coerce_template_parms): Avoid looking at the
14366 TYPE_LANG_DECL portion of a typename type, since there won't be
14368 (tsubst): Do constant folding as necessary to make sure that
14369 arguments passed to lookup_template_class really are constants.
14371 Wed Sep 10 11:21:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14373 * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO.
14374 * decl2.c (finish_file): Only register exception tables if we
14377 * decl.c (init_decl_processing): Add __builtin_[fs]p.
14379 Tue Sep 9 19:49:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14381 * pt.c (unify): Just return 0 for a TYPENAME_TYPE.
14383 Tue Sep 9 17:57:25 1997 Mark Mitchell <mmitchell@usa.net>
14385 * error.c (dump_decl): Avoid crashing when presented with a
14386 uninitialized constant, as can occur with a template parameter.
14387 (dump_expr): Make sure that there are enough levels of
14388 current_template_parms before we start diving through them.
14390 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
14392 * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to
14395 Tue Sep 9 09:36:39 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14397 * except.c (expand_throw): Call build_delete for all
14398 exception types, not just objects with destructors.
14400 Mon Sep 8 02:33:20 1997 Jody Goldberg <jodyg@idt.net>
14402 * decl.c (current_local_enum): Remove static.
14403 * pt.c (tsubst_enum): Save and restore value of current_local_enum
14404 in case template is expanded in enum decl.
14405 (instantiate_class_template): Use new tsubst_enum signature.
14406 (tsubst_expr): Likewise.
14408 Mon Sep 8 01:21:43 1997 Mark Mitchell <mmitchell@usa.net>
14410 * pt.c (begin_member_template_processing): Take a function as
14411 argument, not a set of template arguments. Use the template
14412 parameters, rather than the arguments. Handle non-type parameters
14413 correctly. Push a binding level for the parameters so that multiple
14414 member templates using the same parameter names can be declared.
14415 (end_member_template_processing): Pop the binding level.
14416 (push_template_decl): Mark member templates as static when
14419 * lex.c (do_pending_inlines): Pass the function, not its template
14420 arguments, to begin_member_template_processing.
14421 (process_next_inline): Likewise.
14422 (do_pending_defargs): Likewise.
14424 * error.c (dump_expr): Obtain the correct declaration for a
14425 TEMPLATE_CONST_PARM.
14427 * call.c (add_template_conv_candidate): New function.
14428 (build_object_call): Handle member templates, as done in the other
14431 Sat Sep 6 10:20:27 1997 Mark Mitchell <mmitchell@usa.net>
14433 * decl.c (replace_defag): Undo previous change.
14434 * lex.c (do_pending_defargs): Deal with member templates.
14436 * pt.c (is_member_template): Avoid crashing when passed a
14437 non-function argument.
14439 Fri Sep 5 17:27:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14441 * class.c (grow_method): Remove check for redeclaration.
14443 Fri Sep 5 01:37:17 1997 Mark Mitchell <mmitchell@usa.net>
14445 * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
14446 (DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
14447 (PRIMARY_TEMPLATE_P): Use it.
14448 * call.c (build_overload_call_real): Use it.
14449 * class.c (instantiate_type): Likewise.
14450 * decl.c (decls_match): Likewise.
14451 * method.c (build_overload_identifier): Likewise.
14452 * pt.c (push_template_decl): Likewise.
14453 (classtype_mangled_name): Likewise.
14454 (lookup_template_class): Likewise.
14456 * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
14457 DECL_NTPARMS to conform to usage elsewhere.
14458 * call.c (add_template_candidate): Likewise.
14459 * class.c (instantiate_type): Likewise.
14460 * pt.c (instantiate_template): Likewise.
14461 (get_bindings): Likewise.
14463 * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
14464 is_member_template.
14466 * pt.c (unify): Undo changes to allow multiple levels of template
14468 (type_unification): Likewise.
14469 (fn_type_unification): Likewise.
14470 (get_class_bindings): Likewise.
14471 * cp-tree.h (Likewise).
14473 * decl.c (replace_defarg): Check that the type of the default
14474 parameter does not invlove a template type before complaining
14475 about the initialization.
14477 * error.c (dump_expr): Deal with template constant parameters in
14478 member templates correctly.
14480 * pt.c (is_member_template): Deal with class specializations
14482 (tsubst): Handle "partial instantiation" of member templates
14485 Wed Sep 3 12:30:24 1997 Mark Mitchell <mmitchell@usa.net>
14487 * pt.c (type_unification): Change calling sequence to allow for
14488 multiple levels of template parameters.
14489 (tsubst_expr): Likewise.
14490 (tsubst): Likewise.
14491 (tsubst_copy): Likewise.
14492 (instantiate_template): Likewise.
14494 * call.c (build_overload_call_real): Use it.
14495 (add_builtin_candidate): Use it.
14496 (build_new_method_call): Use it.
14497 * class.c (instantiate_type): Use it.
14498 * decl.c (grokdeclarator): Use it.
14499 * decl2.c (finish_file): Use it.
14500 * method.c (build_overload_identifier): Use it.
14502 * call.c (add_template_candidate): Add additional parameter for
14503 the function return type. Call fn_type_unification istead of
14505 (build_user_type_conversion_1): Handle member templates.
14506 (build_new_function_call): Likewise.
14507 (build_new_op): Likewise.
14508 (build_new_method_call): Likewise.
14510 * class.c (grow_method): Don't give an error message indicating
14511 that two member templates with the same name are ambiguous.
14512 (finish_struct): Treat member template functions just like member
14515 * cp-tree.h (check_member_template): Add declaration.
14516 (begin_member_template_processing): Likewise.
14517 (end_member_template_processing): Likewise.
14518 (fn_type_unification): Likewise.
14519 (is_member_template): Likewise.
14520 (tsubst): Change prototype.
14521 (tsubst_expr): Likewise.
14522 (tsubst_copy): Likewise.
14523 (instantiate_template): Likewise.
14524 (get_bindings): Likewise.
14526 * decl.c (decls_match): Handle multiple levels of template
14528 (pushdecl): Handle template type params just like other type
14530 (push_class_level_binding): Return immediately if the
14531 class_binding_level is NULL.
14532 (grokfndecl): If check_classfn() returns a member_template, use
14533 the result of the template, not the template itself.
14535 * decl2.c (check_member_template): New function. Check to see
14536 that the entity declared to be a member template can be one.
14537 (check_classfn): Allow redeclaration of member template functions
14538 with different types; the new functions can be specializations or
14539 explicit instantiations.
14541 * error.c (dump_decl): Handle multiple levels of template
14543 (dump_function_decl): Update to handle function templates.
14545 * lex.c (do_pending_inlines): Set up template parameter context
14546 for member templates.
14547 (process_next_inline): Likewise.
14549 * method.c (build_overload_identifier): Adjust for multiple levels
14550 of template parameters.
14552 * parse.y (fn.def2): Add member templates.
14553 (component_decl_1): Likewise.
14555 * pt.c (begin_member_template_processing): New function.
14556 (end_member_template_processing): Likewise.
14557 (is_member_template): Likewise.
14558 (fn_type_unification): Likewise.
14559 (current_template_parms): Return a vector of all the template
14560 parms, not just the innermost level of parms.
14561 (push_template_decl): Deal with the possibility of member
14563 (lookup_template_class): Likewise.
14564 (uses_template_parms): Likewise.
14565 (tsubst): Modify processing to TEMPLATE_TYPE_PARM and
14566 TEMPLATE_CONST_PARM to deal with multiple levels of template
14567 arguments. Add processing of TEMPLATE_DECL to produce new
14568 TEMPLATE_DECLs from old ones.
14569 (do_decl_instantiation): Handle member templates.
14571 * search.c (lookup_fnfields_1): Handle member template conversion
14574 * tree.c (cp_tree_equal): Check the levels, as well as the
14575 indices, of TEMPLATE_CONST_PARMs.
14577 * typeck.c (comptypes): Check the levels, as well as the indices,
14578 fo TEMPLATE_TYPE_PARMs.
14579 (build_x_function_call): Treat member templates like member
14582 Wed Sep 3 11:09:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14584 * typeck.c (c_expand_return): Always convert_for_initialization
14585 before checking for returning a pointer to local.
14587 * pt.c (type_unification): If strict and the function parm doesn't
14588 use template parms, just compare types.
14590 Wed Sep 3 10:35:49 1997 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
14592 * method.c (build_overloaded_value): Replace direct call
14593 to the floating point emulator with REAL_VALUE_TO_DECIMAL macro.
14595 Wed Sep 3 00:02:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14597 * typeck.c (convert_arguments): Don't arbitrarily choose the first
14598 of a set of overloaded functions.
14600 Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14602 * lex.c (real_yylex): Don't elide __FUNCTION__.
14604 * method.c (build_overload_value): Add in_template parm.
14605 (build_overload_int): Likewise.
14606 (build_overload_identifier): Pass it.
14608 * decl.c (duplicate_decls): Don't bash a previous template
14609 definition with a redeclaration.
14611 * pt.c (unify): float doesn't match double.
14613 * pt.c (do_type_instantiation): Handle getting a _TYPE or a
14614 TYPE_DECL. Handle getting non-template types.
14615 * parse.y (explicit_instantiation): Use typespec instead of
14616 aggr template_type.
14618 Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
14620 * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
14622 Mon Sep 1 13:19:04 1997 Eugene Mamchits <eugin@ips.ras.ru>
14624 * call.c (add_builtin_candidate): Add missing TREE_TYPE.
14625 (compare_ics): Likewise.
14627 Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14629 * call.c (joust): Warn about choosing one conversion op over
14630 another because of 'this' argument when the other return type is
14632 (source_type): New fn.
14634 * call.c (build_new_op): Strip leading REF_BIND from first operand
14635 to builtin operator.
14637 * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
14640 Thu Aug 28 09:45:23 1997 Jason Merrill <jason@yorick.cygnus.com>
14642 * call.c (null_ptr_cst_p): Remove support for (void*)0.
14644 Wed Aug 27 02:03:34 1997 Jeffrey A Law <law@cygnus.com>
14646 * typeck.c (expand_target_expr): Make definition match declaration.
14648 * class.c (get_basefndecls): Make definition match declaration.
14650 Mon Aug 25 14:30:02 1997 Jason Merrill <jason@yorick.cygnus.com>
14652 * input.c (sub_getch): Eventually give up and release the input file.
14654 * decl.c (cp_finish_decl): If #p i/i, put inline statics in the
14657 * call.c (joust): Tweak message.
14659 Sat Aug 23 18:02:59 1997 Mark Mitchell <mmitchell@usa.net>
14661 * error.c (type_as_string): Put const/volatile on template type
14662 parameters where appropriate.
14664 Sat Aug 23 17:47:22 1997 Jeffrey A Law <law@cygnus.com>
14666 * call.c (strictly_better): Make arguments unsigned ints.
14668 Thu Aug 21 18:48:44 1997 Jason Merrill <jason@yorick.cygnus.com>
14670 * lex.c (real_yylex): Refer to __complex instead of complex.
14672 Thu Aug 21 22:25:46 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
14674 * lex.c (real_yylex): Don't use getc directly.
14676 Wed Aug 20 17:25:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14678 * call.c (is_subseq): Don't try to be clever.
14680 Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
14682 * parse.y, pt.c: Include "except.h".
14683 * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
14684 error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
14685 lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
14686 sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
14689 Wed Aug 20 01:34:40 1997 Jason Merrill <jason@yorick.cygnus.com>
14691 * decl2.c (mark_vtable_entries): Instead of replacing pure
14692 virtuals with a reference to __pure_virtual, copy the decl and
14695 Tue Aug 19 02:26:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14697 * pt.c (lookup_nested_type_by_name): Handle typedef wierdness.
14699 * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com.
14701 * pt.c (instantiate_class_template): Call repo_template_used
14702 before finish_prevtable_vardecl.
14704 * call.c (is_subseq): New fn.
14705 (compare_ics): Use it.
14707 * repo.c (finish_repo): Don't crash on no args.
14709 * parse.y (named_complex_class_head_sans_basetype): Handle
14710 explicit global scope.
14711 * decl2.c (handle_class_head): New fn.
14713 * pt.c (unify): Add CONST_DECL case.
14715 Thu Aug 14 10:05:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14717 * rtti.c (permanent_obstack): Fix decl to not be a pointer.
14719 * cp-tree.h (report_type_mismatch): Add prototype.
14720 * call.c (build_overload_call_real): Remove erroneous fourth
14721 argument to report_type_mismatch.
14722 (build_user_type_conversion_1): Remove erroneous second arg to
14724 (build_new_function_call): Likewise.
14725 (build_object_call): Likewise.
14726 (build_new_op): Likewise.
14727 (build_new_method_call): Likewise.
14729 Wed Aug 13 19:19:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14731 * error.c (dump_decl): Don't bother processing a function with no
14732 DECL_LANG_SPECIFIC.
14734 * method.c (emit_thunk): Call init_function_start in the macro case.
14736 Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
14738 * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
14739 defined and used to set flag_vtable_thunks.
14741 Tue Aug 12 20:13:57 1997 Jason Merrill <jason@yorick.cygnus.com>
14743 * parse.y: Don't clear the inlines from their obstack until they've
14744 all been processed.
14746 * decl.c (duplicate_decls): Don't complain about exception
14747 specification mismatch if flag_exceptions is off.
14749 Mon Aug 11 15:01:56 1997 Marc Lehmann <pcg@goof.com>
14751 * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
14753 Sun Aug 10 12:06:09 1997 Paul Eggert <eggert@twinsun.com>
14755 * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
14756 * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
14757 Include <stdio.h> before include files that formerly used STDIO_PROTO.
14759 * decl.c, g++spec.c, lex.c, method.c, repo.c:
14760 Include "config.h" first, as per autoconf manual.
14762 Fri Aug 8 11:47:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14764 * decl.c (duplicate_decls): Tweak wording.
14765 * lex.c (do_pending_defargs): Don't die if we see a default arg
14766 that isn't a DEFAULT_ARG.
14767 * error.c (dump_expr): Handle DEFAULT_ARG.
14769 * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
14770 * lang-options.h: Add -fhandle-exceptions.
14772 * class.c (build_vtable): Vtables are artificial.
14773 (prepare_fresh_vtable): Likewise.
14775 Wed Aug 6 11:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14777 * cvt.c (ocp_convert): After converting to the target type, set
14778 LOOKUP_NO_CONVERSION.
14780 * call.c (joust): Warn about potentially confusing promotion rules
14782 * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
14784 Tue Aug 5 15:15:07 1997 Michael Meissner <meissner@cygnus.com>
14786 * exception.cc: Declare __terminate_func with noreturn attribute.
14788 Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
14790 * parse.y: Break out eat_saved_input, handle errors.
14791 (function_try_block): Use compstmt instead of compstmt_or_error.
14793 Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14795 * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
14797 Fri Jul 4 01:45:16 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14799 * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
14800 existence of cc1plus check whether $(LANGUAGES) contains C++.
14802 Wed Jul 30 13:04:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14804 * method.c (do_build_copy_constructor): When copying an anonymous
14805 union member loop around to handle nested anonymous unions. Use
14806 the offset of the member relative to the outer structure, not the
14809 Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14811 * call.c (resolve_args): New fn.
14812 (build_new_function_call): Use it.
14813 (build_object_call): Likewise.
14814 (build_new_method_call): Likewise.
14816 Mon Jul 28 16:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14818 * call.c (build_over_call): tsubst all default parms from templates.
14820 Wed Jul 23 13:36:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14822 * decl.c (struct cp_function): Add static_labelno.
14823 (push_cp_function_context): Save it.
14824 (pop_cp_function_context): Restore it.
14826 Tue Jul 22 14:43:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14828 * typeck.c (build_component_ref_1): Convert from reference.
14830 Tue Jul 22 11:06:23 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14832 * parse.y (current_declspecs, prefix_attributes): Initialize to
14835 * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil
14836 before we try to force it to be a TREE_LIST.
14837 (decl): Make sure $1.t is non-nil.
14839 Sun Jul 20 11:53:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14841 * pt.c (uses_template_parms): Handle template first-parse codes.
14843 * decl.c (cp_finish_decl): Only warn about user-defined statics.
14845 Fri Jul 18 17:56:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14847 * pt.c (unify): Handle BOOLEAN_TYPE.
14849 * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE.
14850 * pt.c (tsubst): Don't set it.
14851 * call.c (build_over_call): Use uses_template_parms.
14853 Thu Jul 17 18:06:30 1997 Jason Merrill <jason@yorick.cygnus.com>
14855 * method.c (build_overload_nested_name): Use static_labelno
14856 instead of var_labelno.
14857 (build_qualified_name): New fn.
14858 (build_overload_name): Split out from here.
14859 (build_static_name): Use build_qualified_name.
14860 * decl.c (cp_finish_decl): Statics in extern inline functions
14861 have comdat linkage.
14862 (start_function): Initialize static_labelno.
14864 Thu Jul 17 11:20:17 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14866 * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy
14867 before "all member functions in class [] are private".
14869 Wed Jul 16 23:47:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14871 * lex.c (do_scoped_id): convert_from_reference.
14872 * init.c (build_offset_ref): Likewise.
14874 Wed Jul 16 12:34:29 1997 Benjamin Kosnik <bkoz@lisa.cygnus.com>
14876 * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list.
14878 Mon Jul 14 03:23:46 1997 Jason Merrill <jason@yorick.cygnus.com>
14880 * typeck.c (get_member_function_from_ptrfunc): Promote index
14883 Sun Jul 13 00:11:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14885 * tree.c (layout_basetypes): Move non-virtual destructor warning.
14886 * decl.c (xref_basetypes): Remove non-virtual destructor warning.
14888 Sat Jul 12 12:47:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14890 * decl.c (grokdeclarator): Call add_defarg_fn for the function
14892 * lex.c (add_defarg_fn): Adjust.
14893 (do_pending_defargs): Adjust. Don't skip the first parm.
14895 Fri Jul 11 01:39:50 1997 Jason Merrill <jason@yorick.cygnus.com>
14897 * decl.c (build_enumerator): Global enumerators are also readonly.
14899 * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast.
14900 (build_dynamic_cast): Call it and convert_from_reference.
14902 * lex.c (add_defarg_fn): New fn.
14903 (snarf_defarg): Don't add to defarg_types.
14904 (do_pending_defargs): Lose defarg_types. All fns we process now
14906 * decl.c (grokfndecl): Call add_defarg_fn.
14908 * Makefile.in (CONFLICTS): Expect 18 s/r conflicts.
14909 * cp-tree.def: Add DEFAULT_ARG.
14910 * spew.c (yylex): Call snarf_defarg as appropriate.
14911 * parse.y: New tokens DEFARG and DEFARG_MARKER.
14912 (defarg_again, pending_defargs, defarg, defarg1): New rules.
14913 (structsp): Use pending_defargs.
14914 (parms, full_parm): Use defarg.
14915 * lex.c (init_lex): Initialize inline_text_firstobj.
14916 (do_pending_inlines): Never pass the obstack to feed_input.
14917 (process_next_inline): Call end_input instead of restore_pending_input.
14918 (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs,
14919 finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns.
14920 * input.c (end_input): New fn.
14921 (sub_getch): At the end of some fed input, just keep returning EOF
14922 until someone calls end_input.
14923 Remove 'obstack' field from struct input_source.
14924 * decl.c (grokparms): Handle DEFAULT_ARG.
14925 (replace_defarg): New fn.
14926 * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros.
14928 Wed Jul 9 13:44:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14930 * call.c (implicit_conversion): If nothing else works, try binding
14931 an rvalue to a reference.
14933 Wed Jul 9 13:04:38 1997 Geoffrey Noer <noer@cygnus.com>
14935 * decl.c (init_decl_processing): Fix Jun 30 patch -- move
14936 ifndef for Cygwin32 to include SIGSEGV.
14938 Thu Jul 3 01:44:05 1997 Jason Merrill <jason@yorick.cygnus.com>
14940 * class.c (finish_struct_1): Only complain about pointers without
14941 copy stuff if there are any constructors.
14943 * rtti.c (build_dynamic_cast): Call complete_type on the types.
14945 * decl.c (grokfndecl): If the function we chose doesn't actually
14948 * decl2.c (grokclassfn): Don't specify 'const int' for the
14949 artificial destructor parm.
14951 * pt.c (type_unification): If we are called recursively, nothing
14954 Mon Jun 30 17:53:21 1997 Geoffrey Noer <noer@cygnus.com>
14956 * decl.c (init_decl_processing): Stop trying to catch signals
14957 other than SIGABRT since the Cygwin32 library doesn't support
14958 them correctly yet. This fixes a situation in which g++ causes
14959 a hang on SIGSEGVs and other such signals in our Win32-hosted
14962 Mon Jun 30 14:50:01 1997 Jason Merrill <jason@yorick.cygnus.com>
14964 * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
14966 Fri Jun 27 15:18:49 1997 Jason Merrill <jason@yorick.cygnus.com>
14968 * typeck2.c (store_init_value): Always return the value if our
14969 type needs constructing.
14971 * method.c (hack_identifier): Convert class statics from
14974 Thu Jun 26 11:44:46 1997 Jason Merrill <jason@yorick.cygnus.com>
14976 * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
14978 Thu Jun 19 16:49:28 1997 Mike Stump <mrs@cygnus.com>
14980 * typeck.c (c_expand_return): Make sure we clean up temporaries at
14981 the end of return x;
14983 Thu Jun 19 12:28:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14985 * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER.
14987 Tue Jun 17 18:35:57 1997 Mike Stump <mrs@cygnus.com>
14989 * except.c (expand_builtin_throw): Add support
14990 -fno-sjlj-exceptions -fPIC exception handling on the SPARC.
14992 Mon Jun 16 01:24:37 1997 Jason Merrill <jason@yorick.cygnus.com>
14994 * repo.c (extract_string): Null-terminate.
14996 * cp-tree.h (TI_SPEC_INFO): New macro.
14997 (CLASSTYPE_TI_SPEC_INFO): New macro.
14998 * pt.c (push_template_decl): Correctly determine # of template parms
15001 * call.c (compare_ics): Really fix 'this' conversions.
15003 * pt.c (do_decl_instantiation): Don't crash on explicit inst of
15006 * pt.c (push_template_decl): Complain about mismatch in # of
15007 template parms between a class template and a member template.
15009 Sun Jun 15 02:38:20 1997 Jason Merrill <jason@yorick.cygnus.com>
15011 * method.c (synthesize_method): You can't call
15012 function_cannot_inline_p after finish_function.
15013 * decl.c (finish_function): Turn on flag_inline_functions and turn
15014 off DECL_INLINE before handing a synthesized method to the
15017 Thu Jun 12 17:35:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15019 * method.c (synthesize_method): Remove July 30 change to never set
15020 DECL_INLINE if at_eof.
15022 Thu Jun 12 15:25:08 1997 Mike Stump <mrs@cygnus.com>
15024 * xref.c (GNU_xref_member): Ensure that the node has a
15025 decl_lang_specific part before checking DECL_FRIEND_P.
15027 Thu Jun 12 12:36:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15029 * pt.c (instantiate_class_template): Diagnose non-class types used
15032 Wed Jun 11 17:33:40 1997 Jason Merrill <jason@yorick.cygnus.com>
15034 * typeck.c (build_conditional_expr): Use convert_for_initialization
15035 instead of convert_and_check.
15037 Wed Jun 11 12:31:33 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15039 * parse.y (typespec): Don't pedwarn for typeof.
15041 Tue Jun 10 00:22:09 1997 Jason Merrill <jason@yorick.cygnus.com>
15043 * repo.c (finish_repo): Only check changes if we would write a
15046 * call.c (compare_ics): Fix handling of 'this' conversions.
15048 * pt.c (do_decl_instantiation): Support static data too. Rename
15049 from do_function_instantiation.
15050 * cp-tree.h: Adjust.
15053 * repo.c (extract_string): New fn.
15054 (get_base_filename): Use it.
15055 (init_repo): Compare old args with current args.
15057 Mon Jun 9 14:25:30 1997 Mike Stump <mrs@cygnus.com>
15059 * Makefile.in, Make-lang.in: Protect C-ls with a comment
15060 character, idea from Paul Eggert <eggert@twinsun.com>.
15062 Mon Jun 9 01:52:03 1997 Jason Merrill <jason@yorick.cygnus.com>
15064 * typeck.c (c_expand_return): Be more persistent in looking for
15067 * cvt.c (build_up_reference): Use NOP_EXPR for switching from
15068 pointer to reference.
15070 * class.c (build_vbase_path): Don't do anything if PATH has no steps.
15072 Sun Jun 8 03:07:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15074 * init.c (build_member_call, build_offset_ref):
15075 Use do_scoped_id instead of do_identifier.
15077 * cvt.c (convert): Remove bogosity.
15079 Sat Jun 7 20:50:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15081 * cvt.c (build_up_reference): Do checks of ARGTYPE and
15082 TARGET_TYPE before trying to use get_binfo.
15084 Fri Jun 6 17:36:39 1997 Jason Merrill <jason@yorick.cygnus.com>
15086 * cvt.c (build_up_reference): Call get_binfo to get access control.
15088 * decl2.c (import_export_decl): If we don't support weaks, leave
15091 Fri Jun 6 15:55:49 1997 Mike Stump <mrs@cygnus.com>
15093 * except.c (expand_builtin_throw): Add support for machines that
15094 cannot access globals after throw's epilogue when
15095 -fno-sjlj-exceptions is used.
15097 Thu Jun 5 16:28:43 1997 Jason Merrill <jason@yorick.cygnus.com>
15099 * parse.y: 'std::' becomes '::'.
15100 * lex.c (real_yylex): Remove 'namespace' warning.
15101 * init.c (build_member_call): Ignore 'std::'.
15102 (build_offset_ref): Likewise.
15103 * decl2.c (do_using_directive): Ignore 'using namespace std;'.
15104 (do_toplevel_using_decl): Ignore 'using std::whatever'.
15105 * decl.c (push_namespace): Just sorry.
15106 (pop_namespace): Nop.
15107 (init_decl_processing): Declare std namespace.
15109 Tue Jun 3 18:08:23 1997 Jason Merrill <jason@yorick.cygnus.com>
15111 * search.c (push_class_decls): A name which ambiguously refers to
15112 several instantiations of the same template just refers to the
15115 Tue Jun 3 12:30:40 1997 Benjamin Kosnik <bkoz@cirdan.cygnus.com>
15117 * decl.c (build_enumerator): Fix problem with unsigned long
15118 enumerated values being smashed to ints, causing overflow
15119 when computing next enumerated value (for enum values around
15122 Mon Jun 2 17:40:56 1997 Jason Merrill <jason@yorick.cygnus.com>
15124 * typeck.c (build_component_ref): Only call mark_used on a decl.
15126 Thu May 29 15:54:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15128 * typeck.c (build_c_cast): Make the check for a ptr to function
15129 more specific before possible default_conversion call.
15131 Thu May 29 13:02:06 1997 Mike Stump <mrs@cygnus.com>
15133 * except.c (expand_exception_blocks): Simplify and fix and make
15134 sure we don't end a region in a sequence, as expand_end_bindings
15137 Wed May 28 17:08:03 1997 Mike Stump <mrs@cygnus.com>
15139 * except.c (init_exception_processing): Mark terminate as not
15140 returning so that the optimizer can optimize better.
15142 Tue May 27 19:49:19 1997 Mike Stump <mrs@cygnus.com>
15144 * cvt.c (convert): Don't do any extra work, if we can avoid it
15147 Tue May 27 18:21:47 1997 Mike Stump <mrs@cygnus.com>
15149 * *.[chy]: Change cp_convert to ocp_convert, change convert to
15150 cp_convert. convert is now reserved for the backend, and doesn't
15151 have the semantics a frontend person should ever want.
15153 Fri May 23 10:58:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15155 * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled.
15156 Lose -traditional support.
15158 Thu May 22 15:41:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15160 * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype).
15162 * parse.y (self_reference): Do it for templates, too.
15163 * class.c (pushclass): Don't overload_template_name; the alias
15164 generated by build_self_reference serves the same purpose.
15166 * tree.c (list_hash): Make static, take more args.
15167 (list_hash_lookup): Likewise.
15168 (list_hash_add): Make static.
15169 (list_hash_canon): Lose.
15170 (hash_tree_cons): Only build a new node if one isn't already in the
15172 (hash_tree_chain): Use hash_tree_cons.
15173 * cp-tree.h: Adjust.
15174 * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead
15175 of calling lookup_name.
15177 Wed May 21 18:24:19 1997 Jason Merrill <jason@yorick.cygnus.com>
15179 * pt.c (instantiate_class_template): TYPE_VALUES for an enum
15180 doesn't refer to the CONST_DECLs.
15182 Tue May 20 21:09:32 1997 Bob Manson <manson@charmed.cygnus.com>
15184 * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever
15186 (expand_class_desc): Convert the last argument to a sizetype.
15188 Tue May 20 13:55:57 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15190 * gxx.gperf (__complex, __complex__, __imag, __imag__, __real,
15191 __real__): Add reswords.
15192 * hash.h: Regenerate.
15193 * lex.h (rid): Add RID_COMPLEX.
15194 (RID_LAST_MODIFIER): Set to RID_COMPLEX.
15195 * lex.c (init_lex): Add building of RID_COMPLEX.
15196 (real_yylex): General cleanup in line with what c-lex.c also has,
15197 sans the cruft for traditional; add handling of SPEC_IMAG, complex
15198 types, and imaginary numeric constants.
15199 * parse.y (REALPART, IMAGPART): Add tokens.
15200 (unary_expr): Add REALPART and IMAGPART rules.
15201 * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare.
15202 * decl.c (complex_{integer,float,double,long}_type_node): Define
15204 (init_decl_processing): Set up the types.
15205 (grokdeclarator): Add handling of RID_COMPLEX. Set and use
15206 DEFAULTED_INT instead of EXPLICIT_INT when we default to int type.
15207 * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15208 * cvt.c (cp_convert): Handle COMPLEX_TYPE.
15209 * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add
15211 * method.c (build_overload_name): Add handling of the different
15212 COMPLEX_TYPEs, prefixing them with `J'.
15213 * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE
15214 as a template parm.
15215 (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case.
15216 * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases.
15217 (mapcar): Handle COMPLEX_CST.
15218 * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE.
15219 (common_type): Add code for complex types.
15220 (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15221 (convert_for_assignment): Likewise.
15222 (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases.
15224 Mon May 19 12:26:27 1997 Jason Merrill <jason@yorick.cygnus.com>
15226 * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to
15227 tsubst_expr, as it might try to do overload resolution.
15229 Sat May 17 10:48:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15231 * pt.c (instantiate_class_template): Oops.
15233 Fri May 16 14:23:57 1997 Jason Merrill <jason@yorick.cygnus.com>
15235 * cp-tree.def: Add TAG_DEFN.
15236 * pt.c (tsubst_enum): New fn.
15237 (instantiate_class_template): Use it.
15238 (tsubst_expr): Support TAG_DEFN.
15239 (tsubst): Support local enums.
15240 (tsubst_copy): Likewise.
15241 * decl.c (finish_enum): Likewise.
15242 (start_enum): If this is a local enum, switch to permanent_obstack.
15244 Wed May 14 19:08:28 1997 Mike Stump <mrs@cygnus.com>
15246 * decl.c (store_parm_decls): Set last_parm_cleanup_insn here.
15247 (finish_function): Put the base init code for constructors just
15248 after the parm cleanup insns.
15249 (struct cp_function): Add last_parm_cleanup_insn.