1 1999-12-14 Jason Merrill <jason@casey.cygnus.com>
3 * error.c (dump_decl): operator==, not operator ==.
4 (op_to_string): Likewise.
6 * decl.c (compute_array_index_type): Handle null name.
8 * decl2.c (ambiguous_decl): Fix to match comment.
9 (lookup_using_namespace): Adjust.
11 * decl2.c (import_export_class): Don't ignore dllimport.
13 1999-12-14 Mark Mitchell <mark@codesourcery.com>
15 * class.c (check_field_decls): Split out from ...
16 (finish_struct_1): ... here. Use it. Tidy.
18 * cp-tree.h (remap_save_expr): Add walk_subtrees parameter.
19 * optimize.c (copy_body_r): Pass it.
20 * tree.c (remap_save_expr): Clear walk_subtrees for an
21 already-handled SAVE_EXPR.
22 (cp_unsave_r): Pass walk_subtrees to remap_save_expr.
24 * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
25 * ir.texi (DECL_NAMESPACE_ALIAS): Document it.
27 * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.
29 1999-12-14 Mumit Khan <khan@xraylith.wisc.edu>
31 * class.c (finish_base_struct): Allow multiple COM base classes
32 as well as non-COM bases as long as it's not the leftmost.
34 1999-12-13 Mumit Khan <khan@xraylith.wisc.edu>
36 * lex.c (saving_parse_to_obstack): New global.
37 (reinit_parse_for_block): Use.
38 (reinit_parse_for_expr): Use.
41 1999-12-13 Mark Mitchell <mark@codesourcery.com>
43 * optimize.c (initialize_inlined_parameters): Take FN to which the
44 parameters belong as an argument.
45 (expand_call_inline): Expand calls into the parameter
46 initializations before pushing the function onto the list of
47 functions we are presently expanding.
49 1999-12-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
51 * class.c (get_vtable_name): Use a literal format string and
52 VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT.
53 (prepare_fresh_vtable): Likewise.
55 * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of
58 * decl.c (make_rtl_for_local_static): Remove unused variable `type'.
60 * init.c (build_vec_init): Initialize variable `try_body'.
62 * lex.c (yyerror): Don't call a variadic function with a
63 non-literal format string.
65 * optimize.c (optimize_function): Call memset, not bzero.
67 * pt.c (for_each_template_parm_r): Add static prototype.
69 11999-12-09 Andreas Jaeger <aj@suse.de>
71 * except.c (expand_throw): Add static attribute to match
74 * Makefile.in (semantics.o): Add dependency on output.h.
75 * semantics.c: Include output.h for declaration of
78 999-12-09 Mark Mitchell <mark@codesourcery.com>
80 * decl.c (init_decl_processing): Reenable inlining on trees.
81 (finish_function): Likewise.
82 * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here.
83 * semantics.c (simplify_aggr_init_exprs): New function.
84 (expand_body): Use it.
85 * tree.c (walk_tree): Special-case TARGET_EXPRs since they
86 sometimes present the same sub-tree twice.
88 * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
91 * semantics.c (finish_switch_cond): Do conversions here, not ...
92 * typeck.c (c_expand_start_case): Here.
94 * semantics.c (do_poplevel): Remove unused variable.
96 1999-12-06 Mark Mitchell <mark@codesourcery.com>
98 * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE
99 unless we're declaring the variable in question.
101 1999-12-06 Mark Mitchell <mark@codesourcery.com>
103 * decl.c (init_decl_processing): #if 0 last patch.
104 (finish_function): Likewise.
106 1999-12-05 Mark Mitchell <mark@codesourcery.com>
108 * decl.c (init_decl_processing): Set flag_inline_trees if
111 * cp-tree.h (calls_setjmp_p): Declare.
112 * decl.c (finish_function): Mark functions that call setjmp as
114 * optimize.c (calls_setjmp_r): New function.
115 (calls_setjmp_p): Likewise.
117 1999-12-04 Mark Mitchell <mark@codesourcery.com>
119 * optimize.c (expand_call_inline): Wrap the expanded call in an
120 EXPR_WITH_FILE_LOCATION node to get correct line numbers for
123 * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add
125 (remap_decl): New function.
126 (remap_block): Likewise.
127 (copy_scope_stmt): Likewise.
128 (copy_body_r): Use remap_decl and copy_scope_stmt.
129 (copy_body): Use VARRAY_TOP_TREE.
130 (initialize_inlined_parameters): Likewise.
131 (declare_return_variable): Likewise.
132 (inlinable_function_p): Check flag_inline_trees.
133 (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs
134 specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the
135 parameters of the inlined function.
136 (optimize_function): Prevent recursion into partially complete
139 * cp-tree.def (SCOPE_STMT): Take one operand.
140 * cp-tree.h (SCOPE_STMT_BLOCK): New macro.
141 (SCOPE_NULLIFIED_P): Redefine.
142 (SCOPE_NO_CLEANUPS_P): New macro.
143 (add_scope_stmt): Change prototype.
144 * decl.c (poplevel): Tidy. Warn about unused variables here.
145 Record SCOPE_STMT_BLOCKs.
146 (finish_function): Keep DECL_INITIAL for functions that might be
148 * ir.texi: Document SCOPE_NO_CLEANUPS_P.
149 * semantics.c: Include rtl.h.
150 (add_scope_stmt): Return the new scope statement and, for an
151 end-of-scope statement, its matching begin statement. Don't set
153 (do_pushlevel): Simplify, now that we are always
155 (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs.
156 (expand_stmt): Don't call expand_start_bindings or
157 expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
158 * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
160 * Makefile.in (semantics.o): Depend on RTL_H.
162 * decl2.c (pending_statics_used): Make it a macro.
163 (saved_inlines_used): Likewise.
164 (finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
165 (mark_inline_for_output): Likewise.
166 (ssdf_decls_used): Remove.
167 (start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
168 (generate_ctor_or_dtor_function): Adjust accordingly.
170 1999-11-24 Geoffrey Keating <geoffk@cygnus.com>
171 Greg McGary <gkm@gnu.org>
173 * decl.c (duplicate_decls): Merge
174 DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT,
175 DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK.
177 1999-12-02 Mike Stump <mrs@wrs.com>
179 * init.c (perform_member_init): Handle parse errors better.
181 1999-12-01 Mark Mitchell <mark@codesourcery.com>
183 * cp-tree.h (min_tree_cons): Remove.
184 (scratch_ovl_cons): Likewise.
185 * decl.c (saveable_obstack): Don't declare.
186 (duplicate_decls): Tweak error-message.
187 (initialize_local_var): Explicitly mark the definition as static.
188 (finish_function): Call permanent_allocation, just so
189 that the middle-end sees the obstacks it expects.
190 (mark_cp_function_context): Likewise.
191 * init.c (build_new): Don't use min_tree_cons.
192 * lex.c (permanent_obstack): Don't declare.
193 (current_obstack, saveable_obstack): Likewise.
194 * spew.c (current_obstack, saveable_obstack): Likewise.
195 * tree.c (current_obstack, saveable_obstack): Likewise.
196 (scratch_ovl_cons): Remove.
197 (build_min_nt): Don't mess with obstacks.
198 (build_min): Likewise.
199 (min_tree_cons): Remove
200 * typeck.c (build_component_ref): Don't use scratch_ovl_cons.
201 (build_x_function_call): Likewise.
202 (build_c_cast): Don't use min_tree_cons.
204 1999-11-29 Mark Mitchell <mark@codesourcery.com>
206 * pt.c (tsubst_decl): Robustify.
208 1999-11-27 Mark Mitchell <mark@codesourcery.com>
210 * decl2.c (finish_file): Call expand_body for inline functions
211 that will be written out but that do not yet have RTL.
212 * semantics.c (expand_body): Do not generate RTL For inline
213 functions that do not yet need to be written out.
215 1999-11-25 Mark Mitchell <mark@codesourcery.com>
217 * Make-lang.in (CXX_SRCS): Add optimize.c.
218 * Makefile.in (CXX_OBJS): Add optimize.o.
219 (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
220 (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
221 (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
222 (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
223 (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
225 (optimize.o): New target.
226 * class.c: Don't include splay-tree.h.
227 * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
228 * cp-tree.h: Include splay-tree.h.
229 (DECL_UNINLINABLE): New macro.
230 (CTOR_BEGIN_P, CTOR_END_P): New macros.
231 (flag_inline_trees): New variable.
232 (local_variable_p): New function.
233 (nonstatic_local_decl_p): Likewise.
234 (optimize_function): Likewise.
235 (cplus_unsave_expr_now): Remove.
236 (copy_tree_r): Declare.
237 (remap_save_expr): Likewise.
238 * decl.c (local_variable_p): Don't
240 (local_variable_p_walkfn): New function.
241 (make_rtl_for_local_static): Remove code to try to avoid writing
242 out static constants.
243 (emit_local_var): Fix indentation.
244 (nonstatic_local_decl_p): New function.
245 (check_default_argument): Use local_variable_p_walkfn, not
246 local_variable_p, when walking the tree.
247 (start_function): Set the DECL_CONTEXT for automatically generated
249 (finish_constructor_body): Use CTOR_STMT to mark the end of a
251 * decl2.c: Don't include splay-tree.h.
252 (flag_inline_trees): Define.
253 * dump.c: Don't include
255 * except.c (expand_end_catch_block): Fix comment formatting.
256 (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
257 (expand_throw): Tidy comment.
258 * init.c (build_vec_delete_1): Use create_temporary_var.
259 * lex.c (cplus_tree_code_type): Make it static.
260 (cplus_tree_code_length): Likewise.
261 (cplus_tree_code_name): Likewise.
262 * optimize.c: New file.
263 * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
265 (setup_vtbl_ptr): Mark the beginnings of constructors with
267 (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
268 (expand_body): Call optimize_function. Save bodies if we're doing
270 * tree.c: Don't include splay-tree.h. Include insn-config.h and
272 (copy_tree_r): Make it public.
273 (statement_code_p): New function.
274 (mark_local_for_remap_r): Likewise.
275 (cp_usave_r): Likewise.
276 (cp_unsave): Likewise.
277 (build_cplus_new): Set DECL_CONTEXT for temporary variables.
278 (walk_tree): Walk into `s' class nodes. Walk statement chains.
279 (copy_tree_r): Handle 's' class nodes. Restore chains for
280 statements. Nullify scopes. Don't copy types.
281 (init_tree): Set lang_unsave to cp_unsave.
282 (remap_save_expr): Define.
283 * ir.texi: Document CTOR_STMT.
285 1999-11-24 Jason Merrill <jason@casey.cygnus.com>
287 * search.c (note_debug_info_needed): Do perform this optimization
289 (maybe_suppress_debug_info): Likewise. Start by clearing
290 TYPE_DECL_SUPPRESS_DEBUG.
292 1999-11-24 Mark Mitchell <mark@codesourcery.com>
294 * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
296 * decl2.c (finish_vtable_vardecl): Don't prune vtables here.
298 1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
300 * decl.c (pushdecl, grokdeclarator): Don't call a variadic
301 function with a non-literal format string.
303 * lex.c (do_identifier): Likewise.
305 * typeck.c (build_unary_op): Likewise.
307 1999-11-23 Mark Mitchell <mark@codesourcery.com>
309 * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
311 1999-11-22 Mark Mitchell <mark@codesourcery.com>
313 * cp-tree.def (CTOR_COMPLETE): New tree node.
314 * decl.c (finish_constructor_body): Add it, to mark the end of the
316 (finish_function): Don't call end_protect_partials here.
317 * ir.texi (CTOR_COMPLETE): Document it.
318 * semantics.c (expand_stmt): Handle it.
320 * cp-tree.def (FUNCTION_NAME): New tree node.
321 * cp-tree.h (current_function_name_declared): Tweak documentation.
322 (lang_decl_flags): Add pretty_function_p, adjust dummy.
323 (DECL_PRETTY_FUNCTION_P): New macro.
324 * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
325 etc., in a template function. Use at_function_scope_p instead of
327 * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
329 (tsubst): Handle FUNCTION_NAME.
330 (tsubst_copy): Likewise.
331 (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
332 etc. in instantiation.
333 * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
334 even in template functions.
335 (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
336 conditional scope at the top of a destructor.
338 * error.c (dump_function_decl): Use `[ with ... ]' syntax for
341 1999-11-22 Nathan Sidwell <nathan@acm.org>
343 * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
344 when actually negative.
346 * typeck.c (convert_for_assignment): Expand comment about
347 strange NULL check, moved from ...
348 (convert_for_initialization): ... here. Remove unneeded
351 1999-11-21 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
353 * cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
354 * init.c (build_vec_delete, build_vec_delete_1): Likewise.
355 Always destruct virtual bases of array components, but never
357 (build_vec_init): Adjust invocations.
358 (build_delete): Likewise.
359 * decl2.c (delete_sanity): Likewise.
361 1999-11-19 Nathan Sidwell <nathan@acm.org>
363 * cp-tree.h (grok_method_quals): Return this pointer qualifiers.
364 * decl.c (grokdeclarator): Adjust calls to grok_method_quals.
365 * decl2.c (grok_method_quals): Accept `restrict' as applying to
366 the object pointer. Return such qualifiers.
367 (grokclassfn): Apply this pointer qualifiers. Cleanup unused
370 1999-11-18 Mark Mitchell <mark@codesourcery.com>
372 * except.c (expand_end_catch_block): Fix typo.
373 (expand_exception_blocks): Simplify. Don't call
374 expand_leftover_cleanups.
376 1999-11-15 Jason Merrill <jason@casey.cygnus.com>
378 * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
379 * pt.c (tsubst, case INTEGER_TYPE): Call it.
380 Check uses_template_parms.
382 * class.c (finish_struct): If we're a local class in a template
383 function, add a TAG_DEFN.
384 * pt.c (lookup_template_class): If this is a local class in a
385 template function, call pushtag.
386 (tsubst_expr, case TAG_DEFN): Handle classes, too.
388 Emit debug info with the vtable.
389 * search.c (maybe_suppress_debug_info): New function...
390 * class.c (finish_struct_1): ...split out from here.
391 * cp-tree.h: Declare it.
392 * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
393 if we're writing out the vtable.
394 * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
395 note_debug_info_needed): #if 0 out.
397 1999-11-14 Mark Mitchell <mark@codesourcery.com>
399 * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
400 * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
402 * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
403 * decl2.c (lookup_arg_dependent): Use it.
405 * cp-tree.h (cp_finish_decl): Change prototype.
406 (finish_static_data_member_decl): Likewise.
407 (push_permanent_obstack): Remove declaration.
408 (push_expression_obstack): Likewise.
409 (push_scratch_obstack): Likewise.
410 (DECL_TEMPLATE_PARM_P): Robustify.
411 (SET_DECL_TEMPLATE_PARM_P): New macro.
412 * class.c (add_method): Don't manipulate obstacks.
413 (finish_vtbls): Likewise.
414 * cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
415 * decl.c (binding_for_name): Don't manipulate obstacks.
416 (maybe_push_to_top_level): Likewise.
417 (pop_from_top_level): Likewise.
418 (duplicate_decls): Likewise.
419 (pushdecl): Likewise.
420 (implicitly_declare): Likewise.
421 (build_typename_type): Likewise.
422 (start_decl): Likewise.
423 (cp_finish_decl): Likewise.
424 (finish_decl): Likewise.
425 (destroy_local_static): Likewise.
426 (expand_static_init): Likewise.
427 (complete_array_type): Likewise.
428 (grokvardecl): Likewise.
429 (build_ptrmemfnc_type): Likewise.
430 (grokdeclarator): Likewise.
431 (xref_tag): Likewise.
432 (xref_basetypes): Likewise.
433 (start_enum): Likewise.
434 (finish_enum): Likewise.
435 (start_function): Likewise.
436 (finish_function): Likewise.
437 (start_method): Adjust call to cp_finish_decl.
438 * decl2.c (finish_static_data_member_decl): Don't manipulate
440 (grokfield): Likewise.
441 (grokbitfield): Likewise.
442 (get_temp_name): Likewise.
443 (get_sentry): Likewise.
444 (fnish_file): Likewise.
445 (lookup_arg_dependent): Likewise.
446 * except.c (call_eh_info): Likewise.
447 (push_eh_info): Likewise.
448 (do_pop_exception): Likewise.
449 (initialize_handler_parm): Likewise.
450 (expand_end_eh_spec): Likewise.
451 (alloc_eh_object): Likewise.
452 (expand_throw): Likewise.
453 * expr.c (extract_scalar_init): Likewise.
454 * init.c (build_java_class_ref): Likewise.
455 * lex.c (get_time_identifier): Likewise.
456 (snarf_defarg): Likewise.
457 (add_defarg_fn): Likewise.
458 (is_global): Simplify.
459 (do_identifier): Don't check TREE_PERMANENT.
460 * method.c (emit_thunk): Don't manipulate obstacks.
461 * parse.y (condition): Adjust call to cp_finish_decl.
464 (initdcl0_innards): Likewise.
465 (nomods_initdcl0): Likewise.
466 * pt.c (push_inline_template_parms_recursive): Use
467 SET_DECL_TEMPLATE_PARM_P.
468 (process_template_parm): Likewise.
469 (lookup_template_class): Don't manipulate obstacks.
470 (instantiate_class_template): Adjust call to
471 finish_static_data_member_decl.
472 (tsubst_decl): Don't manipulate obstacks.
473 (tsubst_expr): Likewise.
474 (instantiate_template): Likewise.
475 (instantiate_decl): Adjust calls to cp_finish_decl.
476 * rtti.c (call_void_fn): Don't manipulate obstacks.
477 (get_tinfo_var): Likewise.
478 (get_tinfo_fn_unused): Likewise.
479 (build_dynamic_cast_1): Likewise.
480 (expand_si_desc): Likewise.
481 (expand_class_desc): Likewise.
482 (expand_ptr_desc): Likewise.
483 (expand_attr_desc): Likewise.
484 (expand_generic_desc): Likewise.
485 (synthesize_tinfo_fn): Likewise.
486 * search.c (expand_upcast_fixups): Likewise.
487 * semantics.c (finish_asm_stmt): Likewise.
488 (finish_named_return_value): Likewise.
489 (begin_class_definition): Likewise.
490 (finish_class_definition): Likewise.
491 (finish_typeof): Likewise.
492 * tree.c (build_cplus_method_type): Likewise.
493 (reverse_path): Likewise.
494 (copy_template_template_parm): Likewise.
495 (build_expr_ptr_wrapper): Likewise.
496 (push_expression_obstack): Remove.
497 (push_permanent_obstack): Likewise.
498 * typeck.c (mark_addressable): Likewise.
500 1999-11-13 Mark Mitchell <mark@codesourcery.com>
502 * call.c (build_conditional_expr): Use build_target_expr_with_type.
503 (convert_like): Likewise.
504 (build_over_call): Likewise.
505 * cp-tree.h (build_target_expr): Remove.
506 (build_target_expr_with_type): New function.
507 * cvt.c (build_up_reference): Use get_target_expr.
508 * decl.c (build_target_expr): Move to ...
509 * tree.c (build_target_expr): Here. Make it static.
510 (build_target_expr_with_type): New function. Set DECL_CONTEXT on
511 the temporary VAR_DECLs.
512 (get_target_expr): Use it.
514 1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
516 * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
517 * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
518 * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
519 * class.c (set_rtti_entry): Use it.
521 1999-11-12 Mark Mitchell <mark@codesourcery.com>
523 * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
525 * semantics.c (finish_expr_stmt): Call it here instead. Move
526 default_conversion logic to semantic-analysis time.
528 1999-11-12 Jason Merrill <jason@yorick.cygnus.com>
530 * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
532 Fri Nov 12 12:56:32 MST 1999 Diego Novillo <dnovillo@cygnus.com>
534 * init.c (init_init_processing): Re-instated Nov 11 patch after
537 Fri Nov 12 10:42:02 MST 1999 Diego Novillo <dnovillo@cygnus.com>
539 * init.c (init_init_processing): Undo patch from Nov 11, 1999.
540 Patch had not been approved yet.
542 1999-11-12 Mark Mitchell <mark@codesourcery.com>
544 * decl.c (compute_array_index_type): New function, split out from
546 (create_array_type_for_decl): Likewise.
547 (grokdeclarator): Use them.
549 * semantics.c (expand_stmt): Don't suspend_momentary or
552 Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com>
554 * init.c (init_init_processing): Header information for
555 arrays allocated via `new' should have the same alignment used by
558 1999-11-10 Mark Mitchell <mark@codesourcery.com>
560 * error.c (dump_function_name): Don't crash if given a friend
561 pseudo-instantiation.
563 * cp-tree.h (build_enumerator): Change prototype.
564 * decl.c (enum_next_value): Remove.
565 (enum_overflow): Likewise.
566 (init_decl_processing): Don't register enum_next_value as a root.
567 (start_enum): Clear TYPE_VALUES for a redefined enum.
568 (finish_enum): Reset the type of enumeration constants.
569 (build_enumerator): Fix indentation. Don't copy CONST_DECLs when
570 we don't need to. Maintain the TYPE_VALUES list and look there
571 for the previously defined enumeration constant. Let enumeration
572 constants have the type of their values until the enumeration type
574 * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
576 * parse.c: Regenerated.
577 * pt.c (tsubst_enum): Adjust according to build_enumerator changes.
579 Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
580 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
582 * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
584 1999-11-09 Mark Mitchell <mark@codesourcery.com>
586 * cp-tree.h (language_function): Remove x_last_dtor_insn and
587 x_last_parm_cleanup_insn.
588 * decl.c (last_dtor_insn): Remove.
589 (last_parm_cleanup_insn): Likewise.
590 (expand_start_early_try_stmts): Don't set them.
591 (store_parm_decls): Likewise.
592 (save_function_data): Or save them.
593 (mark_lang_function): Or mark them.
595 1999-11-08 Mark Mitchell <mark@codesourcery.com>
597 * decl.c (store_parm_decls): Generate cleanup code at
598 semantic-analysis time. Destroy objects in the correct order.
600 1999-11-07 Mark Mitchell <mark@codesourcery.com>
602 * cp-tree.h (begin_new_placement): Remove.
603 (finish_new_placement): Likewise.
604 * class.c (finish_struct_1): Don't suspend_momentary or
606 * decl.c (grokdeclarator): Likewise.
607 (maybe_build_cleanup_1): Likewise.
608 * except.c (push_eh_cleanup): Likewise.
609 (build_terminate_handler): Likewise.
610 * init.c (build_new_1): Likewise.
611 * parse.y (parse_decl): Change prototype.
612 (initdecls, notype_initdecls, initdcl): Don't return int.
613 (initdcl0, notype_initdcl0, initdcl0_innards): Likewise.
614 (.begin_new_placement): Remove.
615 (.finish_new_placement): Likewise.
616 (nonmomentary_expr): Likewise.
617 (suspend_mom): Likewise.
618 (condition): Don't suspend_momentary, resume_momentary, or keep
619 track of need to resume.
620 (unary_expr): Likewise.
621 (new_placement): Likewise.
623 (structsp): Likewise.
624 (new_type_id): Likewise.
625 (maybe_parmlist): Likewise.
626 (direct_after_type_declaration): Likewise.
627 (direct_new_declarator): Likewise.
628 (direct_abstract_declaration): Likewise.
629 * parse.c: Regenerated.
630 * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary.
631 * semantics.c (begin_new_placement): Remove.
632 (finish_new_placement): Likewise.
634 1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de>
636 * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
637 (DECL_TEMPLATE_INFO): Use it.
638 * decl.c (warn_extern_redeclared_static): Do nothing for
640 * decl2.c (mark_used): Explicitly check for function or variable.
641 * semantics.c (finish_unary_op_expr): Check whether result is also
644 1999-11-05 Mark Mitchell <mark@codesourcery.com>
646 * Makefile.in (typeck2.o): Depend on output.h.
647 * typeck2.c: Include output.h.
649 * decl.c (flag_ansi): Remove declaration.
651 * pt.c (tinst_level_tick): Make it static.
652 (last_template_error_tick): Likewise.
654 * cp-tree.h (mapcar): Remove declaration.
655 (search_tree): Likewise.
656 (walk_tree_fn): New typedef.
657 (walk_tree): New function.
658 * tree.c (bot_manip): Change prototype. Adjust to be called via
660 (bot_replace): Likewise.
661 (no_linkage_helper): Likewise.
662 (copy_tree_r): New function.
663 (search_tree): Rename, and adjust, to become ...
664 (walk_tree): New function.
666 (target_remap): Remove.
667 (target_remap_count): Likewise.
668 (break_out_target_exprs): Use walk_tree.
669 * decl.c (local_variable_p): Change prototype.
670 (check_default_argument): Use walk_tree.
671 * pt.c (for_each_template_parm_r): New function, split out from ...
672 (for_each_template_parm): Here. Use it, via walk_tree.
674 1999-11-03 Mark Mitchell <mark@codesourcery.com>
676 * class.c (check_bitfield_decl): New function, split out from
678 (check_field_decl): Likewise. Recursively examine members of
680 (finish_struct_1): Use them.
681 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
683 1999-11-02 Mark Mitchell <mark@codesourcery.com>
685 * decl.c (grokfndecl): Remove dead code.
687 * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
689 1999-11-02 Scott Snyder <snyder@fnal.gov>
691 * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
693 * pt.c (tsubst_copy): Likewise.
695 1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
697 * decl2.c (maybe_make_one_only): Always make things comdat on
700 1999-10-31 Mark Mitchell <mark@codesourcery.com>
702 * decl.c (finish_function): Call free_after_parsing for functions
703 we are not immediately turning into RTL.
705 1999-10-31 Brendan Kehoe <brendan@cygnus.com>
707 * cp-tree.h (flag_dump_translation_unit): Add decl.
709 Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
711 * lex.c (yylex): Accept 'f' in mantissa of hex float constant.
713 1999-10-30 Mark Mitchell <mark@codesourcery.com>
715 * decl.c (pop_cp_function_context): Don't call free on a NULL
717 * semantics.c: Include ggc.h.
718 (expand_body): Do garbage-collection after processing a template
719 function. Clear DECL_SAVED_TREE after generating RTL for a
721 * Makefile.in (semantics.o): Depend on ggc.h.
723 1999-10-29 Mark Mitchell <mark@codesourcery.com>
725 * cp-tree.h (make_typename_type): Change prototype.
726 * decl.c (make_typename_type): Only complain if so requested.
727 * parse.y (nested_name_specifier): Adjust calls.
728 (typename_sub0): Likewise.
729 (typename_sub1): Likewise.
730 * parse.c: Regenerated.
731 * pt.c (convert_template_argument): Pass complain to
735 1999-10-28 Mark Mitchell <mark@codesourcery.com>
737 * semantics.c (finish_handler): End the scope of the handler
738 before attaching it to the statement-tree.
740 1999-10-28 Ian Lance Taylor <ian@zembu.com>
742 * rtti.c (build_dynamic_cast_1): Give a better error message for
743 an attempt to dynamic_cast from a non-polymorphic type.
745 1999-10-27 Mark Mitchell <mark@codesourcery.com>
747 * cp-tree.h (make_temp_vec): Remove.
748 (make_scratch_vec): Likewise.
749 * call.c (add_function_candidate): Use make_tree_vec.
750 (add_conv_candidate): Likewise.
751 (build_builtin_candidate): Likewise.
752 (add_template_candidate_real): Likewise.
753 * class.c (resolve_address_of_overloaded_function): Likewise.
754 * decl.c (start_function): Don't fool with the momentary obstack.
755 (finish_function): Likewise.
756 * init.c (expand_direct_vtbls_init): Likewise.
757 (begin_init_stmts): Likewise.
758 (finish_init_stmts): Likewise.
759 * pt.c (add_to_template_args): Use make_tree_vec.
760 (check_explicit_specialization): Likewise.
761 (coerce_template_parms): Likewise.
762 (lookup_template_class): Don't fool with the momentary obstack.
763 (instantiate_class_template): Likewise.
764 (tsubst_template_arg_vector): Use make_tree_vec.
765 (tsubst_aggr_type): Don't fool with the momentary obstack.
766 (tsubst_decl): Likewise. Use make_tree_vec.
767 (try_one_overload): Likewise.
768 (try_class_unification): Don't fool with the momentary obstack.
769 (get_bindings_real): Use make_tree_vec.
770 (set_mangled_name_for_template_decl): Likewise.
771 * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
772 * semantics.c (finish_expr_stmt): Likewise.
773 (finish_do_stmt): Likewise.
774 (finish_for_expr): Likewise.
775 (finish_switch_cond): Likewise.
776 (do_pushlevel): Likewise.
777 (do_poplevel): Likewise.
778 * tree.c (make_temp_vec): Remove.
780 * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump
781 CLEANUP_P for a TRY_BLOCK.
782 * ir.texi: Document SAVE_EXPR.
784 Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
786 * call.c (build_over_call): Check that the built-in function is
787 of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
788 * typeck.c (build_function_call_real): Similarly.
790 1999-10-26 Mark Mitchell <mark@codesourcery.com>
792 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
795 1999-10-24 Mark Mitchell <mark@codesourcery.com>
797 * decl.c (push_overloaded_decl_1): Use pushdecl.
799 * decl.c (auto_function): Replace #ifdef'd __inline with just
801 * lex.c (my_get_run_time): Likeise.
803 (identifier_type): Likewise.
804 * method.c (start_squangling): Likewise.
805 (end_squangling): Likewise.
807 (old_backref_index): Likewise.
808 (flush_repeats): Likewise.
809 (issue_ktype): Likewise.
810 * parse.y (empty_parms): Likewise.
811 * parse.c: Regenerated.
813 1999-10-21 Mark Mitchell <mark@codesourcery.com>
815 * dump.c (dequeue_and_dump): Replace several uses of
816 queue_and_dump_index with dump_child.
818 1999-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
820 * expr.c: Include tm_p.h.
822 1999-10-21 Mark Mitchell <mark@codesourcery.com>
824 * cp-tree.h (SCOPE_PARTIAL_P): New macro.
825 (pushlevel_temporary): Remove.
826 (add_scope_stmt): New function.
827 * decl.c (pushlevel_temporary): Remove.
828 (poplevel): Use add_scope_stmt.
829 (start_decl_1): Likewise.
830 * semantics.c (add_scope_stmt): New function.
831 (do_pushlevel): Use it.
832 (do_poplevel): Use it.
833 (expand_stmt): Check SCOPE_PARTIAL_P.
835 * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
836 * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
837 * expr.c (cplus_expand_expr): Expand it.
838 * ir.texi: Document EMPTY_CLASS_EXPR.
840 1999-10-20 Mark Mitchell <mark@codesourcery.com>
842 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
843 parameters as having namespace scope.
845 1999-10-19 Mark Mitchell <mark@codesourcery.com>
847 * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
848 (mangling_flags): New type.
849 (build_overload_int): Change prototype.
850 (build_overload_value): Likewise.
851 (numeric_output_need_bar): Improve comment.
852 (mangle_expression): New function, broken out from ...
853 (build_overload_int): Here.
854 (build_overload_value): Adjust for use of mangling flags. Don't
855 warn about real-valued template parameters here. Do handle
856 complex expressions involving real-valued template parameters.
857 (build_template_parm_names): Encase non-type template parameters
858 in underscores, if necessary.
859 (process_overload_item): Remove conditional on
860 PARM_CAN_BE_ARRAY_TYPE.
862 1999-10-17 Mark Mitchell <mark@codesourcery.com>
864 * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
866 * ir.texi: Clean up documentation of RETURN_INIT.
868 1999-10-15 Greg McGary <gkm@gnu.org>
870 * lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
871 (lang_init): Set default for flag_bounds_check if still "unspecified".
873 1999-10-13 Andrew Haley <aph@cygnus.com>
875 * class.c (finish_struct_1): Force alignment of non-bitfields to
878 Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
880 * typeck2.c (process_init_constructor): Handle empty constructors.
882 1999-10-13 Jason Merrill <jason@yorick.cygnus.com>
884 * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
886 * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
889 1999-10-13 Mark Mitchell <mark@codesourcery.com>
891 * decl.c (make_rtl_for_local_static): Don't create register RTL
892 for addressable constants.
894 1999-10-13 Nathan Sidwell <nathan@acm.org>
896 * cp-tree.h (build_x_va_arg): Prototype new function.
897 * call.c (build_x_va_arg): Define it.
898 * parse.y (unary_expr): Call build_x_va_arg.
900 * cp-tree.h (convert_type_from_ellipsis): Prototype new function.
901 * call.c (convert_type_from_ellipsis): Define it.
902 * decl.c (init_decl_processing): Set lang_type_promotes_to.
904 * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
906 1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
908 * class.c (fixed_type_or_null): Always set *nonnull.
910 1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
912 * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
913 __GNUC__ and __GNUC_MINOR__.
915 1999-10-09 Mark Mitchell <mark@codesourcery.com>
917 * cp-tree.h (make_rtl_for_local_static): New function.
918 * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
920 (make_rtl_for_local_static): Here.
921 * semantics.c (expand_stmt): Use make_rtl_for_local_static.
923 1999-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
925 * method.c: Include tm_p.h.
927 1999-10-7 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
929 * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
930 * lex.c (cp_make_lake_type): Likewise.
931 * tree.c (init_tree): Init make_lang_type_fn.
933 1999-10-07 Mark Mitchell <mark@codesourcery.com>
935 * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
938 * semantics.c (expand_stmt): Don't pretend to have asmspecs for
939 local statics if we don't really have them.
941 * ir.texi: Improve documentation for STMT_EXPR. Describe
944 1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
946 * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
948 1999-10-07 Greg McGary <gkm@gnu.org>
950 * class.c (finish_struct_1): Use simpler method of
951 removing elements of a singly-linked list which doesn't
952 lose for classes without data members.
954 1999-10-07 Mark Mitchell <mark@codesourcery.com>
956 * friend.c (make_friend_class): Robustify.
958 * semantics.c (finish_object_call_expr): Reject calls to template
961 1999-10-06 Mark Mitchell <mark@codesourcery.com>
963 * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
965 * cp-tree.h (CLASSTYPE_VFIELD): Remove.
966 * call.c (build_vfield_ref): Use TYPE_VFIELD, not
968 * class.c (get_vfield_offset): Likewise.
969 (finish_base_struct): Likewise.
970 (modify_one_vtable): Likewise.
971 (fixup_vtable_deltas): Likewise.
972 (finish_struct_1): Likewise.
973 * init.c (expand_virtual_init): Likewise.
974 * search.c (lookup_field_1): Likewise.
975 (expand_upcast_fixups): Likewise.
976 * typeck.c (build_component_ref): Likewise.
977 (build_binary_op_nodefault): Likewise.
979 * dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
980 * ir.texi: Document TYPE_VFIELD.
982 1999-10-06 Brendan Kehoe <brendan@cygnus.com>
984 * decl.c (grokdeclarator): Only warn about non-zero arrays if
985 !in_system_header (linux socketbits.h can give this for
986 __cmsg_data, which is using a GNU extension).
988 1999-10-05 Mark Mitchell <mark@codesourcery.com>
990 * decl2.c (start_static_storage_duration_function): Push the
991 function declaration so it ends up in namespace scope.
993 * dump.c (DUMP_CHILDREN): Remove.
994 (DUMP_BINFO): Adjust.
995 (struct dump_node_info): Remove dump_children_p.
996 (queue_and_dump_type): Remove dump_children_p parameter.
997 (queue): Don't set dump_children_p.
998 (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
999 queue_and_dump_index.
1000 (dequeue_and_dump): Unconditionally print children. Adjust calls
1001 to functions mentioned above.
1002 (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
1004 * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
1005 * dump.c (dequeue_and_dump): Dump them.
1007 * method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
1009 * decl.c (start_function): Set current_in_charge_parm for
1010 constructors, too, where appropriate.
1011 * search.c (fixup_all_virtual_upcast_offsets): New function.
1012 (expand_indirect_vtbls_init): Use it.
1014 1999-10-04 Nathan Sidwell <nathan@acm.org>
1016 * decl2.c (grok_alignof): Don't decay lvalues.
1018 * init.c (build_new): Remove unused variable.
1020 1999-10-04 Mark Mitchell <mark@codesourcery.com>
1022 * cp-tree.h (struct language_function): Remove static_labelno.
1023 (static_labelno): Remove macro.
1024 * method.c (build_overload_nested_name): Make static_labelno
1027 * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
1028 to decide whether or not a function is defined.
1030 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
1031 situations where make_node will do it automatically.
1032 * decl.c (grok_reference_init): Likewise.
1033 (expand_static_init): Likewise.
1034 (do_static_initialization): Likewise.
1035 * init.c (perform_member_init): Likewise.
1036 (expand_aggr_init_1): Likewise.
1037 (build_new_1): Likewise.
1038 * method.c (do_build_copy_constructor): Likewise.
1039 (do_build_assign_ref): Likewise.
1040 * search.c (expand_upcast_fixups): Likewise.
1041 * semantics.c (finish_stmt_expr): Likewise.
1042 * typeck.c (build_unary_op): Likewise.
1043 (check_return_expr): Likewise.
1045 1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
1047 * init.c (build_vec_delete_1): Fold COND_EXPRs.
1049 1999-10-03 Mark Mitchell <mark@codesourcery.com>
1051 * cp-tree.def (VEC_INIT_EXPR): Remove.
1052 * cp-tree.h (struct stmt_tree): New type.
1053 (struct saved_scope): Remove firstobj. Add x_saved_tree,
1055 (class_cache_firstobj): Remove.
1056 (struct language_function): Remove stmts_are_full_exprs_p,
1057 x_last_tree, and x_last_expr_type. Add x_stmt_tree.
1058 (current_stmt_tree): New macro.
1059 (last_tree): Adjust.
1060 (last_expr_type): Likewise.
1061 (doing_semantic_analysis_p): Simplify.
1062 (stmts_are_full_exprs_p): Adjust.
1063 (begin_tree): Remove prototype.
1064 (end_tree): Likewise.
1065 (begin_stmt_tree): Change prototype.
1066 (finish_stmt_tree): Likewise.
1067 (building_stmt_tree): Simplify.
1068 * decl.c (mark_stmt_tree): New function.
1069 (mark_saved_scope): Use it.
1070 (start_function): Rearrange slightly to call begin_stmt_tree
1072 (save_function_data): Tweak.
1073 (finish_function): Adjust call to finish_stmt_tree.
1074 (mark_lang_function): Use mark_stmt_tree.
1075 * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
1076 * init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
1077 (build_vec_init): Remove creation of stand-in intializer.
1078 * pt.c (begin_tree): Remove.
1079 (end_tree): Likewise.
1080 * semantics.c (SET_LAST_STMT): New macro. Use it throughout.
1081 (begin_compound_stmt): Handle a compound-statement outside of a
1083 (begin_stmt_expr): Handle a statement-expression outsidef of a
1085 (finish_stmt_expr): Likewise.
1086 (begin_class_definition): Don't call begin_tree.
1087 (finish_inline_definitions): Don't call end_tree.
1088 (begin_stmt_tree): Take a pointer to tree, not a function as input.
1089 (finish_stmt_tree): Likewise.
1090 * tree.c (search_tree): Don't handle VEC_INIT_EXPR.
1093 * parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
1094 * parse.c: Regenerated.
1096 * dump.c (dqueue_and_dump): Dump bitfieldness.
1098 * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
1099 bitfields, rather than DECL_BIT_FIELD.
1100 * ir.texi: Document how to tell whether or not a field is a
1103 * lex.c (make_lang_type): Fix typo in comment.
1105 1999-10-01 Jason Merrill <jason@yorick.cygnus.com>
1107 * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
1109 1999-10-01 Mark Mitchell <mark@codesourcery.com>
1111 * pt.c (tsubst_decl): If the type of a template instantiation is
1112 bogus, so is the whole instantiation.
1114 1999-09-30 Mark Mitchell <mark@codesourcery.com>
1116 * decl.c (initialize_local_var): Handle static variables here.
1117 (cp_finish_decl): Tweak handling of function-scope static
1119 * semantics.c (expand_stmt): Handle DECL_STMTs for static
1122 * method.c (emit_thunk): Don't crash when -fsyntax-only.
1124 * cp-tree.h (lang_decl_flags): Add global_ctor_p and
1125 global_dtor_p. Add init_priority.
1126 (DECL_ACCESS): Adjust accordingly.
1127 (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
1128 (GLOBAL_INIT_PRIORITY): Likewise.
1129 * decl.c (lang_mark_tree): Adjust accordingly.
1130 (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
1131 and GLOBAL_INIT_PRIORITY.
1132 * dump.c (dequeue_and_dump): Print them.
1133 * ir.texi: Document them.
1135 * decl2.c (struct priority_info_s): Remove initialization_sequence
1136 and destruction_sequence.
1137 (start_static_storage_duration_function): Return the body of the
1138 function. Convert for function-at-a-time mode.
1139 (generate_inits_for_priority): Remove.
1140 (finish_static_storage_duration_function): Change prototype.
1141 Adjust for function-at-a-time mode.
1142 (do_static_initialization): Likewise.
1143 (do_static_destruction): Likewise.
1144 (do_static_initialization_and_destruction): Remove.
1145 (start_static_initialization_or_destruction): New function.
1146 (finish_static_initialization_or_destruction): Likewise.
1147 (get_priority_info): Don't manipulation initialization_sequence or
1148 destruction_sequence.
1149 (prune_vars_needing_no_initialization): New function.
1150 (write_out_vars): Likewise.
1151 (finish_file): Use the various new functions instead of the old.
1153 Thu Sep 30 00:13:27 1999 Dirk Zoller <duz@rtsffm.com>
1155 * cp-tree.h (warn_float_equal): Declare.
1156 * decl2.c (warn_float_equal): Define.
1157 (lang_decode_option): Recognize -W[no-]float-equal.
1158 * typeck.c (build_binary_op_nodefault): Conditionally warn
1159 about equality tests of floating point types.
1161 1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
1163 Support normal type_info-based EH mechanisms with -fno-rtti.
1164 * except.c (build_eh_type_type): Remove special -fno-rtti handling.
1165 (build_eh_type_type_ref): Likewise.
1166 (build_eh_type): Remove.
1167 (expand_throw): Call build_eh_type_type, not build_eh_type.
1168 * decl2.c (import_export_decl): Don't associate the tinfo fn with
1169 the vtable if -fno-rtti.
1170 * decl.c (init_decl_processing): Always init_rtti_processing.
1172 * rtti.c (get_typeid): Don't complain about -fno-rtti.
1174 * class.c (class_cache_obstack, class_obstack): Remove.
1175 (init_class_processing): Don't initialize class_obstack.
1176 (push_cache_obstack): Remove.
1177 (pushclass): Don't call it.
1178 * cp-tree.h: Remove prototype for push_cache_obstack.
1179 * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
1180 (pushlevel_class): Don't push_decl_level.
1181 (poplevel_class): Don't pop_stack_level.
1182 (push_class_level_binding): Don't push_cache_obstack.
1183 (init_decl_processing): Don't intialize decl_obstack.
1184 * search.c (push_class_decls): Don't push_cache_obstack.
1185 * tree.c (list_hash_add): Put hash node on permanent_obstack.
1186 (hash_tree_cons): Don't mess with obstacks.
1187 (print_lang_statistics): Don't print stats for class_obstack and
1190 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1192 * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
1193 * ir.texi: Document DECL_EXTERNAL.
1195 * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
1196 * ir.texi: Document THUNK_DECLs.
1198 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
1199 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1200 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1201 * error.c (dump_template_bindings): Remove unused parameter.
1202 Handle multiple levels of template parameters.
1203 (dump_template_decl): Use `parms', not `args', for template
1204 parameters. Fix thinko.
1205 (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass
1206 flags to dump_template_bindings.
1207 * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
1208 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1209 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1210 (tsubst_copy): Clarify variable name.
1211 (most_general_template): Robustify.
1213 1999-09-29 Nathan Sidwell <nathan@acm.org>
1215 * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
1216 to change primary template rendering.
1218 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1220 * cp-tree.h (UPT_TEMPLATE): Remove.
1221 (UPT_PARMS): Likewise.
1222 (DECL_NEEDED_P): New macro.
1223 * decl2.c (finish_vtable_vardecl): Use it.
1224 (finish_objects): Don't crash with -fsyntax-only.
1225 (finish_file): Use DECL_NEEDED_P. Don't prune vtables when
1227 * pt.c (tsubst_friend_function): Remove FIXME that talks about
1229 (tsubst_expr): Correct handling of function try-blocks.
1230 * semantics.c: Include flags.h.
1231 (expand_body): Don't do RTL generation if -fsyntax-only.
1232 * Makefile.in (semantics.o): Depends on flags.h.
1234 1999-09-28 Gabriel Dos Reis <gdr@codesourcery.com>
1236 * pt.c (most_general_template): Adjust declaration.
1238 * cp-tree.h: (most_general_template): Declare.
1240 * error.c (dump_template_value): Rename to ...
1241 (dump_template_argument): This.
1242 (dump_template_argument_list): New function.
1243 (dump_type): Use it.
1244 (dump_template_parameter): New function.
1245 (dump_template_decl): Use it.
1246 (dump_template_bindings): New function.
1247 (dump_function_decl): Use it. Pretty print function template
1250 1999-09-28 Nathan Sidwell <nathan@acm.org>
1252 * decl.c (grokdeclarator): Distinguish parameter context for
1253 diagnostics. Tidy up missing type diagnostic.
1254 Diagnose `explicit' in one place. Diagnose `mutable' in one place.
1256 1999-09-28 Mark Mitchell <mark@codesourcery.com>
1258 * ir.texi: Improve documentation for TARGET_EXPR.
1260 1999-09-27 Nathan Sidwell <nathan@acm.org>
1262 Augment stringification of trees.
1263 * cp-tree.h (tree_string_flags): New error stringifying enumeration.
1264 (fndecl_as_string, type_as_string_real, args_as_string,
1265 code_as_string, language_as_string, parm_as_string,
1266 op_as_string, assop_as_string, cv_as_string): Remove.
1267 (type_as_string, decl_as_string, expr_as_string): Adjust prototype.
1268 (context_as_string): Declare new function.
1269 * error.c (cp_printers): Move definition.
1271 (OB_END_TEMPLATE_ID): Adjust.
1272 (interesting_scope_p): Remove.
1273 (dump_scope): New static function.
1274 (dump_qualifiers): Adjust prototype, reimplement.
1275 (dump_template_value): Use tree_string_flags.
1276 (dump_type_real): Move back to dump_type.
1277 (dump_type): Adjust prototype. Use tree_string_flags.
1278 (dump_aggr_type): Likewise. Use dump_template_parms.
1279 (dump_type_prefix): Adjust prototype. Use tree_string_flags.
1281 (dump_type_suffix): Adjust prototype. Use tree_string_flags.
1282 (dump_simple_decl): Likewise.
1283 (dump_decl): Likewise. Use dump_template_decl.
1284 (dump_template_decl): New static function broken out of dump_decl.
1285 (dump_function_decl): Adjust prototype. Use tree_string_flags.
1286 (dump_parameters): Likewise. Prefix space.
1287 (dump_exception_spec): Adjust prototype. Use tree_string_flags.
1288 (dump_function_name): Likewise. Use dump_template_parms.
1289 (dump_template_parms): New static function broken out of
1291 (dump_expr_list): Adjust prototype. Use tree_string_flags.
1292 (dump_expr): Likewise.
1293 (fndecl_as_string): Removed
1294 (type_as_string_real): Removed
1295 (dump_binary_op): Adjust prototype. Use tree_string_flags.
1296 (dump_unary_op): Likewise.
1297 (type_as_string): Likewise.
1298 (expr_as_string): Likewise.
1299 (decl_as_string): Likewise.
1300 (context_as_string): New function.
1301 (lang_decl_name): Adjust.
1302 (decl_to_string): New static print callback.
1303 (expr_to_string): Likewise.
1304 (fndecl_to_string): Likewise.
1305 (code_as_string): Renamed to ...
1306 (code_to_string): ... here. Adjust.
1307 (language_as_string): Renamed to ...
1308 (language_to_string): ... here. Adjust.
1309 (parm_as_string): Renamed to ...
1310 (parm_to_string): ... here.
1311 (op_as_string): Renamed to ...
1312 (op_to_string): ... here.
1313 (assop_as_string): Renamed to ...
1314 (assop_to_string): ... here.
1315 (type_to_string): New static print callback.
1316 (args_as_string): Renamed to ...
1317 (args_to_string): ... here. Adjust.
1318 (cv_as_string): Renamed to ...
1319 (cv_to_string): ... here. Adjust.
1320 * pt.c (mangle_class_name_for_template): Use tree_string_flags.
1321 (print_template_context): Likewise.
1323 1999-09-26 Mark Mitchell <mark@codesourcery.com>
1325 * cp-tree.h (expand_throw): Remove prototype.
1326 * except.c (expand_throw): Make it static. Use tree-generation
1327 functions, rather than RTL-generation functions.
1328 (build_throw): Use it.
1329 * expr.c: Include except.h.
1330 (cplus_expand_expr): Don't call expand_throw here.
1331 * Makefile.in (expr.o): Depend on except.h.
1332 * ir.texi: Update documentation for THROW_EXPR.
1334 * decl.c (start_function): Set x_dont_save_pending_sizes rather
1335 than calling get_pending_sizes.
1336 * init.c (build_new): Don't save and restore
1337 immediate_size_expand; instead, assert that it has the expected
1340 1999-09-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1342 * lex.c (compiler_error): Add missing call to va_end().
1344 1999-09-25 Mark Mitchell <mark@codesourcery.com>
1346 * dump.c (dequeue_and_dump): Handle RESULT_DECL.
1347 * ir.texi: Document RESULT_DECL and DECL_RESULT.
1349 * cp-tree.h (check_return_expr): New function.
1350 * decl.c (finish_constructor_body): New function.
1351 (pushdecl): Put global friend functions in namespace binding
1352 level, not the class binding level.
1353 (finish_destructor_body): Make sure the dtor_label is always
1354 defined. Fix typo in comment.
1355 (finish_function): Move generation of constructor-termination code
1356 to semantic-analysis time. Move generation of implicit `main'
1357 return value to semantic-analysis time.
1358 * semantics.c (finish_return_stmt): Generate goto's to
1359 ctor_label/dtor_label here. Use check_return_expr to do semantic
1360 analysis on the returned expression.
1361 * typeck.c (maybe_warn_about_returning_address_of_local): New
1362 function split out from c_expand_return.
1363 (check_return_expr): Likewise.
1364 (c_expand_return): Just generate the RTL for the return.
1366 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1368 * cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
1369 (cleanup_type): Likewise.
1370 (search_tree): Change prototype.
1371 * decl.c (local_variable_p): Adjust for new interface to
1373 (check_default_argument): Likewise.
1374 * error.c (dump_expr): Handle INIT_EXPR.
1375 * except.c (expand_throw): Don't make cleanup_type a local static.
1376 * expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
1377 * init.c (build_new): Call build_new_1 directly, rather than
1378 building a NEW_EXPR.
1379 (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when
1380 processing file-scope initializers.
1381 * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
1382 * tree.c: Include splay-tree.h
1383 (no_linkage_helper): Adjust for new interface to search_tree.
1384 (search_tree): Pass around pointers to tree nodes, rather than the
1385 nodes themselves. Handle VEC_INIT_EXPR.
1386 (no_linkage_check): Adjust for new interface to search_tree.
1387 (mapcar): Handle VEC_INIT_EXPR.
1388 (target_remap): New variable.
1389 (bot_manip): Use it.
1390 (bot_replace): New function.
1391 (break_out_target_exprs): Use it to remap all variables used in a
1392 default argument expression.
1393 * typeck.c (build_modify_expr): Don't crash when outside a
1394 function and presented with an INIT_EXPR assignment
1395 * Makefile.in (tree.o): Depend on splay-tree.h.
1397 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1399 * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
1401 (builtin_function): New arg CLASS. Arg CODE now of type int. All
1403 Set the builtin's DECL_BUILT_IN_CLASS.
1405 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1407 * decl.c (pushdecl): Don't make local declarations of extern
1408 variables give the variable a DECL_CONTEXT for the function.
1409 (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify.
1410 Don't accidentally make RTL for local declarations.
1411 (emit_local_var): Handle declarations with asm-specifiers here.
1413 1999-09-23 Mark Mitchell <mark@codesourcery.com>
1415 * ir.texi: Improve documentation for TARGET_EXPRs. Discuss
1416 STMT_IS_FULL_EXPR_P.
1418 * cp-tree.h (language_function): Add cannot_inline.
1419 * decl.c (start_function): Restore current_function_cannot_inline
1420 from the saved value.
1421 (save_function_data): Save current_function_cannot_inline.
1422 * decl2.c (start_objects): Change prototype. Build the function
1423 in function-at-a-time mode.
1424 (finish_objects): Likewise.
1425 (generate_ctor_or_dtor_function): Adjust accordingly.
1427 * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
1428 * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
1429 Don't call expand_anon_union_decl here
1430 * semantics.c (exapnd_stmt): Call it here, instead.
1431 * typeck.c (mark_addressable): Addressed variables are implicitly
1434 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1436 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
1437 (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
1438 (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
1439 * cp-tree.h: Add tree checking macros to various tree access
1441 * ptree.c (print_lang_decl): Test for function or variable
1442 before accessing template info.
1444 1999-09-23 Jason Merrill <jason@yorick.cygnus.com>
1446 * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
1447 * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
1448 * decl2.c (lang_f_options): Add -fshort-wchar.
1449 * cp-tree.h: Declare flag_short_wchar.
1450 * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned
1453 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1455 * ir.texi: Fix formatting errors and typos.
1457 1999-09-22 Mark Mitchell <mark@codesourcery.com>
1459 * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
1461 * decl.c (pushdecl): Do create a binding for extern "C" functions,
1462 but not for their DECL_ASSEMBLER_NAMEs.
1463 (lookup_name_current_level): Fix formatting.
1464 (xref_tag): Likewise.
1465 * decl2.c (start_objects): Mark static constructors and
1466 destructors as used.
1468 1999-09-22 Jason Merrill <jason@yorick.cygnus.com>
1470 * decl.c (define_case_label): Don't crash if we're not in a switch.
1472 * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
1473 * lang-options.h: Restore -fthis-is-variable. Remove help strings
1474 for unsupported flags.
1476 1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
1478 * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
1479 Accept and warn about -fthis-is-variable.
1481 1999-09-21 Mark Mitchell <mark@codesourcery.com>
1483 * dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
1484 CLEANUP_STMT, and SCOPE_STMT.
1486 * decl2.c (lang_decode_option): Adjust, in the wake of recent
1487 changes to option processing.
1489 1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1491 * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
1492 function pointer from pmfs with no object given.
1493 (convert_for_assignment): Do not return error when converting
1496 1999-09-21 Alex Samuel <samuel@codesourcery.com>
1498 * lex.c (internal_filename): New variable.
1499 (INTERNAL_FILENAME): New macro.
1500 (init_parse): Allocate internal_filename and mark as root. Use it
1501 instead of a string constant.
1503 1999-09-21 Nathan Sidwell <nathan@acm.org>
1505 Reimplement dynamic cast and catch matching.
1506 * cp-tree.h (get_dynamic_cast_base_type): Prototype new function
1507 * search.c (dynamic_cast_base_recurse): New function.
1508 (get_dynamic_cast_base_type): New function for dynamic cast.
1509 * rtti.c (build_dynamic_cast_1): Determine source and target
1510 class relationship. Call __dynamic_cast_2.
1511 * tinfo.h (__user_type_info::upcast): New catch dispatcher.
1512 (__user_type_info::dyncast): New dynamic cast dispatcher.
1513 (__user_type_info::sub_kind): New nested enumeration.
1514 (__user_type_info::contained_p): sub_kind predicate.
1515 (__user_type_info::contained_public_p): Likewise.
1516 (__user_type_info::contained_nonpublic_p): Likewise.
1517 (__user_type_info::contained_nonvirtual_p: Likewise.
1518 (__user_type_info::upcast_result): New nested struct.
1519 (__user_type_info::dyncast_result): New nested struct.
1520 (*::do_upcast): New catch function.
1521 (*::do_dyncast): New dynamic cast function.
1522 (__user_type_info::find_public_subobj): New dynamic cast
1524 (*::do_find_public_subobj): New dynamic cast helper function.
1525 * tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
1526 (__user_type_info::dyncast): Define dynamic cast dispatcher.
1527 (*::do_upcast): Define catch function.
1528 (*::do_dyncast): Define dynamic cast function.
1529 (*::do_find_public_subobj): Define dynamic cast helper function.
1530 * tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
1531 (__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
1532 (__dynamic_cast_2): New dynamic cast runtime.
1534 1999-09-20 Mark Mitchell <mark@codesourcery.com>
1536 * cp-tree.h (finish_stmt_expr): Change prototype.
1537 * expr.c (cplus_expand_expr): Adjust call accordingly.
1538 * init.c (finish_init_stmts): Likewise.
1539 * parse.y (primary): Likewise.
1540 * pt.c (tsubst_copy): Likewise.
1541 * semantics.c (finish_stmt_expr): Don't take two parameters.
1542 Don't remove generated BLOCKs from the block-tree.
1544 Remove support for assigning to `this'.
1545 * NEWS: Note that fact.
1546 * class.c (build_vbase_path): Don't check flag_this_is_variable.
1547 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
1548 (language_function): Remove assigns_this, just_assigned_this, and
1549 x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p.
1550 (base_init_expr): Remove.
1551 (current_vcalls_possible_p): New macro.
1552 (vtbls_set_up_p): Likewise.
1553 (emit_base_init): Change prototype.
1554 * decl.c (finish_destructor_body): New function, split out from
1556 (current_function_assigns_this): Remove.
1557 (current_function_just_assigned_this): Likewise.
1558 (start_function): Don't set them.
1559 (finish_function): Don't check them. Don't emit
1560 base-initialization code here. Generate code for destructors when
1561 doing semantic analysis.
1562 (finish_stmt): Don't check current_function_just_assigned_this.
1563 * decl2.c (lang_f_options): Remove this-is-variable.
1564 (lang_decode_option): Likewise.
1565 (grokclassfn): Don't check flag_this_is_variable.
1566 * init.c (emit_base_init): Return the expression generated.
1567 (construct_virtual_bases): Don't push/pop obstacks. Fix
1569 (build_new_1): Don't check flag_this_is_variable.
1570 (get_temp_regvar): Don't set DECL_REGISTER.
1571 (build_vec_init): Don't call use_variable.
1572 * lang-options.h: Remove "-fthis-is-variable" and
1573 "-fno-this-is-variable".
1574 * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
1575 * search.c (expand_upcast_fixups): Use finish_expr_stmt, not
1577 * semantics.c (finish_expr_stmt_real): Rename to ...
1578 (finish_expr_stmt): This. Remove assigned_this parameter.
1579 (begin_if_stmt): Call do_pushlevel before starting the statement.
1580 (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
1582 (setup_vtbl_ptr): Emit initialization code for bases and members
1583 at semantic-analysis time. Emit code to initialize vtables in
1585 (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
1586 Don't handle CTOR_INITIALIZER any more.
1587 * typeck.c (build_modify_expr): Don't check for assignments to
1589 (c_expand_return): Don't suggest assigning to `this'.
1591 * Makefile.in (decl.o): Depend on RTL_H.
1592 (decl2.o): Likewise.
1593 (class.o): Likewise.
1595 (method.o): Likewise.
1596 (search.o): Likewise.
1600 * decl.c (duplicate_decls): When a builtin function is redeclared
1601 as static, make sure it is mangled correctly.
1603 * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add
1604 detail about the statement-tree.
1606 1999-09-20 Nathan Sidwell <nathan@acm.org>
1608 * parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
1610 1999-09-20 Nick Clifton <nickc@cygnus.com>
1612 * decl2.c (lang_decode_option): Extend comment.
1614 Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1616 * typeck.c: Include "tm_p.h".
1618 1999-09-19 Mark Mitchell <mark@codesourcery.com>
1620 * ir.texi: New file.
1622 1999-09-19 Paul Burchard <burchard@pobox.com>
1624 * semantics.c (expand_stmt): Initialize return value.
1626 1999-09-18 Paul Burchard <burchard@pobox.com>
1628 * gxxint.texi: G++ now implements namespaces.
1630 1999-09-18 Mark Mitchell <mark@codesourcery.com>
1632 * decl.c (pop_label): Don't warn about unused labels more than
1634 * semantics.c (finish_goto_stmt): Always marked used labels as
1637 * decl.c (layout_var_decl): Change prototype. Call layout_decl
1638 even when the declaration is external.
1639 (cp_finish_decl): Adjust call to layout_var_decl.
1640 * pt.c (tsubst_expr): Make sure to initialize stmt before using it.
1642 1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
1644 * typeck.c (get_member_function_from_ptrfunc): Always consider
1645 virtuality inside member pointer.
1647 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1649 Turn on function-at-a-time processing.
1650 * cp-tree.h (doing_semantic_analysis_p): New macro.
1651 (SF_DEFAULT): Define to zero, not SF_EXPAND.
1652 (start_handler_parms): Change prototype.
1653 (expand_start_catch_block): Likewise.
1654 (expand_end_catch_block): Likewise.
1655 (expand_start_eh_spec): Likewise.
1656 (expand_end_eh_spec): Declare.
1657 (finish_handler_parms): Change prototype.
1658 (begin_catch_block): Declare.
1659 (finish_handler): Change prototype.
1660 (do_pushlevel): Declare.
1661 (do_poplevel): Likewise.
1662 * decl.c (pushlevel): Don't create
1663 binding levels when not doing semantic analysis.
1664 (poplevel): Don't pop them.
1665 (pushdecl): Assert that we are never called when not doing
1667 (pushdecl_top_level): Use push_to_top_level.
1668 (make_label_decl): Don't fiddle with obstacks. Make RTL For the
1669 label when expanding.
1670 (cp_finish_decl): Only inject for-scope variables when doing
1671 semantic analysis. Add comments.
1672 (start_handler_parms): Return the handler parm.
1673 (start_function): Reorganize. Don't clear DECL_INITIAL if it is
1674 already set. Reinitialize from saved function data if available.
1675 Don't pushlevel when not doing semantic analysis.
1676 (store_parm_decls): Only generate RTL when expanding. Only
1677 pushdecl when doing semantic analysis. Set
1678 current_eh_spec_try_block if appropriate.
1679 (finish_function): Simplify. Use do_pushlevel and do_poplevel.
1680 Combine common code. Don't poplevel when not doing semantic
1682 (push_cp_function_context): Don't expand functions without an
1683 explicit call to expand_body.
1684 (mark_lang_function): Make eh_spec_try_block and
1686 * except.c (expand_end_eh_spec): Don't
1688 (process_start_catch_block): Likewise.
1689 (push_eh_cleanup): Use finish_decl_cleanup.
1690 (initialize_handler_parm): New function.
1691 (expand_start_catch_block): Use it.
1692 (expand_end_catch_block): Use tree-generation functions, not
1693 RTL-generation functions.
1694 (expand_start_eh_spec): Likewise.
1695 (expand_end_eh_spec): Likewise.
1696 (expand_exception_blocks): Simplify.
1697 (start_anon_func): Use do_pushlevel.
1698 (end_anon_func): Use do_poplvel. Call expand_body for the
1700 * expr.c (do_case): Don't call define_case_label.
1701 * init.c (create_temporary_var): Set DECL_CONTEXT for local
1703 * method.c (emit_thunk): Call expand_body for the
1705 (sythesize_method): Likewise.
1706 * parse.y (handler_args): Give it ttype.
1707 (eat_saved_input): Call expand_body.
1708 (base_init): Use do_pushlevel.
1709 (pending_inline): Call expand_body.
1710 (handler): Adjust calls to finish_handler_parms and
1712 (handler_args): Don't call expand_start_catch_block. Return the
1713 catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling.
1714 * parse.c: Regenerated.
1715 * rtti.c (synthesize_tinfo_fn): Call finish_function.
1716 * semantics.c (do_pushlevel): Give it external linkage. Build
1718 (do_poplevel): Likewise.
1719 (finish_case_label): Call define_case_label when doing semantic
1721 (finish_goto_stmt): Create RTL for labels.
1722 (finish_function_try_block): Set in_function_try_handler
1724 (finish_function_handler_sequence): Unset it.
1725 (finish_handler_parms): Use expand_start_catch_block even when
1726 building a statement-tree.
1727 (begin_catch_block): New function.
1728 (finish_handler): Move a little RTL-generation logic here.
1729 (finish_decl_cleanup): Allow cleanups for empty declarations.
1730 (finish_named_return_value): Don't pushdecl when not doing
1732 (expand_stmt): Don't do semantic analysis for variable
1733 declarations. Handle START_CATCH_STMT. Call expand_label
1734 directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust
1735 HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
1736 (expand_body): Let expand_stmt handle CTOR_INITIALIZER,
1737 RETURN_INIT and function try blocks.
1739 * cp-tree.h (language_function): Add x_eh_spec_try_block. Add
1740 x_scope_stmt_stack. Add x_in_charge_parm.
1741 (current_eh_spec_try_block): New macro.
1742 (current_scope_stmt_stack): Likewise.
1743 (current_in_charge_parm): Likewise.
1744 * decl.c (start_function): Initialize current_in_charge_parm.
1745 (finish_function): Use current_in_charge_parm rather than looking
1747 * search.c (expand_indirect_vtbls_init): Likewise.
1749 * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
1750 (TRY_BLOCK): Likewise.
1751 (HANDLER): Likewise.
1752 (START_CATCH_STMT): New tree node.
1753 (SCOPE_STMT): Likewise.
1754 * cp-tree.h (SCOPE_BEGIN_P): New macro.
1755 (SCOPE_NULLIFIED_P): Likewise.
1756 (struct lang_decl_flags): Add pending_inline_p. Adjust dummy.
1757 (struct lang_decl): Add saved_language_function.
1758 (DECL_PENDING_INLINE_INFO): Adjust documentation.
1759 (DECL_PENDING_INLINE_P): New macro.
1760 (TYPE_TI_ARGS): Fix typo in comment.
1761 (DECL_SAVED_TREE): Add to documentation.
1762 (DECL_SAVED_FUNCTION_DATA): New macro.
1763 (START_CATCH_TYPE): Likewise.
1764 (SCOPE_END_P): New macro.
1765 (declare_parm_level): Don't declare.
1766 * decl.c (mark_lang_function): New function, split out from
1767 mark_cp_function_context.
1768 (save_function_data): New function.
1769 (declare_parm_level): Remove.
1770 (finish_function): Use save_function_data to squirrel away
1771 important stuff for later use.
1772 (mark_cp_function_context): Use mark_function_data.
1773 (lang_mark_tree): Likewise.
1774 * lex.c (begin_definition_of_inclass_inline): Set
1775 DECL_PENDING_INLINE_P.
1776 (store_pending_inline): Clear it.
1777 * pt.c (tsubst_decl): Likewise.
1779 1999-09-17 Nathan Sidwell <nathan@acm.org>
1781 * call.c (perform_implicit_conversion): Deal with error_mark_node.
1783 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1785 * decl.c (warn_extern_redeclared_static): Don't get confused by
1786 static member functions.
1787 (duplicate_decls): Merge DECL_THIS_STATIC.
1789 * decl.c (expand_static_init): Make sure assignments to local
1790 statics actually occur.
1792 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1794 * cp-tree.h (poplevel_class): Declare.
1795 * class.c (popclass): Use poplevel_class, not poplevel.
1796 * decl.c (poplevel_class): Don't make it static. Don't return a
1798 (poplevel): Don't call poplevel_class; abort in a class
1799 binding level is seen.
1800 * semantics.c (finish_translation_unit): Use pop_everything.
1801 * parse.y (member_init): Allow errors.
1802 (pending_inline): Call finish_function.
1803 * parse.c: Regenerated.
1804 * Makefile.in (CONFLICTS): Adjust.
1806 1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
1808 * error.c: Reduce code duplication.
1809 (dump_template_value): New function.
1810 (dump_type_real): Use it.
1811 (dump_decl): Likewise.
1812 (dump_function_name): Likewise.
1813 (dump_function_decl): Don't be too talkative about function return
1816 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1818 * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
1820 * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
1822 1999-09-16 Jason Merrill <jason@yorick.cygnus.com>
1824 * decl2.c (finish_file): Also call check_global_declarations for
1825 the pending_statics list.
1827 1999-09-15 Jason Merrill <jason@yorick.cygnus.com>
1829 * lex.c (cp_pragma_implementation): Allow #pragma implementation
1832 1999-09-15 Richard Henderson <rth@cygnus.com>
1834 * lex.c (mark_impl_file_chain): Follow the next chain.
1836 1999-09-15 Mark Mitchell <mark@codesourcery.com>
1838 * decl.c (warn_extern_redeclared_static): Simplify. Catch
1839 problems with extern "C" functions redeclared as static.
1840 (duplicate_decls): When a builtin is redeclared static, make the
1841 new function have internal linkage.
1843 1999-09-15 Mark Mitchell <mark@codesourcery.com>
1845 * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
1846 * pt.c (tsubst_copy): Likewise.
1847 * tree.c (search_tree): Likewise.
1850 1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1852 * typeck2.c (ack): Don't declare progname.
1854 1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
1856 * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
1857 filenames with ggc_alloc_string.
1859 1999-09-14 Mark Mitchell <mark@codesourcery.com>
1861 * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
1863 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
1865 * cvt.c (build_up_reference): Likewise.
1866 * tree.c (build_cplus_new): Likewise.
1867 (get_target_expr): Likewise.
1869 Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org>
1871 * Makefile.in: Prepend $(SHELL) to move-if-change calls.
1873 1999-09-13 Mark Mitchell <mark@codesourcery.com>
1875 * cp-tree.h (build_target_expr): New function.
1876 * call.c (build_conditional_expr): Use build_target_expr.
1877 (convert_like): Likewise.
1878 (build_over_call): Likewise.
1879 * cvt.c (build_up_reference): Likewise.
1880 * decl.c (build_cleanup_on_safe_obstack): Fold into ...
1881 (destroy_local_var): Here.
1882 (build_target_expr): New function.
1883 * tree.c (build_cplus_new): Use it.
1884 (get_target_expr): Likewise.
1886 1999-09-13 Nathan Sidwell <nathan@acm.org>
1888 * typeck.c (expr_sizeof): Don't decay arrays and functions.
1889 Remove misleading comment.
1890 (build_compound_expr): Don't decay arrays.
1892 1999-09-13 Jason Merrill <jason@yorick.cygnus.com>
1894 * call.c (build_conditional_expr): Always use a TARGET_EXPR for
1895 class rvalues again.
1897 Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1899 * Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
1901 * g++spec.c: Include gcc.h.
1902 (lang_specific_driver): Constify a char*. Call xcalloc, not
1903 xmalloc/bzero. All calls to the function pointer parameter now
1904 explicitly call `fatal'.
1906 1999-09-12 Mark Mitchell <mark@codesourcery.com>
1908 * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
1909 * cvt.c (ocp_convert): Complete the from and destination types.
1910 Adjust warning about functions always being `true' in conditionals.
1911 * decl.c (duplicate_decls): Don't play funny games with abort.
1912 * error.c (dump_expr): Handle OVERLOADs.
1913 * spew.c (probe_obstack): Remove.
1914 * typeck.c (condition_conversion): Use perform_implicit_conversion.
1916 1999-09-12 Bernd Schmidt <bernds@cygnus.co.uk>
1918 * cp-tree.h (auto_function, define_function): Adjust prototypes.
1919 * decl.c (define_function): Lose FUNCTION_CODE arg. All callers
1921 (auto_function): Likewise, for CODE arg.
1922 Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
1923 (builtin_function): ... here.
1925 1999-09-11 Mark Mitchell <mark@codesourcery.com>
1927 * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
1928 (init_decl_processing): Don't set TREE_PERMANENT for the
1930 (start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
1931 (grokdeclarator): Likewise.
1932 (grokparms): Don't check TREE_PERMANENT when building up lists.
1933 * decl2.c (grokfield): Don't assert TREE_PERMANENT.
1934 (mark_inline_for_output): Likewise.
1935 * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
1936 * init.c (build_offset_ref): Don't check TREE_PERMANENT.
1937 * lex.c (check_newline): Don't check ggc_p; it is always one.
1938 * pt.c (process_template_parm): Don't check TREE_PERMANENT.
1939 * spew.c (yylex): Don't copy_node or probe_obstacks for
1940 non-permanent CONSTANTs and STRINGs.
1941 * tree.c (build_cplus_array_type_1): Don't fuss with
1942 TREE_PERMANENT on ARRAY_TYPEs.
1944 * cp-tree.def (CLEANUP_STMT): New node.
1945 * cp-tree.h (language_function): Add name_declared.
1946 (current_function_name_declared): New macro.
1947 (CLEANUP_DECL): New macro.
1948 (CLEANUP_EXPR): Likewise.
1949 (emit_local_var): Likewise.
1950 (finish_decl_cleanup): New function.
1951 * cvt.c (build_up_reference): Simplify.
1952 (ocp_convert): Remove dead code.
1953 * decl.c (start_decl): Remove call to add_decl_stmt.
1954 (grok_reference_init): Adjust, to handle bindings temporaries to
1955 references. Remove dead code.
1956 (initialize_local_var): Don't generate RTL for
1957 declarations here, or build cleanups here. Don't fuss with
1958 obstacks. Replace expand_start_target_temps calls with explicit
1959 setting of stms_are_full_exprs_p.
1960 (destroy_local_var): New function.
1961 (emit_local_var): Likewise.
1962 (cp_finish_decl): Use them, as appropriate.
1963 (start_function): Announce template functions.
1964 (store_parm_decls): Don't call declare_function_name here.
1965 (finish_stmt): Don't start emit base-initialization code when just
1966 building the statement-tree.
1967 * init.c (create_temporary_var): Move add_decl_stmt call ...
1968 (get_temp_regvar): Here.
1969 * pt.c (tsubst_expr): Make DECL_INITIAL look like what
1970 cp_finish_decl would expect. Don't call add_decl_stmt.
1971 * semantics.c (begin_compound_stmt): Call declare_function_name,
1973 (finish_decl_cleanup): New function.
1974 (expand_stmt): Use emit_local_var to output variables.
1975 (expand_body): Set current_funtion_name_declared.
1977 1999-09-10 Mark Mitchell <mark@codesourcery.com>
1979 * cp-tree.h (finish_cleanup_try_block): New function.
1980 * semantics.c (finish_cleanup_try_block): Add comment.
1982 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1984 * cp-tree.h: Delete declarations for all tree nodes now moved to
1986 * decl.c: Delete their definitions.
1987 (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
1988 FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
1990 (init_decl_processing): Call build_common_tree_nodes and
1991 build_common_tree_nodes_2 instead of building their nodes here.
1992 Don't add gc roots for them.
1994 1999-09-10 Mark Mitchell <mark@codesourcery.com>
1996 * cp-tree.h (language_function): Rename expanding_p to
1997 x_expanding_p. Rename named_label_uses to x_named_label_uses.
1998 (expanding_p): Adjust accordingly.
1999 (TREE_VIA_PRIVATE): Fix typo in comment.
2000 (DECL_REFERENCE_SLOT): Remove.
2001 (SET_DECL_REFERENCE_SLOT): Likewise.
2002 * decl.c (named_label_uses): Adjust. Remove chicken comment.
2003 (push_overloaded_decl): Don't truncate the chain of bindings when
2004 adding an overloaded function.
2005 (grok_reference_init): Don't use DECL_REFERENCE_SLOT.
2006 (initialize_local_var): Fix typo in comment.
2007 (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
2008 * decl2.c (start_objects): Make the fact that we are expanding
2009 the generated function right away explicit.
2010 (start_static_storage_duration_function): Likewise.
2011 (finish_file): Fix typo in comment.
2012 * init.c (build_vec_init): Correct bugs in handling cleanups.
2013 * semantics.c (maybe_convert_cond): New function.
2014 (FINISH_COND): Always store the condition, even if there's
2016 (finish_if_stmt_cond): Use maybe_convert_cond.
2017 (finish_while_stmt_cond): Likewise.
2018 (finish_do_stmt): Likewise.
2019 (finish_for_cond): Likewise.
2020 (expand_cond): Adjust.
2022 * cp-tree.h (FN_TRY_BLOCK_P): New macro.
2023 * init.c (perform_member_init): Remove obstack machinations.
2024 (expand_cleanup_for_base): Likewise.
2025 (finish_init_stmts): Mark the statement-expression as used.
2026 * method.c (emit_thunk): Use tree-generating functions, not
2028 (do_build_copy_constructor): Likewise.
2029 (do_build_assign_ref): Likewise.
2030 (synthesize_method): Likewise. Keep track of line numbers.
2031 * pt.c (tsubst_expr): Handle various kinds of try blocks.
2032 * semantics.c (expand_stmts): Remove.
2033 (begin_function_try_block): Set FN_TRY_BLOCK_P.
2034 (finish_function_try_block): Be careful rechaining
2035 function try blocks.
2036 (expand_stmt): Loop through all the statements at a given level.
2037 (exapnd_body): Be careful with line-numbers here too. Prepare for
2038 being called directly from the parser.
2040 * cp-tree.h (finish_function): Adjust prototype.
2041 * decl.c (finish_function): Return the function compiled.
2042 * pt.c (instantiate_decl): Don't play games with obstacks.
2043 * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
2044 (search_tree): Likewise.
2045 * typeck.c: Fix typo in comment.
2046 * typeck2.c (store_init_value): Add comment.
2048 * cp-tree.h (CPTI_ATEXIT): New macro.
2049 (atexit_node): Likewise.
2050 * decl.c (destroy_local_static): New function, broken out from ...
2051 (expand_static_init): Here.
2053 * rtti.c (get_tinfo_var): These should always be global
2054 (expand_si_desc): Use tree, not RTL, functions to generate code.
2055 (expand_class_desc): Likewise.
2056 (expand_ptr_desc): Likewise.
2057 (expand_attr_desc): Likewise.
2058 (expand_generic_desc): Likewise.
2059 (synthesize_tinfo_fn): Likewise.
2061 1999-09-09 Mark Mitchell <mark@codesourcery.com>
2063 * semantics.c (RECHAIN_STMTS): Remove `last' parameter.
2064 (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
2066 (RECHAIN_STMST_FROM_CHAIN): Likewise.
2068 * parse.y (simple_stmt): Fix typo in last change.
2070 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
2071 (STMT_IS_FULL_EXPR_P): Likewise.
2072 (STMT_LINENO_FOR_FN_P): Likewise.
2073 (prep_stmt): New function.
2074 (building_stmt_tree): Tweak for safety.
2075 * pt.c (tsubst_expr): Use prep_stmt throughout.
2076 (add_tree): Move it to semantics.c
2077 * semantics.c (add_tree): Move it here.
2078 (finish_expr_stmt_real): New function.
2079 (finish_expr_stmt): Use it.
2080 (finish_if_stmt_cond): Use FINISH_COND.
2081 (finish_while_stmt_cond): Likewise.
2082 (finish_for_cond): Likewise.
2083 (finish_stmt_tree): Tweak line-number handling.
2084 (prep_stmt): New function.
2085 (expand_stmt): Use it.
2087 * cp-tree.h (begin_switch_stmt): Adjust prototype.
2088 (finish_switch_cond): Likewise.
2089 * parse.y (simple_stmt): Adjust accordingly.
2090 * parse.c: Regenerated.
2091 * pt.c (tsubst_expr): Adjust accordingly.
2092 * semantics.c (expand_cond): New function.
2093 (FINISH_COND): New macro.
2094 (begin_switch_stmt): Build the SWITCH_STMT here.
2095 (finish_switch_stmt_cond): Not here.
2096 (expand_stmt): Adjust calls to begin_switch_stmt and
2097 finish_switch_cond. Use expand_cond throughout.
2099 * dump.c (dequeue_and_dump): Dump types for constants.
2100 Describe DECL_ARG_TYPE more intuitively.
2103 * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
2104 (lang_cleanup_tree): Remove.
2105 * lex.c (make_lang_type): Use ggc_alloc to allocate
2108 Reorganize per-function data.
2109 * cp-tree.h (saved_scope): Add function_decl, bindings.
2110 (language_function): Rename binding_level to bindings.
2111 (cp_function_chain): Use the current_function, not the
2112 outer_function_chain.
2113 (current_class_ptr): Make it work, even when there's no
2115 (current_class_ref): Likewise.
2116 (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
2118 (clear_temp_name): Remove.
2119 * decl.c (check_function_type): New function, broken out from
2121 (current_binding_level): Adjust definition.
2122 (pushlevel): Simplify.
2123 (poplevel): Don't use named_label_uses when we're outside
2125 (mark_saved_scope): Mark function_decl and bindings.
2126 (maybe_push_to_top_level): Don't unconditionally push a new
2127 function context. Save bindings and the current_function_decl.
2128 Don't clear named_labels.
2129 (pop_from_top_level): Pop function context if appropriate.
2130 (init_decl_processing): Set init_lang_status and free_lang_status,
2131 rather than save_lang_status and restore_lang_status.
2132 (start_function): Take SF_* flags. Don't clear per-function data.
2133 Reorder and simplify to use new per-function data code. Add
2135 (store_parm_decls): Don't call init_function_start here.
2136 (finish_function): Adjust for new handling of per-function data.
2137 (push_cp_function_context): Simplify.
2138 (mark_cp_function_context): Change binding_level to bindings.
2139 * decl2.c (clear_temp_name): Remove.
2140 (start_objects): Use SF flags to start_function.
2141 (start_static_storage_duration_function): Likewise.
2142 * except.c (start_anon_func): Remove redundant calls to
2143 push_function_context_to. Use SF flags to start function.
2144 (end_anon_func): Remove redundant call to pop_function_context
2146 * lex.c (reinit_parse_for_function): Don't initialize per-function
2148 * method.c (emit_thunk): Clear current_function after calling
2149 assemble_end_function. Use SF flags for start_function.
2150 (synthesize_method): Use SF flags for start_function.
2151 * parse.c: Regenerated.
2152 * parse.y (fn.defpen): Likewise.
2153 (pending_inline): Clear current_function, even if something goes
2155 * pt.c (instantiate_decl): Use SF flags to start_function.
2156 Don't save and restore expanding_p.
2157 (add_tree): Handle the case where we are outside any function.
2158 (end_tree): Likewise.
2159 * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
2160 * semantics.c (begin_function_definition): Likewise.
2161 (expand_body): Likewise.
2163 1999-09-09 Nathan Sidwell <nathan@acm.org>
2165 * cp-tree.h (convert_to_void): Prototype new function.
2166 (require_complete_type_in_void): Remove prototype.
2167 * cvt.c (convert_to_void): New function.
2168 (ocp_convert): Use convert_to_void.
2169 * decl.c (cplus_expand_expr_stmt): Likewise, for complete
2171 * typeck.c (require_complete_type_in_void): Remove function.
2172 (build_compound_expr): Use convert_to_void.
2173 (build_static_cast): Likewise.
2174 (build_c_cast): Likewise.
2175 * semantics.c (finish_expr_stmt): Do not decay full expressions.
2177 * typeck.c (build_x_compound_expr): Add FIXME.
2179 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2181 * cp-tree.h (scratch_tree_cons): Remove.
2182 * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
2183 and perm_tree_cons with plain tree_cons.
2184 * class.c: Likewise.
2186 * decl2.c: Likewise.
2187 * except.c: Likewise.
2191 * method.c: Likewise.
2192 * parse.y: Likewise.
2196 * search.c: Likewise.
2197 * typeck.c: Likewise.
2198 * parse.c: Regenerated.
2199 * tree.c (build_srcloc): Simplify.
2201 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2203 * cp-tree.h (lang_decl_flags): Remove permanent_attr.
2205 (LANG_DECL_PERMANENT): Remove.
2206 * decl.c (duplicate_decls): Don't mess about with obstacks trying
2208 (lang_mark_tree): Mark DECL_LANG_SPECIFIC.
2209 * lex.c (free_lang_decl_chain): Remove.
2210 (build_lang_decl): Don't use obstacks.
2211 (retrofit_lang_decl): Likewise.
2212 (copy_lang_decl): Likewise.
2214 * cp-tree.h (saved_scope): Remove old_binding_level and
2215 function_decl. Tidy up.
2216 * decl.c (mark_saved_scope): Don't set them.
2217 (maybe_push_to_top_level): Clear memory.
2219 * decl.c (layout_var_decl): Change prototype. Don't complete
2220 types for external objects.
2221 (check_initializer): Likewise. Tidy.
2222 (initialize_local_var): Complete types here.
2223 (cp_finish_decl): Not here. Reorganize a little.
2224 (grokvardecl): Don't complete types here.
2226 * decl.c (start_function): Clear last_dtor_insn and
2227 last_parm_cleanup_insn.
2228 (push_cp_function_context): Just copy over a little of
2229 the old context, not all of it.
2231 * cp-tree.h (copy_to_permanent): Remove.
2232 (permanent_p): Likewise.
2233 * decl.c (building_typename_type): Don't use copy_to_permanent.
2234 (start_decl): Likewise.
2235 (grok_reference_init): Likewise.
2236 (cp_finish_decl): Likewise.
2237 * init.c (build_new_1): Don't use mapcar.
2238 (build_vec_delete_1): Don't use copy_to_permanent.
2239 (build_vec_init): Likewise.
2240 * parse.y (primary): Likewise.
2241 * parse.c: Regenerated.
2242 * pt.c (push_template_decl_real): Don't use copy_to_permanent.
2243 (lookup_template_class): Likewise.
2244 (tsubst_friend_function): Likewise.
2245 (instantiate_class_template): Likewise.
2246 (tsubst_decl): Likewise.
2248 (instantiate_template): Likewise.
2250 * rtti.c (get_tinfo_fn): Likewise.
2251 (build_dynamic_cast): Likewise.
2252 * semantics.c (finish_if_stmt_cond): Likewise.
2253 (finish_while_stmt_cond): Likewise.
2254 (finish_do_stmt): Likewise.
2255 (finish_for_cond): Likewise.
2256 (finish_for_expr): Likewise.
2257 (finish_cleanup): Likewise.
2258 (add_decl_stmt): Likewise.
2259 (finish_named_return_value): Likewise.
2260 (finish_qualified_call_expr): Likewise.
2261 * tree.c (perm_manip): Remove.
2262 (build_exception_variant): Don't use copy_to_permanent.
2263 (permanent_p): Remove.
2264 (copy_to_permament): Remove.
2265 (build_min_nt): Don't use copy_to_permanent.
2266 (build_min): Likewise.
2267 (min_tree_cons): Likewise.
2268 * typeckc.c (build_static_cast): Likewise.
2269 (build_reinterpret_cast): Likewise.
2270 (build_const_cast): Likewise.
2272 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2274 * decl.c (ggc_p): Set it to 1.
2275 (mark_saved_scope): Add prototype.
2277 1999-09-07 Richard Henderson <rth@cygnus.com>
2279 * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
2280 * typeck.c (self_promoting_args_p): Delete.
2282 1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
2284 * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
2285 (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
2287 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2289 * Makefile.in (tree.o): Depend on ggc.h.
2290 * class.c (make_method_vec): Remove.
2291 (free_method_vec): Likewise.
2292 (free_method_vecs): Remove.
2293 (add_method): Don't use them.
2294 * cp-tree.def (PTRMEM_CST): Make it longer.
2295 (TEMPLATE_PARM_INDEX): Make it shorter.
2296 * cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
2297 (template_parm_index): Remove RTL field.
2298 (ptrmem_cst): Add RTL field.
2299 (finish_function): Removed parameter.
2300 (process_next_inline): Change prototype.
2301 (init_cplus_unsave): Rename to init_tree.
2302 (binding_init): Remove.
2303 * decl.c (free_binding_nodes): Remove.
2304 (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P.
2305 (pop_binding): Don't use free_binding_nodes.
2306 (free_binding_vecs): Remove.
2307 (store_bindings): Don't use them.
2308 (pop_from_top_level): Likewise.
2309 (lookup_namespace_name): Simplify.
2310 (build_typename_type): Don't use obstack_free.
2311 (unqualified_namespace_lookup): Simplify.
2312 (lookup_name_real): Simplify.
2313 (start_function): Remove comment about leaks.
2314 (finish_function): Removed nested parameter. Call
2315 expand_end_bindings even when building_stmt_tree.
2316 Call ggc_push_context and ggc_pop_context around
2317 rest_of_compilation, if necessary.
2318 (mark_cp_function_context): Handle a NULL language-context.
2319 (lang_mark_false_label_stack): Fix typo.
2320 (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
2321 TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on
2322 pointer to method types.
2323 (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
2324 * decl2.c (finish_objects): Adjust call to finish_function.
2325 (finish_static_store_duration_function): Likewise.
2326 (do_nonmember_using_decl): Remove call to binding_init.
2327 * except.c (end_anon_func): Adjust call to finish_function.
2328 * lex.c (mark_impl_file_chain): New function.
2329 (init_parse): Call init_tree, not init_cplus_unsave.
2331 (cp_pramga_interface): Use xmalloc, not permalloc.
2332 (cp_pragma_implementation): Likewise.
2333 (begin_definition_of_inclass_inline): Simplify.
2334 (process_next_inline): Adjust prototype.
2335 (do_scoped_id): Don't call binding_init.
2336 (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
2337 * method.c (emit_thunk): Adjust call to finish_function.
2338 (synthesize_method): Likewise.
2339 * parse.y (%union): Add a new `pi' variant.
2340 (PRE_PARSED_FUNCTION_DECL): Use it.
2341 (fn.defpen): Likewise.
2342 (fndef): Adjust call to finish_function.
2343 * pt.c (instantiate_decl): Likewise.
2344 * rtti.c (syntheisze_tinfo_fn): Likewise.
2345 * semantics.c (expand_body): Likewise.
2346 * tree.c: Include ggc.h.
2347 (mark_list_hash): New function.
2348 (binding_init): Remove.
2349 (init_cplus_unsave): Rename to ...
2350 (init_tree): This. Add GC roots.
2352 1999-09-05 Mark Mitchell <mark@codesourcery.com>
2354 Get ready for garbage collection.
2355 * Makefile.in (CXX_TREE_H): Add varray.h
2356 (lex.o): Depend on ggc.h.
2358 (decl2.o): Likewise.
2359 (method.o): Likewise.
2360 (search.o): Likewise.
2363 * class.c: Include ggc.h.
2364 (current_class_name): Remove.
2365 (current_class_type): Likewise.
2366 (current_access_specifier): Likewise.
2367 (previous_class_type): Likewise.
2368 (previous_class_values): Likewise.
2369 (class_cache_firstobj): Likewise.
2370 (current_lang_base): Likewise.
2371 (current_lang_stack): Likewise.
2372 (current_lang_stacksize): Likewise.
2373 (lang_name_c): Likewise.
2374 (lang_name_cplusplus): Likewise.
2375 (lang_name_java): Likewise.
2376 (current_lang_name): Likewise.
2377 (base_layout_decl): Likewise.
2378 (access_default_node): Likewise.
2379 (access_public_node): Likewise.
2380 (access_protected_node): Likewise.
2381 (access_private_node): Likewise.
2382 (access_default_virtual_node): Likewise.
2383 (access_public_virtual_node): Likewise.
2384 (access_protected_virtual_node): Likewise.
2385 (access_private_virtual_node): Likewise.
2386 (signed_zero_node): Likewise.
2387 (init_class_processing): Don't build base_layout_decl.
2388 (push_lang_context): Adjust now that current_lang_base is a varray.
2389 (pop_lang_context): Likewise.
2390 * cp-tree.h: Include varray.h.
2391 (cp_global_trees): Add access_default, access_public,
2392 access_protected, access_private, access_default_virtual,
2393 access_public_virtual, access_protected_virtual,
2394 access_private_virtual, ctor_identifier, delta2_identifier,
2395 delta_identifier, dtor_identifier, in_charge_identifier,
2396 index_identifier, nelts_identifier, this_identifier,
2397 pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
2398 lang_name_c, lang_name_cplusplus, lang_name_java,
2399 empty_except_spec, null, jclass, minus_one, terminate.
2400 (saved_scope): Move here from decl.c. Define globals in terms of
2401 saved_scope: current_namespace, current_class_name,
2402 current_class_type, current_access_specifier, current_lang_stack,
2403 current_lang_base, current_lang_name, current_function_parms,
2404 current_template_parms, processing_template_decl,
2405 processing_specialization, processing_explicit_instantiation,
2406 previous_class_type, previous_class_values, class_cache_firstobj.
2407 (scope_chain): New variable.
2408 (init_pt): New function.
2409 * decl.c (current_namespace): Remove.
2410 (this_identifier, in_charge_identifier, ctor_identifier): Likewise.
2411 (dtor_identifier, pfn_identifier, index_identifier): Likewise.
2412 (delta_identifier, delta2_identifier): Likewise.
2413 (pfn_or_delta2_identifier, tag_identifier): Likewise
2414 (vt_off_identifier, empty_except_spec, null_node): Likewise.
2415 (current_function_parms, current_lang_base): Remove.
2416 (current_lang_stack, previous_class_values): Remove.
2417 (class_binding_level): Macroize.
2418 (saved_scope): Remove.
2419 (current_saved_scope): Rename to scope_chain.
2420 (mark_saved_scope): Adjust for new scope structure.
2421 (maybe_push_to_top_level): Likewise.
2422 (pop_from_top_level): Likewise.
2423 (duplicate_decls): Adjust now that current_lang_base is a varray.
2424 (build_typename_type): Call ggc_add_tree_hash_table_root.
2425 (init_decl_processing): Call init_pt. Call push_to_top_level to
2426 set up globals. Add GC roots.
2427 (xref_basetypes): Adjust now that current_lang_base is a varray.
2428 * decl.h (this_identifier): Remove.
2429 (in_charge_identifier): Likewise.
2430 * decl2.c: Don't include varray.h.
2431 (current_namespace): Remove.
2432 (init_decl2): Add GC roots.
2433 * except.c (Terminate): Remove.
2434 (init_exception_processing): Use terminate_node instead.
2435 (build_terminate_handler): Likewise.
2436 * init.c (nc_nelts_field_id): Remove.
2437 (minus_one): Likewise.
2438 (init_init_processing): Use minus_one_node and nelts_identifier
2439 instead. Add GC roots.
2440 (jclass_node): Remove.
2441 (build_new_1): Use nelts_identifier.
2442 (build_vec_init): Likewise.
2443 (build_vec_delete): Likewise.
2444 * lex.c: Include ggc.h.
2445 (defarg_fn): Move declaration early.
2446 (defarg_parms): Likewise.
2447 (init_parse): Add GC roots.
2448 (handle_cp_pragma): Remove redundant declaration of
2450 * method.c: Include ggc.h.
2451 (btypelist): Make it a varray. All uses changed.
2452 (ktypelist): Likewise.
2453 (init_method): Add GC roots.
2454 * pt.c: Don't include varray.h. Include ggc.h.
2455 (current_template_parms): Remove.
2456 (processing_template_decl): Likewise.
2457 (processing_specialization): Likewise.
2458 (processing_explicit_instantiation): Likewise.
2459 (init_pt): New function.
2460 * repo.c: Include ggc.h.
2461 (init_repo): Add GC roots.
2462 * search.c: Don't include varray.h.
2463 (_vptr_name): Remove.
2464 (lookup_field_1): Use vtpr_identifier instead.
2465 (expand_indirect_vtbls_init): Remove redundant declaration of
2466 in_charge_identifier.
2467 (init_search_processing): Use vptr_identifier.
2469 1999-09-05 Richard Henderson <rth@cygnus.com>
2470 Bernd Schmidt <bernds@cygnus.co.uk>
2471 Mark Mitchell <mark@codesourcery.com>
2473 * Makefile.in (parse.o): Depend on ggc.h.
2474 (decl2.o): Depend on ggc.h.
2475 (init.o): Depend on ggc.h.
2476 * cp-tree.h (init_decl2): Declare.
2477 (cp_parse_init): Likewise.
2478 * decl.c (ggc_p): Define to zero.
2479 (mark_saved_scope): New function.
2480 (init_decl_processing): Call cp_parse_init, and cp_decl2.
2482 (expand_static_init): Add GC roots.
2483 * decl2.c: Include ggc.h.
2484 (init_decl2): New function.
2485 * init.c: Include ggc.h.
2486 (init_init_processing): Add GC roots.
2487 * parse.y: Include ggc.h.
2488 (cp_parse_init): New function.
2490 1999-09-04 Mark Mitchell <mark@codesourcery.com>
2492 * decl.c (init_decl_processing): Set mark_lang_status.
2493 (lang_mark_false_label_stack): Adjust prototype.
2494 * decl2.c (grok_function_init): Remove extraneous declaration of
2497 * Make-lang.in (cc1plus): Remove dependency on GGC.
2498 * Makefile.in (OBJS): Don't mention ggc-simple.o.
2499 (OBJDEPS): Don't mention ggc-simple.o.
2501 * Make-lang.in (cc1plus): Depend on $(GGC).
2502 * Makefile.in (OBJS): Add ggc-simple.o.
2503 (OBJDEPS): Likewise.
2504 * cp-tree.h (language_function): Rename members to `x_' versions;
2505 we now have x_named_labels, x_ctor_label, x_dtor_label,
2506 x_base_init_list, x_member_init_list, x_base_init_expr,
2507 x_current_class_ptr, x_current_class_ref, x_last_tree,
2508 x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
2510 (dtor_label, ctor_label, current_base_init_list,
2511 current_member_init_list, base_init_expr, current_class_ptr,
2512 current_class_ref, last_tree, last_expr_type): Adjust accordingly.
2513 * decl.c: Include ggc.h.
2514 (last_dtor_insn): Adjust to use x_ names.
2515 (last_parm_cleanup_insn): Likewise.
2516 (original_result_rtx): Likewise.
2517 (named_labels): Likewise.
2518 (mark_binding_level): New function.
2519 (mark_cp_function_context): Likewise.
2520 (mark_false_label_stack): Likewise.
2521 (lang_mark_tree): Likewise.
2522 (lang_cleanup_tree): Likewise.
2524 1999-09-03 Mark Mitchell <mark@codesourcery.com>
2526 * Makefile.in (CXX_TREE_H): Include function.h.
2527 (decl.o): Don't depend on function.h.
2528 (decl2.o): Likewise.
2529 (typeck.o): Likewise.
2531 (method.o): Likewise.
2532 * cp-tree.h: Include function.h.
2533 (cp_function): Rename to language_function. Remove next.
2534 (cp_function_chain): Make it a macro, not a variable.
2535 (push_cp_function_context): Don't declare.
2536 (pop_cp_function_context): Likewise.
2537 * decl.c: Don't include function.h.
2538 (push_cp_function_context): Make it static. Make it suitable for
2539 a save_lang_status callback.
2540 (pop_cp_function_context): Likewise.
2541 (maybe_push_to_top_level): Call push_function_context_to, not
2542 push_cp_function_context.
2543 (pop_from_top_level): Call pop_function_context_from, not
2544 pop_cp_function_context.
2545 (init_decl_processing): Set save_lang_status and
2546 restore_lang_status. Call push_function_context_to, not
2547 push_cp_function_context.
2548 (cp_function_chain): Remove.
2549 * decl2.c: Don't include function.h.
2550 * except.c: Don't include function.h.
2551 (start_anon_func): Call push_function_context_to, not
2552 push_cp_function_context.
2553 (end_anon_func): Call pop_function_context_from, not
2554 pop_cp_function_context.
2555 * init.c: Don't include function.h.
2556 * lex.c (begin_definition_of_inclass_inline): Call
2557 push_function_context_to, not push_cp_function_context.
2558 (process_next_inline): Call pop_function_context_from, not
2559 pop_cp_function_context.
2560 * method.c: Don't include function.h.
2561 (synthesize_method): Call push_function_context_to, not
2562 push_cp_function_context. Call pop_function_context_from, not
2563 pop_cp_function_context.
2564 * typeck.c: Don't include function.h.
2566 * decl.c (expand_static_init): Tweak handling of static
2567 initializations for objects without constructors.
2569 1999-09-03 Nathan Sidwell <nathan@acm.org>
2571 * typeck.c (build_indirect_ref): Reject dereference of pointer to
2574 1999-09-02 Mark Mitchell <mark@codesourcery.com>
2576 * cp-tree.h (cp_function): Move here, from decl.c.
2577 (cp_function_chain): Declare.
2578 (dtor_label): New macro, instead of variable.
2579 (ctor_label): Likewise.
2580 (current_base_init_list): Likewise.
2581 (current_member_init_list): Likewise.
2582 (base_init_expr): Likewise.
2583 (current_class_ptr): Likewise.
2584 (current_class_ref): Likewise.
2585 (last_tree): Likewise.
2586 (last_expr_type): Likewise.
2587 (current_function_returns_value): Likewise.
2588 (current_function_returns_null): Likewise.
2589 (current_function_just_assigned_this): Likewise.
2590 (current_function_parms_stored): Likewise.
2591 (temp_name_counter): Likewise.
2592 (static_labelno): Likewise.
2593 (expanding_p): Likewise.
2594 (stmts_are_full_exprs_p): Likewise.
2595 (in_function_try_handler): Likewise.
2596 (lang_type): Remove nested type_flags. All uses changed.
2597 * call.c (ctor_label): Remove.
2598 (dtor_label): Likewise.
2599 * class.c (current_class_ptr): Remove.
2600 (current_class_ref): Likewise.
2601 * decl.c (static_labelno): Remove.
2602 (dtor_label): Likewise.
2603 (last_dtor_insn): New macro, instead of variable.
2604 (last_parm_cleanup_insn): Likewise.
2605 (original_result_rtx): Likewise.
2606 (in_function_try_handler): Remove.
2607 (named_label_uses): New macro, instead of variable.
2608 (named_labels): Likewise.
2609 (current_function_returns_value): Remove.
2610 (current_function_returns_null): Likewise.
2611 (current_function_assigns_this): New macro, instead of variable.
2612 (current_function_just_assigned_this): Likewise.
2613 (current_binding_level): Likewise.
2614 (init_decl_processing): Call push_cp_function_context.
2615 (cp_function): Move to cp-tree.h
2616 (cp_function_chain): Make it global.
2617 (temp_name_counter): Remove.
2618 (push_cp_function_context): Simplify.
2619 (pop_cp_function_context): Likewise.
2620 * decl2.c (temp_name_counter): Remove.
2621 * init_c (current_base_init_list): Likewise.
2622 (current_member_init_list): Likewise.
2623 (base_init_expr): Likewise.
2624 * method.c (static_labelno): Likewise.
2625 * pt.c (last_tree): Likewise.
2626 * semantics.c (expanding_p): Likewise.
2627 (stmts_are_full_exprs_p): Likewise.
2628 (last_expr_type): Likewise.
2629 * typeck.c (dtor_label): Likewise.
2630 (ctor_label): Likewise.
2632 1999-09-01 Alex Samuel <samuel@codesourcery.com>
2634 * decl2.c (arg_assoc_template_arg): New prototype. New function.
2635 (arg_assoc_class): Use arg_assoc_template_arg for template
2637 (arg_assoc): Likewise.
2638 * pt.c (mangle_class_name_for_template): Allow member template
2641 1999-09-02 Nathan Sidwell <nathan@acm.org>
2643 * call.c (build_conditional_expr): Warn on enum mismatches.
2644 (convert_arg_to_ellipsis): Move non-pod check to after
2647 1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2649 * gxx.gperf (hash, is_reserved_word): Add prototypes.
2651 * init.c (build_vec_init): Initialize variable `try_block'.
2653 * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
2654 Likewise for bzero/memset.
2655 (token_getch, token_put_back): Add static prototypes. Remove
2656 `inline' from the definitions.
2657 (retrofit_lang_decl): Call memset, not bzero, to avoid casts.
2659 1999-09-01 Mark Mitchell <mark@codesourcery.com>
2661 * cp-tree.h (lang_type): Move align into type_flags.
2662 (CLASSTYPE_ALIGN): Adjust accordingly.
2663 * call.c (direct_reference_binding): Remove misleading comment.
2665 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2667 * parse.y (language_string): Constify.
2669 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2671 * repo.c (getpwd): Don't prototype.
2672 * xref.c (getpwd): Likewise
2674 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2676 * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
2677 Remove hacks for stuff which now comes from libiberty.
2679 1999-08-30 Jason Merrill <jason@yorick.cygnus.com>
2681 * cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
2683 1999-08-30 Mark Mitchell <mark@codesourcery.com>
2685 * cp-tree.h (begin_init_stmts): Declare.
2686 (finish_init_stmts): Likewise.
2687 * cvt.c (build_up_reference): Wrap the declaration of a temporary
2688 in a statement-expression so that we will see it when expanding
2689 tree structure later.
2690 * init.c (begin_init_stmts): Don't make it static.
2691 (finish_init_stmts): Likewise.
2693 * cp-tree.h (start_handler_parms): New function.
2694 (expand_start_catch_block): Take only one parameter.
2695 (start_handler_parms): New function.
2696 * decl.c (start_handler_parms): Define it.
2697 * except.c (process_start_catch_block): Take only one parameter.
2698 Don't call grokdeclarator here.
2699 (expand_start_catch_block): Don't call grokdeclarator here,
2701 * parse.y (handler_args): Adjust call to
2702 expand_start_catch_block. Use start_handler_parms.
2703 * pt.c (push_template_decl_real): Make permanent lists have
2705 (tsubst_expr): Adjust calls to expand_start_catch_block
2707 * semantics.c (expand_stmt): Likewise.
2709 1999-08-29 Alex Samuel <samuel@codesourcery.com>
2711 * pt.c (push_template_decl_real): Use template declaration from
2712 class type if it exists.
2714 1999-08-29 Mark Mitchell <mark@codesourcery.com>
2716 * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
2717 (maybe_inject_for_scope_var): Declare it.
2718 (initialize_local_var): Likewise.
2719 * decl.c (maybe_inject_for_scope_var): Make it global.
2720 (initialize_local_var): Likewise. Move cleanup handling here,
2721 from cp_finish_decl.
2722 (make_rtl_for_nonlocal_decl): Use
2723 push_obstacks_nochange/pop_obstacks, rather than
2724 end_temporary_allocation/resume_temporary_allocation.
2725 (cp_finish_decl): Try to complete the type of a variable when it
2726 is declared. Move cleanup-handling to initialize_local_var.
2727 (expand_static_init): Use tree-building code, rather than
2729 * decl2.c (get_temp_name): Assert non-initializedness of
2731 * init.c (create_temporary_var): Move RTL-assigning code to ...
2732 (get_temp_regvar): Here.
2733 * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here.
2734 * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just
2735 call initialize_local_var to generate initialization code.
2737 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2739 * cp-tree.h (fndecl_as_string, type_as_string,
2740 type_as_string_real, args_as_string, decl_as_string,
2741 expr_as_string, code_as_string, language_as_string,
2742 parm_as_string, op_as_string, assop_as_string, cv_as_string,
2743 lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
2745 * errfn.c (cp_printer): Likewise.
2747 * error.c (cp_printer, fndecl_as_string, type_as_string_real,
2748 type_as_string, expr_as_string, decl_as_string, lang_decl_name,
2749 cp_file_of, code_as_string, language_as_string, parm_as_string,
2750 op_as_string, assop_as_string, args_as_string, cv_as_string):
2753 * tree.c (lang_printable_name): Likewise.
2755 1999-08-28 Richard Henderson <rth@cygnus.com>
2757 * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
2759 1999-08-28 Mark Mitchell <mark@codesourcery.com>
2761 * cp-tree.h (strip_array_types): New function.
2762 * decl.c (maybe_deduce_size_from_array_init): New function, split
2763 out from cp_finish_decl.
2764 (layout_var_decl): Likewise.
2765 (maybe_commonize_var): Likewise.
2766 (maybe_inject_for_scope_var): Likewise.
2767 (initialize_local_var): Likewise.
2768 (build_cleanup_on_safe_obstack): Likewise.
2769 (check_initializer): Likewise.
2770 (make_rtl_for_nonlocal_decl): Likewise.
2771 (cp_finish_decl): Use them.
2772 * typeck.c (strip_array_types): New function.
2774 * cp-tree.def (LABEL_STMT): New tree node.
2775 * cp-tree.h (LABEL_STMT_LABEL): New macro.
2776 (shadow_label): Remove.
2777 (declare_local_label): New function.
2778 (finish_label_decl): Likewise.
2779 * decl.c (make_label_decl): New function, split out from
2781 (shadowed_labels): Remove.
2782 (binding_level): Add shadowed_labels.
2783 (clear_binding_level): Remove.
2784 (push_binding_level): Just bzero the new binding level.
2785 (pushlevel): Fix indentation.
2786 (pop_label): New function.
2787 (pop_labels): Likewise, split out from poplevel.
2788 (poplevel): Pop local labels. Use pop_labels.
2789 (maybe_push_to_top_level): Don't clear shadowed_labels.
2790 (lookup_label): Use make_label_decl.
2791 (shadow_label): Remove.
2792 (declare_local_label): New function.
2793 (define_label): Simplify.
2794 (start_function): Don't clear shadowed_labels.
2795 (cp_function): Remove shadowed_labels.
2796 (push_cp_function_context): Don't save shadowed_labels.
2797 (pop_cp_function_context): Don't restore it.
2798 * dump.c (dequeue_and_dump): Handle LABEL_STMT.
2799 * parse.y (label_decl): Use finish_label_decl.
2800 * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
2802 * semantics.c (finish_label_stmt): Add a LABEL_STMT when
2804 (finish_label_decl): New function.
2805 (expand_stmt): Handle LABEL_STMTs and local label declarations.
2807 1999-08-26 Mark Mitchell <mark@codesourcery.com>
2809 * decl.c (lookup_label): Build labels on the permanent obstack
2810 when building statement trees. Don't build RTL for labels when
2811 building statement trees.
2812 * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
2813 building statement trees.
2814 (finish_label_stmt): Likewise.
2815 (expand_stmt): Adjust accordingly.
2816 * pt.c (tsubst_expr); Likewise.
2817 (do_decl_instantiation): Robustify.
2819 * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
2820 * tree.c (build_cplus_new): Set it.
2821 * expr.c (cplus_expand_expr): Use it.
2822 * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
2824 * decl.c (store_parm_decls): Reset immediate_size_expand.
2825 (finish_function): Likewise.
2827 * tree.c (cplus_unsave_expr_now): Don't return a value.
2829 * semantics.c (do_poplevel): Always initialize the return value.
2831 1999-08-26 Gavin Romig-Koch <gavin@cygnus.com>
2833 * cp-tree.h (cplus_unsave_expr_now) : Correct return type.
2834 * tree.h (cplus_unsave_expr_now) : Same.
2836 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2838 * decl.c (grokdeclarator): Amend comment.
2839 * except.c (expand_start_catch_block): Call push_template_decl for
2840 catch-block parameters.
2841 * method.c (synthesize_method): Build an empty compound statement
2842 for the body of a constructor.
2844 1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
2846 * tree.c (cp_build_qualified_type_real): If we're asking for the
2847 same quals we already have, just return.
2849 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2851 * cp-tree.def (SUBOBJECT): New tree node.
2852 * cp-tree.h (CLEANUP_P): New macro.
2853 (SUBOBJECT_CLEANUP): Likewise.
2854 (keep_next_level): Add parameter.
2855 (get_temp_regvar): Don't declare.
2856 (emit_base_init): Remove parameter.
2857 (expand_aggr_init): Rename to build_aggr_init.
2858 (expand_vec_init): Rename to build_vec_init.
2859 (do_pushlevel): Remove.
2860 (do_poplevel): Likewise.
2861 (finish_cleanup): New function.
2862 (finish_subobject): Likewise.
2863 (stmts_are_full_exprs_p): New variable.
2864 * decl.c (keep_next_level): Add parameter.
2865 (cp_finish_decl): Use build_aggr_init, not
2866 expand_aggr_init. Use finish_expr_stmt to expand the code.
2867 (expand_static_init): Use tree-generating, not RTL-generating,
2868 functions to handle the initialization.
2869 (start_function): Remove dead code. Always have a momentary
2870 obstack inside the function, even before hitting the first curly
2872 (cplus_expand_expr_stmt): Move calls to
2873 expand_{start,end}_target_temps into semantics.c.
2874 (cp_function): Add stmts_are_full_exprs_p.
2875 (push_cp_function_context): Save it.
2876 (pop_cp_function_context): Restore it.
2877 * decl2.c (get_temp_regvar): Move to init.c.
2878 (do_static_initialization): Use build_{aggr,vec}_init.
2879 (do_static_destruction): Fix typo in comment.
2880 * dump.c (dequeue_and_dump): Handle INIT_EXPR.
2881 * except.c (expand_throw): Use create_temporary_var.
2882 * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
2883 * init.c (expand_vec_init_try_block): Remove.
2884 (expand_vec_init_catch_clause): Likewise.
2885 (get_temp_regvar): New function.
2886 (begin_init_stmts): Likewise.
2887 (finish_init_stmts): Likewise.
2888 (perform_member_init): Use build_{aggr,vec}_init. Build up tree
2890 (emit_base_init): Likewise. Remove unused parameter.
2891 (expand_virtual_init): Likewise.
2892 (expand_cleanup_for_base): Use finish_subobject.
2893 (expand_aggr_vbase_init_1): Simplify.
2894 (construct_virtual_bases): Use tree-generating functions to build
2896 (expand_aggr_init): Likewise. Rename to build_aggr_init.
2897 (expand_default_init): Likewise.
2898 (expand_aggr_init_1): Likewise.
2899 (expand_vec_init): Rename to build_vec_init.
2900 * method.c (do_build_copy_constructor): Use tree-generating
2901 functions. Don't call clear_last_expr.
2902 (do_build_assign_ref): Likewise.
2903 (synthesize_method): Call clear_last_expr here.
2904 * parse.y (base_init): Don't call clear_last_expr here.
2905 (nodecls): Likewise.
2906 * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
2907 * semantics.c (do_pushlevel): Move to here.
2908 (do_poplevel): Likewise.
2909 (stmts_are_full_exprs_p): New variable.
2910 (finish_expr_stmt): Handle logic for temoprary cleanup here.
2911 (finish_for_stmt): Use finish_expr_stmt.
2912 (finish_cleanup): New function.
2913 (finish_function_try_block): Fix indentation.
2914 (finish_subobject): New function.
2915 (setup_vtbl_ptr): Call keep_next_level here.
2916 (finish_stmt_expr): Handle a block with no scope inside the
2917 statement-expression.
2918 (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle
2920 * tree.c (search_tree): Handle INIT_EXPR.
2922 * typeck.c (build_modify_expr): Don't build an RTL_EXPR.
2923 * typeck2.c (store_init_value): Change expand_aggr_init to
2924 build_aggr_init in comment.
2926 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2928 * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
2930 1999-08-25 Nathan Sidwell <nathan@acm.org>
2932 * decl2.c (handle_class_head): Be graceful about additional
2933 scope qualifiers. Adjust comments to reflect reality.
2935 1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
2937 * call.c (build_conditional_expr): Fix typo.
2938 * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
2939 lvalue before trying to mess with the sides.
2941 * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
2943 Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
2945 * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
2947 1999-08-23 Jason Merrill <jason@yorick.cygnus.com>
2949 * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
2950 Return arbitrary pointer or NULL.
2951 (check_eh_spec): Call __throw_type_match_rtti_2.
2952 * tinfo.h (*::dcast): Return int. Add valp parm.
2953 * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers.
2954 * tinfo2.cc (__throw_type_match_rtti_2): Likewise.
2955 (__throw_type_match_rtti): Now just a wrapper.
2957 * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
2958 (init_exception_processing): Don't initialize them.
2960 1999-08-23 Paul Burchard <burchard@pobox.com>
2962 * decl.c (check_default_argument): Fix typo.
2964 1999-08-22 Mark Mitchell <mark@codesourcery.com>
2966 * cp-tree.def (STMT_EXPR): Fix typo in node name.
2968 * dump.c (dump_next_stmt): New function.
2969 (dequeue_and_dump): Use it.
2971 * pt.c (tsubst_copy): Make sure to initialize return value for a
2972 STMT_EXPR, even when processing_template_decl.
2973 * semantics.c (finish_stmt_expr): A statement-expression whose
2974 last statement is not an expression-statement has type `void'.
2976 1999-08-20 Mark Mitchell <mark@codesourcery.com>
2978 * semantics.c (finish_stmt_expr): Fix typo in comment.
2979 * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
2981 * init.c (build_vec_delete_1): Make the children of a permanent
2982 BIND_EXPR permanent.
2983 * pt.c (register_specialization): Don't register a specialization
2986 1999-08-18 Andrew Haley <aph@cygnus.com>
2988 * method.c (process_overload_item): Call build_mangled_C9x_name ()
2989 for all integer parameter types larger than long long.
2991 1999-08-19 Mark Mitchell <mark@codesourcery.com>
2993 * pt.c (redeclare_class_template): Merge default template
2994 arguments in both directions.
2996 * typeck.c (common_type): Undo 1999-08-18 change. Remove
2997 compiler_error message.
2999 1999-08-19 Jason Merrill <jason@yorick.cygnus.com>
3001 * cp-tree.h: Declare flag_use_repository.
3002 * pt.c (do_decl_instantiation): Don't complain about duplicate
3003 instantiation with -frepo.
3004 (do_type_instantiation): Likewise.
3006 * pt.c (push_template_decl_real): Complain about everything
3007 that isn't a valid template.
3009 * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
3012 1999-08-19 Mark Mitchell <mark@codesourcery.com>
3014 * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
3015 * decl2.c (build_expr_from_tree): Handle it.
3016 * error.c (dump_expr): Likewise.
3017 * pt.c (for_each_template_parm): Likewise.
3018 (tsubst_copy): Likewise.
3019 * tree.c (search_tree): Likewise.
3020 * semantics.c (finish_pseudo_destructor_call): Create it.
3022 1999-08-18 Mark Mitchell <mark@codesourcery.com>
3024 * search.c (setup_class_bindings): Robustify.
3025 * typeck.c (common_type): Use same_type_p, not pointer equality,
3028 * cp-tree.h (build_lang_field_decl): Remove.
3029 * class.c (build_vtable): Replace calls to build_lang_field_decl
3030 with build_lang_decl.
3031 (prepare_fresh_vtable): Likewise.
3032 (finish_struct_1): Likewise.
3033 (init_class_processing): Likewise.
3034 * decl.c (push_using_decl): Likewise.
3035 (init_decl_processsing): Likewise.
3036 (grokvardecl): Likewise.
3037 (build_ptrmemfunc_type): Likewise.
3038 (grokdeclarator): Likewise.
3039 (build_enumerator): Likewise.
3040 * decl2.c (grok_x_components): Likewise.
3041 (do_class_using_decl): Likewise.
3042 * except.c (call_eh_info): Likewise.
3043 * init.c (init_init_processing): Likewise.
3044 * rtti.c (expand_class_decl): Likewise.
3045 * tree.c (build_base_fields): Likewise.
3046 (build_vbase_pointer_fields): Likewise.
3047 * lex.c (build_lang_decl): Build declarations on the permanent
3048 obstack if we're building statmeent trees.
3049 (retrofit_lang_decl): Handle both the full lang_decl and also the
3050 smaller lang_decl_flags here.
3051 (build_lang_field_decl): Remove.
3052 * pt.c (push_template_decl_real): Issue errors for variable
3053 declarations that are not static members.
3055 1999-08-18 Richard Henderson <rth@cygnus.com>
3057 * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
3060 1999-08-17 Mark Mitchell <mark@codesourcery.com>
3062 * cp-tree.h (back_end_hook): New variable.
3063 * decl2.c (back_end_hook): Define it.
3064 (finish_file): If it's non-NULL, call it.
3066 * decl.c (add_decl_to_level): New function.
3067 (push_local_binding): Use it.
3068 (find_binding): Fix typo in comment.
3069 (pushdecl): Use add_decl_to_level. Put templates on the
3070 corresponding namespace-scope binding levels.
3071 * dump.c (dequeue_and_dump): Print the specializations of a
3073 * pt.c (push_template_decl_real): Don't push a template multiple
3076 1999-08-17 Mark Mitchell <mark@codesourcery.com>
3078 * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
3079 (CALL_DECLARATOR_QUALS): Likewise.
3080 (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
3081 * decl.c (grokdeclarator): Adjust to use them.
3082 * decl2.c (grokfield): Likewise.
3083 (reparse_absdcl_as_casts): Likewise.
3084 * lex.c (make_call_declarator): Likewise.
3085 (set_quals_and_spec): Likewise.
3086 * pt.c (tsubst): Likewise.
3087 * tree.c (mapcar): Remove special hack to handle third operand of
3090 1999-08-16 Mark Mitchell <mark@codesourcery.com>
3092 * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
3093 * class.c (build_vtable): Use build_lang_field_decl to build the
3094 VAR_DECLs for vtables.
3095 (prepare_fresh_vtable): Likewise.
3096 * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
3097 CAN_HAVE_FULL_LANG_DECL_P.
3098 (push_using_decl): Use build_lang_decl to build USING_DECLs.
3099 (grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
3100 * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
3101 (build_lang_field_decl): Likewise.
3102 (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
3105 * cp-tree.def (STMT_EXPR): New tree node.
3106 * cp-tree.h (STMT_EXPR_STMT): New macro.
3107 (store_return_init): Change prototype.
3108 (finish_named_return_value): New function.
3109 (expand_stmt): Likewise.
3110 (expand_body): Likewise.
3111 (begin_stmt_tree): Likewise.
3112 (finish_stmt_tree): Likewise.
3113 (expanding_p): New variable.
3114 (last_expr_type): Likewise.
3115 (building_stmt_tree): New macro.
3116 * decl.c (start_function): Use building_stmt_tree, not
3117 processing_template_decl, where appropriate.
3118 (store_parm_decls): Likewise.
3119 (store_return_init): Move most of the body to semantics.c.
3120 (finish_function): Use building_stmt_tree.
3121 (finish_stmt): Clear last_expr_type here.
3122 (cp_function): Add expanding_p, last_tree, last_expr_type.
3123 (push_cp_function_context): Save them.
3124 (pop_cp_function_context): Restore them.
3125 * decl2.c (setup_vtbl_ptr): Move to semantics.c.
3126 * error.c (dump_expr): Handle STMT_EXPR.
3127 * except.c (expand_start_catch_block): Use building_stmt_tree.
3129 * expr.c (cplus_expand_expr): Handle STMT_EXPR.
3130 (do_case): Move add_tree call to semantics.c.
3131 * parse.y (return_init): Use finish_named_return_value.
3132 (for.init.statement): Use finish_expr_stmt.
3133 * parse.c: Regenerated.
3134 * pt.c (do_pushlevel): Move to semantics.c.
3135 (do_poplevel): Likewise.
3136 (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
3137 (tsubst_expr): Don't expand all the way to RTL here. Handle
3138 RETURN_INIT and CTOR_INITIALIZER.
3139 (instantiate_decl): Call expand_body after tsubst'ing into
3141 * semantics.c (expand_stmts): New function.
3142 (expanding_p): New variable.
3143 (last_expr_type): Likewise.
3144 (finish_expr_stmt): Use building_stmt_tree.
3145 (begin_if_stmt): Likewise.
3146 (finish_if_stmt_cond): Likewise.
3147 (finish_then_clause): Likewise.
3148 (begin_else_clause): Likewise.
3149 (finish_else_clause): Likewise.
3150 (begin_while_stmt): Likewise.
3151 (finish_while_stmt_cond): Likewise.
3152 (finish_while_stmt): Likewise.
3153 (finish_do_body): Likewise.
3154 (finish_do_stmt): Likewise.
3155 (finish_return_stmt): Likewise.
3156 (begin_for_stmt): Likewise.
3157 (fnish_for_init_stmt): Likewise.
3158 (finish_for_cond): Likewise.
3159 (finish_for_expr): Likewise.
3160 (finish_for_stmt): Likewise.
3161 (finish_break_stmt): Likewise.
3162 (finish_continue_stmt): Likewise.
3163 (finish_switch_cond): Likewise.
3164 (finish_switch_stmt): Likewise.
3165 (finish_case_label): Call add_tree here if necessary.
3166 (finish_goto_statement): Use building_stmt_tree.
3167 (begin_try_block): Likewise.
3168 (begin_function_try_block): Likewise.
3169 (finish_try_block): Likewise.
3170 (finish_function_try_block): Likewise.
3171 (finish_handler_sequence): Likewise.
3172 (finish_function_handler_sequence): Likewise.
3173 (begin_handler): Likewise.
3174 (finish_handler_parms): Likewise.
3175 (finish_handler): Likewise.
3176 (begin_compound_stmt): Likewise.
3177 (finish_compound_stmt): Likewise.
3178 (finish_asm_stmt): Likewise.
3179 (finish_label_stmt): Likewise.
3180 (finish_named_return_value): New function.
3181 (setup_vtbl_ptr): Moved here from decl2.c.
3182 (do_pushlevel): Moved here from pt.c.
3183 (do_poplevel): Likewise.
3184 (begin_stmt_expr): Use building_stmt_tree.
3185 (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR,
3186 when building_stmt_tree.
3187 (begin_stmt_tree): New function.
3188 (finish_stmt_tree): Likewise.
3189 (expand_stmt): Likewise.
3190 (expand_body): Likewise.
3191 * tree.c (build_cplus_method_type): Make sure the argument types
3192 end up on the same obstack as the METHOD_TYPE.
3193 (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
3194 THROW_EXPR, STMT_EXPR.
3195 (mapcar): Break out common cases. Handle COMPOUND_EXPR,
3196 MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than
3197 sorry, if an unsupported node is encountered.
3198 * typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
3199 (c_expand_return): Don't call add_tree here.
3201 1999-08-15 Mark Mitchell <mark@codesourcery.com>
3203 * pt.c (check_default_tmpl_args): Don't check in local scopes.
3204 (tsubst_decl): Make sure the declaration is on a saveable
3205 obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
3207 (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
3209 1999-08-14 Jason Merrill <jason@yorick.cygnus.com>
3211 Speed up Koenig lookup.
3212 * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm
3213 to return namespaces we've looked at.
3214 * decl2.c (lookup_using_namespace): Likewise.
3215 (add_function): Don't call ovl_member.
3216 (lookup_arg_dependent): Initialize k.namespaces to the list of
3217 namespaces seen in unqualified lookup.
3218 * call.c (equal_functions): Move here from tree.c.
3219 (joust): Use it to handle duplicate candidates.
3220 * tree.c (ovl_member): Use ==.
3222 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3224 * cp-tree.def (DECL_STMT): Make it smaller.
3225 * cp-tree.h (lang_decl_flags): Move saved_tree to ...
3226 (lang_decl): ... here. Add next.
3227 (DECL_SAVED_TREE): Adjust accordingly.
3228 (DECL_IMPLICIT_TYPEDEF_P): New macro.
3229 (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
3230 (DECL_STMT_DECL): Likewise.
3231 (create_implicit_typedef): New function.
3232 (maybe_push_decl): Likewise.
3233 (tsubst_default_argument): New function.
3234 (at_function_scope_p): Likewise.
3235 (add_decl_stmt): Likewise.
3236 (push_permanent_obstack): Likewise.
3237 * call.c (convert_default_arg): Use tsubst_default_argument.
3238 * class.c (add_method): Use push_permanent_obstack.
3239 (build_self_reference): Create a TEMPLATE_DECL for the
3240 self-reference, if necessary.
3241 * decl.c (pseudo_global_level_p): Only look at the current binding
3243 (push_binding): Use push_permanent_obstack.
3244 (create_implicit_typedef): New function.
3246 (duplicate_decls): Use push_permanent_obstack.
3247 (maybe_push_decl): New function.
3248 (start_decl): Use it. Remove dead code. Use add_decl_stmt.
3249 (start_decl_1): Remove dead code.
3250 (cp_finish_decl): Remove DECL_STMT handling here. Don't use
3251 pseudo_global_level_p.
3252 (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
3254 (grokdeclarator): Likewise, for TYPE_DECLs. Don't use
3255 pseudo_global_level_p.
3256 * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
3258 (get_sentry): Use push_permanent_obstack.
3259 * dump.c (dequeue_and_dump): Enable DECL_STMT.
3260 * except.c (call_eh_info): Use push_permanent_obstack.
3261 (build_eh_type_ref): Likewise.
3262 (do_pop_exception): Likewise.
3263 (expand_eh_spec): Likewise.
3264 (alloc_eh_object): Likewise.
3265 (expand_throw): Likewise.
3266 * init.c (build_java_class_ref): Likewise.
3267 * lex.c (get_time_identifier): Likewise.
3268 (free_lang_decl_chain): Correct type.
3269 (retrofit_lang_decl): Adjust accordingly.
3270 (build_lang_field_decl): Likewise.
3271 * lex.h (free_lang_decl_chain): Likewise.
3272 * parse.y (lang_extdef): Don't use pseudo_global_level_p.
3273 * parse.c: Regenerated.
3274 * pt.c (tsubst_default_arguments): New function.
3275 (retrieve_local_specialization): Likewise.
3276 (register_local_specialization): Likewise.
3277 (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use
3278 pseudo_global_level_p to determine whether or not a template is
3280 (lookup_template_class): Likewise. Use create_implicit_typedef.
3281 (instantiate_class_template): Call tsubst_default_arguments for
3282 member functions, if appropriate.
3283 (tsubst_default_argument): New function.
3284 (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs.
3285 * search.c (at_function_scope_p): New function.
3286 * semantics.c (finish_asm_stmt): Use push_permanent_obstack.
3287 (finish_label_stmt): Likewise.
3288 (add_decl_stmt): New function.
3289 (begin_class_definition): Likewise.
3290 (finish_typeof): Likewise.
3291 * tree.c (copy_template_template_parm): Likewise.
3292 (copy_to_permanent): Likewise.
3293 (push_permanent_obstack): Define.
3294 (mark_addressable): Use it.
3295 * typeck.c (mark_addressable): Likewise.
3297 1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
3299 * cp-tree.h (init_cplus_unsave): New.
3300 (cplus_unsave_expr_now): New.
3301 * lex.c (init_parse): Call init_cplus_unsave.
3302 * tree.c (init_cplus_unsave): New.
3303 (cplus_unsave_expr_now): New.
3305 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3307 * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and
3308 decl_constant_value to simplify array bounds.
3310 1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
3312 * lang-options.h: Add -fms-extensions.
3313 * cp-tree.h: Declare flag_ms_extensions.
3314 * decl2.c: Define it.
3315 * class.c (instantiate_type): Don't complain about taking the address
3316 of a bound member function if -fms-extensions.
3317 * typeck.c (build_unary_op): Likewise.
3318 * decl.c (grokdeclarator): Or about implicit int.
3319 * init.c (resolve_offset_ref): Or about implicit '&'.
3321 1999-08-11 Mark Mitchell <mark@codesourcery.com>
3323 * cp-tree.h (minimal_parse_mode): Remove.
3324 (finish_label_stmt): New function.
3325 * decl.c (saved_scope): Remove minimal parse mode.
3326 (maybe_push_to_top_level): Don't save it.
3327 (pop_from_top_level): Don't restore it.
3328 (define_label): Split out template-handling code to semantics.c.
3329 (start_decl): Don't use minimal_parse_mode.
3330 (cp_finish_decl): Likewise.
3331 (start_function): Don't increment it.
3332 (store_return_init): Don't use it.
3333 (finish_function): Don't decrement it.
3334 * parse.y (label_colon): Use finish_label_stmt throughout.
3335 * parse.c: Regenerated.
3336 * pt.c (minimal_parse_mode): Don't define it.
3337 (tsubst_expr): Use finish_label_stmt.
3338 * semantics.c (finish_label_stmt): New function.
3340 * dump.c (queue): Be careful when computing bitmasks.
3341 (dequeue_and_dump): Describe binfos as binfos, not as
3344 * parse.y (pedantic): Give it itype. Adjust usage accordingly
3346 * parse.c: Regenerated.
3348 * Make-lang.in (CXX_SRCS): Remove sig.c.
3349 * Makefile.in (CXX_OBJS): Remove sig.o.
3351 * cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
3352 (CPTI_SIGNATURE_TYPE): Likewise.
3353 (CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
3354 (opaque_type_node): Likewise.
3355 (signature_type_node): Likewise.
3356 (sigtable_entry_type): Likewise.
3357 (flag_handle_signatures): Likewise.
3358 (lang_type): Remove is_signature, is_signature_pointer,
3359 is_signature_reference, has_opaque_typedecls,
3360 sigtables_has_been_generated. Adjust dummy. Remove signature,
3361 signature_pointer_to, signature_reference_to.
3362 (IS_SIGNATURE): Remove.
3363 (SET_SIGNATURE): Remove.
3364 (CLEAR_SIGNATURE): Remove.
3365 (IS_SIGNATURE_POINTER): Remove.
3366 (IS_SIGNATURE_REFERENCE): Remove.
3367 (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
3368 (SIGTABLE_HAS_BEEN_GENERATED): Remove.
3369 (CLASSTYPE_SIGNATURE): Remove.
3370 (SIGNATURE_TYPE): Remove.
3371 (SIGNATURE_METHOD_VEC): Remove.
3372 (SIGNATURE_POINTER_TO): Remove.
3373 (SIGNATURE_REFERENCE_TO): Remove.
3374 (lang_decl_flags): Remove is_default_implementation. Rename
3375 memfunc_pointer_to to saved_tree.
3376 (IS_DEFAULT_IMPLEMENTATION): Remove.
3377 (DECL_MEMFUNC_POINTER_TO): Remove.
3378 (DECL_MEMFUNC_POINTING_TO): Remove.
3379 (DECL_SAVED_TREE): Adjust definition.
3380 (tag_types): Remove signature_type_node.
3381 (SIGNATURE_FIELD_NAME): Remove.
3382 (SIGNATURE_FIELD_NAME_FORMAT): Likewise.
3383 (SIGNATURE_OPTR_NAME): Likewise.
3384 (SIGNATURE_SPTR_NAME): Likewise.
3385 (SIGNATURE_POINTER_NAME): Likewise.
3386 (SIGNATURE_POINTER_NAME_FORMAT): Likewise.
3387 (SIGNATURE_REFERENCE_NAME): Likewise.
3388 (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
3389 (SIGTABLE_PTR_TYPE): Likewise.
3390 (SIGTABLE_NAME_FORMAT): Likewise.
3391 (SIGTABLE_NAME_FORMAT_LONG): Likewise.
3392 (SIGTABLE_TAG_NAME): Likewise.
3393 (SIGTABLE_VB_OFF_NAME): Likewise.
3394 (SIGTABLE_VT_OFF_NAME): Likewise.
3395 (finish_base_specifiers): Change prototype.
3396 (build_signature_pointer_type): Remove.
3397 (build_signature_reference_type): Remove.
3398 (build_signature_pointer_constructor): Remove.
3399 (build_signature_method_call): Remove.
3400 (build_optr_ref): Likewise.
3401 (append_signature_fields): Likewise.
3402 (signature_error): Likewise.
3403 * call.c (build_this): Remove signature support.
3404 (build_over_call): Likewise.
3405 (build_new_method_call): Likewise.
3406 * class.c (add_implicitly_declared_members): Likewise.
3407 (finish_struct_1): Likewise.
3408 (finish_struct): Likewise.
3409 * cvt.c (cp_convert_to_pointer): Likewise.
3410 (convert_to_pointer_force): Likewise.
3411 (ocp_convert): Likewise.
3412 * decl.c (sigtable_decl_p): Remove.
3413 (init_decl_processing): Remove support for signatures.
3414 (cp_finish_decl): Likewise.
3415 (grokdeclarator): Likewise.
3416 (grokparms): Likewise.
3417 (xref_tag): Likewise.
3418 (start_function): Likewise.
3419 (start_method): Likewise.
3420 * decl2.c (finish_sigtable_vardecl): Remove.
3421 (flag_handle_signatures): Remove.
3422 (lang_f_options): Remove handle-signatures.
3423 (grokfield): Remove support for signatures.
3424 (grokbitfield): Likewise.
3425 (finish_file): Likewise.
3426 (reparse_absdcl_as_casts): Likewise.
3427 * error.c (dump_type_real): Likewise.
3428 (dump_function_decl): Likewise.
3429 * friend.c (make_friend_class): Likewise.
3430 * gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
3431 * hash.h: Regenerated.
3432 * init.c (build_new_1): Remove support for signatures.
3433 * lang-options.h: Remove -fhandle-signatures,
3434 -fno-handle-signatures.
3435 * lex.c (init_parse): Remove support for signatures.
3436 (yyprint): Likewise.
3437 * lex.h (rid): Remove RID_SIGNATURE.
3438 * method.c (build_decl_overload_real): Remove support for
3440 (hack_identifier): Likewise.
3441 * parse.y (base_class): Likewise.
3442 (base_class.1): Likewise.
3443 (access_specifier): Likewise.
3444 * search.c (lookup_member): Likewise.
3445 * semantics.c (finish_qualified_object_call_expr): Likewise.
3446 (finish_template_type_parm): Likewise.
3447 (begin_class_definition): Likewise.
3448 (finish_base_specifier): Likewise.
3450 * tree.c (build_cplus_method_type): Remove support for signatures.
3451 * typeck.c (require_complete_type): Likewise.
3452 (c_sizeof): Likewise.
3453 (c_alignof): Likewise.
3454 (build_object_ref): Likewise.
3455 (build_component_ref): Likewise.
3456 (build_indirect_ref): Likewise.
3457 (build_c_cast): Likewise.
3458 (build_modify_expr): Likewise.
3459 (convert_for_initialization): Likewise.
3460 * typeck2.c (signature_error): Remove.
3461 (store_init_value): Remove support for signatures.
3462 (digest_init): Likewise.
3463 (build_x_arrow): Likewise.
3464 (build_functional_cast): Likewise.
3465 * xref.c (GNU_xref_decl): Likewise.
3467 1999-08-10 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3469 * lex.c (do_identifier): Remove unnecessary lookup of class field.
3471 1999-08-09 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3473 * decl2.c (set_decl_namespace): Do not complain about non-matching
3474 decls if processing a template.
3476 1999-08-09 Mark Mitchell <mark@codesourcery.com>
3478 * decl.c (build_ptrmemfunc_type): Handle qualified
3479 pointer-to-member types here.
3480 * tree.c (cp_build_qualified_type_real): Simplify handling here.
3482 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3484 * lex.c (lang_identify): Likewise.
3486 1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
3488 * Makefile.in: Update dependencies.
3489 * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
3491 * decl.c: Include "function.h"
3492 (cleanup_label, return_label): Delete declarations.
3493 (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX.
3494 (finish_function): Rename last_parm_insn variable to
3495 fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX.
3496 * decl2.c: Include "function.h".
3497 (rtl_expr_chain): Delete declaration.
3498 * method.c: Include "function.h"
3499 * tree.c (build_vbase_pointer_fields): Don't initialize
3500 DECL_SAVED_INSNS with NULL_RTX.
3501 * typeck.c: Include "function.h"
3503 1999-08-09 Jason Merrill <jason@yorick.cygnus.com>
3505 * semantics.c (begin_function_try_block, finish_function_try_block,
3506 finish_function_handler_sequence): New fns.
3507 * parse.y (function_try_block): Use them.
3508 * pt.c (instantiate_decl): Likewise.
3510 * cp-tree.h: Declare in_function_try_handler.
3511 * decl.c: Define it.
3512 (start_function): Clear it.
3513 (struct cp_function, push_cp_function_context): Save it.
3514 (pop_cp_function_context): Restore it.
3515 * parse.y (function_try_block): Set and clear it.
3516 * except.c (expand_end_catch_block): Rethrow if we reach the end
3517 of a function-try-block handler in a ctor or dtor.
3518 * typeck.c (c_expand_return): Complain about returning from a
3519 function-try-block handler of a ctor.
3521 * parse.y (function_try_block): Call end_protect_partials
3522 before expand_start_all_catch.
3524 1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
3526 * decl.c (struct binding_level): Add eh_region field.
3527 (push_binding_level): Set it.
3528 (define_label): Complain about jumping into an EH block.
3530 * ptree.c (print_lang_type): Print the real type of a PMF.
3531 Print what exceptions a fn type throws.
3533 1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3535 * class.c (count_fields, add_fields_to_vec): Add static prototype.
3537 * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
3538 get_id_2, composite_pointer_type, dump_node_to_file): Constify a
3541 * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
3544 * decl2.c (finish_static_data_member_decl, grokfield): Constify a
3547 * dump.c (queue_and_dump_index, dump_int, dump_string,
3548 dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
3550 (dump_stmt): Add static prototype.
3552 * errfn.c (cp_thing): Constify a char*.
3554 * error.c (dump_unary_op, dump_binary_op, aggr_variety,
3555 dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
3556 dump_expr): Constify a char*.
3558 * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
3559 read_line_number): Add static prototype.
3560 (opname_tab, assignop_tab, operator_name_string): Constify a char*.
3561 (real_yylex): Move label `letter' into the scope where it is used.
3563 * method.c (build_mangled_template_parm_index, build_overload_int,
3564 build_decl_overload_real, get_id_2): Constify a char*.
3566 * search.c (check_final_overrider): Make static.
3568 * typeck.c (composite_pointer_type): Constify a char*.
3570 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
3572 * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
3573 we're looking at a class.
3575 * decl.c (lookup_name_real): Set the complain flag if we're
3576 looking for a namespace member.
3578 * lex.c (real_yylex): We can have a number with no digits.
3580 * cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
3582 * search.c (binfo_from_vbase): New fn.
3583 * cp-tree.h: Declare it.
3584 * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
3585 from pointer to member of virtual base.
3586 * typeck.c (get_delta_difference): Likewise.
3588 1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
3590 * pt.c (tsubst): Use build_index_type to build in-template array
3591 index type. Fixes g++.oliva/dwarf1.C.
3592 * decl.c (grokdeclarator): Likewise, just for consistency, as it
3593 doesn't seem to trigger the bug without it.
3595 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
3597 * typeck2.c (add_exception_specifier): Use complete_type.
3599 1999-08-06 Mark Mitchell <mark@codesourcery.com>
3601 * error.c (dump_expr): Handle EXACT_DIV_EXPR.
3602 (dump_binary_op): Bulletproof.
3603 * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
3604 * tree.c (search_tree): Don't enumerate all the nodes of classes
3605 `1', `2', and `<'; handle them generically. Don't be sorry about
3606 "unrecognized tree codes"; just abort.
3607 (no_linkage_check): Don't do linkage checks for templates.
3609 * tree.c (cp_build_qualified_type_real): Handle
3610 pointer-to-member-function types correctly.
3612 1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
3614 * decl.c (pushdecl): Only give an error for shadowing a parm
3615 from *this* function.
3617 Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
3619 * typeck2.c: Update URLs and mail addresses.
3621 1999-08-04 Nathan Sidwell <nathan@acm.org>
3623 * cp-tree.h (empty_except_spec): New global var.
3624 (compexcepttypes): Remove prototype.
3625 (comp_except_specs): Prototype new global function.
3626 (add_exception_specifier): Prototype new global function.
3627 * decl.c (empty_except_spec): Define new global var.
3628 (duplicate_decls): Use comp_except_specs, reword error message.
3629 (init_decl_processing): Initialize empty_except_spec.
3630 Adjust build_exception_variant calls.
3631 * parse.y (exception_specification_opt): Use empty_except_spec.
3632 (ansi_raise_identifier): Call check_for_new_type.
3633 (ansi_raise_identifiers): Use add_exception_specifier.
3634 * pt.c (tsubst): Use add_exception_specifier to build exception
3636 * search.c (check_final_overrider): New static function, broken
3637 out of get_matching_virtual. Check throw specifiers, reword
3639 (get_matching_virtual): Use check_final_overrider.
3640 * tree.c (build_exception_variant): Use comp_except_specs.
3641 * typeck.c (compexcepttypes): Remove.
3642 (comp_except_types): New static function, helper for
3643 comp_except_specs. Compare two types as exception specifiers.
3644 (comp_except_specs): New global function, compare two exception
3646 (comptypes): Adjust for comp_except_specs.
3647 * typeck2.c (add_exception_specifier): New global function.
3649 * class.c (check_for_override): Reword error message.
3651 1999-08-03 Nathan Sidwell <nathan@acm.org>
3653 * call.c (convert_arg_to_ellipsis): Use pod_type_p.
3654 * cp-tree.h (struct lang_type): Added non_pod_class flag.
3655 (CLASSTYPE_NON_POD_P): New macro to access it.
3656 * class.c (finish_struct_1): Determine non-PODness.
3657 Check for arrays of pointers (-Weffc++).
3658 Remove array inspection duplicated code.
3659 * tree.c (pod_type_p): Detect non-pod non-aggregate types.
3660 Use CLASSTYPE_NON_POD_P.
3662 1999-08-03 Nathan Sidwell <nathan@acm.org>
3664 * class.c (duplicate_tag_error): Preserve template information.
3666 1999-08-03 Nathan Sidwell <nathan@acm.org>
3668 * decl.c (start_enum): Show location of previous definition.
3669 * parse.y (enumlist_opt): New reduction.
3670 (structsp): Simplify enum rules to use enumlist_opt.
3672 1999-08-03 Jason Merrill <jason@yorick.cygnus.com>
3674 * lex.c (yyprint): Handle PFUNCNAME.
3676 * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
3677 build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
3679 1999-08-03 Mumit Khan <khan@xraylith.wisc.edu>
3681 * decl.c (start_decl): Set attributes before duplicate_decls call.
3683 1999-08-02 Mark Mitchell <mark@codesourcery.com>
3685 * Make-lang.in (CXX_SRCS): Add dump.c.
3686 * Makefile.in (CXX_OBJS): Add dump.o.
3687 (dump.o): New target.
3688 * cp-tree.h (DECL_CONV_FN_P): Document.
3689 (DECL_OVERLOADED_OPERATOR_P): New function.
3690 (TYPE_PTRMEM_CLASS_TYPE): New macro.
3691 (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
3692 (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
3693 (ASM_VOLATILE_P): New macro.
3694 (STMT_LINENO): Likewise.
3695 (cp_namespace_decls): New function.
3696 (dump_node_to_file): New function.
3697 * decl.c (cp_namespace_decls): New function.
3698 (walk_namespaces_r): Use it.
3699 (wrapup_globals_for_namespace): Likewise.
3700 * decl2.c (flag_dump_translation_unit): New variable.
3701 (lang_decode_option): Handle -fdump-translation-unit.
3702 (finish_file): If flag_dump_translation_unit is set, dump the
3705 * lang-options.h: Add -fdump-translation-unit.
3706 * pt.c (tsubst_template_parms): Robustify.
3707 (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
3708 (tsubst_expr): Use STMT_LINENO.
3709 * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
3710 for invalid cv-qualifiers even while building templates.
3712 1999-08-02 Richard Henderson <rth@cygnus.com>
3714 * call.c: Include defaults.h instead of expr.h.
3717 * typeck.c: Include defaults.h.
3719 1999-08-02 Mark Mitchell <mark@codesourcery.com>
3721 * lex.c (errorcount, sorrycount): Don't declare.
3722 * repo.c (errorcount, sorrycount): Likewise.
3723 * typeck2.c (errorcount, sorrycount): Likewise.
3725 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
3727 * call.c (convert_default_arg, build_over_call): Change all uses of
3728 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
3729 Ensure expr.h is included.
3730 * decl.c (grokparams): Ditto.
3731 * pt.c (tsubst_decl): Ditto.
3732 * typeck.c (convert_arguments): Ditto.
3734 1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
3736 * class.c (mark_overriders): Fix order of args to overrides.
3737 (warn_hidden): Likewise. Fix for having virtual and non-virtual
3738 functions with the same name.
3740 1999-08-02 Richard Henderson <rth@cygnus.com>
3742 * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
3744 1999-08-01 Mark Mitchell <mark@codesourcery.com>
3746 * call.c (build_conditional_expr): Fix typo in comment.
3748 1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
3750 * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
3751 case_stack; use in_control_zone_p.
3752 * typeck.c (c_expand_return): Likewise.
3754 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
3756 * except.c (catch_clauses): Delete declaration.
3758 1999-07-30 Mark Mitchell <mark@codesourcery.com>
3760 * call.c (build_conditional_expr): Call convert_from_reference to
3761 avoid reference/non-reference type confusion. Fix typo.
3763 1999-07-30 Richard Henderson <rth@cygnus.com>
3765 * typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
3766 * cp-tree.h (initializer_constant_valid_p): Remove.
3768 1999-07-28 Mark Mitchell <mark@codesourcery.com>
3770 * call.c (conditional_conversion): Don't build BASE_CONVs for
3771 conversions between things that have the same type.
3772 (build_conditional_expr): Tweak.
3773 (convert_like): Some BASE_CONVs really do require the generation
3776 * init.c (perform_member_init): Don't go through build_modify_expr
3777 for simple initializations.
3779 1999-07-27 Jason Merrill <jason@yorick.cygnus.com>
3781 * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
3782 * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
3783 virtual functions and MI. Simplify.
3785 * method.c: Remove prototype for largest_union_member.
3786 * pt.c (determine_specialization): Fix uninitialized warning.
3787 * lex.c (real_yylex): Likewise.
3789 1999-07-27 Mark Mitchell <mark@codesourcery.com>
3791 * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
3794 * cp-tree.h (BINFO_VIRTUALS): Document new format.
3795 * class.c (modify_one_vtable): Change prototype accordingly.
3796 (modify_all_vtables): Likewise.
3797 (modify_all_direct_vtables): Likewise.
3798 (modify_all_indirect_vtables): Likewise.
3799 (build_vtable_entry_for_fn): New function.
3800 (set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
3801 (modify_vtable_entry): Likewise.
3802 (add_virtual_function): Likewise.
3803 (build_vtbl_initializer): New function.
3804 (finish_vtbls): Simplify for new BINFO_VIRTUALS format.
3805 (fixup_vtable_deltas1): Likewise.
3806 (fixup_vtable_deltas): Likewise.
3807 (override_one_vtable): Likewise.
3808 (finish_struct_1): Likewise.
3810 * error.c (dump_expr): Likewise.
3811 * search.c (get_abstract_virtuals_1): Likewise.
3812 (get_abstract_virtuals): Likewise.
3813 (expand_upcast_fixups): Likewise.
3814 * tree.c (debug_binfo): Likewise.
3815 * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
3816 __pure_virtual here.
3818 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3820 * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
3821 as per 1999-07-26 change.
3823 * typeck.c (c_sizeof): Don't allow non-static data members.
3824 (expr_sizeof): Likewise.
3826 1999-07-26 Jason Merrill <jason@yorick.cygnus.com>
3828 * input.c (feed_input): Only touch lineno and input_filename
3829 if !USE_CPPLIB. Save the old values before setting the new ones.
3831 * input.c (feed_input): Add file, line parms.
3832 * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
3833 (real_yylex): Check linemode before input_redirected().
3835 * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
3836 from op new to warning.
3838 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3840 * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
3841 * call.c: All uses changed.
3842 * typeck.c: Likewise.
3844 1999-07-26 Nathan Sidwell <nathan@acm.org>
3846 * exception.cc (__cplus_type_matcher): Match __eh_matcher
3849 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3851 * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
3852 (ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
3853 (strip_top_quals): Declare.
3854 (ncp_convert): Likewise.
3855 (type_after_usual_arithmetic_converions): Likewise.
3856 (composite_pointer_type): Likewise.
3857 * call.c (strip_top_quals): Don't make it static.
3858 (promoted_arithmetic_type_p): New function.
3859 (conditional_conversion): Likewise.
3860 (null_ptr_cst_p): Allow `false' as a NULL pointer constant.
3861 (standard_conversion): Use same_type_p. Don't build BASE_CONVs
3862 for converting a type to itself.
3863 (reference_binding): Honor LOOKUP_NO_TEMP_BIND.
3864 (implicit_conversion): Make sure the from and to types are
3866 (add_builtin_candidate): Correct handling of ?: operator.
3867 (add_builtin_candidates): Improve documentation.
3868 (build_conditional_expr): New function.
3869 (can_convert): Implement in terms of can_convert_arg.
3870 (ncp_convert): New function.
3871 * typeck.c (type_after_usual_arithmetic_conversions): New
3872 function, split out from common_type.
3873 (composite_pointer_type): New function, split out from
3874 build_conditional_expr.
3875 (common_type): Use type_after_usual_arithmetic_conversions.
3876 Remove redundant attribute merging.
3877 (comptypes): Tidy. Handle COMPLEX_TYPE.
3878 (build_binary_op_nodefault): Use null_ptr_cst_p.
3879 (build_conditional_expr): Remove.
3880 (convert_for_assignment): Use new conversion functions.
3882 * cp-tree.h (abstract_virtuals_error): Change declaration.
3883 * typeck2.c (abstract_virtuals_error): Check to see if an error
3884 ocurred, and return a boolean value accordingly.
3885 (build_functional_cast): Adjust accordingly.
3886 * class.c (finish_struct_1): Likewise.
3887 * cvt.c (ocp_convert): Likewise.
3888 * decl.c (cp_finish_decl): Likewise.
3889 (grokparams): Likewise.
3890 (grok_op_properties): Likewise.
3891 (start_function): Likewise.
3892 * init.c (build_new_1): Likewise.
3894 * pt.c (unify): Don't get confused by pointers-to-member functions.
3896 * search.c (build_cplus_new): Robustify.
3898 1999-07-24 Richard Henderson <rth@cygnus.com>
3900 * gxx.gperf (__builtin_va_arg): New.
3901 * parse.y (VA_ARG): New token.
3902 (unary_expr): Recognize it.
3904 Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com)
3906 * g++FAQ.texi: Deleted per Joe Buck's request.
3907 * Makefile.in: Corresponding changes.
3909 1999-07-23 Jason Merrill <jason@yorick.cygnus.com>
3911 * lex.c: Sync with C frontend.
3912 (whitespace_cr): New fn.
3913 (skip_white_space): Use it.
3914 (init_parse): Reorder.
3915 (yyprint): Support CONSTANT.
3916 (pragma_getc, pragma_ungetc): Bring back.
3917 (read_line_number): Change in_system_header directly.
3918 (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
3919 (parse_float): Update to C version.
3920 (yylex): Handle '$' under the letter case.
3921 Remove looking_for_typename handling.
3922 Support hex floating point constants.
3923 Follow C's lead for choosing type of integer constants.
3924 Rearrange stuff to match C frontend.
3925 (yyungetc, reinit_parse_for_block, yylex): Support indent_level.
3926 * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
3928 1999-07-23 Mark Mitchell <mark@codesourcery.com>
3930 * call.c (reference_binding): Tweak.
3931 (mayble_handle_implicit_object): Use direct_reference_binding to
3932 create the right implicit conversion sequence.
3934 1999-07-22 Mark Mitchell <mark@codesourcery.com>
3936 * pt.c (convert_nontype_argument): Don't call decl_constant_value
3937 if we're converting to a reference type.
3939 * call.c (NEED_TEMPORARY_P): New macro.
3940 (standard_conversion): Set it, for derived-to-base conversions.
3941 (reference_related_p): New function.
3942 (reference_compatible_p): Likewise.
3943 (convert_class_to_reference): Likewise.
3944 (direct_reference_binding): Likewise.
3945 (reference_binding): Rework for standards-compliance.
3946 (convert_like): Adjust accordingly.
3947 (maybe_handle_ref_bind): Simplify; the right conversion sequences
3948 are now built up in reference_binding.
3949 (initialize_reference): New function.
3950 * cp-tree.h (ICS_USER_FLAG): Document.
3951 (ICS_THIS_FLAG): Likewise.
3952 (ICS_BAD_FLAG): Likewise.
3953 (NEED_TEMPORARY_P): Likewise.
3954 (cp_lvalue_kind): New type.
3955 (real_lvalue_p): Return it.
3956 * error.c (dump_expr): Provide more accurate representation for
3958 * init.c (expand_default_init): Do not try to perform implicit
3959 conversions for a brace-enclosed initializer.
3960 * search.c (lookup_conversions): Document.
3961 * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate
3963 (real_lvalue_p): Adjust accordingly.
3964 (lvalue_p): Likewise.
3965 (build_cplus_new): Don't allow the creation of an abstract class.
3966 * typeck.c (convert_for_initialization): Use initialize_reference.
3968 1999-07-21 Gavin Romig-Koch <gavin@cygnus.com>
3970 * lex.c (real_yylex) : Correct the test for overflow when lexing
3973 1999-07-20 Jason Merrill <jason@yorick.cygnus.com>
3975 * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL,
3976 not DECL_BUILT_IN, to determine if a function is internally declared.
3977 (duplicate_decls): Likewise. Improve handling of builtins.
3978 (push_overloaded_decl): Remove special handling of builtins.
3980 * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P.
3982 * decl.c (grokdeclarator): Pull out decl_constant_value in
3985 * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm.
3986 * cp-tree.h, pt.c, semantics.c: Adjust.
3987 * method.c (largest_union_member): Remove.
3989 * lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
3991 * lex.c (token_getch, token_put_back): New fns.
3992 (real_yylex): Use them.
3994 * lex.c (lang_init): Generalize.
3995 (lang_init_options): Tell cpplib this is C++.
3996 (nextchar): Remove. Replace uses with put_back.
3997 (skip_white_space): Handle linemode here. Optimize for cpplib.
3998 (extend_token_buffer_to): New fn.
3999 (extend_token_buffer): Use it.
4000 (read_line_number, check_newline): Just deal with tokens.
4001 (real_yylex): More cpplib optimizations. Simplify. Don't produce
4002 EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here.
4003 * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING.
4004 * parse.y (PAREN_STAR_PAREN): Remove.
4005 * input.c: Don't use the putback machinery with cpplib.
4006 (sub_getch): Fold back into getch.
4007 (getch): Don't handle linemode here.
4008 (feed_input): Unget any text in the token buffer.
4010 * lex.c (set_typedecl_interface_info, set_vardecl_interface_info,
4011 nextyychar, nextyylval): Remove.
4013 1999-07-20 Michael Tiemann <tiemann@holodeck.cygnus.com>
4014 Jason Merrill <jason@yorick.cygnus.com>
4016 * lex.c (indent_level): New variable.
4017 (init_parse): Set cpp_token to CPP_DIRECTIVE.
4018 (consume_string): Make this smart about USE_CPPLIB.
4019 (yyungetc): Use put_back function.
4020 (pragma_getc, pragma_ungetc): Functions deleted.
4021 (check_newline): Rewrite to be intelligent about USE_CPPLIB.
4022 Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and
4024 (real_yylex): Rewrite to be intelligent about USE_CPPLIB.
4025 Also, clean up cases where we redundantly set token_buffer[0].
4026 (read_line_number): New fn.
4027 * input.c (feed_input): Use integrated cpplib if USE_CPPLIB.
4028 (end_input): Call cpp_pop_buffer if USE_CPPLIB.
4029 (sub_getch): Conditionalize out code that's not appropriate if
4031 (put_back): Rewrite in case USE_CPPLIB is defined.
4032 (input_redirected): Ditto.
4034 Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
4036 * cp-tree.h: Delete lots of declarations of tree nodes; replaced by
4037 c_global_trees and accessor macros defined in c-common.h.
4038 (cp_tree_index): New enumeration.
4039 (cp_global_trees): Declare new array. Add accessor macros for it, and
4040 delete declarations of tree nodes replaced by it.
4041 (builtin_function): Delete macro, add declaration for new function.
4043 * decl.c: Delete definitions for tree nodes that were replaced by
4044 cp_global_trees and c_global_trees.
4045 (init_decl_processing): Call c_common_nodes_and_builtins; delete code
4046 to generate the common builtins here.
4047 (builtin_function): New function.
4048 * decl2.c (abort_fndecl): Delete declaration.
4049 * except.c (expand_builtin_return_address): Delete declaration.
4050 (builtin_return_address_fndecl): Delete variable.
4051 (const_ptr_type_node): Delete declaration.
4052 * lex.c (cons_up_default_function): Delete declaration of
4054 * parse.y (void_list_node): Delete declaration.
4055 * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
4057 (const_string_type_node): Delete declaration.
4058 * search.c (abort_fndecl): Delete declaration.
4059 * Makefile.in: Update dependencies.
4061 1999-07-19 Mark Mitchell <mark@codesourcery.com>
4063 * pt.c (check_default_tmpl_args): Move test for missing default
4064 arguments here, from ...
4065 (end_template_parm_list): Here.
4067 1999-07-18 Mark Mitchell <mark@codesourcery.com>
4069 * decl.c (lookup_nested_type): Remove.
4070 (pushtag): Don't call it.
4072 Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com)
4074 * Makefile.in (INTERFACE): Bump to 2.
4076 1999-07-17 Alexandre Oliva <oliva@dcc.unicamp.br>
4078 * typeck2.c (my_friendly_abort): Updated URL with bug reporting
4079 instructions to gcc.gnu.org. Removed e-mail address.
4081 1999-07-17 Mark Mitchell <mark@codesourcery.com>
4083 * pt.c (determine_specialization): Tighten error-checking.
4084 (end_template_parm_list): Likewise.
4086 1999-07-14 Mark Mitchell <mark@codesourcery.com>
4088 * pt.c (check_default_tmpl_args): Handle friends defined in the
4089 class just like member functions defined in the class.
4091 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
4092 Jason Merrill <jason@yorick.cygnus.com>
4094 * cp-tree.h (struct lang_decl): Added field for storing sorted
4095 FIELD_DECLs (used in TYPE_DECLs).
4096 (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
4097 (DECL_SORTED_FIELDS): New macro.
4098 * class.c (method_name_cmp): New function.
4099 (finish_struct_methods): Modified to support sorting and searching
4101 (finish_struct_anon): Changed code in inner loop to use ELT rather
4102 than UELT (which required an extra indirection for every reference).
4103 (field_decl_cmp): New function to support sorting FIELD_DECLs.
4104 (finish_struct_1): Sort fields.
4105 * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
4106 (lookup_fnfields_1): Search sorted methods in METHOD_VEC.
4107 Also, switch to using array indexing rather than a changing pointer.
4108 * ptree.c (print_lang_decl): Handle TYPE_DECLs that have
4111 1999-07-09 Jason Merrill <jason@yorick.cygnus.com>
4113 * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
4114 casts in system headers or extern "C" blocks.
4116 * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
4119 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
4121 * decl2.c (write_virtuals): Deleted declaration.
4122 * cp-tree.h (write_virtuals): Deleted extern declaration.
4123 * class.c (finish_struct_1): Removed #if 0'd code that mentions
4125 * semantics.c (begin_class_definition): Rewrite code to not depend
4128 * lex.c (cp_pragma_interface): New function.
4129 (cp_pragma_implementation): Likewise.
4130 (handle_cp_pragma): Call them.
4132 * typeck.c (comptypes): Simplify C code in look_hard.
4134 * xref.c (PALLOC): Use xcalloc, not calloc.
4135 (SALLOC): Use xmalloc, not malloc.
4137 * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
4139 * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
4142 * decl.c (duplicate_decls): If a redeclaration doesn't match the
4143 initial declaration, then don't save the inline info and by all
4144 means don't mark the function as a builtin function.
4146 * decl.c (lookup_name_real): Set NONCLASS to 1 if
4147 CURRENT_CLASS_TYPE is 0.
4149 * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
4152 * ptree.c (print_lang_type): Added vtable-needs-writing.
4154 Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
4156 * decl2.c (mark_vtable_entries): Fix check for rtti offset.
4158 1999-07-06 Gavin Romig-Koch <gavin@cygnus.com>
4160 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4161 Merged into c-common.
4163 1999-07-05 Dave Brolley <brolley@cygnus.com>
4165 * lex.c (errorcount): Declare it.
4166 (finish_parse): Update errorcount for when using CPPLIB.
4168 1999-07-05 Mark Mitchell <mark@codesourcery.com>
4170 * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
4172 (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
4173 * decl.c (push_class_binding): Use it.
4174 (lookup_name_real): Likewise.
4176 1999-07-02 Gavin Romig-Koch <gavin@cygnus.com>
4178 * cp-tree.h (widest_integer_literal_type_node,
4179 widest_unsigned_literal_type) : New.
4180 * decl.c (widest_integer_literal_type_node,
4181 widest_unsigned_literal_type) : New.
4182 (init_decl_processing): Handle/use the two new types.
4183 * lex.c (real_yylex): Same.
4184 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4187 1999-07-01 Mark Mitchell <mark@codesourcery.com>
4189 * decl.c (grokdeclarator): Don't give names "for linkage purposes"
4190 to anonymous cv-qualified types.
4192 1999-07-01 Gavin Romig-Koch <gavin@cygnus.com>
4194 * lex.c (real_yylex) : Change integer literal overflow handling to
4197 * lex.c (real_yylex): Improve 'integer constant out of range' messages.
4199 1999-06-28 Richard Henderson <rth@cygnus.com>
4201 * decl.c (cp_finish_decl): Fix typo in cp_warning_at call.
4203 1999-06-28 Jason Merrill <jason@yorick.cygnus.com>
4205 * error.c (dump_type_real): Handle TREE_LIST again.
4207 * typeck.c (comp_target_parms): Don't complain about
4208 converting from () to (...) if !flag_strict_prototype.
4210 * decl.c (grokdeclarator): Update the names of all variants when
4213 1999-06-21 Mark Mitchell <mark@codesourcery.com>
4215 * init.c (expand_aggr_vbase_init): Rename to
4216 construct_virtual_bases. Conditionalize construction here,
4218 (emit_base_init): Here.
4220 1999-06-19 Mark Mitchell <mark@codesourcery.com>
4222 * semantics.c (finish_asm_statement): Apply decay conversions to
4225 * decl.c (expand_static_init): When building an anonymous function
4226 for use with atexit, compute its body before and after entering
4229 * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
4232 1999-06-18 Mark Mitchell <mark@codesourcery.com>
4234 * init.c (expand_aggr_vbase_init): Add flag parameter.
4235 (build_partial_cleanup_for): Remove, inlining into ..
4236 (expand_cleanup_for_base): ... here. Take flag parameter.
4237 (emit_base_init): Pass the in_chrg parameter to
4238 emit_aggr_vbase_init.
4239 (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.
4241 1999-06-16 Mark Mitchell <mark@codesourcery.com>
4243 * decl2.c (import_export_decl): Use same_type_p, rather than
4244 relying on pointer-equality for types.
4246 * method.c (do_build_copy_constructor): Simplify.
4248 * call.c (build_method_call): Remove bogus code for two-argument
4250 * init.c (build_new_1): Expand on comment, and remove dead code.
4252 * init.c (expand_cleanup_for_base): New function, split out
4254 (emit_base_init): Here.
4255 (expand_aggr_vbase_init): Use it.
4257 1999-06-15 Mark Mitchell <mark@codesourcery.com>
4259 * cp-tree.h (class_cache_firstobj): Declare.
4260 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4261 * class.c (permanent_obstack): Remove declaration.
4262 (class_cache_firstobj): Make it global.
4263 (add_method): Don't use permanent_obstack directly.
4264 (pushclass): Only free the class_cache_obstack if we know how far
4266 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4267 * decl.c: Remove dead comment.
4268 (saved_scope): Add class_cache_firstobj.
4269 (push_to_top_level): Save it.
4270 (pop_from_top_level): Restore it.
4271 (push_class_level_binding): Use push_cache_obstack, not
4272 maybe_push_cache_obstack.
4273 * search.c (push_class_decls): Likewise.
4275 1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
4277 * pt.c (tsubst_friend_function): Push into namespace of friend
4278 function before pushdecl'ing it.
4280 1999-06-14 Nathan Sidwell <nathan@acm.org>
4282 * call.c (build_new_op): Remove REF_BIND from all operands.
4284 1999-06-13 Alexandre Oliva <oliva@dcc.unicamp.br>
4286 * init.c (build_new_1): Look up operator delete even if there was
4287 no explicit new placement.
4289 1999-06-08 Nathan Sidwell <nathan@acm.org>
4291 * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
4293 (build_throw): ... here. Call it.
4294 (process_start_catch_block): Call it.
4296 1999-06-07 Mark Mitchell <mark@codesourcery.com>
4298 * search.c (convert_pointer_to_single_level): Reimplement without
4301 1999-06-06 Mark Mitchell <mark@codesourcery.com>
4303 * method.c (is_back_referenceable_type): Back-reference bools when
4306 1999-06-07 Dave Brolley <brolley@cygnus.com>
4308 * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
4309 * input.c (putback_buffer): New structure type.
4310 (putback): Replaces putback_char member.
4311 (putback): Replaces putback_char static variable.
4312 (feed_input): Use putback.
4313 (end_input): Use putback.
4314 (sub_getch): Use putback.
4315 (put_back): Use putback.
4317 1999-06-05 Mark Mitchell <mark@codesourcery.com>
4319 * decl.c (grokdeclarator): Fix typo in last change.
4321 1999-06-04 Jason Merrill <jason@yorick.cygnus.com>
4323 * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
4324 (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
4326 1999-06-04 Nathan Sidwell <nathan@acm.org>
4328 * except.c (build_throw): Check throw expression validity.
4330 1999-06-03 Mark Mitchell <mark@codesourcery.com>
4332 * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
4333 just because flag_signed_bitfields is false.
4335 1999-06-03 Nathan Sidwell <nathan@acm.org>
4337 * semantics.c (begin_class_definition): Update the struct's
4339 * class.c (finish_struct): ... rather than here.
4341 * decl.c (make_typename_type): Don't rely on uninitialized
4344 1999-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4346 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4348 1999-05-31 Mark Mitchell <mark@codesourcery.com>
4350 * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
4351 and friends rather than messing with current_obstack directly.
4352 (cp_build_qualified_type_real): Rework ARRAY_TYPE
4353 allocation to match practice throughout the rest of the
4356 1999-05-30 Mark Mitchell <mark@codesourcery.com>
4358 * lex.c (make_lang_type): Create TYPE_BINFO for
4359 TEMPLATE_TYPE_PARMs just like for non-template types.
4361 * decl.c (start_decl): Move checks on initialization to ...
4362 (cp_finish_decl): Here. Tidy formatting slightly.
4364 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4366 * decl.c (add_binding): Don't complain about a redeclaration of a
4367 semantically identical typedef in a local scope.
4369 1999-05-28 Nathan Sidwell <nathan@acm.org>
4371 * decl.c (complete_array_type): Allocate off same obstack. Fix
4372 DO_DEFAULT comment to match reality.
4374 * friend.c (make_friend_class): Fix diagnostic typo.
4376 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4378 * decl.c (lookup_namespace_name): Handle getting a
4380 (expand_static_init): Don't call pushdecl for implicitly declared
4381 `atexit' used to register destructors.
4383 1999-05-25 Mark Mitchell <mark@codesourcery.com>
4385 * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
4388 * cp-tree.h (NAMESPACE_LEVEL): Reformat.
4389 (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes
4390 by combining TEMPLATE_INFO and LEVEL into a single union.
4391 (DECL_TEMPLATE_INFO): Reformat.
4392 (DECL_SAVED_TREE): Document.
4393 (DECL_TEMPLATE_INJECT): Remove.
4394 * class.c (finish_struct): Remove code to deal with
4395 DECL_TEMPLATE_INJECT.
4397 * decl.c (maybe_process_template_type_declaration): Handle all new
4398 types in templates uniformly.
4399 * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
4401 * pt.c (lookup_template_class): Inject template instantiations of
4402 forward-declarations.
4403 (instantiate_class_template): Remove code processing
4404 DECL_TEMPLATE_INJECT.
4406 * pt.c (lookup_template_class): Tweak lookup to find member
4409 * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
4411 * semantics.c (finish_asm_stmt): Make strings permanent if they're
4414 1999-05-25 Jason Merrill <jason@yorick.cygnus.com>
4416 * typeck.c (casts_away_constness, casts_away_constness_r): Strip both
4417 parts of pointer to data member types.
4419 1999-05-24 Mark Mitchell <mark@codesourcery.com>
4421 * decl2.c (mark_vtable_entries): Don't make a copy of a function,
4422 and then make it look like `abort'. Just use `abort' instead.
4424 * typeck.c (build_static_cast): Don't allow static_casts that cast
4426 (casts_away_constness_r): New function.
4427 (casts_away_constness): Likewise.
4429 * decl.c (lookup_tag): Remove code no longer needed after
4430 name-lookup improvements.
4431 * decl2.c (handle_class_head): Make error-recovery more robust.
4432 * friend.c (make_friend_class): Reject templated typename types.
4433 * lex.c (is_global): A template parameter isn't global.
4434 * parse.y (class_head): Robustify.
4435 * parse.c: Regenerated.
4437 1999-05-22 Mark Mitchell <mark@codesourcery.com>
4439 * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
4440 INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs.
4442 * cp-tree.h (push_nested_namespace): Declare.
4443 (pop_nested_namespace): Likewise.
4444 * decl.c (push_nested_namespace): New function.
4445 (pop_nested_namespace): Likewise.
4446 * pt.c (instantiate_class_template): Use them.
4448 * tree.c (mapcar): Handle NON_LVALUE_EXPR.
4450 * cp-tree.h (cplus_expand_constant): Declare.
4451 * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
4452 converted from one pointer-to-object type to another.
4453 * expr.c (cplus_expand_constant): Don't make it static.
4454 * typeck.c (build_component_ref): Don't crash when presented with
4455 a component which is a TEMPLATE_DECL.
4456 (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a
4457 cast from a pointer-to-member constant to its own type does not
4458 result in a valid non-type template argument.
4460 1999-05-21 Mark Mitchell <mark@codesourcery.com>
4461 Nathan Sidwell <nathan@acm.org>
4463 * Make-lang.in (cc1plus): Make it depend on gxx.gperf.
4464 * cp-tree.h: Fix typo in documentation on pointers-to-members.
4465 (cp_build_qualified_type): Make it a macro.
4466 (cp_build_qualified_type_real): Declare.
4467 * decl.c (grokdeclarator): Remove misleading comment. Avoid
4468 problem with template parameters and restrict-qualification.
4469 * gxx.gperf: Replace NORID with RID_UNUSED throughout.
4470 * hash.h: Regenerated.
4471 * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
4473 (NORID): Remove definition.
4474 * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
4475 (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs.
4476 (fn_type_unification): Check that the function type resulting from
4477 the deduction is legal.
4478 (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
4479 (unify): Use cp_build_qualified_type_real.
4480 * tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
4481 (cp_build_qualified_type): Rename to ...
4482 (cp_build_qualified_type_real): Add additional COMPLAIN parameter
4483 and modify appropriately.
4485 * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
4486 reveal optimization opportunities.
4488 * pt.c (tsubst): Don't issue error messages when we're not
4489 complaining, even if we see a qualified function type.
4490 (check_cv_quals_for_unify): Don't allow a qualified function
4493 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
4495 * class.c (instantiate_type): Downgrade errors for object-dependent
4496 memfn refs to pedwarn.
4498 1999-05-20 Mark Mitchell <mark@codesourcery.com>
4500 * decl.c (grokdeclarator): Don't treat [] as indicating a
4501 zero-sized array in a typedef.
4503 * call.c (build_object_call): Don't look at DECL_NAME for a type.
4504 (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
4505 (typeck.c): Or TYPE_MAIN_VARIANT for a type.
4507 * pt.c (for_each_template_parm): Rework to match documentation.
4508 Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
4510 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
4512 * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
4514 * class.c (finish_base_struct): Allow non-COM bases for COM classes
4515 except at the leftmost position.
4516 (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
4517 Pass the binfo's class, not the most derived, to skip_rtti_stuff.
4518 * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
4520 * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
4521 (build_cplus_new): Make sure that what we return is of the right type.
4523 1999-05-20 Mark Mitchell <mark@codesourcery.com>
4525 * cp-tree.h (make_ptrmem_cst): New function.
4526 * expr.c (cplus_expand_constant): Split out from ...
4527 (cplus_expand_expr): Here. Use cplus_expand_constant.
4528 (init_cplus_expand): Set lang_expand_constant.
4529 * pt.c (convert_nontype_argument): Use make_ptrmem_cst.
4531 * tree.c (make_ptrmem_cst): Define.
4532 * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
4533 * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.
4535 1999-05-19 Mark Mitchell <mark@codesourcery.com>
4537 * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
4539 * decl2.c (start_static_storage_duration_function): Fix comment.
4540 (finish_file): Create static storage duration functions lazily.
4542 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
4544 Implement anonymous structs.
4545 * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
4546 * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
4547 * class.c (finish_struct_1): Remove redundant check for anon struct.
4548 * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
4549 (check_tag_decl): Check for anonymous struct here.
4550 * decl2.c (build_anon_union_vars): Catch anon struct at file scope.
4551 * init.c (sort_member_init, emit_base_init): Handle getting fields
4552 as well as names in current_member_init_list.
4553 (perform_member_init): Handle getting an anon aggr.
4554 * method.c (do_build_assign_ref): Don't descend into anon aggrs.
4555 (do_build_copy_constructor): Likewise.
4557 1999-05-19 Mark Mitchell <mark@codesourcery.com>
4559 * tree.c (cp_build_qualified_type): Don't allow qualified function
4562 Wed May 19 02:50:53 1999 Arvind Sankar <arvinds@mit.edu>
4564 * gxxint.texi: Fix typo.
4566 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
4568 * call.c (find_scoped_type, resolve_scope_to_name): Lose.
4569 * class.c (finish_struct_1): Use CLASS_TYPE_P.
4570 * ptree.c (print_lang_type): Likewise.
4571 * typeck.c (build_modify_expr, c_expand_asm_operands): Use
4573 * typeck2.c (digest_init): Likewise.
4575 1999-05-18 Jason Merrill <jason@yorick.cygnus.com>
4577 * call.c (joust): Compare the types of the conv ops, not the
4578 target types of the conversions.
4580 Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
4582 * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
4585 1999-05-17 Mark Mitchell <mark@codesourcery.com>
4587 * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation.
4588 * decl.c (grokfndecl): Don't allow inline declarations of friend
4589 template specializations, or friend template specializations with
4591 * pt.c (tsubst): Handle substitution into array types that does
4592 not yield a fixed upper bound, even when not processing a
4594 (tsubst_copy): Deal with the fact that the second operand to a
4595 TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC.
4596 * search.c (marked_pushdecls_p): Don't descend into
4597 TEMPLATE_TYPE_PARMs and the like.
4598 (unmarked_pushdecls_p): Likewise.
4600 * call.c (build_over_call): Don't throw away
4601 initializations/copies of empty classes; use MODIFY_EXPR and
4602 INIT_EXPR as for non-empty classes.
4603 * class.c (finish_struct_1): Put the padding byte for an empty
4604 class on the TYPE_NONCOPIED_PARTS list for the class.
4606 1999-05-16 Mark Mitchell <mark@codesourcery.com>
4608 * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
4609 indicate a reference to a field that is a qualified name.
4611 1999-05-16 Jason Merrill <jason@yorick.cygnus.com>
4613 * decl2.c (finish_objects): Don't use .?tors.* if we don't have
4614 ASM_OUTPUT_CONSTRUCTOR.
4616 * friend.c (do_friend): Add attrlist arg. Remove support for
4617 getting a non-decl as 'decl'.
4618 * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or
4620 (grokdeclarator): Adjust.
4621 * cp-tree.h: Adjust.
4623 1999-05-16 Mark Mitchell <mark@codesourcery.com>
4625 * cp-tree.h (permanent_p): New function.
4626 * init.c (build_new_1): Use mapcar, not copy_node, to copy a
4627 possibly complex tree node.
4628 * tree.c (mapcar): Adjust comments, and follow coding standards in
4630 (permanent_p): New function.
4632 1999-05-13 Per Bothner <bothner@cygnus.com>
4634 * class.c (push_lang_context): Turn off DECL_IGNORED_P for
4635 primitive Java types, if we actually see `extern "Java"'.
4637 1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
4639 * lang-specs.h: Pass -$ to the preprocessor.
4641 1999-05-10 Jason Merrill <jason@yorick.cygnus.com>
4643 * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too.
4644 Don't bother wrapping an OFFSET_TYPE around unknown_type_node.
4645 (resolve_offset_ref): Don't handle a raw baselink.
4646 * cvt.c (build_expr_type_conversion): Likewise.
4647 * typeck.c (decay_conversion, build_c_cast, convert_for_assignment,
4648 convert_for_initialization): Likewise.
4649 * class.c (instantiate_type): Handle seeing a baselink under an
4651 * error.c (dump_expr): Likewise.
4652 * pt.c (for_each_template_parm): Likewise.
4653 (resolve_overloaded_unification): Likewise.
4654 * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise.
4655 * typeck.c (expr_sizeof): Also complain about other permutations
4656 of overloaded functions.
4658 1999-05-07 Jason Merrill <jason@yorick.cygnus.com>
4660 * init.c (resolve_offset_ref): Don't return a raw method.
4662 * typeck.c (decay_conversion): Don't handle a raw method.
4663 Resolve all OFFSET_REFs.
4664 (get_member_function_from_ptrfunc): 0 is a valid vtable index.
4665 (build_binary_op_nodefault): Handle resolving overloaded fns. Use
4666 same_type_p for pmf bits. Don't use build_binary_op to compare
4667 raw pointers to methods.
4668 (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE,
4669 to decide when to call resolve_offset_ref.
4670 (build_c_cast, convert_for_initialization): Likewise.
4671 * cvt.c (build_expr_type_conversion): Likewise.
4673 1999-05-06 Nathan Sidwell <nathan@acm.org>
4675 * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class.
4677 1999-05-05 Mark Mitchell <mark@codesourcery.com>
4679 * decl2.c (start_objects): Don't let static constructors and
4680 destructors get inlined.
4682 * parse.y (nested_name_specifier): Make sure ordinary types are
4683 complete, just like template types.
4684 * parse.c: Regenerated.
4686 * pt.c (check_explicit_specialization): Improve error messages.
4688 1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
4690 * typeck.c (string_conv_p): Use same_type_p to check whether we
4691 try to convert between char and wchar_t.
4693 1999-05-03 Mark Mitchell <mark@codesourcery.com>
4695 * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous
4696 lookup to error_mark_node here.
4697 (lookup_member): Revise documentation. Add comments. Don't set
4698 the TREE_TYPE to error_mark_node here, and don't build up an extra
4699 TREE_LIST for ambiguous lookups.
4700 (setup_class_bindings): Adjust accordingly.
4701 (push_class_decls): Revise out-of-date comments.
4703 * typeck.c (build_const_cast): Tighten checks for legality.
4705 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
4707 * init.c (build_member_call): Lookup names coming from
4708 namespace-scoped LOOKUP_EXPR.
4710 1999-05-03 Jim Blandy <jimb@zwingli.cygnus.com>
4712 * gxxint.texi: Add documentation for 'I'.
4714 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
4716 * tinfo.cc (operator==): Qualify type_info with std::.
4718 1999-05-02 Mark Mitchell <mark@codesourcery.com>
4720 * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy.
4721 (DECL_COMDAT): Remove definition.
4723 1999-05-01 Mark Mitchell <mark@codesourcery.com>
4725 * decl.c (wrapup_globals_for_namespace): Fix thinko in previous
4728 1999-04-30 Mark Mitchell <mark@codesourcery.com>
4730 * class.c (build_vtable): Use build_lang_decl when building
4731 vtables, not just build_decl.
4732 (prepare_fresh_vtable): Likewise.
4733 * decl.c (wrapup_globals_for_namespace): Mark vtables as
4734 DECL_EXTERNAL when calling wrapup_global_declarations.
4735 * decl2.c (priority_info_s): Add initializations_p and
4736 destructions_p members.
4737 (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED,
4738 when deciding what vtables to write out.
4739 (ssdf_decls): New variable.
4740 (ssdf_decls_used): Likewise.
4741 (start_static_storage_duration_function): Deal with being called
4742 multiple times. Avoid inlining this function.
4743 (generate_inits_for_priority): Deal with reuse of priority map.
4744 (get_priority_info): Clear initializations_p and destructions_p.
4745 (do_static_initialization): Tweak comment.
4746 (do_static_destruction): Likewise. Fix condition on sentries for
4748 (generate_ctor_or_dtor_function): Call all of the static storage
4750 (generate_ctor_or_dtor_function_for_priority): Check
4751 initializations_p and destructions_p to see what priorities need
4752 initialization functions.
4753 (finish_file): Rework to generate multiple static storage duration
4754 functions, rather than just one.
4756 * typeck.c (build_const_cast): Tweak last change to handle
4757 templates correctly.
4759 * typeck.c (build_const_cast): Disallow use of const_cast to
4760 anything but a pointer or reference type.
4762 1999-04-30 Nathan Sidwell <nathan@acm.org>
4764 * decl.c (cp_finish_decl): Don't permit arrays of abstract or
4767 1999-04-29 Mark Mitchell <mark@codesourcery.com>
4769 * decl2.c (do_static_destruction): Remove obsolete FIXME comment.
4770 (finish_file): Indent comments properly.
4772 1999-04-29 Richard Henderson <rth@cygnus.com>
4774 * decl2.c (do_static_initialization): Call do_pending_stack_adjust.
4775 (do_static_destruction): Likewise.
4777 1999-04-29 Nathan Sidwell <nathan@acm.org>
4779 * cp-tree.h (TYPE_NOTHROW_P): New macro.
4780 * decl2.c (delete_sanity): Warn on deleting void *.
4781 * init.c (build_new_1): Use TYPE_NOTHROW_P.
4782 * typeck.c (c_expand_return): cp_pedwarn on returning NULL from
4783 throwing operator new.
4785 1999-04-28 Nathan Sidwell <nathan@acm.org>
4787 * cp-tree.h (build_component_addr): Remove prototype.
4788 * typeck.c (build_component_addr): Make static. Remove MSG
4790 (build_component_addr): Remove MSG parameter, clean up
4792 (build_x_function_call): Use cp_error.
4793 (build_unary_op): Adjust call of build_component_addr.
4795 1999-04-28 Mark Mitchell <mark@codesourcery.com>
4797 * pt.c (tsubst_friend_class): Check for NULL.
4799 Wed Apr 28 11:42:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4801 * search.c (binfo_for_vtable): Initialize bfvi.var.
4803 1999-04-27 Nathan Sidwell <nathan@acm.org>
4805 * rtti.c (build_x_typeid): Check rtti is enabled.
4807 1999-04-26 Mark Mitchell <mark@codesourcery.com>
4809 * search.c (is_subobject_of_p): Make sure we're looking at the
4812 1999-04-26 Marc Espie <espie@cvs.openbsd.org>
4814 * Make-lang.in (cplib2.ready): Don't depend on phony targets.
4816 1999-04-23 Mark Mitchell <mark@codesourcery.com>
4818 * decl2.c (finish_file): Tweak handling of extern inlines so that
4819 they are not unnecessarily put out.
4821 * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
4822 such as base classes.
4824 1999-04-22 Brendan Kehoe <brendan@cygnus.com>
4826 * tree.c (build_exception_variant): Fix typo: use the chain of U,
4827 not trying V, while cycling through U.
4829 1999-04-22 Mark Mitchell <mark@codesourcery.com>
4831 * cp-tree.h (lang_decl_flags): Remove returns_first_arg and
4832 preserves_first_arg. Enlarge dummy accordingly.
4833 (DECL_TINFO_FN_P): New macro.
4834 (SET_DECL_TINFO_FN_P): Likeiwse.
4835 (DECL_RETURNS_FIRST_ARG): Remove.
4836 (DECL_PRESERVES_THIS): Likewise.
4837 (DECL_INIT_PRIORITY): New macro.
4838 (finish_struct_1): Change prototype.
4839 (cat_namespace_levels): Remove prototype.
4840 (vtable_decl_p): New prototype.
4841 (vtype_decl_p): Likewise.
4842 (sigtable_decl_p): Likewise.
4843 (walk_globals_pred): New typedef.
4844 (walk_globals_fn): Likewise.
4845 (walk_globals): New prototype.
4846 (walk_namespaces_fn): New typedef.
4847 (walk_namespaces): New prototype.
4848 (wrapup_globals_for_namespace): Likewise.
4849 (walk_vtables): Remove prototype.
4850 (walk_sigtables): Likewise.
4851 (instantiate_pending_templates): New prototype.
4852 * class.c (finish_struct_1): Don't return a value.
4853 * decl.h (pending_statics): Remove declaration.
4854 * decl.c (walk_namespaces_r): New function.
4855 (walk_globals_r): Likewise.
4856 (vtable_decl_p): Likewise.
4857 (vtype_decl_p): Likewise.
4858 (sigtable_decl_p): Likewise.
4859 (walk_namespaces): Likewise.
4860 (walk_globals_data): New type.
4861 (walk_globals): New function.
4862 (wrapup_globals_for_namespace): Likewise.
4863 (expand_static_init): Remove assertion. Remove redundancy in
4864 conditional. Don't put static data members in static_aggregates
4866 (finish_function): Remove redundancy in conditional. Don't set
4867 DECL_RETURNS_FIRST_ARG.
4868 (cat_namespace_levels): Remove.
4869 * decl2.c: Include splay-tree.h and varray.h.
4870 (priority_info_s): New structure.
4871 (finish_vtable_vardecl): Change prototype. Adjust for new calling
4873 (prune_vtable_vardecl): Likewise.
4874 (finish_sigtable_vardecl): Likewise.
4875 (setup_initp): Remove.
4878 (start_static_storage_duration_function): New function.
4879 (generate_inits_for_priority): Likewise.
4880 (finish_static_storage_duration_function): Likewise.
4881 (get_priority_info): Likewise.
4882 (do_static_initialization): Likewise.
4883 (do_static_destruction): Likewise.
4884 (do_static_initialization_and_destruction): Likewise.
4885 (generate_ctor_or_dtor_function): Likewise.
4886 (generate_ctor_and_dtor_functions_for_priority): Likewise.
4887 (pending_statics): Make it a varray.
4888 (pending_statics_used): New variable.
4889 (saved_inlines): Make it a varray.
4890 (saved_inlines_used): New variable.
4891 (finish_static_data_member): Change method of updating
4893 (mark_inline_for_output): Remove #if 0'd code. Change method of
4894 updating saved_inlines.
4895 (walk_vtables): Remove.
4896 (walk_sigtables): Likewise.
4897 (import_export_decl): Use DECL_TINFO_FN_P.
4898 (pending_templates): Remove declaration.
4899 (maybe_templates): Likewise.
4900 (static_aggregates_initp): Likewise.
4901 (setup_initp): Likewise.
4902 (finish_objects): Simplify.
4903 (INITIALIZE_P_IDENTIFIER): New macro.
4904 (PRIORITY_IDENTIFIER): New macro.
4905 (SSDF_IDENTIFIER): New macro.
4906 (initialize_p_decl): New variable.
4907 (priority_decl): Likewise.
4908 (ssdf_decl): Likewise.
4909 (priority_info_map): Likewise.
4910 (finish_file): Recode output of static intializers and other
4911 file-scope finalization tasks.
4912 * error.c (OB_END_TEMPLATE_ID): New macro.
4913 (dump_type_real): Use it.
4914 (dump_decl): Likewise.
4915 (dump_function_name): Likewise.
4916 * lex.c (set_typedecl_interface_info): Adjust for new walk_globals
4918 (check_newline): Use walk_globals, not walk_vtables.
4919 * pt.c (pending_tempalte_expansions): Remove.
4920 (set_vardecl_interface_info): Likewise.
4921 (pending_templates): Make static.
4922 (maybe_templates): Likewise.
4923 (instantiate_class_template): Adjust call to finish_struct_1.
4924 (instantiate_pending_templates): New function.
4925 * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P.
4926 * tree.c (static_aggregates_initp): Remove.
4927 (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY
4929 * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h.
4931 * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes
4932 with the RTL code RETURN.
4933 * hash.h: Regenerated.
4934 * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD.
4935 * parse.y: Replace RETURN with RETURN_KEYWORD throughout.
4936 * parse.c: Regenerated.
4937 * pt.c: Include varray.h. Include rtl.h since varray.h requires
4939 (inline_parm_levels): New variable.
4940 (inline_parm_levels_used): Likewise.
4941 (maybe_begin_member_template_processing): Update them.
4942 (maybe_end_member_template_processing): Use them, rather than
4943 guessing how many levels to pop.
4945 * decl.c (make_typename_type): Tighten error-checking.
4947 1999-04-20 Mark Mitchell <mark@codesourcery.com>
4949 * cp-tree.h (build_binary_op): Remove unneeded parameter.
4950 * class.c (build_vrable_entry_ref): Adjust call to
4952 * decl.c (expand_static_init): Likewise.
4953 (grokdeclarator): Likewise.
4954 (finish_function): Likewise.
4955 * decl2.c (delete_sanity): Likewise.
4956 (do_dtors): Likewise.
4957 (do_ctors): Likewise.
4958 * error.c (dump_type_suffix): Likewise.
4959 * expr.c (cplus_expand_expr): Likewise.
4960 * init.c (resolve_offset_ref): Likewise.
4961 (build_new): Likewise.
4962 (build_new_1): Likewise.
4963 (build_vec_delete_1): Likewise.
4964 (expand_vec_init_catch_clause): Likewise.
4965 (build_delete): Likewise.
4966 * pt.c (tsubst): Likewise.
4967 * rtti.c (synthesize_tinfo_fn): Likewise.
4968 * search.c (expand_upcast_fixups): Likewise.
4969 (expand_direct_vtbls_init): Likewise.
4970 * typeck.c (get_member_function_from_ptrfunc): Likewise.
4971 (build_binary_op_nodefault): Likewise.
4972 (point_int_sum): Likewise.
4973 (pointer_diff): Likewise.
4974 (build_unary_op): Likewise.
4975 (build_modify_expr): Likewise.
4976 (get_delta_difference): Likewise.
4977 (build_ptrmemfunc): Likewise.
4978 (expand_ptrmemfunc_cst): Likewise.
4980 1999-04-20 Jason Merrill <jason@yorick.cygnus.com>
4982 * decl.c (grokfndecl): Always call cplus_decl_attributes.
4983 * decl2.c (grokfield): Pass attrlist to grokdeclarator.
4985 1999-04-19 Mark Mitchell <mark@codesourcery.com>
4987 * cp-tree.h (finish_static_data_member_decl): New function.
4988 * decl2.c (finish_static_data_member_decl): Split out from ...
4990 * pt.c (instantiate_class_template): Use it here instead of
4992 (tsubst_decl): Don't set DECL_ASSEMBLER_NAME;
4993 finish_static_data_member_decl will do that. Explicit set
4994 DECL_EXTERNAL to match non-template processing.
4996 1999-04-18 Mark Mitchell <mark@codesourcery.com>
4998 * cp-tree.h (finish_class_definition): Add parameter.
4999 * parse.y (structsp): Use it. Don't call pop_scope here.
5000 * parse.c: Regenerated.
5001 * semantics.c (finish_class_definition): Pop it here.
5003 1999-04-17 Mark Mitchell <mark@codesourcery.com>
5005 * decl.c (xref_tag): Revise handling of nested template
5007 * pt.c (check_explicit_specialization): Tweak handling of friend
5008 templates in template classes.
5009 (tsubst_friend_class): Handle friend declarations for nested
5010 member template classes.
5012 1999-04-16 Mark Mitchell <mark@codesourcery.com>
5014 * class.c (finish_struct): Remove unused variable.
5015 (pushclass): Likewise.
5016 (invalidate_class_lookup_cache): Likewise.
5017 * cp-tree.def (TYPENAME_TYPE): Improve documentation.
5018 * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME
5019 doesn't get obliterated.
5020 (make_typename_type): Handle template classes correctly.
5022 * cp-tree.h (TREE_NONLOCAL_FLAG): Remove.
5023 (storetags): Declare.
5024 * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG.
5025 (pushclass): Likewise. Use storetags to install tag declarations,
5027 (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG.
5028 * decl.c (storetags): Make it global.
5029 (push_class_binding): Set INHERITED_VALUE_BINDING_P for an
5030 implicit typename declaration.
5031 (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG.
5032 * method.c (hack_identifier): Likewise.
5033 * search.c (lookup_member): Likewise.
5035 * decl.c (warn_about_implicit_typename_lookup): New function.
5036 (lookup_name_real): Use it. Rework handling of implicit typename
5039 1999-04-15 Mark Mitchell <mark@codesourcery.com>
5041 * cp-tree.h (lookup_nested_field): Remove.
5042 * class.c (push_nested_class): Handle UNION_TYPEs.
5043 (pop_nested_class): Likewise.
5044 * decl.c (lookup_name_real): Don't call lookup_nested_field.
5045 (start_decl): Use push_nested_class, not just pushclass.
5046 (cp_finish_decl): Use pop_nested_class, not just popclass.
5047 * search.c (lookup_nested_field): Remove.
5049 * cp-tree.h (lang_type): Add documentation.
5050 * decl2.c (handle_class_head): Create template declarations here,
5052 * parse.y (class_head): Return whether or not we entered a new
5053 scope, as well as the type named.
5054 (named_class_head): Likewise.
5055 (named_complex_class_head_sans_basetype): Likewise.
5056 (structsp): Adjust accordingly. Pop scope when required.
5057 * parse.c: Regenerated.
5058 * pt.c (check_default_tmpl_args): Robustify.
5059 (redeclare_class_template): Likewise.
5060 (instantiate_class_template): An instantiation of an
5061 anonymous union is itself an anonymous union.
5062 * semantics.c (begin_class_definition): Don't create template
5065 1999-04-15 Jason Merrill <jason@yorick.cygnus.com>
5067 * parse.y (after_type_declarator_intern): New nonterminal.
5068 (after_type_declarator): Use it.
5069 (direct_after_type_declarator): Likewise. Move above
5070 nonnested_type to fix reduce/reduce conflict resolution.
5071 (declmods): Reducing from just 'attributes' has EMPTY precedence.
5072 * Makefile.in (CONFLICTS): Update.
5074 * decl.c (define_label): Downgrade error for jumping over a
5075 non-POD decl to pedwarn.
5077 1999-04-14 Mark Mitchell <mark@codesourcery.com>
5079 * cp-tree.h (popclass): Change declaration.
5080 (pop_nested_class): Likewise.
5081 (poplevel_class): Remove declaration.
5082 * call.c (convert_default_argument): Pass no arguments to
5084 * class.c (finish_struct_1): Likewise.
5085 (finish_struct): Likewise.
5086 (popclass): Remove argument. Simplify code accordingly.
5087 (pop_nested_class): Likewise.
5088 * decl.c (poplevel_class): Declare it here, and make it static.
5089 (poplevel): Handle class scopes.
5090 (poplevel_class): Don't take an rgument. Simplify.
5091 (pop_everything): Pass no arguments to pop_nested_class.
5092 (cp_finish_decl): Pass no arguments to popclass.
5093 (grokdeclarator): Pass no arguments to pop_nested_class.
5094 (finish_function): Likewise.
5095 * decl2.c (grokfield): Likewise.
5096 (pop_scope): Pass no arguments to popclass.
5097 * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
5098 * pt.c (instantiate_class_template): Move call to pushclass, and
5099 document. Pass no arguments to popclass.
5100 (regenerate_decl_from_template): Likewise.
5102 1999-04-14 Jason Merrill <jason@yorick.cygnus.com>
5104 * typeck.c (build_unary_op): Handle taking the address of a unique
5105 bound non-static member function.
5107 1999-04-13 Martin von Loewis <loewis@informatik.hu-berlin.de>
5109 * lang-options.h (-Wdeprecated): New flag.
5110 * decl2.c (warn_deprecated): New flag.
5111 (lang_decode_option): Deprecated this-is-variable,
5112 external-templates, alt-external-templates.
5113 Support -Wdeprecated.
5114 * errfn.c (cp_deprecated): New function.
5116 1999-04-13 Jason Merrill <jason@yorick.cygnus.com>
5118 * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
5119 of the decls themselves.
5121 * pt.c (tsubst_function_type): Copy attributes over.
5123 * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority
5125 * cp-tree.h: Add prototype.
5126 * decl.c (init_decl_processing): Set valid_lang_attribute.
5128 1999-04-13 Mark Mitchell <mark@codesourcery.com>
5130 * class.c (finish_struct_1): Look at the const-ness of the field's
5131 type, not the TREE_READONLY-ness of the declaration.
5132 * method.c (synthesize_method): Likewise.
5133 * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
5134 creating new declarations.
5136 1999-04-13 Mike Stump <mrs@wrs.com>
5138 * decl2.c (import_export_decl): Because vtables always reference
5139 virtual functions, even if they are inlined, don't allow
5140 -fno-implement-inlines to not emit them, instead, emit them with
5142 * decl.c (start_function): Likewise.
5144 1999-04-12 Jason Merrill <jason@yorick.cygnus.com>
5146 * cp-tree.h (struct lang_type): Add com_interface.
5147 (CLASSTYPE_COM_INTERFACE): New macro.
5148 * class.c (set_rtti_entry): COM interface classes have no RTTI
5149 entries in their vtables; adjust.
5150 (add_virtual_function, finish_base_struct, skip_rtti_stuff,
5151 modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
5152 finish_struct_1): Likewise.
5153 * decl2.c (mark_vtable_entries): Likewise.
5154 * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
5155 * search.c (get_abstract_virtuals_1, get_abstract_virtuals,
5156 expand_upcast_fixups): Likewise.
5157 * tree.c (debug_binfo): Likewise.
5159 * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
5160 * typeck.c (comptypes): If we get it, ignore attributes.
5161 * class.c (instantiate_type): Use BASELINK_P. Change complain
5162 parameter to flags; 2 means ignore attributes.
5163 * call.c (build_op_delete_call): Pass it.
5165 * decl.c (xref_tag): Only complain once about using a typedef-name
5166 with 'struct'. Downgrade to pedwarn.
5168 * decl.c (grokdeclarator): Allow [] syntax for zero-length array.
5170 * parse.y (absdcl_intern): New nonterminal.
5171 (absdcl, direct_abstract_declarator): Use it.
5173 * pt.c (lookup_template_class): Look through implict typename.
5175 1999-04-11 Mark Mitchell <mark@codesourcery.com>
5177 * friend.c (add_friend): Deal gracefully with error_mark_node.
5178 * method.c (build_overload_value): Handle pointers-to-members as
5179 template parameters.
5181 * decl.c (push_binding): Fix typo in comment.
5183 1999-04-10 Mark Mitchell <mark@codesourcery.com>
5185 * error.c (dump_type_real): If a typename is a template-id, put
5186 out the template arguments.
5187 (dump_expr): Handle TEMPLATE_ID_EXPR.
5188 * pt.c (lookup_template_class): Now that full arguments are
5189 available everywhere, remove code that tried to guess them.
5191 1999-04-09 Mark Mitchell <mark@codesourcery.com>
5193 * decl.c (make_typename_type): Complain if we don't find a type
5194 when trying to make a typename type for a non-template type.
5196 1999-04-09 Jason Merrill <jason@yorick.cygnus.com>
5198 * decl.c (start_decl): Pass attributes to grokdeclarator.
5199 (grokdeclarator): Handle attributes on constructor-syntax
5202 1999-04-08 Mark Mitchell <mark@codesourcery.com>
5204 * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands
5207 * search.c (template_self_reference_p): Tweak.
5209 1999-04-07 Mark Mitchell <mark@codesourcery.com>
5211 * init.c (build_offset_ref): Don't build yet another weird data
5212 structure to describe overloaded functions.
5214 1999-04-06 Mark Mitchell <mark@codesourcery.com>
5216 * cp-tree.h (BASELINK_P): New macro.
5217 (SET_BASELINK_P): Likewise.
5218 * init.c (build_member_call): Remove needless assignment in if
5220 * search.c (lookup_field_r): Fix handling when we are looking
5221 specifically for a type; these are not hidden by functions and
5223 (lookup_member): Use SET_BASELINK_P.
5224 * tree.c (is_overloaded_fn): Use BASELINK_P.
5225 (really_overloaed_fn): Likewise.
5226 (get_first_fn): Likewise.
5228 1999-04-05 Mark Mitchell <mark@codesourcery.com>
5230 * decl.c (lookup_name_current_level): Tweak, and improve
5233 * class.c (maybe_fixup_vptrs): Remove declaration.
5234 (build_class_init_list): Likewise.
5235 * decl.c (pushdecl_class_level): Call check_template_shadow here
5237 (push_class_level_binding): ... not here.
5238 * search.c (dfs_push_type_decls): Only avoid
5239 template-self-reference TYPE_DECLs if they are from base classes.
5241 1999-04-04 Mark Mitchell <mark@codesourcery.com>
5243 * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL
5246 1999-04-03 Jason Merrill <jason@yorick.cygnus.com>
5248 * class.c (maybe_fixup_vptrs, build_class_init_list): Lose.
5249 (finish_struct_1): Don't call build_class_init_list.
5251 1999-04-02 Mark Mitchell <mark@codesourcery.com>
5253 * tinfo.h (__class_type_info): Fix illegal declaration.
5255 * cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
5256 * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
5257 (IDENTIFIER_CLASS_VALUE): Improve documentation.
5258 (is_properly_derived_from): Declare.
5259 (invalidate_class_lookup_cache): Likewise.
5260 (maybe_maybe_note_name_used_in_class): Likewise.
5261 (note_name_declared_in_class): Likewise.
5262 (push_using_decl): Remove duplicate declaration.
5263 (id_in_current_class): Remove declaration.
5264 (push_class_binding): Change prototype.
5265 (clear_identitifer_class_values): Declare.
5266 * call.c (is_properly_derived_from): Make it global.
5267 (build_new_function_call): Be careful about updating candidates.
5268 (build_new_method_call): Handle COMPONENT_REFs. Don't crash when
5269 asked to make illegal calls.
5270 * class.c: Include splay-tree.h.
5271 (class_stack_node): Add names_used slot.
5272 (check_member_decl_is_same_in_complete_scope): Remove.
5273 (add_method): Fix comment. Push the declaration into class
5275 (finish_struct_1): When popping the class, pop the bindings too.
5276 Remove check for data member/function member conflict.
5277 (finish_struct): Remove calls to
5278 check_member_decl_is_same_in_complete_scope. Change calls to
5280 (pushclass): Clear names_used in the class stack entry.
5281 Use invalidate_class_lookup_cache to remove cached entries, rather
5282 than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE
5283 before entering a new class. Remove dead code. Don't mess with
5284 current_function_decl when pushing declarations.
5285 (invalidate_class_lookup_cache): New function, split out from ...
5286 (popclass): Here. Clean up names_used on our way out.
5287 (instantiate_type): Adjust.
5288 (build_self_reference): Don't push the declaration here.
5289 (maybe_note_name_used_in_class): New function.
5290 (note_name_declared_in_class): Likewise.
5291 * decl.c (add_binding): Change prototype.
5292 (find_class_binding_level): New function.
5293 (innermost_nonclass_level): Likewise.
5294 (current_binding_level): Update documentation.
5295 (inner_binding_level): Remove. Replace with current_binding_level
5297 (push_binding_level): Remove special handling of
5298 class_binding_level.
5299 (pop_binding_level): Likewise. Use find_class_binding_level.
5300 (suspend_binding_level): Likewise.
5301 (global_bindings_p): Use innermost_nonclass_level.
5302 (toplevel_bindings_p): Likewise.
5303 (namespace_bindings_p): Likewise.
5304 (pseudo_global_level_p): Likewise.
5305 (push_binding): Clear INHERITED_VALUE_BINDING_P.
5306 (add_binding): Check for illegal multiple declarations. Return a
5307 value indicating whether or not the new binding was legal.
5308 (push_local_binding): Skip over class binding levels. Check
5309 return value from add_binding.
5310 (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call
5311 note_name_declared_in_class.
5312 (pushlevel_class): Remove "fake out the rest of the compiler"
5314 (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
5315 (clear_identifier_class_values): New function.
5316 (pop_from_top_level): Use it.
5317 (pop_everything): Tweak.
5318 (maybe_process_template_type_declaration): Don't push the
5319 declaration for the template here.
5320 (pushtag): Don't push tag declarations into class scope here.
5321 (pushdecl): Apply DeMorgan's law for readability.
5322 (pushdecl_class_level): Remove special-case code for
5323 TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions.
5324 (push_class_level_bindng): Deal with inherited bindings.
5325 (lookup_name_real): Remove special-case code for
5326 TYPE_BEING_DEFINED, and some implicit typename magic.
5327 (grokdeclarator): Handle COMPONENT_REF for a template function.
5328 (build_enumerator): Don't call pushdecl_class_level here.
5329 (id_in_current_class): Remove.
5330 * decl2.c (grokfield): Don't call pushdecl_class_level or
5331 check_template_shadow.
5332 * errfn.c (cp_file_of): Don't declare.
5333 (cp_line_of): Likewise.
5334 * error.c (dump_decl): Handle an OVERLOAD.
5335 (cp_file_of): Likewise.
5336 (cp_line_of): Likewise.
5337 * init.c (build_member_call): Handle a COMPONENT_REF.
5338 * lex.c (do_identifier): Call maybe_note_name_used_in_class, not
5339 pushdecl_class_level.
5340 * method.c (hack_identifier): Build COMPONENT_REFs for references
5341 to member templates as well as member functions. Remove dead
5343 * parse.y (left_curly): Remove.
5344 (nonnested_type): Call maybe_note_name_used_in_class, not
5345 pushdecl_class_level.
5346 * parse.c: Regenerated.
5347 (nested_name_specifier_1): Likewise.
5348 * pt.c (check_explicit_specialization): Adjust, for robustness.
5349 (check_template_shadow): Handle OVERLOADs.
5350 (build_template_decl): Set DECL_CONSTRUCTOR_P on the
5351 TEMPLATE_DECL, if appropriate.
5352 * search.c (envelope_add_decl): Remove.
5353 (dfs_pushdecls): Likewise.
5354 (dfs_compress_decls): Likewise.
5355 (dfs_push_decls): New function.
5356 (dfs_push_type_decls): Likewise.
5357 (setup_class_bindings): Likewise.
5358 (template_self_reference_p): Likewise.
5359 (lookup_field_r): Use it.
5360 (looup_member): Remove old comment. Deal with ambiguity.
5361 (push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
5362 and remove envelope processing.
5363 * semantics.c (begin_class_definition): Let pushclass push
5364 declarations for base classes.
5365 (finish_member_declaration): Push declarations into class scope.
5366 * typeck.c (build_component_ref): Just put an OVERLOAD into the
5367 COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
5368 (build_x_function_call): Deal with OVERLOAD. Handle template-ids.
5369 * Makefile.in (class.o): Depend on splay-tree.h.
5371 Wed Mar 31 11:30:43 1999 Nathan Sidwell <nathan@acm.org>
5373 * cvt.c (convert_pointer_to_real): Use same_type_p.
5374 * typeck.c (comp_target_types): Use same_type_p.
5376 1999-03-31 Jason Merrill <jason@yorick.cygnus.com>
5378 * semantics.c (begin_inline_definitions,
5379 finish_inline_definitions): Rename from finish_default_args and
5380 begin_inline_definitions, respectively, to something that isn't a
5382 * parse.y (structsp): Adjust.
5384 * tree.c (hash_tree_cons): Remove obsolete via_* parms.
5385 (list_hash_lookup): Likewise.
5386 (hash_tree_chain): Adjust.
5387 * pt.c (tsubst): Adjust.
5388 (tsubst_arg_types): Use plain hash_tree_cons.
5389 * cp-tree.h (hash_tree_cons_simple): Lose.
5390 * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons.
5392 Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5394 * Makefile.in (hash.h): Generate using gperf language 'C', not
5395 'KR-C', so gperf uses the `const' keyword on strings.
5397 * gxx.gperf (resword): Const-ify a char*.
5399 1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
5401 * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
5402 CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
5403 CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
5404 CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
5405 CLASSTYPE_BINFO_AS_LIST): Remove cruft.
5406 * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
5409 1999-03-29 Jason Merrill <jason@yorick.cygnus.com>
5411 * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
5413 1999-03-28 Jason Merrill <jason@yorick.cygnus.com>
5415 * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops.
5417 1999-03-27 Mark Mitchell <mark@codesourcery.com>
5419 * cp-tree.h (add_friend): Declare.
5420 (add_friends): Likewise.
5421 * friend.c (add_friend): Make it global. Don't add to
5422 DECL_BEFRIENDING_CLASSES if the befriending class is a template.
5423 (add_friends): Make it global.
5424 (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
5425 befriending class is a template.
5426 * parse.y (component_decl_1): Fix typo in comment.
5427 * parse.c: Regenerated.
5428 * pt.c (instantiate_class_template): Use add_friend and
5429 add_friends rather that duplicating some of their functionality
5432 1999-03-27 Jason Merrill <jason@yorick.cygnus.com>
5434 * call.c (build_field_call): Unify 'this' and non-'this' cases.
5436 * typeck.c (build_indirect_ref): Check for 'this' sooner.
5438 Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5440 * call.c (op_error): Const-ify a char*.
5441 (add_candidate, source_type, add_warning): Add static prototype.
5442 (print_z_candidates): Const-ify a char*.
5444 * class.c (resolve_address_of_overloaded_function,
5445 fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
5446 (get_vtable_name, finish_struct_1): Const-ify a char*.
5448 * cvt.c (convert_to_reference): Likewise.
5450 * decl.c (redeclaration_error_message, record_builtin_type,
5451 record_unknown_type, member_function_or_else, bad_specifiers):
5453 (find_binding, select_decl, unqualified_namespace_lookup,
5454 lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
5455 Add static prototype.
5456 (warn_extern_redeclared_static, duplicate_decls, pushdecl,
5457 implicitly_declare, record_builtin_java_type, define_function,
5458 grok_op_properties, tag_name): Const-ify a char*.
5460 * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
5461 (define_function, finish_builtin_type): Const-ify a char*.
5462 (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
5463 cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
5464 (file_name_nondirectory): Const-ify a char*.
5465 (init_filename_times): Don't prototype.
5466 (compiler_error): Prototype.
5467 (yyerror, init_repo): Const-ify a char*.
5468 (build_srcloc): Don't prototype.
5469 (build_x_indirect_ref, build_indirect_ref, build_component_addr):
5471 (warn_for_assignment): Don't prototype.
5472 (convert_for_initialization, readonly_error, check_for_new_type,
5473 GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
5476 * decl2.c (acceptable_java_type, output_vtable_inherit,
5477 setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
5478 merge_functions, decl_namespace, validate_nonmember_using_decl,
5479 do_nonmember_using_decl): Add static prototype.
5480 (lang_f_options): Const-ify a char*.
5481 (finish_builtin_type): Likewise.
5482 (add_function, arg_assoc_namespace, arg_assoc_class): Add static
5485 * errfn.c: Include cp-tree.h.
5486 (cp_thing): Add static prototype.
5487 (compiler_error): Don't protoptype.
5488 (cp_compiler_error): Cast `compiler_error' to `errorfn' before
5489 passing it to `cp_thing'.
5491 * error.c (interesting_scope_p): Add static prototype.
5493 * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
5496 * init.c (compiler_error): Don't prototype.
5497 (member_init_ok_or_else): Const-ify a char*.
5498 (build_java_class_ref): Add static prototype.
5500 * lex.c (compiler_error): Don't prototype.
5501 (get_time_identifier, interface_strcmp, extend_token_buffer,
5502 handle_cp_pragma): Const-ify a char*.
5503 (is_global, init_filename_times): Add static prototype.
5504 (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
5505 (compiler_error): Change from fixed args to variable args.
5506 (yyerror): Const-ify a char*.
5508 * parse.y (cond_stmt_keyword): Const-ify a char*.
5509 (parse_decl): Add static prototype.
5511 * pt.c (template_args_equal, print_template_context): Likewise.
5512 (print_candidates, check_default_tmpl_args): Const-ify a char*.
5513 (instantiate_class_template): Likewise.
5515 * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
5517 * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
5518 expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
5520 * search.c (lookup_field_info, lookup_member): Likewise.
5521 (lookup_member): Cast the first argument of `bzero' to a PTR.
5523 * sig.c (compiler_error): Don't prototype.
5524 (build_signature_pointer_or_reference_nam): Const-ify a char*.
5525 (get_sigtable_name, build_member_function_pointer): Likewise.
5527 * tree.c (compiler_error): Don't prototype.
5528 (no_linkage_helper, build_srcloc): Add static prototype.
5529 (build_vbase_pointer_fields): Const-ify a char*.
5530 (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
5532 * typeck.c (compiler_error): Don't prototype.
5533 (convert_for_assignment): Const-ify a char*.
5534 (comp_cv_target_types): Add static prototype.
5535 (build_x_indirect_ref, build_indirect_ref, convert_arguments,
5536 build_component_addr, build_unary_op, convert_for_initialization):
5539 * typeck2.c (ack): Add static prototype and change from fixed args
5541 (readonly_error, check_for_new_type): Const-ify a char*.
5543 * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
5544 fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
5545 (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'.
5546 (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
5547 gen_assign, GNU_xref_member): Const-ify a char*.
5549 1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
5551 * gxxint.texi: Remove old discussion on copying virtual bases.
5553 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
5555 * Make-lang.in: Remove all references to g++.o/g++.c.
5556 Link g++ from gcc.o.
5558 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
5560 * decl2.c (comdat_linkage): Treat vtables like functions.
5562 1999-03-25 Mark Mitchell <mark@codesourcery.com>
5564 * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES.
5566 1999-03-25 Nathan Sidwell <nathan@acm.org>
5568 * decl.c (init_decl_processing): Add `signed' type as a synonym
5571 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
5573 * typeck.c (common_type): Handle cv-qual unification for pointers
5576 * decl.c (unqualified_namespace_lookup): Return error_mark_node
5578 (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
5579 * lex.c (do_identifier): If we got error_mark_node, call
5582 1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
5584 * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
5587 1999-03-24 Jason Merrill <jason@yorick.cygnus.com>
5589 * decl.c (lookup_name_real): Do nested field lookup regardless of
5592 1999-03-24 Mark Mitchell <mark@codesourcery.com>
5594 * cp-tree.h (lang_type): Remove has_assignment and
5595 has_real_assignment. Add befriending_classes.
5596 (TYPE_HAS_ASSIGNMENT): Remove.
5597 (TYPE_HAS_REAL_ASSIGNMENT): Likewise.
5598 (CLASSTYPE_BEFRIENDING_CLASSES): New macro.
5599 (lang_decl): Document.
5600 (DECL_BEFRIENDING_CLASSES): New macro.
5601 (FRIEND_NAME): Move declaration to more obvious location.
5602 (FRIEND_DECLS): Likewise.
5603 * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
5604 * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
5605 (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
5606 (grok_op_properties): Likewise.
5607 * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
5608 (add_friend): Likewise. Don't do weird things with assignment
5609 operators. Update DECL_BEFRIENDING_CLASSES.
5610 (add_friends): Don't do weird things with assignment operators.
5611 (make_friend_class): Likewise. Update
5612 CLASSTYPE_BEFRIENDING_CLASSES.
5613 * pt.c (instantiate_class_template): Don't set
5614 TYPE_HAS_ASSIGNMENT.
5615 (tsubst_copy): Substitute the TREE_TYPE for more unary
5617 * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
5618 * search.c (protected_accessible_p): New function.
5619 (friend_accessible_p): Likewise.
5620 (accessible_p): Use them.
5622 1999-03-23 Mark Mitchell <mark@codesourcery.com>
5624 * pt.c (convert_nontype_argument): Don't create things that aren't
5625 PTRMEM_CSTs when applying a qualification conversion to a
5628 1999-03-23 Mark Mitchell <mark@codesourcery.com>
5630 * Makefile.in (OBJS): Don't mention hash.o.
5631 (OBJDEPS): Likewise.
5633 1999-03-23 Jason Merrill <jason@yorick.cygnus.com>
5635 * decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
5636 * decl.c (expand_static_init): Make sure we don't add any after
5639 * decl.c (cp_finish_decl): Move intelligence about handling
5640 DECL_COMDAT for variables from here...
5641 * decl2.c (comdat_linkage): ...to here.
5642 (maybe_make_one_only): Tweak.
5643 (import_export_decl): Call comdat_linkage for variables, too.
5644 (finish_file): Handle template statics properly.
5646 1999-03-22 Mark Mitchell <mark@codesourcery.com>
5648 * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
5649 Document internals of pointer-to-member-functions.
5650 (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
5651 (PFN_FROM_PTRMEMFUNC): Likewise.
5652 (build_type_conversion): Remove unused parameter.
5653 (build_ptrmemfunc1): Declare.
5654 (expand_ptrmemfunc_cst): New function.
5655 (delta2_from_ptrmemfunc): Likewise.
5656 (pfn_from_ptrmemfunc): Likewise.
5657 * cvt.c (cp_convert_to_pointer): Remove unused parameter to
5658 build_type_conversion. Use TYPE_PTRMEM_P for readability.
5659 (convert_to_reference): Remove unused parameter to
5660 build_type_conversion.
5661 (ocp_convert): Likewise.
5662 (build_user_type_conversion): Likewise.
5663 * error.c (dump_expr): Handle NULL pointer-to-member functions.
5664 * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
5665 * method.c (build_overload_value): Don't go splitting CONSTRUCTORs
5666 open when handling pointer-to-member functions.
5667 * pt.c (convert_nontype_argument): Clean up error messages. Be
5668 more stringent with pointers-to-members.
5669 * typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
5670 (build_unary_op): Tidy ever-so-slightly.
5671 (build_conditional_expr): Remove extra parameter to
5672 build_type_conversion.
5673 (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
5675 (expand_ptrmemfunc_cst): Define.
5676 (delta2_from_ptrmemfunc): Likewise.
5677 (pfn_from_ptrmemfunc): Likewise.
5679 1999-03-19 Mark Mitchell <mark@codesourcery.com>
5681 * init.c (build_member_call): Handle template-id expressions
5683 * typeck.c (build_x_function_call): Likewise.
5685 1999-03-19 Chip Salzenberg <chip@perlsupport.com>
5687 * friend.c (make_friend_class): Avoid core dump when
5688 not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
5690 1999-03-18 Jason Merrill <jason@yorick.cygnus.com>
5692 * decl.c (start_function): Suppress normal linkage heuristics
5693 for #pragma interface under MULTIPLE_SYMBOL_SPACES.
5695 1999-03-19 Alexandre Oliva <oliva@dcc.unicamp.br>
5697 * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c.
5698 ($(srcdir)/cp/parse.c): Moved from ../Makefile.in.
5700 1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de>
5702 * parse.y (named_complex_class_head_sans_basetype):
5703 Do not push a scope for error_mark_node.
5704 (maybe_base_class_list): Likewise.
5706 * decl.c (start_decl): Check for error_mark_node as a type.
5707 Detected by g++.brendan/array-refs.C.
5708 (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C.
5709 (maybe_build_cleanup_1): Likewise. Detected by
5710 g++.jason/incomplete1.C.
5712 * tree.c (build_dummy_object): Use void_zero_node instead of the
5714 (is_dummy_object): Check for such a node.
5715 Detected by g++.bob/inherit1.C
5717 1999-03-16 Jason Merrill <jason@yorick.cygnus.com>
5719 * method.c (old_backref_index): Split out...
5720 (flush_repeats): From here. Rename back from try_old_backref.
5721 (build_mangled_name): Put back some old-style repeat handling.
5723 Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5725 * lex.c: Don't include setjmp.h.
5726 (parse_float): New static function.
5727 (pf_args): New struct.
5728 (real_yylex): Use them in call to `do_float_handler'.
5730 1999-03-15 Mark Mitchell <mark@markmitchell.com>
5732 * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
5733 * tree.c (layout_basetypes): Not here.
5734 * search.c (dfs_search): Remove; no longer used.
5736 1999-03-12 Mark Mitchell <mark@markmitchell.com>
5738 * decl2.c (validate_nonmember_using_decl): Issue sensible
5739 error-messages on bogus qualifiers.
5741 1999-03-14 Jason Merrill <jason@yorick.cygnus.com>
5743 * call.c (add_function_candidate): Fix uninitialized variable.
5745 * Makefile.in (search.o): Add dependency on varray.h.
5747 1999-03-13 Jason Merrill <jason@yorick.cygnus.com>
5749 * decl.c (duplicate_decls): Use same_type_p.
5750 * method.c (try_old_backref): Renamed from flush_repeats. Use
5751 same_type_p. Don't try to handle repeats. Return success.
5752 (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support
5753 calls from old-style code, too.
5754 (check_ktype): Use same_type_p.
5755 (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT.
5756 (build_qualified_name): Simplify logic.
5757 (process_overload_item): Strip typedefs and quals at the top.
5758 (build_mangled_name_for_type_with_Gcode): Remove call to
5759 type_canonical_variant.
5760 (build_mangled_name): Likewise. Remove support for old-style
5761 repeats, which have been disabled since 2.7.2. Don't mess with
5763 (build_decl_overload_real): Don't mess with TREE_USED.
5765 1999-03-13 Nathan Sidwell <nathan@acm.org>
5767 * error.c (cp_printers): Add 'F' escape character.
5768 (dump_type_real): Remove TREE_LIST (fnargs) printing.
5769 Functionality moved to dump_parameters.
5770 (dump_type_suffix): Use dump_parameters and dump_exception_spec.
5771 (dump_function_decl): Extend meaning of V parameter. Use
5772 dump_parameters and dump_exception_spec.
5773 (dump_parameters): New static function.
5774 (dump_exception_spec): New static function.
5775 (fndecl_as_string): Change argument semantics. Use
5776 dump_function_decl directly.
5778 * sig.c (build_signature_table_constructor): Use cp_error.
5780 1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de>
5782 * semantics.c (finish_switch_cond): Handle error cases gracefully.
5783 Detected by g++.law/enum5.C.
5785 * typeck.c (build_modify_expr): Check for errors after resolving
5786 offsets. Detected by g++.brendan/static1.C.
5788 * decl.c (complete_array_type): Ignore initial_value if it is an
5789 error. Detected by g++.benjamin/17930.C.
5791 * typeck2.c (process_init_constructor): Return error if one argument
5792 is in error. Detected by g++.benjamin/13478.C.
5794 1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
5796 * decl.c (select_decl): Allow class templates when we need types.
5797 * decl2.c (ambiguous_decl): Likewise.
5799 1999-03-12 Mark Mitchell <mark@markmitchell.com>
5801 * lex.c (do_identifier): Correct call to enforce_access.
5802 * search.c (accessible_p): Tweak comment.
5804 1999-03-10 Mark Mitchell <mark@markmitchell.com>
5806 * semantics.c (begin_class_definition): Call build_self_reference.
5807 (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
5809 * search.c (assert_canonical_unmarked): Fix typo in prototype.
5811 * search.c (dfs_canonical_queue): New function.
5812 (dfs_assert_unmarked_p): Likewise.
5813 (assert_canonical_unmarked): Likewise.
5814 (access_in_type): Use it.
5815 (accessible_p): Likewise. Walk the whole tree when umarking.
5817 * sig.c (build_signature_table_constructor): Use accessible_p
5818 instead of compute_access.
5820 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
5822 * call.c (add_builtin_candidates): Handle overloaded conversion ops.
5824 1999-03-09 Mark Mitchell <mark@markmitchell.com>
5826 * cp-tree.h (flag_access_control): Declare.
5827 (TREE_VIA_PPUBLIC): Document.
5828 (DECL_NONSTATIC_MEMBER_P): New macro.
5829 (enforce_access): Return an indication of whether or not access
5831 (build_self_reference): Change prototype.
5832 (compute_access): Replace with ...
5833 (accessible_p): New function.
5834 (dfs_walk): Change prototype.
5835 (dfs_unmark): Likewise.
5836 (markedp): Likewise.
5837 * call.c (enforce_access): Use accessible_p.
5838 * class.c (build_self_reference): Insert the declaration into the
5839 list of members for this type, and make it public.
5840 * decl.c (xref_basetypes): Avoid ill-timed recursion.
5841 * init.c (build_offset_ref): Use lookup_member, not three separate
5842 name-lookups. Call enforce_access rather than checking for
5843 illegal accesses here.
5844 (resolve_offset_ref): Likewise.
5845 * lex.c (do_identifier): Likewise.
5846 * method.c (hack_identifier): Likewise.
5847 * parse.y (self_reference): Remove.
5848 (opt_component_decl_list): Don't use it.
5849 * parse.c: Regenerated.
5850 * pt.c (print_candidates): Generalize to handle lists of
5851 overloaded functions.
5852 (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's
5854 (get_template_base): Use new calling convention for dfs_walk.
5855 * search.c: Include varray.h. Add prototypes.
5856 (dfs_walk): Accept a data pointer to pass to the work functions.
5857 All callers changed. All work functions changed.
5858 (breadth_first_search): Rename to bfs_walk, and make consistent
5860 (dfs_walk_real): New function.
5861 (canonical_binfo): New function.
5862 (context_for_name_lookup): Likewise.
5863 (shared_marked_p): Likewise.
5864 (shared_unmarked_p): Likewise.
5865 (lokup_field_queue_p): Likewise.
5866 (lookup_field_r): Generalize to handle both functions and fields.
5867 (lookup_field): Just call lookup_member.
5868 (lookup_fnfields): Likewise.
5869 (lookup_member): Move body of lookup_field here and generalize.
5870 (dfs_accessible_queue_p): Likewise.
5871 (dfs_accessible_p): Likewise.
5872 (dfs_access_in_type): Likewise.
5873 (access_in_type): Likewise.
5874 (compute_access): Remove, and replace with ...
5875 (accessible_p): New function.
5876 (vbase_types): Remove.
5877 (vbase_decl_ptr_intermediate): Likewise.
5878 (vbase_decl_ptr): Likewise.
5879 (vbase_init_result): Likewise.
5880 (closed_envelopes): Likewise.
5881 (bvtable): Likewise.
5883 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
5885 * call.c (add_function_candidate): Check for proper number of args
5886 before checking the validity of those args.
5888 1999-03-06 Jason Merrill <jason@yorick.cygnus.com>
5890 * cp-tree.h (struct lang_type): Add anon_union field.
5891 (ANON_UNION_TYPE_P): Use it instead of examining type.
5892 (SET_ANON_UNION_TYPE_P): New macro.
5893 * decl.c (check_tag_decl): Use it.
5895 * search.c (compute_access): Handle non-type contexts earlier, and
5898 * tree.c (build_exception_variant): Use copy_to_permanent.
5900 * decl2.c (setup_initp): Give statics with no priority the default
5902 (do_dtors, do_ctors, finish_file): Remove special handling of
5903 non-prioritized statics.
5905 1999-03-05 Mark Mitchell <mark@markmitchell.com>
5907 * cp-tree.h (ANON_UNION_TYPE_P): Robustify.
5908 * decl.c (make_typename_type): Don't issue an error if an
5909 immediate lookup fails; it migt be resolved later.
5910 * friend.c (is_friend): Add comment.
5911 * search.c (breadth_first_search): Add POSTFN and DATA
5912 parameters. Tidy. All callers changed.
5913 (lookup_field_queue_p): New function.
5914 (lookup_field_r): Likewise.
5915 (lookup_field_post): Likewise.
5916 (lookup_field): Use them, via breadth_first_search, instead of
5918 (compute_access): Robustify.
5919 (lookup_fnfield_info): New structure.
5921 1999-03-05 Jason Merrill <jason@yorick.cygnus.com>
5923 * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again.
5925 1999-03-03 Jason Merrill <jason@yorick.cygnus.com>
5927 * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
5930 * decl2.c (import_export_class): Also return if
5931 CLASSTYPE_INTERFACE_ONLY is set.
5933 1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de>
5935 * decl.c (push_overloaded_decl): Only overwrite the old binding if
5937 * decl2.c (do_local_using_decl): Fix loop termination.
5939 1999-03-02 Mark Mitchell <mark@markmitchell.com>
5941 * cp-tree.h (determine_specialization): Don't declare.
5942 * pt.c (determine_specialization): Make it static. Eliminate
5943 complain parameter. Note that decl is always non-NULL now, and
5944 simplify accordingly.
5946 * decl.c (maybe_push_to_top_level): Always call
5947 push_cp_function_context.
5948 (pop_from_top_level): Always call pop_cp_function_context.
5950 1999-02-26 Nathan Sidwell <nathan@acm.org>
5952 * typeck.c (complete_type_or_else): Add VALUE arg, for helpful
5954 * cp-tree.h (complete_type_or_else): Added VALUE parameter.
5955 * init.c (build_new_1): Extra arg to complete_type_or_else.
5956 (build_delete): Likewise.
5957 * typeck.c (require_complete_type): Likewise.
5958 (pointer_int_sum): Likewise.
5959 (pointer_diff): Likewise.
5960 (build_component_ref): Likewise.
5962 * typeck2.c (incomplete_type_error): Always use cp_error.
5963 Show declaration of undefined type, if appropriate.
5964 Deal with UNKNOWN_TYPE nodes.
5966 * typeck.c (require_complete_type): Use TYPE_SIZE as
5967 size_zero_node to mean incomplete type.
5968 (require_complete_type_in_void): New function.
5969 (build_compound_expr): Call complete_type_in_void for LHS.
5970 (build_c_cast): Call complete_type_in_void for void cast.
5971 * cvt.c (ocp_convert): Call complete_type_in_void for void cast.
5972 * decl.c (cplus_expand_expr_stmt): Void expression checks moved to
5973 require_complete_type_in_void. Call it.
5974 * cp-tree.h (require_complete_type_in_void): Prototype new function.
5976 * typeck.c (convert_arguments): Use alternative format for
5977 function decls. Don't require_complete_type here. Simplify
5978 diagnostic printing.
5979 (convert_for_initialization): Don't require_complete_type on RHS yet.
5980 * call.c (convert_arg_to_ellipsis): Call require_complete_type.
5982 * call.c (build_over_call): Cope with qualified void return type.
5983 * semantics.c (finish_call_expr): Likewise.
5984 * typeck.c (build_function_call_real): Likewise.
5985 (c_expand_return): Likewise.
5986 * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
5988 * call.c (print_z_candidates): Use alternate print format, to be
5989 consistent with (pt.c) print_candidates.
5990 * method.c (hack_identifier): List candidate members.
5991 * search.c (lookup_field): Build ambiguous list, and show it, if
5994 1999-02-26 Mark Mitchell <mark@markmitchell.com>
5996 * typeck.c (decay_conversion): Don't confuse constant array
5997 variables with their initializers.
5999 * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when
6001 * pt.c (regenerate_decl_from_template): Tweak for clarity.
6002 (instantiate_decl): Mark a decl instantiated before regenerating
6003 it to avoid recursion.
6004 * tree.c (mapcar): Don't call decl_constant_value unless we know
6005 something is TREE_READONLY_DECL_P.
6007 * class.c (check_for_override): Don't stop checking when we find
6008 the first overridden function. Delete #if 0'd code.
6009 * search.c (get_matching_virtual): Likewise.
6011 1999-02-25 Richard Henderson <rth@cygnus.com>
6013 * lang-specs.h: Define __FAST_MATH__ when appropriate.
6015 1999-02-24 Mike Stump <mrs@wrs.com>
6017 * typeck.c (convert_for_assignment): Allow boolean integral constant
6018 expressions to convert to null pointer.
6020 1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
6022 * decl.c (lookup_namespace_name): Resolve namespace aliases.
6024 * class.c (push_nested_class): Allow namespaces.
6026 * decl2.c (set_decl_namespace): Add friendp parameter.
6027 * decl.c (grokfndecl): Pass it.
6028 (grokvardecl): Likewise.
6029 * cp-tree.h: Change declaration.
6031 1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
6033 * pt.c (tsubst): Allow an array of explicit size zero.
6035 1999-02-23 Jason Merrill <jason@yorick.cygnus.com>
6037 * errfn.c: Change varargs code to look like toplev.c.
6039 * method.c (process_modifiers): Don't prepend 'U' for char or
6042 1999-02-20 Craig Burley <craig@jcb-sc.com>
6044 * Make-lang.in (cplib2.ready): Don't consider updating
6045 cplib2 stuff if the current directory isn't writable, as
6046 it won't work (such as during a `make install').
6048 Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
6050 * decl2.c (start_objects): Make file scope constructors and
6051 destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
6052 ASM_OUTPUT_DESTRUCTOR are defined.
6054 1999-02-19 Mark Mitchell <mark@markmitchell.com>
6056 * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
6057 (fn_type_unification): Adjust prototype.
6058 (lookup_fnfields_1): Declare.
6059 * call.c (add_template_candidate_real): Adjust call to
6060 fn_type_unification.
6061 * class.c (add_method): Don't allow duplicate declarations of
6062 constructors or destructors.
6063 (resolve_address_of_overloaded_function): Remove unused variable.
6064 Adjust call to fn_type_unification.
6065 * decl.c (grokfndecl): Be more robust in the face of illegal
6067 * decl2.c (check_classfn): Remove hokey handling of member
6069 * pt.c (determine_specialization): Improve comments. Adjust to
6070 handle template argument deduction as per the standard.
6071 (check_explicit_specialization): Fix comment spacing. Handle
6072 type-conversion operators correctly. Improve error-recovery.
6073 (fn_type_unification): Remove EXTRA_FN_ARG parameter.
6074 (get_bindings_real): Simplify handling of static members.
6075 * search.c (lookup_fnfields_1): Make it have external linkage.
6076 * typeck.c (compparms): Fix comment.
6077 (build_unary_op): Don't try to figure out which template
6078 specialization is being referred to when when the address-of
6079 operator is used with a template function.
6081 Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6083 * cp-tree.h (lvalue_or_else): Qualify a char* with the `const'
6084 keyword to match an analogous change at the top level.
6086 * tree.c (lvalue_or_else): Likewise.
6088 1999-02-17 Mark Mitchell <mark@markmitchell.com>
6090 * decl.c (xref_basetypes): Comment.
6091 * pt.c (instantiate_class_template): Use xref_basetypes.
6093 1999-02-16 Mark Mitchell <mark@markmitchell.com>
6095 * cp-tree.h (tsubst): Change prototype.
6096 (tsubst_expr): Likewise.
6097 (tsubst_copy): Likewise.
6098 (type_unification): Remove prototype.
6099 * call.c (convert_default_arg): Adjust call to tsubst_expr.
6100 * class.c (resolve_address_of_overloaded_function): Just use
6101 fn_type_unification.
6102 * decl.c (grokdeclarator): Adjust call to tsubst.
6103 * method.c (build_template_parm_names): Likewise.
6104 * pt.c (GTB_VIA_VIRTUAL): New macro.
6105 (GTB_IGNORE_TYPE): Likewise.
6106 (resolve_overloaded_unification): Add `complain' parameter.
6107 (try_one_overload): Likewise.
6108 (tsubst_template_arg_vector): Likewise.
6109 (tsubst_template_parms): Likewise.
6110 (tsubst_aggr_type): Likewise.
6111 (tsubst_arg_types): Likewise.
6112 (tsubst_call_declarator_parms): Likewise.
6113 (unify): Remove explicit_mask.
6114 (type_unification_real): Likewise.
6115 (get_template_base_recursive): Likewise.
6116 (coerce_template_template_parms): Provide prototype.
6117 (tsubst_function_type): Likewise.
6118 (try_class_unification): New function.
6119 All callers changed to use new complain parameter.
6120 (get_template_base): Use try_class_unification.
6121 (unify): Adjust handling of classes derived from template types.
6122 (fn_type_unification): Substitute explicit arguments before
6125 1999-02-16 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6127 * decl.c (pushdecl): Remove dead code.
6129 1999-02-16 Jason Merrill <jason@yorick.cygnus.com>
6131 * decl2.c (finish_objects): Fix code I missed in previous change.
6133 1999-02-13 Jason Merrill <jason@yorick.cygnus.com>
6135 * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
6136 (grokdeclarator): Don't expect error_mark_node from grokfndecl.
6138 * pt.c (maybe_process_partial_specialization): Complain about
6139 'template <>' on non-specialization.
6141 1999-02-10 Jason Merrill <jason@yorick.cygnus.com>
6143 * decl.c (grokdeclarator): Catch wierd declarators.
6144 * decl2.c (finish_file): Don't abort because of namespace parsing
6146 (check_decl_namespace): Remove.
6148 1999-02-09 Mark Mitchell <mark@markmitchell.com>
6150 * cp-tree.h (get_template_base): Don't declare.
6151 (dfs_walk): Declare.
6152 (dfs_unmark): Likewise.
6153 (markedp): Likewise.
6154 * pt.c (unify): Remove duplicate declaration. Pass tparms and
6155 targs to get_template_base.
6156 (get_template_base_recursive): Move here from search.c. Check to
6157 see that the base found can be instantiated to form the desired
6159 (get_template_base): Likewise.
6160 (get_class_bindings): Simplify.
6161 * search.c (get_template_base_recursive): Move to pt.c.
6162 (get_template_base): Likewise.
6163 (markedp): Make it global.
6164 (dfs_walk): Likewise.
6165 (dfs_unmark): Likewise.
6167 1999-02-07 Jason Merrill <jason@yorick.cygnus.com>
6169 * pt.c (maybe_process_partial_specialization): Complain about
6170 specialization in wrong namespace.
6171 * tree.c (decl_namespace_context): New fn.
6173 1999-02-06 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6175 * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
6176 * pt.c (coerce_template_template_parms): Handle nested
6177 template template parameters.
6179 Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com)
6181 * typeck2.c: Update email addresses.
6183 1999-02-04 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6185 * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag
6188 1999-02-04 Jason Merrill <jason@yorick.cygnus.com>
6190 * lex.c (retrofit_lang_decl): Split out...
6191 (build_lang_decl): From here.
6192 * decl.c (pushdecl): Call it for functions generated by the middle
6193 end that don't have DECL_LANG_SPECIFIC.
6194 * cp-tree.h: Declare it.
6196 * decl2.c: Remove flag_init_priority. Always enable initp stuff.
6197 (start_objects, finish_objects): Only use special
6198 init_priority code if the user specified a priority.
6199 (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
6202 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
6204 * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and
6205 mkstemp.o. Get them from libiberty now.
6206 (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o.
6208 Tue Feb 2 22:38:48 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
6210 * decl2.c (lang_decode_option): Use read_integral_parameter.
6212 1999-02-01 Mark Mitchell <mark@markmitchell.com>
6214 * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
6215 before calling complete_type_or_else.
6217 Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6219 * input.c (inline): Don't define, its handled by system.h.
6221 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
6223 * decl2.c: Don't define flag_no_ident here. Don't process
6225 * cp-tree.h: Don't declare flag_no_ident here.
6226 * lang-specs.h: Map -Qn to -fno-ident.
6228 1999-01-28 Jason Merrill <jason@yorick.cygnus.com>
6230 * cp-tree.h (struct tree_binding): Replace scope field with a union.
6231 (BINDING_SCOPE): Adjust.
6232 * decl.c (BINDING_LEVEL): Adjust.
6234 1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
6236 * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
6239 * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
6242 * tree.c (equal_functions): Fix name in prototype.
6244 * decl.c (push_local_binding): Add FLAGS argument.
6245 (pushdecl, push_overloaded_decl): Pass it.
6246 * decl2.c (do_local_using_decl): Likewise.
6247 * cp-tree.h: Adjust prototype.
6248 * decl.c (poplevel): Fix logic.
6250 * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
6251 (poplevel): Handle that. Fix logic for removing TREE_LISTs.
6252 (cat_namespace_levels): Don't loop forever.
6254 1999-01-25 Richard Henderson <rth@cygnus.com>
6256 * typeck.c (build_reinterpret_cast): Fix typo in duplicated test.
6258 1999-01-25 Jason Merrill <jason@yorick.cygnus.com>
6260 * class.c (resolve_address_of_overloaded_function): Mark the
6261 chosen function used.
6263 * call.c (build_call): Make sure that a function coming in has
6264 been marked used already.
6265 * decl.c (expand_static_init): Call mark_used instead of
6267 * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
6268 alloc_eh_object, expand_throw): Likewise.
6269 * init.c (build_builtin_delete_call): Likewise.
6270 * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
6271 expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
6272 expand_generic_desc): Likewise.
6274 1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
6276 * tree.c (equal_functions): New function.
6277 (ovl_member): Call it.
6279 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6281 * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf.
6283 1999-01-25 Martin von Loewis <loewis@informatik.hu-berlin.de>
6285 * decl.c (decls_match): Return 1 if old and new are identical.
6286 (push_overloaded_decl): Set OVL_USED when PUSH_USING.
6288 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6290 * decl.c (start_function): Make member functions one_only on windows.
6291 * decl2.c (import_export_decl): Likewise.
6293 * decl.c (grokdeclarator): Don't complain about implicit int in
6294 a system header. Change same-name field check to not complain in
6295 a system header instead of within extern "C".
6297 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6299 * cp-tree.h (PUSH_GLOBAL): New macro.
6300 (PUSH_LOCAL): Likewise.
6301 (PUSH_USING): Likewise.
6302 (namespace_bindings_p): Declare.
6303 (push_overloaded_decl): Likewise.
6304 * decl.c (push_overloaded_decl): Don't make it static. Check for
6305 illegal declarations after using declarations here.
6306 (namespace_bindings_p): Likewise.
6307 (duplicate_decls): Don't consider declarations from different
6308 namespaces to be the same.
6309 (pushdecl): Use symbolic PUSH_ constants in calls to
6310 push_overloaded_decl.
6311 (push_overloaded_decl_1): Likewise.
6312 * decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
6313 (do_nonmember_using_decl): Check for illegal using declarations
6314 after ordinary declarations here.
6315 (do_local_using_decl): Call pushdecl to insert declarations.
6317 1999-01-21 Jason Merrill <jason@yorick.cygnus.com>
6319 * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo.
6321 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6323 * tree.c (build_cplus_array_type_1): Don't call build_array_type
6324 for types involving template parameters.
6326 * cp-tree.h (PARM_DECL_EXPR): Delete.
6327 (convert_default_arg): Change prototype.
6328 (check_default_argument): Declare.
6329 (search_tree): Likewise.
6330 * call.c (convert_default_arg): Take the function to which the
6331 default argument belongs as a parameter, and do any necessary
6332 instantiation here, instead of ...
6333 (build_over_call): Here.
6334 * decl.c (local_variable_p): New function.
6335 (check_default_argument): Likewise, split out and tidied from ...
6337 * error.c (dump_expr): Don't set PARM_DECL_EXPR.
6338 * pt.c (tsubst_call_declarator_parms): New function.
6339 (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing
6340 with CALL_EXPRs, rather than trying to be clever.
6341 (tsubst): Use tsubst_call_declarator_parms.
6342 * tree.c (search_tree): Don't make it static.
6343 * typeck.c (convert_arguments): Use new interface to
6344 convert_default_arg.
6346 1999-01-20 Mark Mitchell <mark@markmitchell.com>
6348 * error.c (dump_function_decl): Don't print the argument types for
6349 a function when the verbosity level is negative.
6351 * call.c (build_over_call): Check format attributes at call-time.
6353 * pt.c (tsubst_copy): Fix comment.
6354 (unify): Don't allow unification with variable-sized arrays.
6356 * semantics.c (finish_stmt_expr): When processing a template make
6357 the BIND_EXPR long-lived.
6359 1999-01-19 Jason Merrill <jason@yorick.cygnus.com>
6361 * decl2.c (finish_vtable_vardecl): Make vtables comdat here.
6362 (import_export_vtable): Not here.
6364 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6366 * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique
6367 non-static member function.
6369 1999-01-18 Nathan Sidwell <nathan@acm.org>
6371 * class.c (instantiate_type): Only diagnose illegal address of member
6372 function if complaining.
6374 * decl.c (lookup_name_real): Remove duplicate code.
6376 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6378 * tree.c (copy_template_template_parm): Use permanent_obstack.
6380 1999-01-18 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6382 * pt.c (unify): Remove restrictions on deduction of argument
6383 of template template parameters.
6385 1999-01-18 Nathan Sidwell <nathan@acm.org>
6387 * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
6389 * class.c (resolve_address_of_overloaded_function): Show list of
6390 all candidates, when none of them match.
6392 1999-01-18 Chip Salzenberg <chip@perlsupport.com>
6394 * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
6395 definition of 'casting away const' in reinterpret_cast<>.
6397 1999-01-18 Graham <grahams@rcp.co.uk>
6399 * cvt.c: Add include for decl.h, remove extern for
6400 static_aggregates which is now provided by decl.h.
6402 * Makefile.in (cvt.o): Add dependency for decl.h and missing
6403 dependencies for convert.h and flags.h.
6405 1999-01-18 Nathan Sidwell <nathan@acm.org>
6407 * decl2.c (do_dtors): Set current location to that of the
6408 decl, for sensible diagnostics and debugging.
6409 (check_classfn): Issue `incomplete type' error, if
6410 class is not defined.
6412 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6414 * cp-tree.h: Add prototype for bound_pmf_p.
6416 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6417 Manfred Hollstein <manfred@s-direktnet.de>
6419 * decl.c (grokdeclarator): Don't make 'main(){}' an error with only
6422 1999-01-16 Nathan Sidwell <nathan@acm.org>
6424 * cp-tree.h (struct lang_type): Added has_mutable flag.
6425 (CLASSTYPE_HAS_MUTABLE): New macro to access it.
6426 (TYPE_HAS_MUTABLE_P): New macro to read it.
6427 (cp_has_mutable_p): Prototype for new function.
6428 * class.c (finish_struct_1): Set has_mutable from members.
6429 * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if
6430 it contains a mutable.
6431 * typeck.c (cp_has_mutable_p): New function.
6433 1999-01-15 Mark Mitchell <mark@markmitchell.com>
6435 * pt.c (process_template_parm): Ignore top-level qualifiers on
6436 non-type parameters.
6438 * decl.c (start_function): Use current_function_parms in the call
6439 to require_complete_type_for_parms, not the probably empty
6442 1999-01-14 Jason Merrill <jason@yorick.cygnus.com>
6444 * semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
6446 * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
6447 that we don't suppress the other copies.
6448 * lex.c (handle_cp_pragma): Likewise.
6450 1999-01-13 Mark Mitchell <mark@markmitchell.com>
6452 * decl.c (grokdeclarator): Undo 1998-12-14 change.
6453 * tree.c (build_cplus_array_type_1): Likewise.
6454 * pt.c (instantiate_class_template): Remove misleading comment.
6455 (tsubst_aggr_type): Substitute if there are template parameters,
6456 regardless of whether or not they use template arguments.
6457 (unify): Likewise, but for unification.
6459 1999-01-12 Richard Henderson <rth@cygnus.com>
6461 * cp-tree.h (flag_permissive): Declare extern.
6463 1999-01-06 Mark Mitchell <mark@markmitchell.com>
6465 * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT
6467 (lang_type): Add is_partial_instantiation. Decrease width of
6469 (PARTIAL_INSTANTIATION_P): New macro.
6470 (OPERATOR_TYPENAME_P): Remove.
6471 * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not
6472 OPERATOR_TYPENAME_P.
6473 (grok_op_properties): Likewise.
6474 * friend.c (do_friend): Handle friends that are member functions
6476 * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT.
6477 * pt.c (instantiate_class_template): Rework for clarity. Avoid
6478 leaving TYPE_BEING_DEFINED set in obscure cases. Don't do
6479 any more partial instantiation than is absolutely necessary for
6480 implicit typename. Set PARTIAL_INSTANTIATION_P.
6481 (tsubst_decl): Use IDENTIFIER_TYPENAME_P.
6482 * semantics.c (begin_class_definition): Handle partial
6483 specializations of a type that was previously partially
6486 Wed Jan 6 03:18:53 1999 Mark Elbrecht <snowball3@usa.net.
6488 * g++spec.c (LIBSTDCXX): Provide default definition.
6489 (lang_specific_driver): Use LIBSTDCXX instead of "-lstdc++".
6491 Tue Jan 5 22:11:25 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6493 * Make-lang.in (g++.o): Depend on prefix.h.
6495 1999-01-04 Jason Merrill <jason@yorick.cygnus.com>
6497 * tree.c (bound_pmf_p): New fn.
6498 * typeck.c (build_c_cast): Use it.
6500 * decl.c (grok_op_properties): Use same_type_p.
6502 Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6504 * Makefile.in (cvt.o): Depend on toplev.h.
6506 * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes.
6508 * cvt.c: Include toplev.h.
6510 * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and
6513 * init.c (expand_vec_init): Initialize variable `itype'.
6515 * lex.c (yyerror): Cast the argument passed to a ctype function to
6518 * method.c (build_mangled_C9x_name): Wrap prototype and definition
6519 in "HOST_BITS_PER_WIDE_INT >= 64".
6521 * typeck.c (build_binary_op): Mark parameter `convert_p' with
6524 1998-12-22 Mark Mitchell <mark@markmitchell.com>
6526 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
6527 * tree.c (build_exception_variant): Don't crash on empty throw
6530 1998-12-18 DJ Delorie <dj@cygnus.com>
6532 * cvt.c (convert_to_reference): Check for both error_mark_node
6533 and NULL_NODE after call to convert_for_initialization.
6535 1998-12-17 Jason Merrill <jason@yorick.cygnus.com>
6537 * error.c (interesting_scope_p): New fn.
6538 (dump_simple_decl): Use it.
6539 (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
6540 (dump_expr, case OFFSET_REF): Print ->* if appropriate.
6542 1998-12-16 Mark Mitchell <mark@markmitchell.com>
6544 * class.c (resolve_address_of_overloaded_function): Do conversion
6545 to correct type here, rather than ...
6546 (instantiate_type): Here.
6548 * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
6549 (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
6550 (decl_template_parm_p): Remove.
6551 * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
6553 * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
6554 * pt.c (push_inline_template_parms_recursive): Set it.
6555 (decl_template_parm_p): Remove.
6556 (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
6557 (process_template_parm): Set it.
6559 Wed Dec 16 16:33:58 1998 Dave Brolley <brolley@cygnus.com>
6561 * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
6562 if configured with cpplib.
6564 1998-12-15 Mark Mitchell <mark@markmitchell.com>
6566 * decl.c (poplevel): Make sure ns_binding is initialized.
6568 * decl.c (finish_function): Undo inadvertent change in previous
6571 1998-12-14 Mark Mitchell <mark@markmitchell.com>
6573 * class.c (pushclass): Tweak handling of class-level bindings.
6574 (resolve_address_of_overloaded_function): Update pointer-to-member
6576 (instantiate_type): Likewise.
6577 * cvt.c (cp_convert_to_pointer): Likewise.
6578 * decl.c (pop_binding): Take the DECL to pop, not just the name.
6579 Deal with `struct stat' hack.
6580 (binding_level): Add to documentation.
6581 (push_binding): Clear BINDING_TYPE.
6582 (add_binding): New function.
6583 (push_local_binding): Use it.
6584 (push_class_binding): Likewise.
6585 (poplevel): Adjust calls to pop_binding.
6586 (poplevel_class): Likewise.
6587 (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
6588 declarations to current binding level.
6589 (push_class_level_binding): Likewise.
6590 (push_overloaded_decl): Adjust handling of OVERLOADs in local
6592 (lookup_namespace_name): Don't crash when confronted with a
6594 (lookup_name_real): Do `struct stat' hack in local binding
6596 (build_ptrmemfunc_type): Adjust documentation.
6597 (grokdeclarator): Don't avoid building real array types when
6598 processing templates unless really necessary.
6599 (finish_method): Adjust calls to pop_binding.
6600 * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
6601 not reparse_decl_as_expr.
6602 (build_expr_from_tree): Deal with a template-id as the function to
6603 call in a METHOD_CALL_EXPR.
6604 * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
6605 (maybe_adjust_types_For_deduction): Don't do peculiar things with
6607 (resolve_overloaded_unification): Handle COMPONENT_REFs. Build
6608 pointer-to-member types where necessary.
6609 * tree.c (build_cplus_array_type_1): Don't avoid building real
6610 array types when processing templates unless really necessary.
6611 (build_exception_variant): Compare the exception lists correctly.
6613 1998-12-13 Mark Mitchell <mark@markmitchell.com>
6615 * cp-tree.def (CPLUS_BINDING): Update documentation.
6616 * cp-tree.h (LOCAL_BINDING_P): New macro.
6617 (lang_identifier): Rename local_value to bindings.
6618 (tree_binding): Make `scope' of type `void*', not `tree'.
6619 (BINDING_SCOPE): Update documentation.
6620 (IDENTIFIER_LOCAL_VALUE): Remove.
6621 (IDENTIFIER_CLASS_VALUE): Document.
6622 (IDENTIFIER_BINDING): New macro.
6623 (IDENTIFIER_VALUE): Likewise.
6624 (TIME_IDENTIFIER_TIME): Likewise.
6625 (TIME_IDENTIFIER_FILEINFO): Likewise.
6626 (IMPLICIT_TYPENAME_P): Likewise.
6627 (set_identifier_local_value): Remove.
6628 (push_local_binding): New function.
6629 (push_class_binding): Likewise.
6630 * class.c (pushclass): Update comments; use push_class_binding.
6631 * decl.c (set_identifier_local_value_with_scope): Remove.
6632 (set_identifier_local_value): Likewise.
6633 (push_binding): New function.
6634 (pop_binding): Likewise.
6635 (binding_level): Update documentation. Remove shadowed.
6636 (BINDING_LEVEL): New macro.
6637 (free_binding_nodes): New variable.
6638 (poplevel): Adjust for new name-lookup scheme. Don't mess up
6639 BLOCK_VARs when doing for-scope extension. Remove effectively
6641 (pushlevel_class): Tweak formatting.
6642 (poplevel_class): Adjust for new name-lookup scheme.
6643 (print_binding_level): Likewise.
6644 (store_bindings): Likewise.
6645 (pushdecl): Likewise.
6646 (pushdecl_class_level): Likewise.
6647 (push_class_level_binding): Likewise.
6648 (push_overloaded_decl): Update comments. Adjust for new
6650 (lookup_name_real): Likewise.
6651 (lookup_name_current_level): Likewise.
6652 (cp_finish_decl): Likewise.
6653 (require_complete_types_for_parms): Likewise. Remove misleading
6655 (grok_parms): Likewise. Don't call
6656 require_complete_types_for_parms here.
6657 (grok_ctor_properties): Don't treat templates as copy
6659 (grop_op_properties): Or as assignment operators.
6660 (start_function): Document. Adjust for new name-lookup scheme.
6661 (finish_function): Likewise.
6662 * decl2.c (do_local_using_decl): Use push_local_binding.
6663 * lex.c (begin_definition_of_inclass_inline): New function, split
6665 (do_pending_inlines): Here, and ...
6666 (process_next_inline): Here.
6667 (get_time_identifier): Use TIME_IDENTIFIER_* macros.
6668 (init_filename_times): Likewise.
6669 (extract_interface_info): Likewise.
6670 (ste_typedecl_interface_info): Likewise.
6671 (check_newline): Likewise.
6672 (dump_time_statistics): Likewise.
6673 (handle_cp_pragma): Likewise.
6674 (do_identifier): Adjust for new name-lookup scheme.
6675 * parse.y (function_try_block): Return ctor_initializer_opt value.
6677 (fn.defpen): Pass appropriate values to start_function.
6678 (pending_inline): Use functor_try_block value, and pass
6679 appropriate values to finish_function.
6680 * pt.c (is_member_template): Update documentation; remove handling
6681 of FUNCTION_DECLs. As per name, this function should deal only in
6683 (decl_template_parm_p): Change name of olddecl parameter to decl.
6684 (check_template_shadow): Adjust for new name-lookup scheme.
6685 (lookup_template_class): Likewise.
6686 (tsubst_decl): Tweak so as not to confuse member templates with
6687 copy constructors and assignment operators.
6688 (unify): Handle UNION_TYPEs.
6689 * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
6690 (lang_print_xnode): Adjust for new name-lookup scheme.
6691 * typeck.c (mark_addressable): Likewise.
6692 (c_expand_return): Likewise.
6694 1998-12-08 Jason Merrill <jason@yorick.cygnus.com>
6696 * decl.c (grokdeclarator): Allow field with same name as class
6699 * decl.c (lookup_name_real): Don't limit field lookup to types.
6700 * class.c (check_member_decl_is_same_in_complete_scope): No error
6701 if icv and x are the same.
6702 * lex.c (do_identifier): Tweak error message.
6704 1998-12-10 Mark Mitchell <mark@markmitchell.com>
6706 * decl.c (start_enum): Use push_obstacks, not
6707 end_temporary_allocation.
6708 (finish_enum): Call pop_obstacks.
6710 1998-12-10 Mark Mitchell <mark@markmitchell.com>
6712 * class.c (instantiate_type): Return error_mark_node rather than
6715 1998-12-09 Mark Mitchell <mark@markmitchell.com>
6717 * cp-tree.h (most_specialized_instantiation): New function.
6718 (print_candidates): Likewise.
6719 * class.c (validate_lhs): Remove.
6720 (resolve_address_of_overloaded_function): New function, split out
6721 and then substantially reworked, from ...
6722 (instantiate_type): Use it. Simplify.
6723 * cvt.c (convert_to_reference): Complain when caller has indicated
6724 that's the right thing to do. Don't crash if instantiate_type
6726 * pt.c: Substitute `parameters' for `paramters' throughout.
6727 (print_candidates): Don't make it static.
6728 (most_specialized_instantiation): Split out from ...
6729 (most_specialized): Here.
6731 Wed Dec 9 15:33:01 1998 Dave Brolley <brolley@cygnus.com>
6733 * lex.c (lang_init_options): Initialize cpplib.
6734 * decl2.c (parse_options,cpp_initialized): Removed.
6735 (lang_decode_option): Move initialization of cpplib to
6738 1998-12-09 Mark Mitchell <mark@markmitchell.com>
6740 * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
6741 well as the TYPE_DECL, when a typedef name is assigned to a
6742 previously anonymous type.
6744 1998-12-08 Andrew MacLeod <amacleod@cygnus.com>
6746 * cp/except.c (call_eh_info): Use __start_cp_handler instead of
6747 __cp_eh_info for getting the eh info pointer. Add table_index to
6749 (push_eh_cleanup): Don't increment 'handlers' data field.
6750 (process_start_catch_block): Don't set the 'caught' field.
6752 * cp/exception.cc (CP_EH_INFO): New macro for getting the
6753 exception info pointer within library routines.
6754 (__cp_eh_info): Use CP_EH_INFO.
6755 (__start_cp_handler): Get exception info pointer, set caught field,
6756 and increment the handlers field. Avoids this being done by handlers.
6757 (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
6758 (uncaught_exception): Use CP_EH_INFO macro.
6760 Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com)
6762 * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
6764 Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
6766 * lex.c (check_newline): Add support for \ as `natural'
6767 characters in file names in #line to be consistent with #include
6768 handling. We support escape processing in the # 1 "..." version of
6769 the command. See also support in cp/lex.c.
6771 1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
6773 * cp/decl2.c: s/data/opts/ when initializing cpp_reader
6776 1998-12-07 Jason Merrill <jason@yorick.cygnus.com>
6778 * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
6780 * error.c (dump_simple_decl): Also print namespace context.
6781 (dump_function_decl): Likewise.
6783 * decl2.c (ambiguous_decl): Don't print old value if it's
6786 * decl.c (lookup_name_real): Fix handling of local types shadowed
6787 by a non-type decl. Remove obsolete code.
6788 * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
6790 * lang-options.h: Add -fpermissive.
6791 * decl2.c: Likewise.
6792 * cp-tree.h: Add flag_permissive.
6793 * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
6794 were specified, set flag_pedantic_errors.
6795 * call.c (build_over_call): Turn dropped qualifier messages
6797 * cvt.c (convert_to_reference): Likewise.
6798 * typeck.c (convert_for_assignment): Likewise.
6800 1998-12-05 Jason Merrill <jason@yorick.cygnus.com>
6802 * decl2.c (coerce_new_type): Use same_type_p.
6803 (coerce_delete_type): Likewise.
6805 * call.c (check_dtor_name): Return 1, not error_mark_node.
6807 1998-12-04 Jason Merrill <jason@yorick.cygnus.com>
6809 * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
6810 if MULTIPLE_SYMBOL_SPACES.
6812 * pt.c (check_template_shadow): New fn.
6813 * decl2.c (grokfield): Use it.
6814 * decl.c (pushdecl): Likewise.
6815 (pushdecl_class_level): Likewise.
6816 (start_method): Likewise.
6817 (xref_tag): Don't try to use 't' if we're defining.
6819 * call.c (check_dtor_name): Just return an error_mark_node.
6820 * pt.c (lookup_template_class): Complain about using non-template here.
6821 * parse.y (apparent_template_type): Not here.
6823 * pt.c (check_explicit_specialization): Complain about specialization
6826 * lang-options.h: Add -f{no-,}implicit-inline-templates.
6828 * pt.c (convert_nontype_argument): Don't assume that any integer
6829 argument is intended to be a constant-expression.
6831 1998-12-03 Mark Mitchell <mark@markmitchell.com>
6833 * class.c (handle_using_decl): Fix comment. Don't lookup
6834 constructors in base classes.
6835 (validate_lhs): Fix typo in comment.
6836 * search.c (lookup_field_1): Don't return a USING_DECL.
6838 * cp-tree.h (DECL_ACCESS): Improve documentation.
6840 * decl.c (expand_static_init): Don't set the initialization-done
6841 flag until the initialization is done.
6843 1998-12-02 Mark Mitchell <mark@markmitchell.com>
6845 * decl2.c (validate_nonmember_using_decl): Complain about using
6846 declarations for class members.
6848 1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
6850 * typeck2.c (process_init_constructor): Use same_type_p.
6852 * decl.c (check_tag_decl): Don't warn about null decl inside a
6855 * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
6857 (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
6858 (resolve_overloaded_unification): Strip baselinks.
6860 Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6862 * g++spec.c: Don't prototype xmalloc.
6864 1998-11-25 Jason Merrill <jason@yorick.cygnus.com>
6866 * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
6868 * decl.c (check_tag_decl): Do complain about null friend decl at
6871 1998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
6873 * lex.c (make_lang_type): Clear the whole struct lang_type, not
6874 only the first multiple of sizeof (int).
6876 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
6878 * decl.c (start_decl): An explicit specialization of a static data
6879 member is only a definition if it has an initializer.
6881 * except.c (expand_throw): Use cp_finish_decl for the throw temp.
6882 * cvt.c (build_up_reference): Pass DIRECT_BIND down into
6884 * init.c (expand_default_init): Check for DIRECT_BIND instead of
6887 * call.c (build_over_call): Use build_decl.
6889 * except.c (expand_throw): Just use convert, not
6890 build_reinterpret_cast.
6892 * lex.c (handle_generic_pragma): Use token_buffer.
6894 * decl.c (check_tag_decl): Don't complain about null friend decl.
6896 1998-11-24 Dave Pitts <dpitts@cozx.com>
6898 * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the
6900 * lex.c (check_newline): Use ISALPHA.
6901 (readescape): Use ISGRAPH.
6902 (yyerror): Use ISGRAPH.
6904 1998-11-24 Nathan Sidwell <nathan@acm.org>
6906 * search.c (get_abstract_virtuals): Do not use initial
6907 CLASSTYPE_ABSTRACT_VIRTUALS.
6908 * typeck2.c (abstract_virtuals_error): Show location of abstract
6910 * call.c (build_new_method_call): Use
6911 CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
6912 * class.c (finish_struct_bits): Don't bother working out whether
6913 get_abstract_virtuals will do anything, just do it.
6915 1998-11-24 Graham <grahams@rcp.co.uk>
6917 * typeck.c (build_component_ref): Remove unused statement.
6919 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
6921 * class.c (add_method): Catch invalid overloads.
6923 * class.c (add_method): Build up OVERLOADs properly for conversion ops.
6924 * search.c (lookup_conversions): Handle getting real OVERLOADs.
6925 (add_conversions): Likewise. Revert last change.
6926 * call.c (add_conv_candidate): Pass totype to add_candidate instead
6927 of fn. Don't add a new candidate if the last one was for the same
6929 (print_z_candidates): Handle getting a type as a function.
6930 (joust): If we got two conversion candidates to the same type,
6932 (build_object_call): Lose 'templates'.
6933 (build_user_type_conversion_1): Handle getting real OVERLOADs.
6935 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
6937 * typeck2.c (process_init_constructor): If there are elements
6938 that don't have initializers and they need to have constructors
6939 run, supply them with initializers.
6941 * class.c (finish_struct_1): A class with a 0-width bitfield is
6944 1998-11-23 Mark Mitchell <mark@markmitchell.com>
6946 * pt.c (instantiate_class_template): Don't try to figure out what
6947 specialization to use for a partial instantiation. Correct
6948 typos in a couple of comments. Avoid calling uses_template_parms
6951 1998-11-23 Benjamin Kosnik <bkoz@cygnus.com>
6953 * method.c (process_overload_item): Add call to
6954 build_mangled_C9x_name for intTI_type_nodes.
6955 (build_mangled_C9x_name): Add prototype, define.
6956 * decl.c (init_decl_processing): Add names for
6959 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
6961 * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
6963 * class.c (finish_struct_1): Set things up for 0-width bitfields
6964 like we do for others.
6966 * decl.c (check_tag_decl): New fn.
6967 (shadow_tag): Split out from here.
6968 * decl2.c (grok_x_components): Call it.
6970 1998-11-22 Jason Merrill <jason@yorick.cygnus.com>
6972 * decl.c: Lose warn_about_return_type.
6973 (grokdeclarator): Always complain about implicit int, except for
6976 * decl.c (tag_name): New fn.
6977 (xref_tag): Complain about using typedef-name after class-key.
6979 * init.c (expand_vec_init): Also keep going if from_array.
6981 * tree.c (is_overloaded_fn): Also handle the output of
6984 * decl.c (grokdeclarator): Use constructor_name when comparing
6985 field name against enclosing class.
6986 * class.c (finish_struct_anon): Likewise.
6988 1998-11-22 Mark Mitchell <mark@markmitchell.com>
6990 * decl.c (poplevel): Remove code to handle KEEP == 2.
6991 (finish_function): Don't confuse BLOCK-order when
6992 processing a destructor.
6994 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
6996 * decl.c (require_complete_types_for_parms): Call layout_decl
6997 after we've completed the type.
6999 1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de>
7001 * decl2.c (validate_nonmember_using_decl): Allow using templates
7002 from the global namespace.
7004 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
7006 Handle specifying template args to member function templates.
7007 * tree.c (build_overload): Always create an OVERLOAD for a template.
7008 * search.c (add_conversions): Handle finding an OVERLOAD.
7009 * decl2.c (check_classfn): Likewise.
7010 * lex.c (identifier_type): See through a baselink.
7011 * parse.y (do_id): Don't call do_identifier if we got a baselink.
7012 * class.c (instantiate_type, case TREE_LIST): Recurse.
7014 * decl.c (grokdeclarator): Allow a boolean constant for array
7015 bounds, odd as that sounds.
7017 * pt.c (unify): Be more strict about non-type parms, except for
7019 (UNIFY_ALLOW_INTEGER): New macro.
7021 1998-11-19 Manfred Hollstein <manfred@s-direktnet.de>
7023 * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir).
7025 1998-11-19 Jason Merrill <jason@yorick.cygnus.com>
7027 * semantics.c (begin_class_definition): Call
7028 maybe_process_partial_specialization before push_template_decl.
7029 Don't call push_template_decl for a specialization.
7030 * search.c (lookup_field): Do return a member template class.
7031 * decl2.c (handle_class_head): Handle member template classes.
7033 * decl.c (grokdeclarator): A parm type need not be complete.
7035 * pt.c (convert_nontype_argument): Fix thinko.
7037 1998-11-18 Mark Mitchell <mark@markmitchell.com>
7039 * cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
7040 (global_delete_fndecl): New variable.
7041 * decl.c (global_delete_fndecl): Define it.
7042 (init_decl_processing): Set it.
7043 * init.c (build_builtin_delete_call): Use it.
7044 * tree.c (mapcar): Recursively call mapcar for the type of EXPR
7047 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
7049 * decl.c (cplus_expand_expr_stmt): Always complain about unresolved
7052 * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue.
7053 * call.c (build_object_call): Also support references to functions.
7054 * typeck.c (convert_for_initialization): Don't decay a function
7055 if the target is a reference to function.
7057 * search.c (add_conversions): Get all the overloads from a class.
7059 * decl.c (grok_ctor_properties): Complain about any constructor
7060 that will take a single arg of the class type by value.
7062 * typeck2.c (build_functional_cast): Can't create objects of
7063 abstract classes this way.
7064 * cvt.c (ocp_convert): Likewise.
7066 * decl.c (grokfndecl): Member functions of local classes are not
7069 1998-11-18 Mark Mitchell <mark@markmitchell.com>
7071 * Make-lang.in (cc1plus): Add dependency on hash.o.
7073 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
7075 * search.c (get_abstract_virtuals): Complain about virtuals with
7077 * typeck2.c (abstract_virtuals_error): Remove handling for virtuals
7078 with no final overrider.
7079 * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
7080 on virtuals with no final overrider.
7082 * lex.c (reinit_parse_for_block): Add a space after the initial ':'.
7084 * class.c (finish_struct_1): Don't remove zero-width bit-fields until
7087 * friend.c (do_friend): Don't set_mangled_name_for_decl.
7089 * class.c (finish_struct_anon): Complain about non-fields.
7090 * decl2.c (build_anon_union_vars): Likewise.
7092 * decl.c (grokdeclarator): Normal data members can't have the same
7093 name as the class, either.
7094 * class.c (finish_struct_anon): Neither can members of an
7097 1998-11-17 Mark Mitchell <mark@markmitchell.com>
7099 * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses.
7100 (TYPE_BINFO): Likewise.
7101 (IS_AGGR_TYPE): Tweak.
7102 (SET_IS_AGGR_TYPE): New macro.
7103 (CLASS_TYPE_P): Tweak.
7104 (lang_type): Group mark bitfields together. Remove linenum.
7105 (CLASSTYPE_SOURCE_LINE): Remove macro.
7106 (CLASSTYPE_MARKED_N): New macro.
7107 (SET_CLASSTYPE_MARKED_N): Likewise.
7108 (CLEAR_CLASSTYPE_MARKED_N): Likewise.
7109 (CLASS_TYPE_MARKED_*): Use them.
7110 (SET_CLASSTYPE_MARKED_*): Likewise.
7111 (CLEAR_CLASSTYPE_MARKED_*): Likewise.
7112 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
7113 (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well.
7114 (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE.
7115 * class.c (class_cache_obstack): New variable.
7116 (class_cache_firstobj): Likewise.
7117 (finish_struct): Don't set CLASSTYPE_SOURCE_LINE.
7118 (pushclass): Free the cache, when appropriate.
7120 (maybe_push_cache_obstack): Use class_cache_obstack.
7121 * decl.c (include hash.h).
7122 (typename_hash): New function.
7123 (typename_compare): Likewise.
7124 (build_typename_type): Check the hash table to avoid creating
7126 (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE.
7127 (grokdeclarator): Use CLASS_TYPE_P.
7128 (xref_basetypes): Likewise.
7129 (start_function): Likewise. Don't put current_class_ref on the
7131 * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO
7133 * lex.c (note_got_semicolon): Use CLASS_TYPE_P.
7134 (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated
7135 fields for types other than class types. Do clear TYPE_ALIAS_SET
7136 for types other than class types, though.
7137 * method.c (build_overload_identifier): Use CLASS_TYPE_P and
7138 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7139 * pt.c (process_template_parm): Don't set
7140 CLASSTYPE_GOT_SEMICOLON.
7141 (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7142 Coerce arguments on the momentary obstack.
7143 (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
7144 (instantiate_class_template): Calculate template arguments on the
7145 momentary obstack. Tidy.
7146 (tsubst_template_arg_vector): Use make_temp_vec.
7147 (tsubst_aggr_type): Put template arguments on the momentary
7149 (tsubst_decl): Likewise.
7150 (tsubst): Copy the array bounds index to the permanent obstack
7151 before building index types. Use new macros.
7152 (unify): Use new macros.
7153 (do_type_instantiation): Likewise.
7154 * search.c (lookup_fnfields_1): Use new macros.
7155 (dfs_pushdecls): Build envelopes on the cache obstack.
7156 (dfs_compress_decls): Use new macros.
7157 (push_class_decls): Build on the cache obstack.
7158 * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON.
7159 * sign.c (build_signature_pointer_or_reference_type): Use
7161 * tree.c (make_binfo): Check CLASS_TYPE_P.
7162 (copy_template_template_parm): Adjust.
7163 (make_temp_vec): Use push_expression_obstack.
7164 * typeck.c (complete_type): Use new macros.
7165 (comptypes): Likewise.
7167 1998-11-17 Jason Merrill <jason@yorick.cygnus.com>
7169 * pt.c (tsubst): Add diagnostics for invalid array, reference
7170 and pointer to member types.
7172 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7174 * typeck2.c (my_friendly_abort): Don't fatal twice in a row.
7176 * typeck.c (c_expand_start_case): Use build_expr_type_conversion.
7179 * parse.y (structsp): Fix cut-and-paste error.
7181 * init.c (build_new): Complain about non-integral size.
7183 * parse.y (unary_expr): Complain about defining types in sizeof.
7185 * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn.
7187 * rtti.c (build_x_typeid): Complain about typeid without
7188 including <typeinfo>.
7189 (get_typeid): Likewise. Complain about typeid of incomplete type.
7190 (get_tinfo_fn_dynamic): Likewise.
7191 (get_typeid_1): Not static anymore.
7192 * except.c (build_eh_type_type): Use get_typeid_1.
7194 * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to
7195 ambiguous or private bases. Fix warning for reference cast.
7197 1998-11-16 Mark Mitchell <mark@markmitchell.com>
7199 * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
7200 * decl.c (duplicate_decls): Remove special-case code to deal with
7201 template friends, and just do the obvious thing.
7202 * pt.c (register_specialization): Tweak for clarity, and also to
7203 clear DECL_INITIAL for an instantiation before it is merged with a
7205 (check_explicit_specialization): Fix indentation.
7206 (tsubst_friend_function): Handle both definitions in friend
7207 declaration and outside friend declarations.
7208 (tsubst_decl): Don't clear DECL_INITIAL for an instantiation.
7209 (regenerate_decl_from_template): Tweak accordingly.
7210 (instantiate_decl): Likewise.
7212 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7214 * decl.c (cplus_expand_expr_stmt): Promote warning about naked
7215 member function reference to error.
7216 * cvt.c (ocp_convert): Complain about converting an overloaded
7219 * init.c (build_offset_ref): Just return a lone static member
7222 * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs,
7225 * typeck.c (build_binary_op_nodefault): Improve error handling.
7227 * decl.c (grokfndecl): Complain about making 'main' a template.
7229 * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*.
7231 * call.c (build_method_call): Handle a BIT_NOT_EXPR around a
7232 TYPE_DECL in a template.
7234 1998-11-15 Jason Merrill <jason@yorick.cygnus.com>
7236 * typeck2.c (my_friendly_abort): Add URL in the other case, too.
7238 * decl.c (struct cp_function): Add named_label_uses.
7239 (push_cp_function_context): Save it.
7240 (pop_cp_function_context): Restore it.
7241 (define_label): Also complain about jumping into the scope of
7242 non-POD objects that don't have constructors.
7243 * tree.c (pod_type_p): New fn.
7245 * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner.
7246 * rtti.c (synthesize_tinfo_fn): Call import_export_decl here.
7247 (get_tinfo_fn): Not here.
7248 * repo.c (repo_get_id): Abort if we get called for an incomplete
7251 1998-11-13 Mark Mitchell <mark@markmitchell.com>
7253 * except.c (expand_throw): Make sure first argument to
7254 __cp_push_exception is of type `void*' to avoid spurious error
7257 1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
7259 * pt.c (try_one_overload): Take orig_targs again. Only check for
7260 mismatches against them; we don't care what a previous call found.
7261 (resolve_overloaded_unification): Adjust.
7263 * search.c (lookup_field): Don't return anything for a non-type
7264 field from a dependent type.
7265 * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
7266 in an array declarator.
7267 (start_decl): Push into the class before looking for the field.
7269 1998-11-08 Mark Mitchell <mark@markmitchell.com>
7271 * method.c (build_overload_value): Handle REFERENCE_TYPE.
7273 1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
7275 * decl.c (grokdeclarator): Allow namespace-scoped members if they
7278 1998-11-08 Jason Merrill <jason@yorick.cygnus.com>
7280 * pt.c (tsubst_decl): Don't mess with the global value of an
7281 un-mangled DECL_ASSEMBLER_NAME.
7283 1998-11-03 Christopher Faylor <cgf@cygnus.com>
7285 * decl.c (init_decl_processing): Remove CYGWIN conditional
7286 since CYGWIN is now able to deal with trapping signals.
7288 Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7290 * cp-tree.h: Don't include gansidecl.h.
7291 * exception.cc: Include gansidecl.h (since we don't include config.h)
7292 * g++spec.c: Don't include gansidecl.h.
7294 1998-11-06 Mark Mitchell <mark@markmitchell.com>
7296 * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease
7298 (DECL_DEFINED_IN_CLASS_P): New macro.
7299 (TEMPLATE_PARMS_FOR_INLINE): Document.
7300 (check_static_variable_definition): New function.
7301 * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if
7303 (check_static_variable_definition): Split out from ...
7304 (grokdeclarator): Here.
7305 * pt.c (check_default_tmpl_args): New function, split out from ...
7306 (push_template_decl_real): Here.
7307 (instantiate_template): Fix comment.
7309 1998-11-04 Mark Mitchell <mark@markmitchell.com>
7311 * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued.
7312 (CP_TYPE_VOLATILE_P): Likewise.
7313 (CP_TYPE_RESTRICT_P): Likewise.
7315 1998-11-03 Mark Mitchell <mark@markmitchell.com>
7317 * pt.c (tsubst): Use build_index_type, not build_index_2_type.
7319 1998-11-02 Jason Merrill <jason@yorick.cygnus.com>
7321 * class.c (instantiate_type): Be more helpful.
7323 * decl2.c (import_export_decl): Call import_export_class.
7325 * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
7326 * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
7327 * pt.c (tsubst_copy): Likewise.
7329 1998-11-02 Mark Mitchell <mark@markmitchell.com>
7331 * init.c (expand_vec_init): Fix off-by-one error.
7333 1998-11-02 Alexandre Oliva <oliva@dcc.unicamp.br>
7335 * parse.y (apparent_template_type): New type.
7336 (named_complex_class_head_sans_basetype): Use it.
7337 * Makefile.in (CONFLICTS): One new conflict.
7338 * parse.c: Regenerated.
7340 1998-11-01 Mark Mitchell <mark@markmitchell.com>
7342 * cp-tree.h (COMPARE_STRICT): New macro.
7343 (COMPARE_BASE): Likewise.
7344 (COMPARE_RELAXED): Likewise.
7345 (COMPARE_REDECLARATION): Likewise.
7346 (same_type_p): Likewise.
7347 (same_or_base_type_p): Likewise.
7348 * call.c (standard_conversion): Use them, in place of comptypes
7349 with numeric arguments.
7350 (reference_binding): Likewise.
7351 (convert_like): Likewise.
7352 (build_over_call): Likewise.
7353 (is_subseq): Likewise.
7354 (is_properly_derived_from): Likewise.
7355 (compare_ics): Likewise.
7357 * class.c (delete_duplicate_fields_1): Likewise.
7358 (resolves_to_fixed_type_p): Likewise.
7359 (instantiate_type): Likewise. Remove #if 0'd code.
7360 * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here.
7361 (pushdecl): Likewise.
7362 (lookup_name_real): Likewise.
7363 (grokdeclarator): Likewise. Check for illegal array declarations.
7364 (grokparms): Likewise.
7365 (grok_op_properties): Likewise.
7366 * decl2.c (check_classfn): Likewise.
7367 * friend.c (is_friend): Likewise.
7368 (make_friend_class): Likewise.
7369 * init.c (expand_aggr_init): Likewise.
7370 (expand_vec_init): Likewise.
7371 * pt.c (is_member_template_class): Remove declaration.
7372 (is_specialization_of): Use COMPARE_* and new macros.
7373 (comp_template_parms): Likewise.
7374 (convert_nontype_argument): Likewise.
7375 (coerce_template_template_parms): Likewise.
7376 (template_args_equal): Likewise.
7377 (lookup_template_class): Likewise.
7378 (type_unification_real): Likewise.
7380 (get_bindings_real): Likewise.
7381 * search.c (covariant_return_p): Likewise.
7382 (get_matching_virtual): Likewise.
7383 * sig.c (match_method_types): Likewise.
7384 * tree.c (vec_binfo_member): Likewise.
7385 (cp_tree_equal): Likewise.
7386 * typeck.c (common_type): Likewise.
7387 (comp_array_types): Likewise. Get issues involving unknown array
7389 (comptypes): Update comments. Use new flags.
7390 (comp_target_types): Use new macros.
7391 (compparms): Likewise.
7392 (comp_target_parms): Likewise.
7393 (string_conv_p): Likewise.
7394 (build_component_ref): Likewise.
7395 (build_indirect_ref): Likewise.
7396 (build_conditional_expr): Likewise.
7397 (build_static_cast): Likewise.
7398 (build_reinterpret_cast): Likewise.
7399 (build_const_cast): Likewise.
7400 (build_modify_expr): Likewise.
7401 (convert_for_assignment): Likewise.
7402 (comp_ptr_ttypes_real): Likewise.
7403 (ptr_reasonably_similar): Likewise.
7404 (comp_ptr_ttypes_const): Likewise.
7406 1998-10-31 Jason Merrill <jason@yorick.cygnus.com>
7408 * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error.
7410 1998-10-30 Mark Mitchell <mark@markmitchell.com>
7412 * decl2.c (delete_sanity): Pass integer_zero_node, not
7413 integer_two_node, to build_vec_delete.
7414 * init.c (build_array_eh_cleanup): Remove.
7415 (expand_vec_init_try_block): New function.
7416 (expand_vec_init_catch_clause): Likewise.
7417 (build_vec_delete_1): Don't deal with case that auto_delete_vec
7418 might be integer_two_node anymore.
7419 (expand_vec_init): Rework for initialization-correctness and
7420 exception-correctness.
7421 * typeck2.c (process_init_constructor): Make mutual exclusivity
7422 of cases more obvious.
7424 1998-10-29 Jason Merrill <jason@yorick.cygnus.com>
7426 * decl.c (lookup_name_real): OK, only warn if not lexing.
7427 Simplify suggested fix.
7429 * cp-tree.h (IDENTIFIER_MARKED): New macro.
7430 * search.c (lookup_conversions): Use breadth_first_search.
7431 (add_conversions): Avoid adding two conversions to the same type.
7432 (breadth_first_search): Work with base binfos, rather
7433 than binfos and base indices.
7434 (get_virtual_destructor): Adjust.
7435 (tree_has_any_destructor_p): Adjust.
7436 (get_matching_virtual): Adjust.
7438 * pt.c (push_template_decl_real): Generalize check for incorrect
7439 number of template parms.
7440 (is_member_template_class): #if 0.
7442 1998-10-29 Richard Henderson <rth@cygnus.com>
7444 * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
7447 1998-10-28 Zack Weinberg <zack@rabi.phys.columbia.edu>
7449 * lex.c: Call check_newline from lang_init always. After
7450 calling cpp_start_read, set yy_cur and yy_lim to read from the
7451 cpplib token buffer.
7453 1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
7455 * class.c (instantiate_type): Don't consider templates for a normal
7458 * class.c (finish_struct_1): Don't complain about non-copy
7459 assignment ops in union members.
7461 * class.c (build_vtable): Don't pass at_eof to import_export_vtable.
7462 (prepare_fresh_vtable): Likewise.
7463 (finish_struct_1): Don't call import_export_class.
7464 * decl2.c (finish_vtable_vardecl): Do import/export stuff.
7465 (finish_prevtable_vardecl): Lose.
7466 (finish_file): Don't call it.
7467 * pt.c (instantiate_class_template): Likewise.
7468 * cp-tree.h: Remove it.
7470 * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
7471 * decl.c (finish_function): Not here.
7472 (start_function): Do set DECL_INITIAL.
7474 * pt.c (push_template_decl_real): Complain about default template
7475 args for enclosing classes.
7477 * call.c (add_function_candidate): Treat conversion functions
7478 as coming from the argument's class.
7479 * cp-tree.h (DECL_CONV_FN_P): New fn.
7480 (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE.
7481 * class.c (add_method): Use DECL_CONV_FN_P.
7482 * decl2.c (check_classfn): Likewise.
7483 * error.c (dump_function_name): Likewise.
7484 (dump_function_decl): Likewise.
7485 * pt.c (fn_type_unification): Likewise.
7486 * search.c (add_conversions): Likewise.
7488 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7490 * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL.
7491 * method.c (hack_identifier): Also check for using RESULT_DECL
7494 1998-10-27 Mark Mitchell <mark@markmitchell.com>
7496 * decl.c (grokdeclarator): Use type_quals, rather than constp,
7499 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7501 * call.c (standard_conversion): instantiate_type here.
7502 (reference_binding): And here.
7503 (implicit_conversion): Not here.
7504 (build_op_delete_call): No need to cons up an OVERLOAD.
7505 * cvt.c (cp_convert_to_pointer): instantiate_type here.
7506 (convert_to_reference): And here.
7507 * decl.c (grok_reference_init): Not here.
7508 (grokparms): Or here.
7509 * typeck2.c (digest_init): Or here.
7510 * typeck.c (decay_conversion): Take the address of overloaded
7512 (require_instantiated_type): Lose.
7513 (convert_arguments): Don't handle unknown types here.
7514 (build_c_cast): Likewise.
7515 (build_binary_op): Gut.
7516 (build_conditional_expr): Don't require_instantiated_type.
7517 (build_modify_expr): Likewise.
7518 (build_static_cast): Don't instantiate_type.
7519 (build_reinterpret_cast): Likewise.
7520 (build_const_cast): Likewise.
7521 (convert_for_initialization): Likewise.
7522 (build_ptrmemfunc): Use type_unknown_p.
7523 (convert_for_assignment): Also do default_conversion on overloaded
7524 functions. Hand them off to ocp_convert.
7526 1998-10-26 Mark Mitchell <mark@markmitchell.com>
7528 * error.c (dump_decl): Deal with TEMPLATE_DECLs that are
7529 VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
7531 * class.c (finish_struct_1): Use build_cplus_array_type to build
7533 * decl.c (init_decl_processing): Likewise.
7534 * except.c (expand_end_eh_spec): Likewise.
7535 * search.c (expand_upcast_fixups): Simplify very slightly.
7537 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7539 * decl.c (grokdeclarator): Complain about a variable using
7540 constructor syntax coming back null from start_decl.
7542 * friend.c (make_friend_class): Complain about trying to make
7543 a non-class type a friend.
7545 * decl.c (grokfndecl): Set DECL_INITIAL for a defn here.
7546 (start_function): Not here.
7548 1998-10-26 Brendan Kehoe <brendan@cygnus.com>
7550 * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
7552 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7554 * typeck2.c (process_init_constructor): Only skip anonymous fields
7555 if they are bitfields.
7557 * cp-tree.def (TYPEOF_TYPE): New code.
7558 * error.c (dump_type_real): Handle it.
7559 * pt.c (tsubst): Likewise.
7560 * tree.c (search_tree): Likewise.
7561 * semantics.c (finish_typeof): New fn.
7562 * parse.y (typespec): Use it.
7563 * cp-tree.h: Declare it.
7565 1998-10-26 Manfred Hollstein <manfred@s-direktnet.de>
7567 * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional.
7569 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7571 * typeck.c (convert_arguments): Don't handle pmf references
7574 * init.c (build_member_call): Don't try to convert to the base type
7575 if it's ambiguous or pedantic.
7577 * typeck2.c (check_for_new_type): Only depend on pedantic for
7580 1998-10-25 Mark Mitchell <mark@markmitchell.com>
7582 * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all
7583 non-converting constructors.
7585 1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
7587 * gxxint.texi: Correct documentation for n, N, Q, and B.
7589 1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
7591 * parse.y (condition): Convert VAR_DECL from reference to indirect
7594 1998-10-23 Andrew MacLeod <amacleod@cygnus.com>
7596 * exception.cc (__cp_pop_exception): Free the original exception
7597 value, not the potentially coerced one.
7599 1998-10-23 Mark Mitchell <mark@markmitchell.com>
7601 * Makefile.in (hash.h): Run gperf when necessary.
7603 * cp-tree.h (CP_TYPE_READONLY): Remove.
7604 (CP_TYPE_VOLATILE): Likewise.
7605 (CP_TYPE_QUALS): New macro.
7606 (CP_TYPE_CONST_P): Likewise.
7607 (CP_TYPE_VOLATILE_P): Likewise.
7608 (CP_TYPE_RESTRICT_P): Likewise.
7609 (CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
7610 (cp_build_type_variant): Rename to ...
7611 (cp_build_qualified_type): New function.
7612 (c_apply_type_quals_to_decl): Declare.
7613 (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
7614 (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
7615 (cp_type_qual_from_rid): New function.
7616 (compparms): Remove unused parameter. All callers changed.
7617 (cp_type_quals): New function.
7618 (at_least_as_qualified_p): Likewise.
7619 (more_qualified_p): Likewise.
7621 * call.c (standard_conversion): Replace calls to
7622 cp_build_type_variant with cp_build_qualified_type. Use
7623 CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
7624 compare them. Use CP_TYPE_* macros to check qualifiers.
7625 (reference_binding): Likewise.
7626 (implicit_conversion): Likewise.
7627 (add_builtin_candidates): Likewise.
7628 (build_over_call): Likewise.
7629 * class.c (overrides): Compare all qualifiers, not just `const',
7630 on method declarations.
7631 * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
7632 (convert_pointer_to_real): Likewise.
7633 (type_promotes_to): Likewise.
7634 * decl.c (check_for_uninitialized_const_var): New function.
7635 (init_decl_processing): More CP_TYPE_QUALS conversion, etc.
7636 (cp_finish_decl): Use check_for_uninitialized_const_var.
7637 (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to
7639 (grok_ctor_properties): Likewise.
7640 (grok_op_properties): Likewise.
7641 (start_function): Likewise.
7642 (rever_static_member_fn): Likewise.
7643 * decl2.c (grok_method_quals): Likewise.
7644 (grokfield): Likewise.
7645 * error.c (dump_readonly_or_volatile): Rename to ...
7646 (dump_qualifiers): New function. Handle `restrict'.
7647 (dump_type_real): Use it.
7648 (dump_aggr_type): Likewise.
7649 (dump_type_prefix): Likewise.
7650 (dump_type_suffix): Likewise.
7651 (dump_function_decl): Likewise.
7652 (cv_as_string): Likewise.
7653 * gxx.gperf: Add __restrict and __restrict__.
7654 * gxxint.texi: Document `u' as used for `__restrict', and a few
7655 other previously undocumented codes.
7656 * hash.h: Regenerated.
7657 * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
7658 (build_member_call): Likewise.
7659 (build_new_1): Likewise.
7660 * lex.c (init_parse): Add entry for RID_RESTRICT.
7661 (cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
7662 (cp_type_qual_from_rid): Define.
7663 * lex.h (enum rid): Add RID_RESTRICT.
7664 * method.c (process_modifiers): Deal with `restrict'.
7665 * parse.y (primary): More CP_TYPE_QUALS conversion, etc.
7666 * parse.c: Regenerated.
7667 * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
7668 (tsubst_aggr_type): Likewise.
7670 (check_cv_quals_for_unify): Likewise.
7672 * rtti.c (init_rtti_processing): Likewise.
7673 (build_headof): Likewise.
7674 (get_tinfo_var): Likewise.
7675 (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling.
7676 (expand_class_desc): Likewise.
7677 (expand_attr_desc): Likewise.
7678 (synthesize_tinfo_fn): Likewise.
7679 * search.c (covariant_return_p): Likewise. Fix `volatile' handling.
7680 (get_matching_virtual): Likewise.
7681 (expand_upcast_fixups): Likewise.
7682 * sig.c (build_signature_pointer_or_reference_name): Take
7683 type_quals, not constp and volatilep.
7684 (build_signature_pointer_or_reference_type): Likewise.
7685 (match_method_types): More CP_TYPE_QUALS conversion, etc.
7686 (build_signature_pointer_constructor): Likewise.
7687 (build_signature_method_call): Likewise.
7688 * tree.c (build_cplus_array_type): Likewise.
7689 (cp_build_type_variant): Rename to ...
7690 (cp_build_qualified_type): New function. Deal with `__restrict'.
7691 (canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
7692 (build_exception_variant): Likewise.
7694 * typeck.c (qualif_type): Likewise.
7695 (common_type): Likewise.
7696 (comptypes): Likewise.
7697 (comp_cv_target_types): Likewise.
7698 (at_least_as_qualified_p): Define.
7699 (more_qualified_p): Likewise.
7700 (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
7701 (compparms): Likewise.
7702 (inline_conversion): Likewise.
7703 (string_conv_p): Likewise.
7704 (build_component_ref): Likewise.
7705 (build_indirect_ref): Likewise.
7706 (build_array_ref): Likewise.
7707 (build_unary_op): Likewise.
7708 (build_conditional_expr): Likewise.
7709 (build_static_cast): Likewise.
7710 (build_c_cast): Likewise.
7711 (build_modify_expr): Likewise.
7712 (convert_For_assignment): Likewise.
7713 (comp_ptr_ttypes_real): Likewise.
7714 (cp_type_quals): New function.
7716 1998-10-23 Jason Merrill <jason@yorick.cygnus.com>
7718 * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
7719 (CP_TYPE_VOLATILE): Likewise.
7720 * decl.c (grokdeclarator): Use them.
7721 * tree.c (canonical_type_variant): Likewise.
7723 1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de>
7725 * parse.y (named_class_head): Push into class while parsing the
7727 * decl2.c (push_scope, pop_scope): New functions.
7728 * cp-tree.h: Declare them.
7729 * init.c (build_new_1): Delay cleanup until end of full expression.
7731 1998-10-21 Jason Merrill <jason@yorick.cygnus.com>
7733 * typeck.c (build_component_ref): Use of a type here is an error.
7735 1998-10-19 Jason Merrill <jason@yorick.cygnus.com>
7737 Revamp references to member functions.
7738 * method.c (hack_identifier): Call build_component_ref for a
7739 reference to a member function.
7740 * typeck.c (build_component_ref): Only return a single function
7741 if it's static. Otherwise, return a COMPONENT_REF.
7742 (build_x_function_call): Handle a COMPONENT_REF.
7743 (build_unary_op): Handle all unknown-type things.
7744 * decl2.c (arg_assoc): Handle COMPONENT_REF.
7745 * class.c (instantiate_type): Complain if the function we get is a
7746 nonstatic member function. Remove code for finding "compatible"
7748 * pt.c (tsubst_copy): Handle NOP_EXPR.
7749 * tree.c (build_dummy_object): New fn.
7750 (maybe_dummy_object): New fn.
7751 (is_dummy_object): New fn.
7752 * cp-tree.h: Declare them.
7753 * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
7754 * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
7755 * init.c (build_member_call): Use maybe_dummy_object and
7757 (build_offset_ref): Use maybe_dummy_object.
7758 (resolve_offset_ref): Use is_dummy_object.
7759 * typeck.c (build_x_function_call): Call build_dummy_object.
7760 (unary_complex_lvalue): Call is_dummy_object.
7762 * typeck.c (build_component_addr): Make sure field is a field.
7764 * call.c (build_new_op): Delete obsolete code.
7766 * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
7768 1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
7770 * decl2.c (validate_nonmember_using_decl): Fix using-directives of
7771 std if std is ignored.
7773 1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
7775 * decl.c (grokvardecl): Fix thinko.
7777 * decl.c (grokdeclarator): Embedded attrs bind to the right,
7780 * parse.y (fn.def2): Fix 'attrs' format.
7782 1998-10-18 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
7784 * Makefile.in (CONFLICTS): Update.
7785 * parse.y (expr_or_declarator_intern): New rule.
7786 (expr_or_declarator, direct_notype_declarator, primary,
7787 functional_cast): Use it.
7788 (notype_declarator_intern): New rule.
7789 (notype_declarator, complex_notype_declarator): Use it.
7791 1998-10-17 Jason Merrill <jason@yorick.cygnus.com>
7793 * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate.
7794 (grokvardecl): Likewise.
7796 Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7798 * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR).
7799 (add_method): Likewise for arguments 1 & 2 of `bcopy'.
7801 * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN.
7803 * pt.c (process_partial_specialization): Cast 1st argument of
7806 * tree.c (build_base_fields): Cast `base_align' to (int) when
7807 comparing against one.
7809 1998-10-16 Mark Mitchell <mark@markmitchell.com>
7811 * decl.c (lookup_name_real): Handle template parameters for member
7812 templates where said parameters have the same name as the
7815 * decl.c (expand_static_init): Build cleanups before entering the
7816 anonymous function used to do them to avoid access-checking
7819 * decl.c (grokfndecl): Add back call to cplus_decl_attributes
7820 accidentally removed by previous change, and make DECL_RTL here.
7821 * class.c (add_method): Don't make DECL_RTL here.
7823 * pt.c (for_each_template_parm): Don't examine uninstantiated
7826 1998-10-16 Dave Brolley <brolley@cygnus.com>
7828 * lex.c (real_yylex): Fix unaligned access of wchar_t.
7830 1998-10-16 Mark Mitchell <mark@markmitchell.com>
7832 * class.c (add_method): Fix documentation to reflect previous
7833 changes. Check for duplicate method declarations here.
7834 * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL
7835 correctly; such things never match.
7836 (grokfndecl): Don't look for duplicate methods here.
7837 * decl2.c (check_classfn): Don't assume names are mangled.
7838 Don't add bogus member function declarations to a class before the
7839 class type is complete.
7840 (grokfield): Reformat error message.
7841 * method.c (set_mangled_name_for_decl): Don't mangle names while
7842 processing_template_decl.
7844 1998-10-16 Jason Merrill <jason@yorick.cygnus.com>
7846 * typeck.c (build_indirect_ref): Complain about a pointer to data
7848 * typeck2.c (build_m_component_ref): Don't indirect a pointer to
7850 * init.c (resolve_offset_ref): Don't undo the above.
7852 * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros.
7853 (struct lang_decl_flags): Add `bitfield'.
7854 * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of
7856 * decl2.c (grokbitfield, grok_alignof): Likewise.
7857 * init.c (build_offset_ref): Likewise.
7858 * typeck.c (build_component_addr, expr_sizeof): Likewise.
7859 * cvt.c (build_up_reference): Don't crash if taking the address
7860 returns error_mark_node.
7862 * decl.c (grokfndecl): Also check ctype when checking for ::main().
7864 1998-10-15 Jason Merrill <jason@yorick.cygnus.com>
7866 * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
7868 (grokdeclarator): Instead of here.
7869 * friend.c (do_friend): Lose special handling of ::main and
7871 * cp-tree.h (DECL_MAIN_P): Check for C linkage.
7873 * spew.c (yylex): Clear looking_for_typename if we got
7876 1998-10-15 Mark Mitchell <mark@markmitchell.com>
7878 * class.c (maybe_warn_about_overly_private_class): Improve error
7879 messages for class with only private constructors.
7881 * cp-tree.def (TYPENAME_TYPE): Add to documentation.
7882 * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
7883 (build_typename_type): New function.
7884 * decl.c (build_typename_type): Broken out from ...
7885 (make_typename_type): Use it.
7886 * search.c (lookup_field): Likewise.
7888 1998-10-14 Benjamin Kosnik <bkoz@rhino.cygnus.com>
7890 * pt.c (convert_nontype_argument): Check against type_referred_to.
7891 * decl.c (grokvardecl): Check for declarator name before building
7892 DECL_ASSEMBLER_NAME.
7894 1998-10-14 Mark Mitchell <mark@markmitchell.com>
7896 * pt.c (lookup_template_class): Add comment.
7897 (instantiate_class_template): Don't mark the _TYPE node for
7898 member class templates as an instantiation.
7900 1998-10-14 Jason Merrill <jason@yorick.cygnus.com>
7902 * decl.c (grokfndecl): Fix my thinko.
7904 1998-10-13 Jason Merrill <jason@yorick.cygnus.com>
7906 * tinfo2.cc (fast_compare): Remove.
7907 (before): Just use strcmp.
7908 * tinfo.cc (operator==): Just use strcmp.
7910 1998-10-13 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
7912 * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
7915 1998-10-13 Mark Mitchell <mark@markmitchell.com>
7917 * cp-tree.h (specializations_of_same_template_p): Remove.
7918 * search.c (get_template_base): Don't use it.
7919 (get_template_base_recursive): Likewise.
7920 * pt.c (specializations_of_same_template_p): Remove.
7921 (unify): Don't use it.
7922 (lookup_template_class): Find the correct parent when setting
7923 CLASSTYPE_TI_TEMPLATE.
7925 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
7927 * tinfo.cc (operator==): Always compare names.
7929 1998-10-12 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
7931 * decl.c (start_function): Fix cut-and-paste error.
7933 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
7935 * inc/typeinfo: Add #pragma interface.
7936 (operator!=): Just call operator==.
7937 * tinfo.cc: Add #pragma implementation.
7938 (operator==): Move from inc/typeinfo and tinfo2.cc.
7939 Check __COMMON_UNRELIABLE instead of _WIN32.
7941 * typeck2.c (my_friendly_abort): Add URL.
7943 1998-10-12 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
7945 * decl.c (start_method): Added extra parameter for attributes.
7946 * cp-tree.h (start_method): Update prototype.
7947 * parse.y (fn.def2): Update start_method parameter list.
7949 1998-10-11 Mark Mitchell <mark@markmitchell.com>
7951 * cp-tree.h (specializations_of_same_template_p): Declare.
7952 * pt.c (specializations_of_same_template_p): New function.
7954 * search.c (get_template_base): Use it.
7955 (get_template_base_recursive): Likewise.
7957 1998-10-10 Manfred Hollstein <manfred@s-direktnet.de>
7959 * decl2.c (start_objects): Add new variable `joiner' and
7960 initialize it properly.
7962 1998-10-09 Mark Mitchell <mark@markmitchell.com>
7964 * search.c (expand_upcast_fixups): Tweak to match 1998-10-07
7965 change to vtable types.
7967 * cvt.c (ocp_convert): Avoid infinite recursion caused by
7970 1998-10-08 Jason Merrill <jason@yorick.cygnus.com>
7972 * pt.c (resolve_overloaded_unification): New fn.
7973 (try_one_overload): Likewise.
7974 (unify): Don't fail on unknown type.
7975 (type_unification_real): Likewise. Use resolve_overloaded_unification
7976 to handle an overloaded argument.
7977 (template_args_equal): Split out...
7978 (comp_template_args): From here.
7979 (determine_specialization): Also allow a template with more
7980 parms than were explicitly specified.
7981 * cp-tree.h: Add template_args_equal.
7982 * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code.
7984 Thu Oct 8 15:58:30 1998 Anthony Green <green@cygnus.com>
7986 * semantics.c (finish_asm_stmt): Revert my 1998-09-28
7989 Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com)
7991 * typeck.c (unsigned_type): Only return TItype nodes when
7992 HOST_BITS_PER_WIDE_INT is >= 64 bits.
7993 (signed_type): Likewise.
7994 * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
7995 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7996 (init_decl_processing): Only create TItype nodes when
7997 HOST_BITS_PER_WIDE_INT is >= 64 bits.
7998 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare
7999 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
8001 Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8003 * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
8004 (gxx.gperf): Update comments describing invocation flags.
8005 (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
8007 1998-10-07 Mark Mitchell <mark@markmitchell.com>
8009 * class.c (finish_struct_1): Add commentary on previous change.
8011 * cp-tree.h (vtbl_ptr_type_node): New variable.
8012 * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
8013 already of the right type.
8014 (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
8015 Simplify code to grow vtable.
8016 * decl.c (vtbl_ptr_type_node): Define.
8017 (init_decl_processing): Initialize it.
8019 1998-10-06 Mark Mitchell <mark@markmitchell.com>
8021 * cp-tree.def (PTRMEM_CST): New tree node.
8022 * cp-tree.h (ptrmem_cst): New type.
8023 (lang_type): Remove local_typedecls.
8024 (dummy): Increase to 12 bits from 11.
8025 (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
8026 (PTRMEM_CST_CLASS): New macro.
8027 (PTRMEM_CST_MEMBER): Likewise.
8028 (current_access_specifier): New variable.
8029 (current_class_type): Remove duplicate declaration.
8030 (finish_struct): Change prototype.
8031 (unreverse_member_declarations): New function.
8032 (pushdecl_class_level): Change prototype.
8033 (grok_enum_decls): Remove.
8034 (fixup_anonymous_union): New function.
8035 (grok_x_components): Change prototype.
8036 (tsubst_chain): Remove.
8037 (finish_member_template_decl): Likewise.
8038 (check_explicit_specialization): Fix indentation.
8039 (finish_class_definition): Change prototype.
8040 (finish_member_class_template): Likewise.
8041 (finish_member_declaration): New function.
8042 (check_multiple_declarators): Likewise.
8043 * class.c (class_stack_node_t): New type.
8044 (current_class_base): Remove.
8045 (current_class_stack): Change type.
8046 (current_access_specifier): New variable.
8047 (grow_method): Remove.
8048 (check_member_decl_is_same_in_complete_scope): Break out from
8050 (make_method_vec): New function.
8051 (free_method_vec): Likewise.
8052 (add_implicitly_declared_members): Break out from finish_struct_1.
8053 (free_method_vecs): New variable.
8054 (add_method): Rework for direct use from parser.
8055 (handle_using_decl): Watch for NULL_TREE while iterating through
8056 CLASSTYPE_METHOD_VEC.
8057 (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
8058 just do some error-checking.
8059 (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
8060 (finish_struct_1): Simplify. Use add_implicitly_declared_members.
8061 (finish_struct): Change prototype. Simplify; fields and methods
8062 are already set up at this point.
8063 (init_class_processing): Set up current_class_stack.
8064 (pushclass): Save current_access_specifier.
8065 (popclass): Restore it.
8066 (currently_open_class): Simplify.
8067 (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
8068 * decl.c (saved_scope): Add access_specifier.
8069 (maybe_push_to_top_level): Save it.
8070 (pop_from_top_level): Restore it.
8071 (maybe_process_template_type_declaration): Use
8072 finish_member_declaration.
8073 (pushtag): Likewise.
8074 (pushdecl_class_level): Don't return a value.
8075 (fixup_anonymous_union): Break out from grok_x_components.
8076 (shadow_tag): Use it.
8077 (xref_tag): Complain about using an elaborated type specifier to
8078 reference a template type parameter or typedef name.
8079 (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
8080 (current_local_enum): Remove.
8081 (build_enumerator): Call finish_member_declaration.
8082 (grok_enum_decls): Remove.
8083 * decl2.c (grok_x_components): Simplify.
8084 (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
8085 (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
8086 (merge_functions): Add to comment.
8087 (arg_assoc_type): Prototype.
8088 (arg_assoc): Pass as many arguments as there are parameters.
8089 * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of
8091 * expr.c (cpls_expand_expr): Remove dead code. Handle
8093 * friend.c (do_friend): Lookup friends when in nested classes.
8095 * init.c (build_offset_ref): Do lookup even for classes that are
8096 only partially defined.
8097 (decl_constant_value): Remove dead code.
8098 * method.c (build_overload_value): Remove hack where by TYPE was
8099 not a TYPE. Handle PTRMEM_CST.
8100 (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
8102 * parse.y (components, notype_components, component_decl,
8103 component_decl_1, component_declarator, component_declarator0):
8104 Now all are itype rather than ttype. Rework to add members to
8106 (typesqpecqual_reserved): Use check_multiple_declarators.
8107 (structsp): Update class to finish_class_definition.
8108 (do_xref_defn): Unsplit into named_class_head.
8109 (access_specifier): Set current_access_specifier.
8110 * pt.c (set_current_access_from_decl): New function.
8111 (finish_member_template_decl): Don't take the parameters.
8112 (comp_template_args): Make more robust.
8113 (lookup_template_class): Don't use current_local_enum.
8114 (for_each_template_parm): Handle PTRMEM_CST.
8115 (instantiate_class_template): Use set_current_access_from_decl,
8116 finish_member_declaration and unreverse_member_declarations. Set
8117 lineno/input_filename before generating implicit member functions.
8118 (type_unification_real): Don't assume back-unification happens
8119 only for the last argument.
8120 (regenerate_decl_from_template): Call pushclass a bit earlier.
8121 (tsubst_chain): Remove.
8122 (tsubst_enum): Use set_current_access_from_decl.
8123 (set_mangled_name_for_template_decl): Fix indentation.
8124 * search.c (lookup_fnfields_1): Change iteration through
8125 CLASSTYPE_METHOD_VEC.
8126 (dfs_pushdecls): Likewise.
8127 (dfs_compress_decls): Likewise.
8128 (add_conversions): Likewise.
8129 * semantics.c (finish_class_definition): Don't take components.
8130 Change call to finish_struct.
8131 (finish_member_declaration): New function.
8132 (finish_member_class_template): Don't take template parameters.
8133 Change call to grok_x_components. Call finish_member_template_decl.
8134 (check_multiple_declarators): New function.
8135 * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
8136 a passed in fieldlist.
8137 * tree.c (search_tree): Handle PTRMEM_CST.
8139 * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
8140 INTEGER_CSTs, for pointer-to-data members.
8142 * call.c (resolve_args): Resolve template specializations, if
8145 Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8147 * Makefile.in (spew.o): Depend on toplev.h.
8149 * call.c (compare_ics): Initialize variables `deref_from_type2',
8150 `deref_to_type1' and `deref_to_type2'.
8152 * except.c (get_eh_type): Hide prototype and definition.
8153 (process_start_catch_block_old): Remove unused static prototype.
8155 * pt.c (tsubst_decl): Initialize variable `argvec'.
8157 * spew.c: Include toplev.h.
8159 1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
8161 * pt.c (instantiate_decl): Do save and restore file position.
8163 1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
8165 * method.c (build_decl_overload_real): Clear
8166 numeric_output_need_bar after __.
8168 1998-10-05 Nathan Sidwell <nathan@acm.org>
8170 * call.c (build_new_method_call): Issue 'incomplete type' error,
8171 if class is not defined.
8173 1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8175 * call.c (build_object_call): Move declaration of variable
8176 `fn' into the scope where it is used. Don't access variable
8177 `fn' when it is uninitialized, instead use `fns'.
8179 1998-10-04 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
8181 * errfn.c (cp_thing): Print buf as a string not as a printf format
8182 to avoid problems with the operator%. Consequently, `%%' sequences
8183 in format are copied as `%' in buf.
8185 1998-10-04 Jason Merrill <jason@yorick.cygnus.com>
8187 * pt.c (pop_tinst_level): Call extract_interface_info.
8188 (instantiate_decl): Don't save and restore file position.
8190 * decl.c (cp_finish_decl): Make statics in extern inlines and
8191 templates common, if possible and the target doesn't support weak
8194 * decl.c (grokdeclarator): Remove redundant calls to
8195 build_type_variant and some duplicated code.
8196 * sig.c (build_signature_reference_type): Only take the type parm.
8197 (build_signature_pointer_type): Likewise.
8198 * tree.c (build_cplus_method_type): Adjust.
8199 * cp-tree.h: Update.
8201 1998-10-04 Mark Mitchell <mark@markmitchell.com>
8203 * call.c (build_over_call): Make pedwarns about dropped qualifiers
8204 into full-fledged errors.
8205 * cvt.c (convert_to_reference): Likewise.
8206 * typeck.c (convert_for_assignment): Likewise.
8208 * search.c (expand_upcast_vtables): In addition to unsetting
8209 TREE_READONLY, remove top-level const type qualifier.
8211 1998-10-03 Mark Mitchell <mark@markmitchell.com>
8213 * class.c (current_class_ptr, current_class_ref): Clarify
8215 * cvt.c (ocp_convert): Don't expect fold to remove all trivial
8216 NOP type conversions.
8217 * decl.c (decls_match): Use comptypes directly; ignore
8218 qualifiers on the DECL.
8219 (duplicate_decls): Remove qualifier checks on DECL.
8220 (grokdeclarator): Make the type built up include top-level
8222 * decl2.c (do_dtors): Fix spelling error.
8223 * error.c (dump_simple_decl): Don't look at qualifiers on the decl
8224 when printing type information.
8225 * init.c (build_new_1): Add documentation. Deal with the fact
8226 that type of allocated memory now contains qualifiers.
8227 * lex.c (is_global): Improve error-recovery.
8228 * sig.c (build_member_function_pointer): Don't cast away const
8229 on fields of sigtable_entry_type.
8230 * tree.c (lvalue_type): Don't look at top-level qualifiers on
8232 * typeck.c (decay_conversion): Likewise.
8233 (build_component_ref): Make sure the type of the COMPONENT_REF
8234 contains top-level qualifiers, as appropriate. Improve
8236 (build_indirect_ref): Simplify. Don't strip top-level qualifiers.
8237 (build_array_ref): Likewise.
8238 (build_unary_op): Improve error-recovery.
8239 (unary_complex_lvalue): Make taking the address a bound member
8240 function an error, not a sorry.
8241 (build_conditional_expr): Look at the type qualifiers, not the
8242 qualifiers on the expression itself.
8244 1998-10-03 Jason Merrill <jason@yorick.cygnus.com>
8246 * decl2.c (merge_functions): Remove duplicates.
8248 * decl2.c: Add -f{no-,}implicit-inline-templates.
8249 (import_export_decl): Check it.
8251 * decl.c (lookup_name_real): Template parms also take precedence
8252 over implicit typename. Only warn if yylex.
8254 * typeck.c (build_conditional_expr): Only fold if ifexp is an
8257 * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
8260 1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
8262 * cp-tree.h (FORMAT_VBASE_NAME): New macro.
8263 * class.c (build_vbase_pointer): Use it.
8264 * rtti.c (expand_class_desc): Likewise.
8265 * tree.c (build_vbase_pointer_fields): Likewise.
8267 Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
8269 * decl.c (start_decl): Add invocation of
8270 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8271 (start_function): Add invocation of
8272 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8274 * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with
8275 HANDLE_GENERIC_PRAGMAS.
8277 1998-09-28 Anthony Green <green@cygnus.com>
8279 * semantics.c (finish_asm_stmt): Always permit volatile asms.
8281 1998-09-28 Mark Mitchell <mark@markmitchell.com>
8283 * decl.c (grokdeclarator): Tighten checks for invalid
8284 destructors. Improve error-messages and error-recovery.
8285 * decl2.c (check_classfn): Don't assume that mangled destructor
8286 names contain type information.
8288 1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
8290 * search.c (get_base_distance): Remove assert.
8292 * decl2.c (build_anon_union_vars): Don't process a field with no
8294 (finish_anon_union): Also complain about local anon unions with no
8297 1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
8299 * decl.c (lookup_namespace_name): If the name is a namespace,
8300 return it immediately.
8302 Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8304 * cp-tree.h (define_case_label): Remove unused parameter.
8305 (check_java_method): Likewise.
8306 (grokclassfn): Likewise.
8307 (expand_aggr_init): Likewise.
8308 (build_x_delete): Likewise.
8309 (maybe_end_member_template_processing): Likewise.
8310 (unshare_base_binfos): Add prototype.
8311 (string_conv_p): Likewise.
8312 (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
8314 * cvt.c (build_up_reference): Remove unused parameter
8315 `checkconst', all callers changed.
8316 (build_type_conversion): Mark parameter `code' with
8318 (build_expr_type_conversion): Initialize variable `conv'.
8320 * decl.c (push_namespace): Initialize variable `d'.
8321 (define_case_label): Remove unused parameter `decl', all callers
8324 * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
8325 `argc' with ATTRIBUTE_UNUSED.
8326 (grokclassfn): Remove unused parameter `cname', all callers
8328 (check_java_method): Likewise for parameter `ctype'.
8329 (copy_assignment_arg_p): Mark parameter `virtualp' with
8331 (finish_prevtable_vardecl): Likewise for parameter `prev'.
8333 * expr.c (extract_init): Likewise for parameters `decl' and `init'.
8335 * init.c (expand_aggr_init_1): Remove unused parameter
8336 `alias_this', all callers changed.
8337 (expand_aggr_init): Likewise.
8338 (expand_default_init): Likewise.
8339 (build_new_1): Initialize variable `susp'.
8340 (build_x_delete): Remove unused parameter `type', all callers
8343 * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
8345 (readescape): Use (unsigned) value in shift.
8346 (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when
8347 comparing to a signed quantity.
8349 * pt.c (maybe_end_member_template_processing): Remove unused
8350 parameter `decl', all callers changed.
8351 (check_explicit_specialization): Add braces around empty body in
8353 (current_template_args): Initialize variable `args'.
8354 (lookup_template_class): Likewise for variable `prev_local_enum'.
8355 (tsubst_decl): Likewise for variable `r'.
8356 (set_mangled_name_for_template_decl): Initialize variable
8359 * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
8360 Likewise for variable `i'.
8361 (yylex): Initialize variable `trrr'.
8363 * typeck.c (compparms): Mark variable `strict' with
8366 * xref.c (simplify_type): Cast argument of ctype function to
8369 1998-09-24 Mark Mitchell <mark@markmitchell.com>
8371 * cp-tree.h (language_lvalue_valid): Remove.
8372 * decl.c (grokdeclarator): Don't disallow references to functions.
8373 * tree.c (lvalue_p_1): New function, combining duplicated
8376 (real_lvalue_p): Likewise.
8377 * typeck.c (language_lvalue_valid): Remove.
8378 (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
8379 they don't have TREE_READONLY set.
8380 * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
8382 1998-09-24 Benjamin Kosnik <bkoz@loony.cygnus.com>
8384 * spew.c (yylex): Give diagnostic.
8385 * hash.h (is_reserved_word): Add export.
8386 * gxx.gperf: Likewise.
8387 * lex.h (rid): Add RID_EXPORT.
8388 * lex.c (init_parse): Likewise.
8390 Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
8392 * friend.c (do_friend): Make warning a full sentence.
8394 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8396 * parse.y (component_decl_list): Improve error-recovery.
8398 1998-09-22 Benjamin Kosnik <bkoz@loony.cygnus.com>
8400 * decl.c (make_typename_type): Move error to point where name
8401 variable can be used by dump_type.
8403 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8405 * decl.c (grokfndecl): Improve error-recovery.
8406 * decl2.c (grokfield): Likewise.
8407 * pt.c (finish_member_template_decl): Likewise.
8409 1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de>
8411 * method.c (hack_identifier): Finding multiple members is always
8414 1998-09-21 Per Bothner <bothner@cygnus.com>
8416 * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o.
8418 Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
8420 * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
8422 1998-09-20 Mark Mitchell <mark@markmitchell.com>
8424 * class.c (maybe_warn_about_overly_private_class): Reformat.
8426 1998-09-17 Andrew MacLeod <amacleod@cygnus.com>
8428 * exception.cc (__cplus_type_matcher): Realign some code.
8430 1998-09-16 Mark Mitchell <mark@markmitchell.com>
8432 * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
8433 (tinfo2.o): Likewise.
8434 (exception.o): Likewise.
8436 (opnew.o): Likewise.
8437 (opnewnt.o): Likewise.
8438 (opvnew.o): Likewise.
8439 (opvnewnt.o): Likewise.
8440 (opdel.o): Likewise.
8441 (opdelnt.o): Likewise.
8442 (opvdel.o): Likewise.
8443 (opvdelnt.o): Likewise.
8445 1998-09-16 Richard Henderson <rth@cygnus.com>
8447 * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
8449 1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
8451 * call.c (build_field_call): Handle static data members too.
8453 * typeck.c (comptypes): When comparing pointer types, check
8454 whether referred types match even in strictest modes.
8456 1998-09-15 Mark Mitchell <mark@markmitchell.com>
8458 * cp-tree.h: Revert previous change.
8459 (finish_struct_methods): Remove declaration.
8460 * class.c: Revert previous change.
8461 (maybe_warn_about_overly_private_class): New function.
8462 (finish_struct_methods): Declare here, and make static. Remove
8463 unnecessary parameters. Tidy slightly. Use
8464 maybe_warn_about_overly_private_class.
8465 (finish_struct_1): Adjust. Remove check for private constructors,
8467 (finish_struct): Adjust.
8469 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8471 * except.c (expand_start_catch_block): No need to check for new
8473 (process_start_catch_block_old): Deleted.
8474 (process_start_catch_block): Add call to start_decl_1().
8475 (expand_end_catch_block): Add call to end_catch_handler().
8476 * exception.cc (__cplus_type_matcher): Only check the exception
8477 language if there is an exception table.
8479 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8481 * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
8482 as used to prevent conflicts with virtual function tables.
8484 1998-09-14 Mark Mitchell <mark@markmitchell.com>
8486 * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
8487 (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
8488 * class.c (maybe_class_too_private_p): New function.
8489 (finish_struct_methods): Use it.
8490 (finish_struct_1): Likewise.
8491 (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
8494 * pt.c (check_specialization_scope): Fix spelling error.
8495 (check_explicit_specialization): Remove code to handle explicit
8496 specializations in class scope; they are now correctly diagnosed
8499 1998-09-10 Mark Mitchell <mark@markmitchell.com>
8501 * decl.c (pushdecl): Don't copy types if the
8502 DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
8505 1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
8507 * class.c (get_enclosing_class): New function.
8508 (is_base_of_enclosing_class): Likewise.
8509 * cp-tree.h (get_enclosing_class): Declare.
8510 (is_base_of_enclosing_class): Likewise.
8511 * pt.c (coerce_template_parms): Use them.
8513 1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
8515 * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
8516 null to decide whether to use it.
8518 * error.c (dump_type_real): Handle NAMESPACE_DECL.
8519 * parse.y (base_class.1): Avoid crash on error.
8521 1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
8523 * decl.c (make_typename_type): If context is a namespace, the code
8526 1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
8528 * parse.y (nomods_initdcl0): Set up the parser stack correctly.
8530 1998-09-08 Mark Mitchell <mark@markmitchell.com>
8532 * cp-tree.h (anonymous_namespace_name): Declare.
8533 * decl.c: Define it.
8534 (push_namespace): Use anonymous_namespace_name, rather than local
8536 * error.c (dump_decl): If a namespace is named
8537 anonymous_namespace_name, call it {anonymous}.
8539 * decl.c (grokparms): Distinguish between references and pointers
8542 1998-09-08 Richard Henderson <rth@cygnus.com>
8543 Mark Mitchell <mark@markmitchell.com>
8545 * pt.c (process_partial_specialization): Consistently allocate
8546 and zero tpd.parms based on ntparms. Use tpd2.parms, not
8547 tpd.parms, where appropriate.
8549 Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
8551 * Makefile.in (INCLUDES): Update after recent toplevel gcc
8554 1998-09-05 Mark Mitchell <mark@markmitchell.com>
8556 * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
8557 * class.c (finish_struct): Remove hackery to deal with explicit
8558 specializations in class scope.
8559 * decl.c (grokfndecl): Improve error-recovery.
8560 * decl2.c (grokfield): Likewise.
8561 * pt.c (check_specialization_scope): New function.
8562 (begin_specialization): Call it.
8563 (process_partial_specialization): New function, split out from
8564 push_template_decl. Check partial specializations more
8566 (push_template_decl): Call it.
8567 (check_explicit_specialization): Don't attempt to handle explicit
8568 specializations in class scope.
8569 (template_parm_data): Document. Add current_arg and
8570 arg_uses_template_parms.
8571 (mark_template_parm): Set it.
8572 (tsubst_arg_types): Remove unused variable.
8573 * semantics.c (begin_class_definition): Tweak.
8575 1998-09-04 Mark Mitchell <mark@markmitchell.com>
8577 * inc/typeinfo (type_info::type_info(const char*)): Make
8580 * cp-tree.h (hash_tree_cons_simple): New macro.
8581 * pt.c (tsubst_arg_types): New function. Use hash_tree_cons.
8582 (coerce_template_parms): Use make_temp_vec, instead of
8583 make_tree_vec. Document this behavior.
8584 (lookup_template_class): Likewise.
8585 (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
8586 Remove dead code (and add assertion to check its deadness). Fix
8587 bug w.r.t. exception specifications.
8589 1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
8591 * decl2.c (import_export_vtable): Always make artificials comdat.
8592 (import_export_decl): Likewise.
8593 * pt.c (mark_decl_instantiated): Likewise.
8595 1998-09-03 Mark Mitchell <mark@markmitchell.com>
8597 * cp-tree.h (finish_globally_qualified_member_call_expr):
8599 (finish_qualified_call_expr).
8600 * semantics.c: Likewise.
8601 * parse.y (primary): Use it.
8602 * method.c (hack_identifier): Remove redundant code.
8604 * init.c (resolve_offset_ref): Call convert_from_reference to
8605 handle members of reference type. Improve error recovery.
8607 1998-09-03 Benjamin Kosnik <bkoz@cygnus.com>
8609 * cp-tree.h: Declare warn_nontemplate_friend.
8610 * decl2.c (lang_decode_option): Set.
8611 * lang-options.h: Add -Wnon-template-friend.
8612 * friend.c (do_friend): Use to toggle non-template function warning.
8614 1998-09-03 Mark Mitchell <mark@markmitchell.com>
8616 * decl.c (finish_enum): Don't resolve CONST_DECLs to their
8617 corresponding INTEGER_CSTs when processing_template_decl.
8618 * pt.c (tsubst_enum): Tweak accordingly.
8620 1998-09-03 Benjamin Kosnik <bkoz@rhino.cygnus.com>
8622 * decl.c (pushdecl_class_level): Add warning here.
8625 1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
8627 * cvt.c (convert_pointer_to_real): Tidy.
8628 * search.c (get_base_distance_recursive): Simplify.
8629 (get_base_distance): Likewise.
8631 * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
8634 Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
8636 * lex.c (check_newline): Call HANDLE_PRAGMA before
8637 HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
8638 if unknown pragmas are encountered.
8639 (handle_sysv_pragma): Interpret return code from
8640 handle_pragma_token (). Return success/failure indication rather
8641 than next unprocessed character.
8642 (pragma_getc): New function: retrieves characters from the
8643 input stream. Defined when HANDLE_PRAGMA is defined.
8644 (pragma_ungetc): New function: replaces characters back into the
8645 input stream. Defined when HANDLE_PRAGMA is defined.
8647 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
8649 * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
8650 * class.c (build_vtable_entry_ref): Likewise.
8652 1998-09-01 Mark Mitchell <mark@markmitchell.com>
8654 * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
8655 * decl2.c (import_export_decl): Likewise.
8656 * pt.c (instantiate_decl): Use it.
8658 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
8660 * decl.c (lookup_name_real): Also do implicit typename thing for
8661 artificial TYPE_DECLs.
8662 * search.c (lookup_field): Likewise.
8663 (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
8664 * semantics.c (begin_constructor_declarator): Use enter_scope_of.
8665 (enter_scope_of): Extract type from implicit typename.
8666 (begin_class_definition): Likewise.
8667 * lex.c (identifier_type): Handle implicit typename when checking
8670 * cp-tree.h: Declare flag_strict_prototype.
8671 * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
8673 * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
8674 specified, set it to the value of pedantic.
8676 1998-09-01 Mark Mitchell <mark@markmitchell.com>
8678 * decl2.c (arg_assoc): Handle template-id expressions as arguments.
8680 1998-08-31 Mark Mitchell <mark@markmitchell.com>
8682 * decl.c (finish_enum): Handle member enums of classes declared in
8685 * decl2.c (grok_x_components): Strip attributes before calling
8688 1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
8690 * cp-tree.h, decl2.c: Remove support for -fall-virtual,
8691 -fenum-int-equivalence and -fno-nonnull-objects.
8692 * class.c (check_for_override): Remove support for -fall-virtual.
8693 (finish_struct_1): Likewise.
8694 * call.c (build_new_op): Remove support for -fenum-int-equivalence.
8695 * typeck.c (build_binary_op_nodefault): Likewise.
8696 * cvt.c (ocp_convert): Likewise.
8697 * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
8698 * class.c (build_vbase_path): Likewise.
8700 Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
8702 * Makefile.in (INTERFACE): New, set to 1.
8704 1998-08-30 Mark Mitchell <mark@markmitchell.com>
8706 * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
8707 comparing with global_namespace.
8708 (dump_aggr_type): Likewise.
8710 * decl.c (grokfndecl): Issue error on declaration of friend
8711 templates with explicit template arguments.
8713 * pt.c (convert_template_argument): New function, split out
8715 (coerce_template_parms): Here.
8716 (tsubst): Attempt better error-recovery.
8718 1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com>
8720 * pt.c (decl_template_parm_p): Add checks for
8721 TEMPLATE_TEMPLATE_PARM.
8723 1998-08-28 Mark Mitchell <mark@markmitchell.com>
8725 * lex.c (do_identifier): Fix thinko in previous change.
8727 1998-08-28 Jason Merrill <jason@yorick.cygnus.com>
8729 * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
8730 * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
8732 1998-08-28 Richard Henderson <rth@cygnus.com>
8734 Add support for discarding unused virtual functions.
8735 * lang-options.h: Add -fvtable-gc.
8736 * cp-tree.h: Add flag_vtable_gc.
8737 * decl2.c (output_vtable_inherit): New fn.
8738 (finish_vtable_vardecl): Call it.
8739 * class.c (build_vtable_entry_ref): New fn.
8740 (build_vtbl_ref): Call it.
8742 1998-08-28 Mark Mitchell <mark@markmitchell.com>
8744 * cp-tree.h (build_enumerator): Take the enumeration type as a
8746 * decl.c (finish_enum): Don't set the TREE_TYPE for the
8747 enumeration constant values if we're processing_template_decls.
8748 Don't set the type for the CONST_DECLs either; that's done in
8750 (build_enumerator): Take the enumeration type as a
8752 * lex.c (do_identifier): Don't resolve enumeration constants while
8753 processing template declarations, even if they happen to be
8754 TEMPLATE_PARM_INDEXs.
8756 * parse.y (current_enum_type): New variable.
8757 (primary): Don't allow statement-expression in local classes just
8758 as we don't in global classes.
8759 (structsp): Use current_enum_type.
8760 (enum_list): Likewise.
8761 * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
8762 finish_enum; they no longer occur.
8764 * cp-tree.h (finish_base_specifier): New function.
8765 * parse.y (base_class): Use it.
8766 * semantics.c (finish_base_specifier): Define it.
8768 * parse.y (structsp): Warn on use of typename outside of template
8771 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
8773 * lex.c (handle_cp_pragma): Remove #pragma vtable.
8774 * lang-options.h: Remove +e options.
8775 * decl2.c (lang_decode_option): Likewise.
8776 (import_export_vtable): Don't check write_virtuals.
8777 (finish_vtable_vardecl, finish_file): Likewise.
8778 * search.c (dfs_debug_mark): Likewise.
8779 * semantics.c (begin_class_definition): Likewise.
8780 * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
8782 * call.c (build_over_call): Check flag_elide_constructors.
8783 * decl2.c: flag_elide_constructors defaults to 1.
8784 * typeck.c (convert_arguments): Remove return_loc parm.
8785 (build_function_call_real): Adjust.
8787 * search.c: Tear out all mi_matrix and memoize code.
8788 (lookup_field, lookup_fnfields): Use scratch_tree_cons.
8789 * lang-options.h: Remove documentation for -fhandle-exceptions,
8790 -fmemoize-lookups and -fsave-memoized.
8791 * cp-tree.h: Lose mi_matrix and memoize support.
8792 * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
8793 * class.c: Lose struct class_level.
8794 (pushclass, popclass): Lose memoize support.
8795 * init.c (build_offset_ref): Likewise.
8797 Never change BINFO_INHERITANCE_CHAIN.
8798 * init.c (emit_base_init): Change modification of
8799 BINFO_INHERITANCE_CHAIN to an assert.
8800 * search.c (get_base_distance_recursive): Likewise.
8801 (get_base_distance): Likewise.
8802 (lookup_member): Likewise.
8803 (convert_pointer_to_single_level): Likewise.
8804 (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs.
8805 (lookup_fnfields): Likewise.
8806 * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
8807 (unshare_base_binfos): Don't call propagate_binfo_offsets.
8808 (layout_basetypes): Call propagate_binfo_offsets instead of
8809 unshare_base_binfos.
8810 * decl.c (xref_basetypes): Call unshare_base_binfos.
8811 * pt.c (instantiate_class_template): Likewise.
8812 * tree.c (reverse_path): Remove 'copy' parm; always make a
8814 * class.c (build_vbase_path): Just call it.
8815 * search.c (compute_access): Likewise. Don't re-reverse.
8817 1998-08-27 Mark Mitchell <mark@markmitchell.com>
8819 * class.c (build_vbase_path): Use reverse_path.
8820 (finish_base_struct): Move warnings for inaccessible bases to
8822 (modify_one_vtable): Remove check of TREE_USED (binfo).
8823 (fixup_vtable_deltas1): Likewise.
8824 * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
8825 (xref_tag): Remove binfos parameter.
8826 (make_binfo): Remove chain parameter.
8827 (reverse_path): Add copy parameter.
8828 * decl.c (init_decl_processing): Change calls to xref_tag.
8829 (xref_tag): Remove binfos parameter.
8830 (xref_basetypes): Change calls to make_binfo.
8831 * decl2.c (grok_x_components): Change calls to xref_tag.
8832 (handle_class_head): Likewise.
8833 * friend.c (do_friend): Likewise.
8834 * lex.c (make_lang_type): Change calls to make_binfo.
8835 * parse.y (structsp): Change calls to xref_tag.
8836 (named_complex_class_head_sans_basetype): Likewise.
8837 (named_class_head): Likewise.
8838 * rtti.c (init_rtti_processing): Likewise.
8839 * search.c (compute_access): Change calls to reverse_path.
8840 (dfs_get_vbase_types): Change calls to make_binfo.
8841 (get_vbase_types): Remove dead code.
8842 * tree.c (unshare_base_binfos): Change calls to make_binfo.
8843 (layout_basetypes): Warn here about inaccessible bases.
8844 (make_binfo): Remove chain parameter.
8845 (reverse_path): Add copy parameter.
8847 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
8849 * class.c: #if 0 complete_type_p.
8850 * init.c (build_java_class_ref, build_new_1): Remove unused locals.
8851 * method.c (process_overload_item): Likewise.
8852 * typeck.c (comp_target_types): Likewise.
8854 Stop sharing binfos for indirect virtual bases.
8855 * tree.c (propagate_binfo_offsets): Unshare vbases, too.
8856 (layout_basetypes): Likewise.
8857 (unshare_base_binfos): Copy vbases, too.
8858 * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
8859 BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
8860 (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
8861 CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
8862 * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
8863 reference to BINFO_VIA_PUBLIC.
8864 (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
8865 (push_class_decls): Use them.
8866 (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
8867 (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
8869 1998-08-27 Mark Mitchell <mark@markmitchell.com>
8871 * decl.c (build_enumerator): Set DECL_CONTEXT for the
8874 1998-08-26 Mark Mitchell <mark@markmitchell.com>
8876 * cp-tree.h (finish_enum): Change prototype.
8877 * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
8878 VALUES parameter. Don't try to compute mins/maxs if
8879 processing_template_decl.
8880 * parse.y (structsp): Use new calling sequence for finish_enum.
8881 * pt.c (tsubst_enum): Likewise. Take the new type as input.
8882 (lookup_template_class): Remove unused variables. Tweak.
8883 Register enums on instantiation list before substituting
8884 enumeration constants.
8885 (tsubst_decl): Remove unused variables.
8886 (regenerate_decl_from_template): Likewise.
8888 * decl.c (duplicate_decls): Don't obliterate the
8889 DECL_TEMPLATE_INFO for a template if we're not replacing it with
8892 * lex.c (do_identifier): Fix typo in comment.
8894 Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8896 * errfn.c: Remove stdarg.h/varargs.h.
8899 1998-08-25 Brendan Kehoe <brendan@cygnus.com>
8901 * pt.c (tsubst_copy): Only do typename overloading on an
8902 IDENTIFIER_NODE that happens to look like a typename if it actually
8903 has a type for us to use.
8905 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
8907 * typeck.c (comp_cv_target_types): Split out...
8908 (comp_target_types): From here. Don't allow cv-qual changes under
8909 a pointer if nptrs == 0. Fix OFFSET_TYPE handling.
8910 (build_ptrmemfunc): Pass 1 to nptrs.
8911 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
8913 1998-08-25 Mark Mitchell <mark@markmitchell.com>
8915 * search.c (dependent_base_p): Don't compare a binfo to
8916 current_class_type; use the TREE_TYPE of the binfo instead.
8918 * cp-tree.h (CLASS_TYPE_P): Revise definition.
8920 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
8922 * decl.c (duplicate_decls): Don't complain about different
8923 exceptions from an internal decl even if pedantic.
8925 * typeck.c (convert_for_assignment): Converting from pm of vbase
8926 to derived is an error, not a sorry.
8928 * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
8929 * class.c (fixed_type_or_null): Rename from
8930 resolves_to_fixed_type_p. Return the dynamic type of the
8931 expression, if fixed, or null.
8932 (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type
8933 does not match the static type.
8934 (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use
8935 resolves_to_fixed_type_p again.
8937 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8939 * pt.c (tsubst_decl): Move special case code for dealing with
8940 tricky friend templates here from ...
8941 (regenerate_decl_from_template): Here.
8943 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8945 * decl.c (start_decl): Remove redundant linkage check.
8947 1998-08-24 Gavin Romig-Koch <gavin@cygnus.com>
8949 * typeck.c (c_expand_return): Handle the case that valtype
8950 is wider than the functions return type.
8952 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8954 * cp-tree.h (CLASS_TYPE_P): New macro.
8955 * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
8956 * pt.c (process_template_parm): Undo previous change.
8958 1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
8960 * cp-tree.h: Declare.
8961 * pt.c (decl_template_parm_p): New function.
8962 * decl.c (pushdecl): Check decls for redeclaring template parms.
8963 (xref_tag): Make redeclaration an error, print decl.
8964 * decl2.c (grokfield): Check field_decls for redeclaration as well.
8966 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8968 * parse.y (primary): Fix up the type of string constants.
8970 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8972 * typeck.c (convert_for_initialization): Move check for odd uses
8973 of NULL to avoid duplicate warnings.
8975 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8977 * tree.c (lvalue_type): Fix for arrays.
8978 * typeck.c (string_conv_p): New fn.
8979 (convert_for_assignment): Use it.
8980 (build_unary_op): Use lvalue_type.
8981 * call.c (standard_conversion, convert_like): Use string_conv_p.
8982 (add_function_candidate): Use lvalue_type.
8983 * cvt.c (convert_to_reference): Likewise.
8984 * decl2.c (lang_decode_option): Ignore -traditional.
8985 * decl.c (init_decl_processing): flag_writable_strings inhibits
8988 1998-08-24 Andrew MacLeod <amacleod@cygnus.com>
8990 * lang-options.h (lang_options): Add fconst-strings to the list
8992 * decl2.c (lang_f_options, lang_decode_option): Likewise.
8994 1998-08-24 Nathan Sidwell <nathan@acm.org>
8996 * lex.c (real_yylex): Don't warn about long long constants if
8997 we're allowing long long.
8999 1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
9001 * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
9002 accessing bindings directly.
9004 * search.c (my_tree_cons): Reimplement.
9006 * lang-specs.h: Remove __HONOR_STD.
9007 * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
9009 1998-08-23 Mark Mitchell <mark@markmitchell.com>
9011 * decl.c (grokdeclarator): Complain about in-class initialization
9012 of aggregates and/or references.
9013 * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
9014 TEMPLATE_TYPE_PARMs.
9016 * decl2.c (grok_array_decl): Add comment.
9017 (mark_used): Don't instantiate an explicit instantiation.
9018 * friend.c (make_friend_class): Remove bogus comment. Fix check
9019 for partial specializations.
9020 * pt.c (check_explicit_specialization): Don't
9021 SET_DECL_EXPLICIT_INSTANTIATION here.
9022 (mark_decl_instantiated): Or here.
9023 (do_decl_instantiation): Do it here, instead. Add checks for
9024 duplicate explicit instantiations, etc. Tidy.
9025 (do_type_instantiation): Likewise.
9026 (instantiate_decl): Improve comments. Complain about explicit
9027 instantiations where no definition is available.
9029 * cp-tree.h (ansi_null_node): Remove.
9030 * call.c (build_over_call): Warn about converting NULL to an
9032 * cvt.c (build_expr_type_conversion): Likewise. Use
9033 null_ptr_cst_p instead of expanding it inline.
9034 * decl.c (ansi_null_node): Remove.
9035 (init_decl_processing): Make null_node always have integral type.
9036 * except.c (build_throw): Warn about converting NULL to an
9038 * lex.c (init_parse): Remove handling of ansi_null_node.
9039 * pt.c (type_unification_real): Don't convert NULL to void* type.
9040 * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
9041 (convert_for_assignment): Warn about converting NULL to an
9043 (convert_for_initialization): Likewise.
9045 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
9047 * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
9048 * pt.c (coerce_template_parms): Use no_linkage_check.
9049 * decl.c (grokvardecl): Likewise.
9050 (grokfndecl): Likewise. Members of anonymous types have no linkage.
9052 * method.c (process_overload_item): Remove useless code.
9054 1998-08-20 Per Bothner <bothner@cygnus.com>
9056 Handle new'ing of Java classes.
9057 * init.c (build_class_classref): New function.
9058 (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject;
9059 constructor does not return this; don't need to exception-protect.
9061 * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag.
9062 * decl2.c (acceptable_java_type): Handle template-derived types.
9064 1998-08-20 Per Bothner <bothner@cygnus.com>
9066 * decl2.c (import_export_vtable): Suppress vtables for Java classes.
9068 1998-08-20 Mark Mitchell <mark@markmitchell.com>
9070 * decl.c (duplicate_decls): Always merge the old and new patterns
9071 for templates, regardless of whether or not the new one has
9072 DECL_INITIAL. Don't throw away specializations. Merge
9074 * pt.c (tsubst_decl): Use the right pattern when calculating the
9075 complete args for a new template instance.
9076 (do_decl_instantiation): Fix typo in comment.
9077 (regenerate_decl_from_template): Deal with tricky friend template
9079 (instantiate_decl): Likewise.
9081 Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com)
9083 * init.c (build_builtin_delete_call): Add missing assemble_external
9086 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
9088 * parse.y (notype_unqualified_id): Also accept ~A<int>.
9090 1998-08-19 Mark Mitchell <mark@markmitchell.com>
9092 * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
9094 * except.c (build_throw): Warn when NULL is thrown, even with
9095 -ansi. Use ansi_null_node, rather than integer_zero_node, in the
9098 * cp-tree.h (ansi_null_node): New variable.
9099 * decl.c (ansi_null_node): New variable.
9100 (init_decl_processing): Initialize its type.
9101 * lex.c (init_parse): Initialize its value. Use ansi_null_node
9102 for null_node in non-ANSI mode.
9103 * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
9104 place of null_node to avoid spurious errors.
9106 1998-08-17 Mark Mitchell <mark@markmitchell.com>
9108 * cp-tree.h (enter_scope_of): New function.
9109 * parse.y (complex_direct_notype_declarator): Use it.
9110 * semantics.c (enter_scope_of): New function.
9112 1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
9114 * decl.c (grokparms): No, here.
9116 * decl.c (grokdeclarator): Catch parm with pointer to array of
9117 unknown bound here...
9118 * method.c (process_overload_item): ...not here.
9120 * gxxint.texi: Remove obsolete documentation of overloading code.
9122 * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
9123 * class.c (finish_struct_bits): Likewise.
9125 * tree.c (lvalue_type): Fix for arrays.
9126 * typeck.c (build_unary_op): Use lvalue_type.
9127 * call.c (add_function_candidate): Likewise.
9128 * cvt.c (convert_to_reference): Likewise.
9130 * decl2.c (lang_decode_option): Ignore -traditional.
9132 * init.c (build_offset_ref): Don't mess with error_mark_node.
9133 * lex.c (do_scoped_id): Use cp_error.
9135 * rtti.c (get_tinfo_fn): Don't mess with the context for now.
9137 1998-08-17 Benjamin Kosnik <bkoz@loony.cygnus.com>
9139 * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
9141 Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com)
9143 * cp-tree.h (set_identifier_local_value): Provide prototype.
9145 * decl2.c (do_namespace_alias): Remove unused variables `binding'
9148 Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com>
9150 * Makefile.in: Rename BBISON to BISON so that it can be properly
9151 inherited from the parent makefile.
9153 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
9155 * lang-options.h: Add -finit-priority.
9156 * decl2.c: Likewise. Check flag_init_priority instead of
9159 * decl2.c (setup_initp): New fn.
9160 (start_objects, finish_objects, do_ctors): Handle init_priority.
9161 (do_dtors, finish_file): Likewise.
9163 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
9165 * pt.c (tsubst_copy): Hush warning.
9167 * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
9169 1998-08-12 Mark Mitchell <mark@markmitchell.com>
9171 * pt.c (print_template_context): Don't abort when instantiating a
9174 * decl.c (grokdeclarator): Issue errors on namespace qualified
9175 declarators in parameter lists or in class scope.
9177 1998-08-09 Mark Mitchell <mark@markmitchell.com>
9179 * pt.c (check_explicit_specialization): Don't abort on bogus
9180 explicit instantiations.
9182 1998-08-07 Mark Mitchell <mark@markmitchell.com>
9184 * typeck.c (require_complete_type): Use complete_type_or_else.
9185 (complete_type_or_else): Always return NULL_TREE on failure, as
9188 * pt.c (tsubst_aggr_type): Prototype.
9189 (tsubst_decl): New function, split out from tsubst. Set
9190 input_filename and lineno as appropriate.
9191 (pop_tinst_level): Restore the file and line number saved in
9193 (instantiate_class_template): Set input_filename and lineno as
9195 (tsubst): Move _DECL processing to tsubst_decl. Make sure the
9196 context for a TYPENAME_TYPE is complete.
9198 * decl2.c (grokbitfield): Issue errors on bitfields declared with
9200 (do_dtors): As in do_ctors, pretend to be a member of the same
9201 class as a static data member while generating a call to its
9204 * cvt.c (cp_convert_to_pointer): Handle NULL pointer
9205 conversions, even in complex virtual base class hierarchies.
9207 1998-08-06 Mark Mitchell <mark@markmitchell.com>
9209 * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
9210 (TYPE_TEMPLATE_INFO): Likewise.
9211 (SET_TYPE_TEMPLATE_INFO): Likewise.
9212 (ENUM_TI_TEMPLATE): Likewise.
9213 (ENUM_TI_ARGS): Likewise.
9214 (lookup_nested_type_by_name): Remove.
9215 * decl.c (maybe_process_template_type_declaration): Handle enums.
9216 (start_enum): Don't check for primary-template enum declarations
9218 (finish_enum): Clean up, document. Make sure template enum
9219 constants get the correct type.
9220 (build_enumerator): Copy initializers for template enumerations,
9222 (grok_enum_decls): Document.
9223 * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
9224 better. Build LOOKUP_EXPRs for local variables, even if they are
9226 * pt.c (tsubst_enum): Remove field_chain parameter.
9227 (template_class_depth): Include the depth of surrounding function
9229 (push_template_decl): Check for primary-template enum declarations
9230 here. Deal with enumeration templates.
9231 (lookup_template_class): Likewise.
9232 (for_each_template_parm): Likewise.
9233 (instantiate_class_template): Don't call tsubst_enum directly,
9234 call tsubst instead, to instantiate enums. Deal with all
9235 field_chain issues here, not in tsubst_enum.
9236 (lookup_nested_type_by_name): Remove.
9237 (tsubst_aggr_type): Revise handling of enumeration types.
9239 (tsubst_copy): Likewise.
9240 (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
9242 1998-08-04 Mark Mitchell <mark@markmitchell.com>
9244 * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
9245 uses template parameters.
9246 * method.c (build_template_parm_names): Use the full set of
9247 template arguments for tsubst'ing.
9248 (build_overload_identifier): Pass the full set of template
9249 arguments to build_template_parm_names, not just the
9251 * pt.c (TMPL_ARGS_DEPTH): Define using
9252 TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
9253 (NUM_TMPL_ARGS): New macro.
9254 (add_outermost_template_args): Deal with the case where the outer
9255 args will be completely discarded.
9256 (coerce_template_parms): Use the full set of template arguments
9257 for tsubst'ing. Simplify. Add some asserts. Improve
9259 (lookup_template_class): Pass the full set of template arguments
9260 to coerce_template_parms.
9261 (tsubst): Add assertion.
9262 (do_type_instantiation): Don't instantiate member template
9265 * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
9266 name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
9268 1998-08-03 Jason Merrill <jason@yorick.cygnus.com>
9270 * method.c (set_mangled_name_for_decl): Change return type to void.
9272 * decl.c (lookup_name_real): A namespace-level decl takes priority
9273 over implicit typename. Avoid doing the same lookup twice.
9275 * search.c (dependent_base_p): New fn.
9276 (dfs_pushdecls, dfs_compress_decls): Use it.
9278 * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
9279 virtual functions if the type doesn't have any.
9281 1998-08-03 Mark Mitchell <mark@markmitchell.com>
9283 * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
9284 uses template parameters.
9286 1998-08-02 Mark Mitchell <mark@markmitchell.com>
9288 * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument.
9289 * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
9290 * lex.c (do_identifier): Don't use a second argument, or a type,
9291 when building LOOKUP_EXPRs.
9292 (do_identifier): Likewise.
9293 (do_scoped_id): Likewise.
9294 * method.c (hack_identifier): Improve error message.
9295 * pt.c (lookup_template_function): Don't needlessly call
9296 copy_to_permanent or build_min.
9297 (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if
9299 (do_decl_instantiation): Improve error message.
9300 * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
9301 (build_min): Copy the type to the permanent obstack, too.
9303 1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
9305 * init.c (init_init_processing): Remove BI* handling.
9306 (build_builtin_call): Remove.
9307 (build_builtin_delete_call): New fn.
9308 (build_delete): Use it.
9310 1998-07-31 Mark Mitchell <mark@markmitchell.com>
9312 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
9313 (maybe_check_template_type): New function.
9314 * decl.c (maybe_process_template_type_declaration): New function,
9315 split out from pushtag Call maybe_check_template_type.
9316 (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P.
9317 (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9318 * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9319 * pt.c (template_class_depth_real): Generalization of ...
9320 (template_class_depth): Use it.
9321 (register_specialization): Use duplicate_decls for duplicate
9322 declarations of specializations.
9323 (maybe_check_template_type): New function.
9324 (push_template_decl_real): Fix comment.
9325 (convert_nontype_argument): Likewise.
9326 (lookup_template_class): Likewise. Avoid an infinite loop on
9328 (tsubst_friend_function): Fix comment.
9329 (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
9331 * semantics.c (begin_function_definition): Use
9332 reset_specialization to note that template headers don't apply
9333 directly to declarations after the opening curly for a function.
9335 1998-07-29 Jason Merrill <jason@yorick.cygnus.com>
9337 * decl.c (push_overloaded_decl): Use current_namespace instead of
9338 DECL_CONTEXT (decl) to determine where we go.
9340 * decl.c (lookup_name_real): Fix typo.
9342 1998-07-28 Mark Mitchell <mark@markmitchell.com>
9344 * friend.c (is_friend): Be lenient with member functions to deal
9345 with nested friends.
9347 1998-07-28 Jason Merrill <jason@yorick.cygnus.com>
9349 * class.c (finish_struct_1): Convert integer_zero_node to
9350 ssizetype before passing it to set_rtti_entry.
9351 * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
9352 of any size to a pointer.
9354 1998-07-27 Mark Mitchell <mark@markmitchell.com>
9356 * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
9357 (build_template_decl_overload): Remove.
9358 (set_mangled_name_for_decl): New function.
9359 (innermost_args): Remove is_spec parameter.
9360 (most_specialized, most_specialized_class): Remove declarations.
9361 (lookup_template_class): Add entering_scope parameter.
9362 (maybe_process_partial_specialization): New function.
9363 (finish_template_decl): Likewise.
9364 (finish_template_type): Likewise.
9365 * class.c (finish_struct): Clean up processing of member template
9367 * decl.c (pushtag): Fix formatting.
9368 (lookup_tag): Improve handling of pseudo-global levels.
9369 (make_typename_type): Adjust call to lookup_template_class.
9370 (shadow_tag): Use maybe_process_partial_specialization.
9371 (xref_tag): Improve handling of member friends.
9372 (start_function): Call push_nested_class before
9373 push_template_decl. Don't call push_template_decl for
9375 * decl2.c (grok_x_components): Don't call xref_tag for
9376 template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
9377 (grokclassfn): Use set_mangled_name_for_decl.
9378 (arg_assoc_class): Adjust call to innermost_args.
9379 (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
9380 * error.c (dump_function_name): Improve printing of template
9382 * friend.c (is_friend): Don't compare types of decls to determine
9383 friendship, unless flag_guiding_decls.
9384 (make_friend_class): Partial specializations cannot be friends.
9385 (do_friend): Use set_mangled_name_for_decl. Call
9386 push_template_decl_real instead of push_template_decl.
9387 * method.c (build_decl_overload_real): Remove prototype. Give it
9389 (build_overload_identififer): Adjust call to innermost_args.
9390 (build_template_decl_overload): Remove.
9391 (set_mangled_name_for_decl): New function.
9392 * parse.y (.finish_template_type): New non-terminal.
9393 (template_def): Use finish_template_decl. Use template_extdef
9395 (template_extdef, template_datadef): New non-terminals, containing
9396 only those rules for things which can be templates.
9398 (template_type, self_template_type): Use .finish_template_type.
9399 (named_class_head): Use maybe_process_partial_specialization.
9400 * pt.c (mangle_class_name_for_template): Remove context parameter.
9401 (get_class_bindings): Remove outer_args parameter.
9402 (complete_template_args): Remove.
9403 (add_outermost_template_args): New function.
9404 (register_specialization): Return the specialization.
9405 (unregister_specialization): New function.
9406 (tsubst_template_parms): Likewise.
9407 (most_specialized, most_specialized_class): Prototype here as
9409 (original_template): Rename to most_general_template.
9410 (tsubst_template_parms): New function.
9411 (set_mangled_name_for_template_decl): Likewise.
9412 (TMPL_ARGS_DEPTH): New macro.
9413 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
9414 (TMPL_ARGS_LEVEL): New macro.
9415 (SET_TMPL_ARGS_LEVEL): Likewise.
9416 (TMPL_ARG): Likewise.
9417 (SET_TMPL_ARG): Likewise.
9418 (TMPL_ARGS_DEPTH): Likewise.
9419 (finish_member_template_decl): Use finish_template_decl.
9420 (maybe_process_partial_specialization): New function, split out
9422 (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
9423 (maybe_begin_member_template_processing): Use new macros.
9424 (is_member_template): Likewise.
9425 (is_member_template_class): Likewise.
9426 (add_to_template_args): Likewise. Deal with multiple levels of
9428 (maybe_process_partial_specialization): New function.
9429 (retrieve_specialization): Add consistency check.
9430 (determine_specialization): Return full argument list.
9431 (check_explicit_specialization): Tweak friend handling. Use full
9432 argument lists. Simplify.
9433 (current_template_args): Use new macros.
9434 (push_template_decl_real): Change ill-named mainargs to specargs.
9435 Check that a partial specialization actually specializes at least
9436 one parameter. Improve friend handling. Modify for full
9438 (classtype_mangled_name): Don't mangle the names of
9440 (lookup_template_class): Add entering_scope parameter. Use it to
9441 avoid finding a template type when an instantiation is required.
9442 Simplify. Use full template arguments.
9443 (tsubst_friend_function): Use unregister_specialization. Use new
9444 macros. Use full template arguments.
9445 (tsubst_friend_class): Substitute, using tsubst_template_parms,
9446 into the template parameters before passing them to
9447 redeclare_class_template.
9448 (instantiate_class_template): Simplify. Use full template
9449 arguments. Adjust calls to get_class_bindings. Use
9450 SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
9451 (innermost_args): Use new macros.
9452 (tsubst_aggr_type): New function, split out from tsubst.
9453 (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
9454 conventions for lookup_template_class. Refine handling of partial
9455 instantiations. Remove calls to complete_template_args.
9456 Simplify. Add consistency checks. Use set_mangled_name_for_decl
9457 and set_mangled_name_for_template_decl.
9458 (tsubst_copy): Use tsubst_aggr_type.
9459 (instantiate_template): Use full template arguments.
9460 (more_specialized): Improve formatting.
9461 (more_specialized_class): Adjust calls to get_class_bindings.
9462 (get_bindings_real): Don't call complete_template_args.
9463 (most_specialized): Don't overwrite input; create a new list.
9464 (most_specialized_class): Use most_general_template.
9465 (regenerate_decl_from_template): Use unregister_specialization.
9466 Use full template arguments.
9467 (instantiate_decl): Use full template arguments.
9468 (set_mangled_name_for_template_decl): New function.
9469 * semantics.c (begin_class_definition): Use
9470 maybe_process_partial_specialization.
9471 (finish_member_class_template): New function.
9472 (finish_template_decl): Likewise.
9473 (finish_template_type): Likewise.
9474 (typeck.c): Don't crash after issuing a compiler_error.
9475 * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
9477 1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
9479 * typeck2.c (build_functional_cast): Handle default-initialization.
9481 * call.c (build_over_call): Pass 1 to popclass.
9483 * parse.y (direct_notype_declarator): Add precedence declaration
9484 to notype_unqualified_id case.
9485 * Makefile.in (EXPECT): Adjust.
9487 * tree.c (ovl_member): Fix for single function in OVL.
9489 1998-07-27 Dave Brolley <brolley@cygnus.com>
9491 * c-lex.c (yylex): Fix boundary conditions in character literal and
9492 string literal loops.
9494 1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
9496 * decl.c (lookup_name_real): OK, do return the from_obj value
9497 unless got_object depends on template parms.
9499 * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
9501 * pt.c (coerce_template_parms): Also complain about local enums.
9503 * cp-tree.h: Add prototype for set_identifier_local_value.
9504 * decl.c (set_identifier_local_value_with_scope): Make static,
9506 * search.c (covariant_return_p): Likewise.
9507 * except.c (build_terminate_handler, alloc_eh_object): Likewise.
9509 * call.c (build_method_call): Only pull out the type of a destructor
9510 if it's a template type parm.
9511 * decl.c (lookup_name_real): Never return the from_obj value.
9513 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
9515 * except.c (process_start_catch_block_old): Call start_decl_1 for
9517 * decl.c (start_decl_1): Avoid duplicate error.
9519 * init.c (expand_default_init): Only perform the initialization if
9520 it will do something.
9522 1998-07-23 H.J. Lu (hjl@gnu.org)
9524 * parse.y (base_class): Check for invalid base class.
9526 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
9528 * decl2.c (import_export_template): Fold in...
9529 (import_export_class): ...to here. Handle dllimport/export.
9531 * class.c (build_vtable): Pass at_eof to import_export_vtable.
9532 (prepare_fresh_vtable): Likewise.
9533 * decl2.c (import_export_class): Split out...
9534 (finish_prevtable_vardecl): From here.
9535 * class.c (finish_struct_1): Call import_export_class if at_eof.
9537 * decl.c (start_function): #if 0 mysterious code I wrote and have
9539 * rtti.c (get_tinfo_fn): If this is for a class type, set
9542 1998-07-22 Jason Merrill <jason@yorick.cygnus.com>
9544 * inc/exception: Change terminate and unexpected to ().
9546 * parse.y (named_class_head_sans_basetype_defn): A
9547 named_class_head_sans_basetype followed by '{' or ':' is a defn.
9549 1998-07-21 Jason Merrill <jason@yorick.cygnus.com>
9551 * tree.c (canonical_type_variant): New fn to handle arrays.
9552 * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
9553 * pt.c (unify, default case): Also fold arg. Fix array bounds case.
9554 * method.c (process_overload_item): Use build_overload_value for
9557 1998-07-20 Dave Brolley <brolley@cygnus.com>
9559 * lex.c (mbchar.h): #include it.
9560 (GET_ENVIRONMENT): New macro.
9561 (init_parse): Set character set based on LANG environment variable.
9562 (real_yylex): Handle multibyte characters in character literals.
9563 (real_yylex): Handle multibyte characters in string literals.
9565 1998-07-19 Jason Merrill <jason@yorick.cygnus.com>
9567 * lex.c (do_identifier): Look for class value even if we don't
9568 have a global value. Do implicit declaration if parsing is 2.
9569 * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
9572 1998-07-19 Mark Mitchell <mark@markmitchell.com>
9574 * decl.c (pushtag): Revert previous change.
9575 * pt.c (lookup_template_class): Don't put out debugging
9576 information for types that use template parameters.
9578 * decl.c (pushtag): Don't put out debugging information for
9579 compiler-generated typedefs.
9581 * error.c (dump_type_real): Don't crash when presented with
9582 intQI_type_node or the like.
9584 * semantics.c (finish_translation_unit): Fix spelling error in
9587 1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
9589 * decl.c (lookup_name_real): Pull out single function here.
9590 (select_decl): Not here.
9591 (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
9593 * decl.c (qualify_lookup): Tweak again.
9595 * pt.c (lookup_template_class): Don't mess with the context of the
9597 * decl2.c (current_decl_namespace): Remove special handling for
9600 * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
9601 a member template specialization.
9603 * tree.c (ovl_member): Use decls_match to compare functions.
9604 * decl.c (decls_match): Check the context of a function.
9606 * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
9607 in Koenig lookup support rules.
9608 * semantics.c (finish_call_expr): Handle the new cases.
9610 * typeck.c (build_x_function_call): Handle overloaded methods.
9612 * decl.c (grokvardecl): Don't call build_static_name for extern "C".
9614 1998-07-16 Mark Mitchell <mark@markmitchell.com>
9616 * semantics.c (finish_object_call_expr): Revert previous change.
9617 * call.c (build_new_method_call): Likewise. Instead, convert
9618 TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
9620 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
9622 * decl.c (qualify_lookup): Handle templates.
9624 * decl2.c (do_using_directive): Don't pass ancestor.
9625 * decl.c (push_using_directive): Calculate ancestor.
9627 * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
9628 * decl.c (pushdecl): Move type shadowing handling from here...
9629 (duplicate_decls): ...to here.
9630 * decl.c (set_identifier_local_value_with_scope): New fn.
9632 (set_identifier_local_value, lookup_type_current_level): New fns.
9633 * decl2.c (do_local_using_decl): Handle types and binding level
9636 * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
9637 * decl.c (select_decl): Extract a lone function from an OVERLOAD.
9638 (lookup_namespace_name): Likewise.
9639 * typeck.c (build_unary_op): Not here anymore.
9641 * decl2.c (do_class_using_decl): Make sure we get an identifier.
9642 * class.c (handle_using_decl): Ignore TYPE_DECLs.
9644 * decl.c (qualify_lookup): New fn.
9645 (lookup_name_real): Use it.
9647 1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de>
9649 * decl2.c (add_using_namespace): When directly using a namespace
9650 that was indirect before, promote it.
9652 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
9653 LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
9654 LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
9655 * decl.c (select_decl): Replace two flag parameters by one.
9656 (unqualified_namespace_lookup): Likewise, pass flag.
9657 (lookup_flags): New function.
9658 (lookup_name_real): Compute flags, pass them.
9659 (lookup_namespace_name): Call with zero-flag.
9660 * decl2.c (ambiguous_decl): Add flag parameter, complain only
9662 (lookup_using_namespace, qualified_lookup_using_namespace):
9663 Add flag parameter, pass them through.
9664 * lex.c (do_scoped_id): Call with zero-flag.
9666 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
9668 * typeck.c (convert_for_assignment): Use comptypes.
9670 1998-07-16 Mark Mitchell <mark@markmitchell.com>
9672 * semantics.c (finish_object_call_expr): Move test for the
9673 function called being a TYPE_DECL to ...
9674 * call.c (build_new_method_call): Here.
9676 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
9678 * decl2.c (arg_assoc_class): Also look at template arguments, if any.
9679 (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
9681 * lex.c (looking_for_typename): Don't initialize.
9683 * decl2.c (ambiguous_decl): Clarify error message.
9685 * decl.c (push_using_directive): Iterate over namespaces used
9688 1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de>
9690 * decl2.c (add_using_namespace): Iterate over namespaces used
9693 * decl.c (lookup_name_real): Accept namespace aliases as locals.
9694 (cat_namespace_levels): Ignore aliases.
9695 (duplicate_decls): Ignore duplicate aliases.
9696 * decl2.c (do_namespace_alias): Process block level namespace
9697 aliases. Store alias with pushdecl. Remove odr errors.
9698 * parse.y (namespace_alias): New non-terminal.
9701 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
9703 * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
9704 Handle TEMPLATE_TYPE_PARM.
9705 (arg_assoc): Rewrite.
9707 * pt.c (complete_template_args): Don't look at the context unless
9710 * method.c (build_decl_overload_real): Fix namespace handling.
9712 * typeck.c (build_unary_op): Extract a lone function from an
9715 * call.c (build_scoped_method_call): Handle getting a namespace
9716 for basetype in a destructor call.
9717 (check_dtor_name): Handle enums.
9719 * parse.y (using_directive): New nonterminal.
9720 (extdef, simple_stmt): Use it.
9722 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
9724 * decl2.c (add_function): Move error message ...
9725 (arg_assoc_namespace): ... from here.
9727 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
9729 * parse.y (namespace_qualifier): Fix multiple level handling.
9730 * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
9731 (arg_assoc): Don't skip the first argument of a function.
9733 Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com)
9735 * search.c (my_tree_cons): Clean up.
9737 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
9739 * call.c (joust): Don't warn about "confusing" conversions to the
9742 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
9744 * class.c (push_nested_class): Complain about namespaces.
9745 * decl.c (start_decl): Enter the object's namespace.
9746 (cp_finish_decl): Leave it.
9747 (grokdeclarator): Likewise.
9748 * decl2.c (check_decl_namespace): New function.
9749 (finish_file): Call it.
9750 * parse.y (complex_direct_notype_declarator): Set complexity
9751 of namespace-qualified ids to -1, enter the namespace.
9753 * method.c (build_template_decl_overload): Expect _DECL as first
9754 parameter. Put context temporarily into current_namespace.
9755 * pt.c (check_explicit_specialization): Change caller.
9758 * init.c (build_offset_ref): Call mark_used and
9759 convert_from_reference for namespace members.
9761 Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
9763 * search.c (my_tree_cons): The bitfield is at index 2.
9765 Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com>
9767 * lang-options.h: Format changed to work with new --help support
9770 1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
9772 * decl2.c (build_expr_from_tree): Change calls of do_identifier.
9773 Do Koenig lookup in CALL_EXPR.
9774 (arg_assoc): Handle error_mark.
9775 * lex.c (is_global): New function.
9776 (do_identifier): Expect arguments for Koenig lookup.
9777 * parse.y (primary): Add rules for calls of unqualified function calls.
9778 (do_id): Change call of do_identifier.
9779 * pt.c (finish_stmt_expr): Likewise.
9780 * semantics.c (finish_id_expr): Likewise.
9781 (finish_call_expr): Add integer parameter to indicate
9782 argument-dependent lookup.
9784 * decl.c (struct binding_level): New field using_directives.
9785 (push_using_decl): Not sorry anymore.
9786 (push_using_directive): New function.
9787 (lookup_tag): Use CP_DECL_CONTEXT to iterate.
9788 (unqualified_namespace_lookup): New function, code from ...
9789 (lookup_name_real): ... here.
9790 * decl2.c (lookup_using_namespace): Pass using list instead of
9792 (validate_nonmember_using_decl): New function.
9793 (do_nonmember_using_decl): New function.
9794 (do_toplevel_using_decl): Use them.
9795 (do_local_using_decl): New function.
9796 (do_using_directive): Support block-level directives.
9797 * parse.y (simple_stmt): Support using declarations and
9799 (namespace_qualifier, namespace_using_decl): New non-terminals.
9801 * xref.c (classname): New function.
9802 (GNU_xref_hier): Change class and base parameters to tree.
9803 * decl.c (xref_baseypes): Change caller.
9804 * friend.c (make_friend_class): Likewise.
9806 1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
9808 * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
9811 * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
9812 template template parameter, record its use.
9813 (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
9814 its template arguments if exists.
9816 * pt.c (coerce_template_template_parms): New function equivalent
9817 to coerce_template_parms when IS_TMPL_PARM is true.
9818 (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter,
9819 all callers changed.
9821 (coerce_template_parms): Access ARGLIST properly when creating a
9822 new vector. Only accept implicit TYPE_DECL as valid argument for
9823 a template template parameter when it is a base class of
9824 current_class_type. Don't display error message when COMPLAIN is
9827 1998-07-12 Klaus Kaempf (kkaempf@progis.de)
9829 * repo.c (get_base_filename): Use file_name_nondirectory.
9830 (open_repo_file): Likewise.
9831 * cp-tree.h (file_name_nondirectory): Add prototype.
9833 1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
9835 * friend.c (do_friend): Pull the identifier out of declarator.
9836 Use cp_error and friends.
9837 * decl2.c (qualified_lookup_using_namespace): Fix call to
9839 * decl.c (lookup_name_real): Don't call complete_type on a namespace.
9840 (grokvardecl): Use DECL_CLASS_SCOPE_P.
9841 * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
9842 * class.c (warn_hidden): Fix for OVERLOAD.
9843 From grahams@rcp.co.uk:
9844 * cp-tree.h (DEFARG_NODE_CHECK): New macro.
9845 (DEFARG_LENGTH, DEFARG_POINTER): Use it.
9847 Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com)
9849 * g++.1 (-traditional): Remove duplicated documentation.
9851 1998-07-11 Mark Mitchell <mark@markmitchell.com>
9853 * method.c (flush_repeats): Add nrepeats parameter.
9854 (issue_nrepeats): Likewise.
9855 (is_back_referenceable_type): New function. Don't back-reference
9856 TEMPLATE_TYPE_PARMs as well as simple types like integers.
9857 (build_mangled_name_for_type): Likewise.
9858 (build_mangled_name_for_type_with_Gcode): Likewise.
9860 (nrepeats): Likewise.
9861 (Nrepeats): Likewise.
9862 (start_squangling): Don't clear the variables removed above.
9863 (end_squangling): Likewise.
9864 (flush_repeats): Tidy. Use nrepeats parameter rather than
9866 (issue_nrepeats): Likewise, but with nrepeats global. Use
9867 is_backreferenceable_type.
9868 (build_overload_nested_name): Tidy. Add comment. Use
9869 build_mangled_name_for_type.
9870 (build_underscore_int): Comment.
9871 (build_overload_scope_ref): Use build_mangled_name_for_type.
9872 (build_overload_int): Likewise.
9873 (build_template_template_parm_names): Tidy.
9874 (build_template_parm_names): Use build_mangled_name_for_type.
9875 (build_overload_identifier): Add comments.
9876 (build_mangled_name_for_type_with_Gcode): Split out from
9878 (build_mangled_name_for_type): Use it.
9879 (build_mangled_name): Rework to use build_mangled_name_for_type
9880 and to not use global nrepeats/Nrepeats. Tidy.
9881 (process_modifiers): Tidy.
9882 (check_btype): Use is_backreferenceable_type. Add comment.
9883 Rename `node' to `type'.
9884 (process_overload_item): Set numeric_output_need_bar here.
9885 Use build_mangled_name_for_type. Tidy.
9886 (build_decl_overload_real): Tidy. Don't use Nrepeats. Use
9887 build_mangled_name_for_type.
9889 * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
9892 1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com>
9894 * cp-tree.h (warn_long_long): Define.
9895 * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
9896 warning "ANSI C++ does not support `long long'".
9897 * decl2.c (warn_long_long): Define.
9898 (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
9900 1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
9902 * decl.c (xref_tag): Handle attributes between 'class' and name.
9903 * parse.y (aggr): Likewise.
9904 * semantics.c (finish_class_definition): Likewise.
9905 * Makefile.in (EXPECTED): Adjust.
9907 * cp-tree.h: Declare flag_optional_diags and warn_multichar.
9908 * decl2.c: Define them.
9909 (lang_decode_option): Handle them.
9910 * lang-options.h: Add -foptional-diags.
9911 * class.c (finish_struct): Don't complain about multiple meanings of
9912 name if -fno-optional-diags.
9913 * decl.c (pushdecl_class_level): Likewise.
9914 * lex.c (real_yylex): Check warn_multichar.
9916 1998-07-06 Jason Merrill <jason@yorick.cygnus.com>
9918 * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
9920 * tree.c (make_binfo): Fix length.
9922 1998-06-30 Benjamin Kosnik <bkoz@bliss.nabi.net>
9924 * decl2.c (lang_decode_option): Remove warn_template_debugging.
9925 * lang-options.h: Likewise.
9927 Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9929 * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
9930 (process_start_catch_block): Likewise for variables
9931 `false_label_rtx', `call_rtx' and `return_value_rtx'.
9933 1998-06-29 Brendan Kehoe <brendan@cygnus.com>
9935 * tree.c (build_srcloc): Make sure we allocate this node on the
9938 Sat Jun 27 23:34:18 1998 Fred Fish <fnf@ninemoons.com>
9940 * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
9941 (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
9942 (lang_specific_driver): Only add -lm automatically if need_math is
9945 Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com)
9947 * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o
9949 Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9951 * Makefile.in (EXPR_H): New dependency variable.
9952 (decl2.o): Depend on $(EXPR_H).
9953 (typeck.o): Likewise.
9957 1998-06-25 Benjamin Kosnik <bkoz@lisa.cygnus.com>
9959 * decl.c (start_enum): Put local enums on permanent_obstack.
9961 1998-06-25 Mark Mitchell <mark@markmitchell.com>
9963 * cp-tree.h (c_get_alias_set): Declare.
9964 * decl.c (init_decl_processing): Set lang_get_alias_set.
9966 1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
9968 * cp-tree.h (mark_all_runtime_matches): Add function prototype.
9969 * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
9970 flag for all function decls which are in the exception table.
9971 * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
9972 * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
9973 code is emitted for any referenced rtti function.
9975 1998-06-25 Dave Brolley <brolley@cygnus.com>
9977 * lang-specs.h: Use new | syntax to eliminate
9978 string concatenation.
9980 1998-06-25 Jason Merrill <jason@yorick.cygnus.com>
9982 * cp-tree.h (CP_DECL_CONTEXT): New macro.
9983 * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
9984 * method.c (build_overload_nested_name): Likewise.
9985 * sig.c (build_signature_pointer_or_reference_type): Don't set
9988 1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
9990 Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
9991 * cp-tree.h (FROB_CONTEXT): New macro.
9992 (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
9993 * decl.c (namespace_binding): Replace NULL_TREE with
9995 (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
9996 * decl2.c (is_namespace_ancestor, lookup_using_namespace):
9998 * decl.c (pushtag): Use FROB_CONTEXT.
9999 (pushdecl, make_typename_type, define_function, grokdeclarator):
10001 * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
10002 * pt.c (push_template_decl_real, lookup_template_class, tsubst):
10004 * decl2.c (decl_namespace): Return global_namespace if no context.
10005 * method.c (build_overload_nested_name): Expect null as context.
10006 * pt.c (mangle_class_name_for_template): Do nothing for null
10008 (lookup_template_class): Allow for null id_context.
10010 1998-06-25 Richard Henderson <rth@cygnus.com>
10012 * method.c (emit_thunk): Set current_function_is_thunk for the
10013 ASM_OUTPUT_MI_THUNK case as well.
10015 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
10017 * exception.cc (__cplus_type_matcher): Get a match_info pointer
10018 instead of an exception table entry as a parameter.
10020 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
10022 * parse.y (function_try_block): Don't call start_catch_handler.
10023 * except.c (call_eh_info): Remove coerced field from declaration.
10024 (build_eh_type_type_ref): New function to create an address of a
10025 rtti function for the new style exception tables.
10026 (expand_start_catch_block): Split function, this contains the
10028 (process_start_catch_block_old): New function to perform the rest
10029 of expand_start_catch_block under old style exceptions.
10030 (process_start_catch_block_old): New function to perform the rest
10031 of expand_start_catch_block under new style exceptions.
10032 (expand_end_catch_block): Only pop the false label off the stack under
10033 the old style of exceptions.
10034 * semantics.c (finish_try_block): Don't call start_catch_handler.
10035 * exception.cc (struct cp_eh_info): Add original_value field.
10036 (__cplus_type_matcher): Perform type matching on the original exception
10037 value, and if we have a match, set the current value.
10038 (__cp_push_exception): Set the original exception value.
10040 1998-06-23 Jason Merrill <jason@yorick.cygnus.com>
10042 * call.c (joust): Fix confusing conversion warning.
10044 * call.c (build_op_delete_call): Add placement parm. Check
10045 LOOKUP_SPECULATIVELY.
10046 * cp-tree.h, decl2.c, init.c: Adjust.
10047 * decl.c (finish_function): Use it.
10049 * pt.c (tsubst): Diagnose creating void fields or variables.
10051 Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10053 * call.c (build_scoped_method_call): Remove unused variable `tmp'.
10055 * cp-tree.h (check_dtor_name): Add prototype.
10057 * init.c (expand_member_init): Remove unused variables
10058 `ptr_type_node', `parm' and `rval'.
10060 * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
10061 in call to fprintf.
10062 (lang_print_xnode): Likewise.
10064 * typeck2.c (enum_name_string): Cast argument to sprintf to long
10065 and use %ld specifier.
10067 * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
10068 specifier in call to fprintf.
10069 (GNU_xref_member): Cast argument to sprintf to int.
10071 Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
10073 * typeck2.c (pop_init_level): Warn about implicit zero initialization
10076 Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10078 * cp-tree.h: Prototype function `check_java_method'.
10080 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10082 * class.c (finish_struct): Make conflicting use of id a pedwarn.
10083 * decl.c (pushdecl_class_level): Likewise.
10085 1998-06-17 Mark Mitchell <mark@markmitchell.com>
10087 * pt.c (convert_nontype_argument): Issue an error when presented
10088 with an integer (real) constant that cannot be simplified to an
10089 INT_CST (REAL_CST).
10091 * cp-tree.h (c_get_alias_set): Remove declaration added in
10092 1998-06-13 change that should never have been checked in.
10094 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10096 * typeck.c (build_binary_op_nodefault): Change % in format strings
10099 * decl.c (grokvardecl): Don't build_static_name for decls that
10100 aren't at namespace scope.
10102 * init.c (perform_member_init): Catch default-initialization of
10105 1998-06-17 Mark Mitchell <mark@markmitchell.com>
10107 * errfn.c (cp_thing): Handle the `%%' formatting sequence.
10109 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
10111 * method.c (hack_identifier): Complain about getting a namespace
10113 * typeck.c (decay_conversion): Remove check for namespaces.
10114 * typeck2.c (incomplete_type_error): Likewise.
10115 * parse.y (template_arg): Add PTYPENAME expansion.
10117 1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
10119 * decl.c (grokvardecl): Don't build external assembler names for
10120 TYPENAMEs in other namespaces as there is no declarator.
10121 * error.c (cp_file_of, cp_line_of): Don't extract file or line number
10122 info from DECL_CONTEXT if it is NULL.
10124 1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
10126 * call.c (check_dtor_name): Split out.
10127 (build_scoped_method_call): Use it.
10128 (build_method_call): Use it.
10129 * init.c (build_offset_ref): Use it.
10131 * typeck.c (build_static_cast): Fix handling of pointers to members.
10133 * decl.c (finish_function): Just return nothing from a constructor.
10134 * typeck.c (c_expand_return): Complain about returning a void
10135 expression from a destructor.
10137 1998-06-13 Mark Mitchell <mark@markmitchell.com>
10139 * class.c (alter_access): Accept a BINFO explaining how to get
10140 from the entity whose accessed is being altered to the type doing
10142 (handle_using_decl): New function containing code split out from ...
10143 (finish_struct_1): Here.
10145 * cp-tree.h (complete_type_or_else): Declare.
10146 * init.c (build_new_1, build_delete): Use it.
10147 * typeck.c (require_complete_type): Use complete_type, rather than
10148 expanding it inline.
10149 (complete_type_or_else): New function.
10150 (build_component_ref): Use it.
10151 (pointer_int_sum): Make sure the type pointed to is complete.
10152 (pointer_diff): Likewise.
10154 * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
10157 * search.c (get_matching_virtual): Note that member templates
10158 cannot override virtual functions.
10160 1998-06-12 Brendan Kehoe <brendan@cygnus.com>
10162 * pt.c (check_explicit_specialization): If DECLARATOR turned into
10163 an error_mark_node from lookup_template_function, return the same.
10164 (determine_specialization): Also make sure TEMPLATE_ID isn't an
10165 error_mark_node, before we try to read its operands.
10166 * decl.c (grokdeclarator): If we got an error_mark_node from
10167 check_explicit_specialization, just return it right back.
10169 1998-06-12 Mark Mitchell <mark@markmitchell.com>
10171 * class.c (instantiate_type): Don't treat template-ids that don't
10172 specify any template arguments as equivalent to ordinary
10173 identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to
10174 pointer-to-members for member templates. Tidy slightly.
10175 * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
10176 * init.c (build_offset_ref): Handle template-ids like ordinary
10177 identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
10178 offset part of the OFFSET_REF.
10179 * typeck.c (build_unary_op): Change check for unknown types to
10180 look for OFFSET_REFs, not SCOPE_REFs.
10182 1998-06-11 Mark Mitchell <mark@markmitchell.com>
10184 * pt.c (is_member_template_class): New function.
10185 (push_template_decl_real): Use it.
10187 1998-06-11 Benjamin Kosnik <bkoz@elmo.cygnus.com>
10189 * friend.c (do_friend): Add support for nested classes using
10190 member functions of the enclosing class as friends.
10192 1998-06-10 Mark Mitchell <mark@markmitchell.com>
10194 * call.c (convert_default_arg): Make global, not static.
10195 (convert_arg_for_ellipsis): Split out from ...
10196 (build_over_call): Here.
10197 * cp-tree.h (convert_default_arg); Declare.
10198 (convert_arg_to_ellipsis): Likewise.
10199 (do_member_init): Remove.
10200 * init.c (do_member_init): Remove; this code is dead.
10201 (expand_member_init): Remove much of this code; it is dead.
10202 * typeck.c (convert_arguments): Use convert_default_arg and
10203 convert_arg_for_ellipsis, rather than duplicating here.
10205 * call.c (convert_like): Don't fail silently if
10206 build_user_type_conversion fails. Always return error_mark_node
10209 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10211 * search.c (covariant_return_p): Complain about ambiguous base.
10213 * typeck.c (build_component_ref): Diagnose ref to nested type.
10215 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10217 * decl.c (grokparms): Check that INIT isn't an error_mark_node
10218 before giving error about invalid type for default arg.
10220 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10222 * call.c (build_method_call): Fix thinko.
10224 1998-06-10 Dave Brolley <brolley@cygnus.com>
10226 * decl2.c (lang_decode_option): New argc/argv interface.
10227 * cp-tree.h (lang_decode_option): New argc/argv interface.
10228 * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
10229 specified for cpplib-enabled compilers.
10230 * lex.c (lang_init): Don't check_newline for cpplib.
10231 (init_parse): Don't initialize cpplib here.
10233 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10235 * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
10236 piece before checking DECL_MUTABLE_P.
10238 1998-06-10 John Carr <jfc@mit.edu>
10240 * tree.c (debug_binfo): Make printf format match arguments.
10242 * error.c (OB_PUTI): Make printf format match arguments.
10244 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10246 * init.c (perform_member_init): Handle default-initialization.
10248 * except.c (build_throw): Handle throwing NULL.
10250 * typeck.c (build_x_function_call): Use resolve_offset_ref.
10252 * search.c (compute_access): Only strip an anonymous union
10255 * call.c (add_builtin_candidates): Tweak.
10257 * cvt.c (build_expr_type_conversion): Restore code for conversion
10259 * decl2.c (delete_sanity): Use it. Clean up.
10261 * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
10263 1998-06-10 Branko Cibej <branko.cibej@hermes.si>
10265 * typeck.c (c_expand_return): Don't warn about void expressions on
10266 return statements in functions returning void.
10268 1998-06-09 Mark Mitchell <mark@markmitchell.com>
10270 * pt.c (fn_type_unification): Revise documentation. Tidy.
10271 (type_unification): Likewise.
10273 1998-06-09 Andrew MacLeod <amacleod@cygnus.com>
10275 * semantics.c (finish_try_block): Rename expand_start_catch, and delete
10277 * parse.y (function_try_block): Rename expand_start_catch, and delete
10279 * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
10282 1998-06-09 Jason Merrill <jason@yorick.cygnus.com>
10284 * search.c (lookup_member): New fn.
10285 * class.c (finish_struct_1): Use it.
10286 * decl.c (lookup_name_real): Use it.
10288 Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10290 * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
10292 * cp-tree.h: Add prototype for `maybe_print_template_context' and
10293 `maybe_make_one_only'.
10295 * decl.c (auto_function): Remove unused variable `decl'.
10297 * decl2.c: Include dwarf2out.h and dwarfout.h.
10299 * lex.c: Remove redundant declarations of `set_float_handler' and
10302 1998-06-08 Andrew MacLeod <amacleod@cygnus.com>
10304 * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
10305 time flag. Call __cp_eh_info instead of __cp_exception_info.
10306 * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
10307 (__cp_exception_info): Return offset into cp_eh_info structure to
10308 match what use to be the start of this structure.
10309 (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
10310 (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
10312 (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
10313 __cp_eh_info instead of __cp_exception_info.
10315 1998-06-08 Jason Merrill <jason@yorick.cygnus.com>
10317 * decl.c (cp_finish_decl): Disable inlining of extern inlines
10318 with static variables.
10320 1998-06-08 Mark Mitchell <mark@markmitchell.com>
10322 * init.c (build_offset_ref): Correct previous change to use build,
10325 1998-06-07 Mark Mitchell <mark@markmitchell.com>
10327 * class.c (instantiate_type): Handle pointer-to-members where the
10328 member is a template.
10329 * init.c (build_offset_ref): Likewise.
10330 * typeck.c (build_unary_op): Likewise.
10332 1998-06-07 Richard Henderson <rth@cygnus.com>
10334 * lex.c (lang_init_options): New function.
10335 (lang_init): Remove flag_exceptions == 2 hack.
10337 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10339 * search.c (envelope_add_decl): Tweak for implicit typename.
10341 * call.c (joust): Also warn about confusing conversion op/constructor
10342 overload resolution.
10344 * spew.c (yylex): Also return the TYPE_DECL if got_object.
10345 Don't clear got_object after '~'.
10346 * call.c (build_scoped_method_call): Tweak destructor handling.
10347 (build_method_call): Likewise.
10348 * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
10349 TYPE_MAIN_VARIANT for destructors.
10350 * semantics.c (finish_object_call_expr): Complain about calling a
10353 1998-06-05 Per Bothner <bothner@cygnus.com>
10355 * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
10356 Define - update needed by gcc.c change.
10358 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10360 * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
10362 1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10364 * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
10365 * decl.c (lookup_name_real): Add namespaces_only parameter.
10366 If set, return only NAMESPACE_DECLs.
10367 (select_decl): Likewise.
10368 (identifier_type_value): Give additional parameter.
10369 (lookup_name_nonclass): Likewise.
10370 (lookup_name): Likewise.
10371 (find_binding): Skip namespace aliases.
10372 (binding_for_name): Likewise.
10373 (push_namespace): Check for namespace aliases.
10374 (lookup_name_namespace_only): New function.
10375 (begin_only_namespace_names, end_only_namespace_names): New functions.
10376 * decl2.c (set_decl_namespace): Skip namespace aliases.
10377 (do_using_directive): Likewise.
10378 (do_namespace_alias): Produce namespace aliases, fix alias
10380 * error.c (dump_decl): Support SCOPE_REF.
10381 * parse.y (extdef): Wrap lookup with namespace_only for namespace
10382 aliases and using declarations.
10384 1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
10386 * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
10388 * error.c (dump_expr): Clean up NEW_EXPR case.
10390 1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
10392 Suggested by Brendan Kehoe
10393 * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
10394 treat it as using ::decl.
10396 * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
10398 * tree.c (mapcar): Support NEW_EXPR.
10400 * error.c (dump_expr): Support NEW_EXPR.
10402 1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
10404 * method.c (make_thunk): Use overload machinery to make name.
10405 * search.c (covariant_return_p): New fn.
10406 (get_matching_virtual): Use it.
10408 * init.c (build_new_1): Fix check for void.
10410 1998-06-01 Per Bothner <bothner@cygnus.com>
10412 * cp-tree.h (TYPE_FOR_JAVA): New macro.
10413 * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
10414 java_int_type_node, java_long_type_node, java_float_type_node,
10415 java_double_type_node, java_char_type_node, java_boolean_type_node):
10416 New "primitive" types, with predefined names __java_byte etc.
10417 (record_builtin_java_type): New function.
10418 (init_decl_processing): Make Java types with record_builtin_java_type.
10419 (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
10420 (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
10421 (grokfndecl): Call check_java_method for Java classes.
10422 * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
10423 (process_overload_item): Match types against specific
10424 java_XX_type_node types, rather than using is_java_type.
10425 * class.c (finish_struct_1): Don't add default copy constructor
10426 or operator= if TYPE_FOR_JAVA.
10427 (pop_lang_conext): Restore strict_prototyp proper if Java.
10428 * decl2.c (acceptable_java_type, check_java_method): New functions.
10429 * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
10430 (tsubst): Move common statement after if statement.
10431 * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
10433 1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
10435 * pt.c (for_each_template_parm): Use first_rtl_op.
10437 * tree.c (build_cplus_array_type_1): Also check index_type for
10440 1998-05-31 Jason Merrill <jason@yorick.cygnus.com>
10442 * pt.c (tsubst): Always copy BINFO_BASETYPES.
10444 1998-05-29 scott snyder <snyder@d0sgif.fnal.gov>
10446 * tree.c (layout_basetypes): If we change TYPE_SIZE, change
10447 TYPE_SIZE_UNIT too.
10449 1998-05-29 Mark Mitchell <mark@markmitchell.com>
10451 * decl.c (grokdeclarator): Don't complain about in-class
10452 initialization of static consts if we don't really know the type
10455 1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
10457 * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
10458 * method.c (build_destructor_name): New fn.
10459 * decl2.c (maybe_retrofit_in_chrg): Split out...
10460 (grokclassfn): From here. Reorganize.
10461 * decl.c (grok_ctor_properties): Make sure ctors for types with
10462 vbases have the in_chrg parm.
10463 * pt.c (instantiate_class_template): Update
10464 TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call
10466 (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
10468 1998-05-28 Mark Mitchell <mark@markmitchell.com>
10470 * pt.c (instantiate_decl): Make test for whether or not static
10471 variables should be instantiated early match its comment.
10473 1998-05-28 Jason Merrill <jason@yorick.cygnus.com>
10475 * decl.c (start_decl): Always pedwarn about vacuously redeclaring
10477 (start_function): Call check_default_args.
10478 * decl2.c (grokfield): Don't call check_default_args.
10479 (check_default_args): Use cp_error_at.
10480 * lex.c (do_pending_defargs): Call check_default_args.
10482 1998-05-27 Brendan Kehoe <brendan@cygnus.com>
10484 * call.c (build_method_call): Make sure get_type_value returns
10485 something before we try to use its TYPE_MAIN_VARIANT.
10486 (build_scoped_method_call): Likewise.
10488 1998-05-27 Jason Merrill <jason@yorick.cygnus.com>
10490 * typeck2.c (digest_init): Complain about getting a TREE_LIST to
10491 initialize an array.
10493 * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
10496 * friend.c (do_friend): Clarify template warning.
10498 1998-05-27 Mark Mitchell <mark@markmitchell.com>
10500 * decl.c (shadow_label): Don't treat decls as identifiers.
10501 (maybe_push_to_top_level): Clear shadowed_labels.
10503 * pt.c (instantiate_decl): Reset lineno and filename after calling
10504 regenerate_decl_from_template.
10506 * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
10509 1998-05-27 Kevin Buhr <buhr@stat.wisc.edu>
10511 * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
10513 1998-05-26 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
10515 * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
10516 (convert_nontype_argument): Handle cases when nontype template
10517 parameters become classes after substitution.
10519 1998-05-26 Mark Mitchell <mark@markmitchell.com>
10521 * friend.c (is_friend): Use comptypes, rather than == to compare
10522 types. Modify for new representation of template friends.
10523 (make_friend_class): Likewise.
10524 * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak.
10525 (instantiate_class_template): Deal with template friends.
10527 * decl.c (store_parm_decls): Remove redundant call to
10528 expand_main_function.
10530 1998-05-26 Benjamin Kosnik <bkoz@loony.cygnus.com>
10532 * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
10535 1998-05-26 Per Bothner <bothner@cygnus.com>
10537 * language_as_string: Handle lang_java.
10539 1998-05-26 Jason Merrill <jason@yorick.cygnus.com>
10541 * decl.c (pushdecl): Don't copy the type_decl.
10543 1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10545 * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
10546 current_class_type.
10547 * decl.c (grokdeclarator): Put typedefs on the type's obstack.
10549 * parse.y (complex_direct_notype_declarator): Use $1 to access
10550 scope of notype_qualified_id.
10552 1998-05-26 Dave Brolley <brolley@cygnus.com>
10554 * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
10555 (init_parse): Initialize cpplib interface.
10557 * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
10558 empty continuation.
10560 1998-05-26 Mark Mitchell <mark@markmitchell.com>
10562 * decl.c (pushtag): Avoid crashing on erroneous input.
10564 1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10566 * decl.c (push_namespace): Only produce one unique name for
10567 anonymous namespaces.
10568 (get_unique_name): Remove.
10570 1998-05-25 Mark Mitchell <mark@markmitchell.com>
10572 * call.c (tourney): Don't do any extra comparisons.
10574 * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
10576 * cp-tree.h (processing_template_parmlist): Declare.
10577 * decl.c (pushtag): Don't call push_template_decl when we
10579 * pt.c (processing_template_parmlist): New variable.
10580 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
10581 (complete_template_args): Use it.
10582 (add_to_template_args): Likewise.
10583 (innermost_args): Likewise.
10584 (tsubst): Likewise.
10585 (begin_template_parm_list): Use processing_template_parmlist.
10586 (end_template_parm_list): Likewise.
10588 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
10589 * decl.c (grokdeclarator): Use it.
10590 * decl2.c (grok_x_components): Likewise.
10591 * init.c (initializing_context): Likewise.
10592 * method.c (do_build_copy_constructor): Likewise.
10593 (do_build_assign_ref): Likewise.
10594 * search.c (compute_access): Likewise.
10595 * typeck.c (build_component_ref): Likewise.
10597 * decl.c (grokdeclarator): Don't give a cv-qualified version of an
10598 unnamed type a typedef name "for linkage purposes".
10600 * pt.c (lookup_template_class): Don't look at
10601 IDENTIFIER_CLASS_VALUE when there's no current_class_type.
10603 * method.c (build_overload_int): Handle error cases gracefully.
10605 * pt.c (instantiate_decl): Handle static member variables
10608 * pt.c (tsubst): Use the tsubst'd type when producing new
10609 TEMPLATE_PARM_INDEX nodes.
10611 1998-05-24 Mark Mitchell <mark@markmitchell.com>
10613 * tree.c (cp_tree_equal): Handle pointers to member functions.
10615 * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make
10616 sure the type of the REF_BIND is a reference type.
10617 (maybe_handle_ref_bind, compare_ics): Rename reference_type to
10618 target_type for clarity.
10620 * parse.y (xcond): Move call to condition_conversion ...
10621 * semantics.c (finish_for_cond): Here.
10622 * parse.c: Regenerated.
10624 1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
10626 * decl.c (push_namespace): Namespaces have type void.
10627 * typeck2.c (incomplete_type_error): Complain about namespace
10628 used as expression.
10629 * typeck.c (decay_conversion): Likewise.
10631 1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
10633 * error.c (dump_expr): Support namespaces.
10635 1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
10637 * cp-tree.def: Add SRCLOC.
10638 * cp-tree.h: Add struct tree_srcloc and accessor macros.
10639 * tree.c (build_srcloc, build_srcloc_here): New fns.
10640 * pt.c (add_pending_template): Use build_srcloc_here.
10641 (push_tinst_level): Update last_template_error_tick before erroring.
10642 (instantiate_decl): Restore lineno and input_filename before
10643 calling add_pending_template.
10644 * decl2.c (finish_file): Set up lineno and input_filename for
10647 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
10649 * decl.c (lang_print_error_function): New fn.
10650 (init_decl_processing): Set print_error_function to use it.
10651 * errfn.c (cp_thing): Don't call maybe_print_template_context here.
10653 * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
10656 * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
10657 copy-initialization.
10659 * class.c (build_vtable_entry): Use int_fits_type_p.
10660 (build_vtable): Pass a signed offset to build_vtable_entry.
10661 (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
10662 set_rtti_entry): Likewise.
10664 1998-05-22 Per Bothner <bothner@cygnus.com>
10666 * cp-tree.h: Add comments documenting which LANG_FLAGS are used.
10667 (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used.
10669 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
10671 * pt.c (print_template_context): Use fprintf instead of cp_error.
10673 * pt.c (determine_specialization): Just return an error_mark_node.
10674 Also print the decl we want in error messages. If we complain,
10675 return error_mark_node.
10676 (tsubst_friend_function): Set lineno and input_filename so
10677 error messages will be useful.
10678 (instantiate_template): Just return an error_mark_node.
10679 (check_explicit_specialization): Don't mess with a returned
10682 * pt.c (print_template_context): Add new argument.
10683 (maybe_print_template_context): New fn.
10684 (push_tinst_level): Increment tinst_level_tick.
10685 (pop_tinst_level): Likewise.
10686 * errfn.c (cp_thing): Call maybe_print_template_context. Use
10687 xrealloc instead of xmalloc.
10689 * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
10691 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
10693 * pt.c (tsubst_friend_class): Don't call redeclare_class_template
10694 if the template we looked up is the same as the one we already
10697 Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
10699 * lex.c: (handle_sysv_pragma): FILE* parameter not used.
10700 (cpp_reader,parse_in): Add for cpplib.
10701 (check_newline): Call handle_sysv_pragma with new interface.
10702 (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
10704 * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
10705 (sub_getch): Call GETC for cpplib.
10707 * cp-tree.h: (get_directive_line): Different prototype for cpplib.
10708 (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
10710 * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib.
10712 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
10714 * decl2.c (maybe_make_one_only): New fn.
10715 (import_export_vtable): Use it.
10716 (import_export_decl): Likewise.
10717 * pt.c (mark_decl_instantiated): Likewise.
10719 1998-05-21 Mark Mitchell <mmitchell@usa.net>
10721 * decl2.c (find_representative_member): Rename to ...
10722 (build_anon_union_vars): New function.
10723 (finish_anon_union): Fix stupidity of previous change.
10725 1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
10727 * decl.c (grokfndecl): Handle definition of specialization in
10728 friend declaration.
10730 * error.c (dump_decl): Fix LOOKUP_EXPR handling.
10732 1998-05-20 Mark Mitchell <mmitchell@usa.net>
10734 * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
10735 to look for type declarations.
10736 (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
10737 * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
10738 (finish_member_class_template): Declare.
10739 * decl.c (pushtag): Put member class templates on the
10740 CLASSTYPE_TAGS list, just as for ordinary member classes.
10741 (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
10742 (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
10743 IDENTIFIER_NAMESPACE_VALUEs.
10744 * parse.y (component_decl): Move code to ...
10745 * semantics.c (finish_member_class_template): New function.
10746 Don't put member class templates on the list of components for a
10748 * parse.c: Regenerated.
10749 * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
10750 In fact, don't use DECL_CONTEXT at all here.
10752 1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
10754 * decl.c (record_unknown_type): New function.
10755 (init_decl_processing): Call it for the unknown and global type
10758 1998-05-20 Mark Mitchell <mmitchell@usa.net>
10760 * decl2.c (find_representative_member): New function.
10761 (finish_anon_union): Use it.
10763 * cp-tree.h (MAIN_NAME_P): New macro.
10764 (DECL_MAIN_P): Likwise.
10765 * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
10766 (grokfndecl): Use the new macros.
10767 (grokdeclarator): Likewise.
10768 (start_function): Likewise.
10769 (store_parm_decls): Likewise.
10770 (finsh_function): Likewise.
10771 * friend.c (do_friend): Likewise.
10772 * typeck.c (build_function_call_real): Likewise.
10773 (build_unary_op): Likewise.
10775 Wed May 20 02:16:01 1998 Jason Merrill <jason@yorick.cygnus.com>
10777 * decl2.c (start_objects, finish_objects, do_dtors,
10778 do_ctors): Split out from...
10779 (finish_file): ...here.
10781 Tue May 19 20:36:23 1998 Jason Merrill <jason@yorick.cygnus.com>
10783 * tree.c (is_overloaded_fn): Don't abort on placeholders from
10786 Tue May 19 15:16:22 1998 Brendan Kehoe <brendan@cygnus.com>
10788 * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
10790 * error.c (dump_expr): Handle an ARROW_EXPR.
10792 Tue May 19 15:13:39 1998 Mark Mitchell <mmitchell@usa.net>
10794 * decl.c (saveable_obstack): Declare.
10795 (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
10796 declare, if necessary.
10798 Tue May 19 14:50:27 1998 Mark Mitchell <mmitchell@usa.net>
10800 * call.c (compare_qual): Remove.
10801 (is_subseq): Tweak.
10802 (is_properly_derived_from): New function.
10803 (maybe_handle_ref_bind): Likewise.
10804 (maybe_handle_implicit_object): Likewise.
10805 (compare_ics): Modify substantially to bring into conformance with
10807 * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
10808 (comp_cv_qualification): Declare.
10809 (comp_cv_qual_signature): Likewise.
10810 * typeck.c (comp_cv_qualification): Likewise.
10811 (comp_cv_qual_signature): Likewise.
10813 Tue May 19 10:05:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10815 * Makefile.in (parse.o): Depend on toplev.h.
10817 * class.c (typecode_p): Remove prototype and definition.
10819 * cp-tree.h (currently_open_class, is_empty_class, member_p):
10822 * decl.c (push_overloaded_decl_top_level): Remove prototype and
10825 * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
10826 in call to `cp_thing'.
10827 (cp_warning): Likewise for function pointer `warning'.
10829 * except.c (do_function_call): Remove prototype and definition.
10830 (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
10832 * method.c (is_java_type): Add prototype and make it static.
10834 * parse.y: Include toplev.h.
10836 * pt.c (type_unification): Remove unused variable `arg'.
10837 (instantiate_decl): Likewise for `save_ti'.
10839 * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
10841 Tue May 19 02:43:25 1998 Jason Merrill <jason@yorick.cygnus.com>
10843 * init.c (build_member_call): Handle template_ids.
10844 * parse.y (primary): Add global_scope template_id.
10846 Mon May 18 23:22:52 1998 Jason Merrill <jason@yorick.cygnus.com>
10848 * decl2.c (get_sentry): Use end_temporary_allocation.
10849 Don't declare permanent_obstack.
10851 Mon May 18 12:28:44 1998 Mark Mitchell <mmitchell@usa.net>
10853 * parse.y (.finish_new_placement): New non-terminal.
10854 (unary_expr, new_type_id): Use it.
10855 * parse.c: Regenerated.
10857 Mon May 18 12:20:27 1998 Brendan Kehoe <brendan@cygnus.com>
10859 * pt.c (redeclare_class_template): Say where the original definition
10860 of the template-parameter's default argument appeared.
10862 Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com>
10864 * call.c (build_over_call): Tweak empty class handling.
10866 * decl.c (make_typename_type): Use currently_open_class.
10868 * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
10870 Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10872 * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
10873 for a type unless it is one.
10875 * class.c (finish_struct_1): Use OVL_CURRENT in error message.
10877 Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com)
10879 * Makefile.in (program_transform_name, objdir): Define.
10881 * Makefile.in (BISON): Use bison from the build tree if it exists.
10884 Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10886 * typeck.c (type_unknown_p): Return true for TREE_LIST also.
10888 * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
10890 Sun May 17 14:51:41 1998 Jason Merrill <jason@yorick.cygnus.com>
10892 * call.c (build_scoped_method_call): Likewise.
10894 Sun May 17 13:53:48 1998 Mark Mitchell <mmitchell@usa.net>
10896 * init.c (build_new_1): Call suspend_momentary around the creation
10897 of values that must be saved for exception handling.
10898 * parse.y (.build_new_placement): New non-terminal.
10899 (unary_expr, new_placement): Use it.
10900 * parse.c: Regenerated.
10902 Sun May 17 12:32:08 1998 Jason Merrill <jason@yorick.cygnus.com>
10904 * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
10907 * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
10910 * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
10912 Fri May 15 20:28:00 1998 Jason Merrill <jason@yorick.cygnus.com>
10914 * decl.c (start_decl): Revert problem change.
10916 * Makefile.in (CONFLICTS): Fix.
10918 Fri May 15 15:34:02 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
10920 * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
10922 Fri May 15 00:46:05 1998 Jason Merrill <jason@yorick.cygnus.com>
10924 * class.c (finish_struct_1): Use BINFO_SIZE.
10926 * decl.c (start_decl): Use 'tem'.
10928 Thu May 14 16:30:47 1998 Andrew MacLeod <amacleod@cygnus.com>
10930 * exception.cc: Include eh-common.h.
10931 (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL.
10932 (__cplus_type_matcher): First stab at new C++ runtime type matcher.
10933 (__cp_push_exception): Initialize eh_info struct as well.
10934 * except.c: Remove local structs and include eh-common.h.
10935 (init_exception_processing): Set language and version codes.
10936 (call_eh_info): Add presence of eh_info to runtime description of
10938 (expand_end_eh_spec): Call start_catch_block() and end_catch_block().
10939 * semantics.c (finish_try_block): Call start_catch_block() and
10941 * parse.y (function_try_block): Call start_catch_block() and
10944 Thu May 14 12:27:34 1998 Brendan Kehoe <brendan@cygnus.com>
10946 * typeck.c (original_type): New function.
10947 (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
10948 to see if they're actually the same.
10949 * cp-tree.h (original_type): Declare.
10951 Wed May 13 12:54:30 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10953 * Makefile.in (lex.o): Depend on output.h.
10955 * call.c (add_function_candidate): Remove unused variable `cand'.
10956 (add_conv_candidate): Likewise.
10957 (build_builtin_candidate): Likewise.
10959 * cp-tree.h: Add prototype for `types_overlap_p'.
10961 * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
10963 * decl2.c (merge_functions): Remove unused variables `tmp' and
10966 * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
10967 (code_as_string): Likewise.
10968 (language_as_string): Likewise.
10969 (parm_as_string): Likewise.
10970 (op_as_string): Likewise.
10971 (assop_as_string): Likewise.
10972 (cv_as_string): Likewise.
10974 * lex.c: Include output.h.
10976 * pt.c (type_unification): Cast first argument of `bzero' to a char*.
10978 * search.c (dfs_no_overlap_yet): Mark parameter `t' with
10981 * tinfo.cc (__class_type_info::dcast): Change the type of variable
10982 `i' from int to size_t.
10984 * typeck.c (language_lvalue_valid): Mark parameter `exp' with
10987 Tue May 12 21:37:49 1998 Jason Merrill <jason@yorick.cygnus.com>
10989 * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
10990 DECL_NAMESPACE_SCOPE_P.
10991 (lang_decl_name): Likewise.
10992 * pt.c (tsubst_friend_function, tsubst): Likewise.
10993 * decl.c (pushdecl, redeclaration_error_message, start_decl,
10994 cp_finish_decl, start_function): Likewise.
10995 * class.c (finish_struct_1): Likewise.
10996 * call.c (build_over_call): Likewise.
10997 (compare_ics): Use DERIVED_FROM_P.
10999 Tue May 12 07:24:18 1998 Mark Mitchell <mmitchell@usa.net>
11001 * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
11002 * method.c (build_mangled_name): Use it.
11003 (build_decl_overload_real): Likewise.
11005 * error.c (dump_simple_decl): New function, broken out from ...
11006 (dump_decl): Use it.
11008 Mon May 11 11:38:07 1998 Mark Mitchell <mmitchell@usa.net>
11010 * ptree.c (lang_print_xnode): Add missing `break'.
11012 * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
11014 * call.c (add_template_candidate): Adjust for changes to
11015 fn_type_unification.
11016 (add_template_candidate_real): Likewise.
11017 (add_template_conv_candidate): Likewise.
11018 (build_user_type_conversion_1): Likewise.
11019 (build_new_function_call): Likewise.
11020 (build_object_call): Likewise.
11021 (build_new_op): Likewise.
11022 (build_new_method_call): Likewise.
11023 * class.c (instantiate_type): Likewise.
11024 * cp-tree.h (unification_kind_t): New type.
11025 (fn_type_unification): Adjust prototype.
11026 (type_unificaiton): Likewise.
11027 * pt.c (UNIFY_ALLOW_NONE): New macro.
11028 (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
11029 (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
11030 (UNIFY_ALLOW_DERIVED): Likewise.
11031 (unify): Change prototype.
11032 (maybe_adjust_types_for_deduction): New function.
11033 (check_cv_quals_for_unify): Likewise.
11034 (determine_specialization): Adjust.
11035 (fn_type_unification): Likewise.
11036 (type_unification): Likewise.
11037 (type_unification_real): Likewise. Use
11038 maybe_adjust_types_for_deduction. Fix mishandling of
11039 back-unification of template functions passed as arguments. Pass
11040 appropriate combination of UNIFY_ALLOW_* to unify.
11041 (unify): Remove unused NTPARMS parameter. Use
11042 check_cv_quals_for_unify. Remove bogus code that allowed
11043 too-generous unification in order to adhere more closely to standard.
11044 (get_bindings_real): Adjust.
11045 (get_class_bindings): Likewise.
11047 * method.c (build_overload_identifier): Only use the innermost
11048 template arguments when mangling.
11049 * pt.c (tsubst_template_argument_vector): New function.
11050 (complete_template_args): Deal with the situation where the
11051 extra_args contain more than one level of arguments.
11052 (lookup_template_class): Deal with member template classes, which
11053 may have more than one level of arguments.
11054 (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
11055 Improve handling of member template classes. Use
11056 DECL_PRIMARY_TEMPLATE instead of inline expansion. Use
11057 tsubst_template_argument_vector where appropriate.
11058 (regenerate_decl_from_template): Break out from ...
11059 (instantiate_decl): Here.
11061 * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
11062 * parse.h: Regenerated.
11063 * parse.c: Really regenerated.
11065 * cp-tree.h (finish_unary_op_expr): New function.
11066 (finish_id_expr): Likewise.
11067 (begin_new_placement): Likewise.
11068 (finish_new_placement): Likewise.
11069 (finish_declarator): Likewise.
11070 (finish_translation_unit): Likewise.
11071 (finish_parmlist): Likewise.
11072 (begin_class_definition): Likewise.
11073 (finish_class_definition): Likewise.
11074 (finish_default_args): Likewise.
11075 (finish_inline_definitions): Likewise.
11076 * parse.y (GCC_ASM_KEYWORD): Remove.
11077 (TYPENAME_ELLIPSIS): Likewise.
11078 * parse.c: Regenerated.
11079 Use new functions in semantics.c in the actions for many rules.
11080 * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
11081 * hash.h: Regenerated.
11082 * semantics.c (finish_expr_stmt): Allow NULL expr.
11083 (finish_unary_op_expr): New function, containing
11084 code previously in parse.y.
11085 (finish_id_expr): Likewise.
11086 (begin_new_placement): Likewise.
11087 (finish_new_placement): Likewise.
11088 (finish_declarator): Likewise.
11089 (finish_translation_unit): Likewise.
11090 (finish_parmlist): Likewise.
11091 (begin_class_definition): Likewise.
11092 (finish_class_definition): Likewise.
11093 (finish_default_args): Likewise.
11094 (finish_inline_definitions): Likewise.
11096 Sun May 10 23:43:13 1998 Mark Mitchell <mmitchell@usa.net>
11098 * typeck.c (build_c_cast): Don't decay arrays and functions to
11099 pointer type when converting to a class type.
11101 Sun May 10 22:53:56 1998 Jason Merrill <jason@yorick.cygnus.com>
11103 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
11104 (DECL_CLASS_SCOPE_P): Likewise.
11106 Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org)
11108 * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
11109 * decl2.c (constructor_name_full): Likewise.
11111 Sun May 10 22:48:12 1998 Mike Stump <mrs@wrs.com>
11113 * tree.c (mapcar): Add OVERLOAD support.
11115 * init.c (resolve_offset_ref): We must use basetype_path before we
11116 destroy it with a call to convert_pointer_to.
11118 Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com>
11120 * class.c (currently_open_class): New fn.
11121 * decl.c (lookup_name_real): Use it.
11122 * search.c (lookup_field): Likewise.
11124 Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
11126 * cp-tree.def (OVERLOAD): New node.
11127 * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
11128 SET_IDENTIFIER_NAMESPACE_VALUE): Define.
11129 (NAMESPACE_BINDING): Remove.
11130 (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
11132 (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
11134 (tree_overload): New struct.
11135 (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
11136 (REAL_IDENTIFIER_TYPE_VALUE): Define.
11137 (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
11138 (lang_decl_flags): Remove in_namespace.
11139 (lang_decl): Remove chain.
11140 (DECL_CHAIN, DECL_NAMESPACE): Remove.
11141 (flag_honor_std): Declare extern.
11142 (identifier_type_value, pushdecl_namespace_level, push_using_decl,
11143 namespace_binding, set_namespace_binding,
11144 lookup_function_nonclass, cat_namespace_levels,
11145 set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
11146 scratch_ovl_cons, ovl_member, build_overload): Declare.
11147 (decl_list_length, get_namespace_id, current_namespace_id,
11148 overloaded_globals_p): Remove.
11149 (lookup_using_namespace, qualified_lookup_using_namespace): Change
11151 (push_scratch_obstack): New macro.
11152 * call.c (add_function_candidate): Special-case type of OVERLOAD node.
11153 (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
11155 (build_new_function_call): Iterate using OVL_CHAIN.
11156 Print DECL_NAME in when reporting ambiguities.
11157 (build_object_call): Iterate using OVL_NEXT for fns, convs.
11158 (build_new_op): Call lookup_function_nonclass.
11159 Iterate using OVL_NEXT.
11160 (build_op_delete_call): Change detection of members.
11161 Do not wrap TREE_LIST around fields and single global functions.
11162 (build_over_call): Don't push a class level if the context is a
11164 (build_new_method_call): Iterate using OVL_NEXT.
11165 * class.c (add_method): Chain overloaded members using
11166 build_overload. Remove copying of method.
11167 (grow_method): When iterating through the obstack, expect OVERLOAD
11168 nodes. Chain overload members.
11169 (finish_struct_methods): Chain overload members. Unpack OVERLOAD
11170 nodes in call to get_baselinks.
11171 (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
11172 (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle
11173 fdecls that are OVERLOAD nodes.
11174 (validate_lhs): New function.
11175 (instantiate_type): Do not copy OVERLOAD nodes. Remove dead
11176 code. Use DECL_NAME in error messages. Split code between global
11177 and member function processing.
11178 * decl.c (global_type_node): New static variable.
11179 (in_std): New global.
11180 (struct binding_level): New field usings.
11181 (resume_binding_level): Assert that we are not in a class.
11182 (toplevel_bindings_p): Just check for namespace_p or
11184 (resume_level): Remove.
11185 (find_binding): New function.
11186 (binding_for_name): Call it.
11187 (namespace_binding, set_namespace_binding): New functions.
11188 (push_namespace): Associate binding level with new namespace,
11189 resume_binding_level for existing namespace. Remove old code.
11190 Fake std by counting.
11191 (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
11192 (maybe_push_to_top_level): Save current namespace.
11193 (pop_from_top_level): Restore saved namespace.
11194 (pop_namespace): Call suspend_binding_level. Remove old code.
11195 (cat_namespace_levels): New function.
11196 (set_identifier_type_value_with_scope): For namespace bindings,
11197 set BINDING_TYPE, and use global_type_node.
11198 Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
11199 (identifier_type_value): New function.
11200 (pushtag): If no context, use current_namespace.
11201 (duplicate_decls): Don't process DECL_CHAIN.
11202 (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
11203 already set. Never reset it to NULL_TREE. Lookup global variables
11204 in their namespace. Push overloaded templates if they are on
11206 (pushdecl_namespace_level): New function.
11207 (pushdecl_top_level): Implement using pushdecl_namespace_level.
11208 (pushdecl_using_decl): New function.
11209 (overloaded_globals_p): Remove.
11210 (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
11211 them. Use namespace_binding and set_namespace_value.
11212 (redeclaration_error_message): Complain if the declarations come
11213 from different namespaces.
11214 (lookup_tag): On namespace level, look in the BINDING_TYPE.
11215 (lookup_namespace_name): Pass tree_bindings from stack. Remove
11217 (select_decl): New function.
11218 (lookup_name_real): Call it for qualified and unqualified lookup.
11219 Pass tree_bindings from the stack.
11220 If prefer_type is 1, also accept namespaces.
11221 (lookup_function_nonclass): New function.
11222 (init_decl_processing): Set the binding level of the global
11223 namespace to global_binding_level.
11224 Build a proper type list for __builtin_apply.
11225 Initialize std_node to "fake std" if flag_honor_std is set.
11226 Initialize global_type_node.
11227 Allocated bad_alloc in namespace std if flag_honor_std.
11228 (define_function): Set the DECL_CONTEXT to the current_namespace.
11229 (start_decl): A namespace is not considered as a context here. If
11230 the DECL_CONTEXT is a namespace, push the decl.
11231 (cp_finish_decl): Check for namespaces used as initializers.
11232 (grokfndecl): Add namespace parameter. Remove processing of
11234 (grokvardecl): Add namespace parameter.
11235 (grokdeclarator): Process SCOPEs that are namespaces. For
11236 mangling, temporarily set the DECL_CONTEXT on anonymous structs.
11237 (start_function): Check for contexts that are namespaces.
11238 Set context for declarations that have not been pushed.
11239 (store_parm_decls): Check for ::main only.
11240 (finish_function): Likewise.
11241 (start_method): Check for contexts that are namespaces.
11242 (start_method): Remove DECL_CHAIN processing.
11243 * decl2.c (flag_honor_std): Declare.
11244 (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
11245 (decl_namespace_list): New static global.
11246 (grok_x_components): Ignore namespaces as type contexts.
11247 (check_classfn): Expect OVERLOAD nodes.
11248 (grokfield): Remove DECL_CHAIN processing.
11249 (finish_file): Call cat_namespace_levels.
11250 (merge_functions): New function.
11251 (ambiguous_decl): Rewrite.
11252 (lookup_using_namespace): Produce tree_bindings.
11253 (qualified_lookup_using_namespace): Likewise.
11254 (set_decl_namespace, decl_namespace, current_decl_namespace,
11255 push_decl_namespace, pop_decl_namespace): New functions.
11256 (arg_lookup): New struct.
11257 (add_function, arg_assoc_namespace, arg_assoc_class,
11258 arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
11260 (get_namespace_id, current_namespace_id): Remove.
11261 (do_toplevel_using_decl): Rewrite.
11262 (do_class_using_decl): Complain about namespace qualifiers.
11263 (do_using_directive): Sorry if not on namespace level. Complain
11264 about unknown namespaces.
11265 * error.c (dump_aggr_type): Check for namespace contexts.
11266 * except.c (init_exception_processing): Push terminate into std.
11267 * friend.c (is_friend): A namespace is not a context, here.
11268 * init.c (expand_member_init): Remove DECL_CHAIN processing.
11269 (build_offset_ref): Process OVERLOAD nodes.
11270 * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
11271 * lex.c (identifier_type): Loop using OVL_CHAIN.
11272 (see_typename): Set looking_for_typename to 2.
11273 (real_yylex): Likewise.
11274 (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
11275 (do_scoped_id): Expect OVERLOAD nodes.
11276 Change calling convention for qualified_lookup_using_namespace.
11277 (build_lang_decl): Don't set in_namespace anymore.
11278 * method.c (typevec_size): New global.
11279 (build_overload_nested_name): Return if global_namespace.
11280 Otherwise, always expect a declaration context.
11281 (build_qualified_name): Likewise.
11282 Make sure we don't write beyond typevec_size.
11283 (build_decl_overload_real): Likewise.
11284 Allocate one extra slot for the namespace.
11285 (hack_identifier): Mark code dead.
11286 Process OVERLOAD and NAMESPACE_DECL nodes.
11287 * parse.y (program): Pop namespaces until in global namespace.
11288 (extdef): In a using-declaration, don't discard the identifier if
11289 there is no declaration.
11290 (left_curly): Ignore type contexts which are namespaces.
11291 (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
11293 * pt.c (template_class_depth): Expect types to be namespaces.
11294 (determine_specialization): Simplify by expecting OVERLOAD nodes.
11295 (push_template_decl): Push into namespace level.
11296 Reset ctx if it is a namespace.
11297 Set DECL_CONTEXT to current_namespace if not set already.
11298 Ignore real contexts that are namespaces.
11299 (mangle_class_name_for_template): Skip global_namespace.
11300 Mangle other namespaces as declarations.
11301 (lookup_template_function): Set type of OVERLOAD nodes to unknown.
11302 (lookup_template_class): Push into namespace of context.
11303 If the context is a namespace, set it to global_namespace.
11304 Use id_context for mangling.
11305 (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
11306 (tsubst_friend_function): Ignore namespace contexts.
11307 Push into namespace level.
11308 (tsubst): Handle NAMESPACE_DECL nodes.
11309 Remove DECL_CHAIN processing.
11310 (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
11311 * ptree.c (print_lang_identifier): Print bindings.
11312 (lang_print_xnode): Print OVERLOAD nodes.
11313 * rtti.c (init_rtti_processing): Push type_info into std.
11314 * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
11315 (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
11316 dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
11317 lookup_fnfields_here): Likewise.
11318 Process all nodes, instead of going through TREE_CHAIN.
11319 * sig.c (build_signature_pointer_or_reference_type): Set context
11320 to global_namespace.
11321 (build_signature_table_constructor): Expect OVERLOAD nodes.
11322 * spew.c (yylex): Save old setting of looking_for_typename.
11323 * tree.c (decl_list_length): Remove.
11324 (binding_init): New function.
11325 (count_functions): Rewrite.
11326 (is_overloaded_fn): Expect OVERLOAD nodes.
11327 (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
11328 (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
11329 ovl_member): New functions.
11330 * typeck.c (require_complete_type): Expect OVERLOAD nodes.
11331 (type_unknown_p): Likewise.
11332 (require_instantiated_type): Likewise.
11333 (build_component_ref): Declare code dead.
11334 (build_x_function_call): Create and expect OVERLOAD nodes.
11335 (build_function_call_real): Check for ::main only.
11336 (build_unary_op): Likewise. Expect OVERLOAD nodes.
11337 (convert_for_assignment): Check for TREE_LIST before accessing
11339 * decl.c (duplicate_decls): Check for namespace bindings instead
11340 of global bindings.
11341 (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
11342 lookup_name_current_level, start_decl, xref_tag,
11343 finish_enum): Likewise.
11344 * init.c (build_offset_ref): Likewise.
11345 * search.c (lookup_field): Likewise.
11346 (lookup_fnfields): Likewise.
11347 (dfs_debug_mark): Likewise.
11348 * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
11349 (poplevel_class, pop_from_top_level): Likewise.
11350 * decl2.c (finish_method): Likewise.
11351 * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
11352 * decl.c (record_builtin_type): Likewise.
11353 (init_decl_processing, grokfndecl): Likewise.
11354 * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
11355 (make_lang_type): Likewise.
11356 * parse.y (make_thunk): Likewise.
11357 * pt.c (tsubst): Likewise.
11358 * tree.c (debug_binfo): Likewise.
11359 * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
11360 tinfo2.cc, inc/new.h: Add std qualifications.
11361 * inc/new: Wrap with namespace std if __HONOR_STD.
11362 * inc/typeinfo: Likewise.
11364 Fri May 8 00:43:50 1998 Jason Merrill <jason@yorick.cygnus.com>
11366 * call.c (build_user_type_conversion_1): Handle second_conv
11367 properly for templates.
11369 Thu May 7 17:09:25 1998 Andrew MacLeod <amacleod@cygnus.com>
11371 * method.c (build_decl_overload_real): Set TREE_USED flag to
11372 zero for build_type_variants nodes as well.
11374 Wed May 6 19:27:09 1998 Jason Merrill <jason@yorick.cygnus.com>
11376 * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE.
11378 Wed May 6 16:49:48 1998 Jim Wilson <wilson@cygnus.com>
11380 * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o,
11381 except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o,
11382 rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o,
11383 xref.o): Add toplev.h dependencies.
11385 Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com)
11387 * errfn.c (cp_error, cp_warning): Remove declarations for
11388 error and warning respectively.
11390 Wed May 6 14:28:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11392 * error.c: Convert to using ctype macros defined in system.h.
11393 * method.c: Likewise.
11394 * xref.c: Likewise.
11395 * lex.c: Likewise. Also remove redundant system header stuff.
11397 Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
11399 * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
11400 expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c,
11401 search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c,
11402 xref.c: Add include of toplev.h.
11404 Wed May 6 02:33:39 1998 Jason Merrill <jason@yorick.cygnus.com>
11406 * tree.c (perm_manip): Also regenerate the RTL of an extern.
11407 (copy_to_permanent): Use end_temporary_allocation.
11409 Tue May 5 23:54:04 1998 Jason Merrill <jason@yorick.cygnus.com>
11411 * init.c (expand_vec_init): The initialization of each array
11412 element is a full-expression.
11414 Tue May 5 18:24:13 1998 Andrew MacLeod <amacleod@cygnus.com>
11416 * method.c (build_mangled_name): Add a call to build_type_variant
11417 to get the right type.
11419 Tue May 5 01:25:03 1998 Jason Merrill <jason@yorick.cygnus.com>
11421 * Makefile.in: Add .SUFFIXES.
11423 * cp-tree.def: Remove NAMESPACE_DECL.
11425 Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
11427 * call.c (build_over_call): Do evaluate arg even if it has empty
11429 * decl.c (start_function): Don't push a member function.
11431 Thu Apr 30 18:59:23 1998 Jim Wilson <wilson@cygnus.com>
11433 * Makefile.in (g++FAQ.info): Put -o option before input file.
11435 Thu Apr 30 13:05:33 1998 Andrew MacLeod <amacleod@cygnus.com>
11437 * gxxint.texi: Add info for squangling codes K and B.
11439 Tue Apr 28 13:22:01 1998 Mark Mitchell <mmitchell@usa.net>
11441 * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
11442 the expression in templates.
11443 (finish_stmt_expr): Likewise.
11445 1998-04-28 Brendan Kehoe <brendan@cygnus.com>
11447 * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int.
11449 Mon Apr 27 13:58:10 1998 Mark Mitchell <mmitchell@usa.net>
11451 * decl.c (maybe_push_to_top_level): Always clear
11452 current_template_parms and processing_template_decl.
11453 (pushtag): Remove check of current_class_type and some comments,
11454 since maybe_push_to_top_level no longer creates confusion.
11456 Sun Apr 26 12:10:18 1998 Mark Mitchell <mmitchell@usa.net>
11458 * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
11459 (DECL_CLASS_TEMPLATE_P): Likewise.
11460 (DECL_PRIMARY_TEMPLATE): Likewise.
11461 (PRIMARY_TEMPLATE_P): Use it.
11462 (push_template_decl_real): New function.
11463 (redeclare_class_template): Take new template parameters as
11465 (is_specialization_of): New function.
11466 (comp_template_args): Declare.
11467 * decl.c (pushtag): Handle friend template classes.
11468 (xref_tag): Likewise. Use new calling convention for
11469 redeclare_class_template.
11470 * decl2.c (grok_x_components): Handle friend templates.
11471 * friend.c (is_friend): Use is_specialization_of where
11472 appropriate. Deal with friend class templates.
11473 (make_friend_class): Let a class template be friends with itself.
11474 * pt.c (comp_template_args): Remove declaration.
11475 (tsubst_friend_class): New function.
11476 (push_template_decl_real): New function.
11477 (push_template_decl): Use it.
11478 (redeclare_class_template): Adjust for new calling convention.
11479 (comp_template_args): Give it external linkage.
11480 (instantiate_class_type): Use tsubst_friend_class to deal
11481 with friend templates.
11482 * typeck.c (comptypes): Use comp_template_args, rather than
11483 expanding it inline.
11484 * parse.y (component_decl): Handle a nested template type
11485 like other component type declarations.
11487 * pt.c (check_explicit_specialization): Handle overloaded
11488 constructors correctly.
11490 * pt.c (mabybe_get_template_decl_from_type_decl): New function.
11491 (lookup_template_class): Use it.
11493 Thu Apr 23 21:19:06 1998 Jason Merrill <jason@yorick.cygnus.com>
11495 * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops.
11496 * cp-tree.h: Add WRAPPER support.
11497 * call.c (add_candidate): Split out from add_*_candidate fns.
11498 (build_over_call): Take the candidate instead of function and args.
11499 Enforce access control here. Emit overload warnings here.
11500 (add_warning): New fn.
11501 (joust): Add WARN parm. If not set, call add_warning instead of
11502 printing a warning. Re-enable some warnings.
11503 (tourney): Pass it.
11504 (convert_like): Adjust.
11505 (build_new_op): Adjust.
11506 (build_new_function_call): Adjust.
11507 (build_user_type_conversion_1): Adjust.
11508 (USER_CONV_FN): Adjust.
11509 * tree.c (build_expr_wrapper, build_expr_ptr_wrapper,
11510 build_int_wrapper): New fns.
11512 Thu Apr 23 18:27:53 1998 Mark P. Mitchell <mmitchell@usa.net>
11514 * pt.c (unify): Fix typo in previous change.
11516 Thu Apr 23 09:32:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11518 * error.c (dump_type_real): Declare canonical_name.
11520 * typeck.c (comp_target_types): Fix PMFs.
11522 Wed Apr 22 13:24:48 1998 Mark Mitchell <mmitchell@usa.net>
11524 * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for
11525 the DECL_RESULTs of a member TEMPLATE_DECL, not just the
11528 * pt.c (tsubst): Decrease the template-level of
11529 TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a
11530 TEMPLATE_PARM_INDEX.
11531 (template_decl_level): New function.
11532 (unify): Make sure to record unifications for template
11533 parameters, even when the parameters exactly match the arguments.
11534 Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
11535 TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that
11536 aren't from the level we're currently working on.
11538 Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net>
11540 * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
11542 * decl2.c (check_member_template): Set DECL_IGNORED for member
11543 class templates, too.
11545 * decl2.c (grokfield): Remangle the name of a member TYPE_DECL.
11547 Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
11549 * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
11551 Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com)
11553 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare.
11554 * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
11555 (init_decl_processing): Handle TI types.
11556 * typeck.c (unsigned_type, signed_type): Handle TI types.
11558 Sat Apr 18 15:25:21 1998 Jim Wilson <wilson@cygnus.com>
11560 * g++spec.c (lang_specific_driver): New argument in_added_libraries.
11561 New local added_libraries. Increment count when add library to
11564 Fri Apr 17 21:25:00 1998 Mark Mitchell <mmitchell@usa.net>
11566 * cp-tree.h (type_as_string_real): New function.
11567 * pt.c (mangle_class_name_for_template): Use it.
11568 * error.c (dump_aggr_type): Change prototype.
11569 (dump_type_prefix): Likewise.
11570 (dump_type_suffix): Likewise.
11571 (dump_type_real): Convert from dump_type. If desired, the
11572 "canonica" name of a typedef, i.e., the name of the underlying
11573 type, can be printed.
11574 (dump_type): Call dump_type_real.
11576 Fri Apr 17 14:30:45 1998 Jason Merrill <jason@yorick.cygnus.com>
11578 * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks.
11580 * typeck.c (comp_target_types): Tweak pedantic case.
11581 (comp_target_parms): Tweak pedantic case. Clean up somewhat.
11582 Return -1 or 1 instead of 1 or 2.
11583 (compparms): Remove STRICT handling.
11584 (convert_for_assignment): Fix handling of pmfs.
11586 Fri Apr 17 14:04:16 1998 Mark Mitchell <mmitchell@usa.net>
11588 * typeck.c (comp_target_types): Handle references like pointers.
11589 (comp_target_parms): Note that return code from comp_target_types
11590 can be negative to indicate failure.
11592 Fri Apr 17 09:10:52 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
11594 * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG),
11595 which requires a working target compiler to build.
11597 Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com)
11599 * tree.c (avoid_overlap): Add prototype.
11601 * spew.c (num_tokens): Add prototype.
11602 (nth_noken, add_token, consume_token, debug_yychar): Likewise.
11604 * search.c (dfs_check_overlap): Add prototype.
11605 (dfs_no_overlap_yet): Likewise.
11607 * pt.c (original_template): Add prototype.
11608 (inline_needs_template_parms): Likewise.
11609 (push_inline_template_parms_recursive): Likewise.
11610 (retrieve_specialization, register_specialization): Likewise.
11611 (print_candidates, reduce_template_parm_level): Likewise.
11612 (build_template_decl, mark_template_parm): Likewise.
11613 (tsubst_friend_function, get_bindings_real): Likewise.
11615 * method.c (start_squangling): Add prototype.
11616 (end_squangling, check_ktype, issue_ktype): Likewise.
11617 (build_overloaded_scope_ref, check_btype): Likewise.
11618 (build_mangled_template_parm_index): Likewise.
11620 * lex.c (init_cpp_parse): Add prototype.
11621 (handle_cp_pragma, handle_sysv_pragma): Likewise.
11622 (reduce_cmp, token_cmp): Likewise.
11624 * except.c (call_eh_info): Add prototype.
11625 (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise.
11626 (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise.
11628 * decl2.c (is_namespace_ancestor): Add prototype.
11629 (namespace_ancestor, add_using_namespace): Likewise.
11630 (ambiguous_decl): Likewise.
11632 * decl.c (indent): Add prototype.
11634 * call.c (add_template_candidate_real): Add prototype.
11636 Fri Apr 17 01:57:12 1998 Jason Merrill <jason@yorick.cygnus.com>
11638 * decl2.c (build_expr_from_tree): Just return a PMF.
11640 Fri Apr 17 00:45:12 1998 Mark Mitchell <mmitchell@usa.net>
11642 * typeck2.c (process_init_constructor): Don't strip cv-qualifiers
11643 when doing initializations.
11645 * pt.c (unify): Use comptypes to compare type args.
11647 Fri Apr 17 00:24:22 1998 Jason Merrill <jason@yorick.cygnus.com>
11649 * decl.c (duplicate_decls): Fix check for when it's safe to free
11652 * pt.c (mangle_class_name_for_template): Don't pass a typedef type
11655 Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
11657 * pt.c (build_template_parm_index): Add prototype.
11659 * search.c (my_tree_cons): Don't clear words outside the
11660 newly allocated node.
11662 Wed Apr 15 15:34:44 1998 Dave Brolley <brolley@cygnus.com>
11664 * lex.c (init_parse): Now returns char* containing the filename.
11666 Wed Apr 15 13:20:06 1998 John Carr <jfc@mit.edu>
11667 Jeff Law <law@cygnus.com>
11669 * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer
11672 Sun Apr 12 22:31:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
11674 * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
11676 Fri Apr 10 12:16:49 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
11678 * decl.c (duplicate_decls): Don't warn for redundant decls if
11679 friend: let add_friend take care of it.
11681 Thu Apr 9 02:40:48 1998 Jason Merrill <jason@yorick.cygnus.com>
11683 * sig.c (build_signature_pointer_constructor): Don't set
11684 TREE_HAS_CONSTRUCTOR for a signature pointer.
11685 * cvt.c (ocp_convert): Don't force a temporary for internal structs.
11686 * init.c (resolve_offset_ref): Warn about implicit & on pmfs
11688 * typeck.c (build_unary_op): Only allow taking the address of a
11690 * typeck2.c (digest_init): Simplify.
11691 (store_init_value): Don't pedwarn about using { } for pmfs.
11693 Thu Apr 9 22:16:57 1998 Per Bothner <bothner@cygnus.com>
11695 * cp-tree.h (start_decl): Update prototype.
11696 * decl.c (start_decl): Like the C version, new parameters
11697 for the attributes. Call cplus_decl_attributes here,
11698 (pushdecl): Like C version, do build_type_copy if TYPE_DECL,
11699 (grokdeclarator): Pass NULL for new start_decl arguments.
11700 * pt.c (tsubst_expr): Likewise.
11701 * parse.y: Merge cplus_decl_attribute calls into start_decl calls.
11702 * typeck.c (common_type): Check TYPE_MAIN_VARIANT.
11703 * lex.c (build_lang_decl): Add lang_name_java.
11704 * class.c (push_lang_context): Add lang_name_java.
11705 * method.c (build_mangled_name): Check for is_java_type.
11707 Thu Apr 9 22:16:57 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
11709 * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
11710 * call.c (build_scoped_method_call): Check for TREE_CODE for
11711 VOID_TYPE instead of type == void_type_node.
11712 (build_method_call): Likewise.
11713 * decl.c (lookup_name_real): Likewise.
11714 (grokdeclarator): Likewise.
11715 (start_decl): Likewise.
11716 (grokparms): Likewise.
11717 (start_function): Likewise.
11718 (finish_function): Likewise.
11719 (start_method): Likewise.
11721 Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
11723 * lex.c (finput): New variable.
11724 (init_cpp_parse): Renamed from init_parse.
11725 (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished.
11726 (finish_parse): New function.
11727 * cp-tree.h (init_lex, init_parse): Remove declarations.
11729 Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
11731 * call.c (build_call): Still evaluate the actual argument.
11732 * class.c (is_empty_class): Update for -fnew-abi.
11734 * decl2.c: -fnew-abi implies -fsquangle.
11736 * method.c (do_build_assign_ref): Don't do anything to copy
11738 (do_build_copy_constructor): Likewise.
11739 * call.c (build_over_call): Likewise.
11741 Sat Apr 4 18:43:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11743 * tree.c (avoid_overlap): Return a value.
11745 Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com)
11747 * method.c (check_btype): Add missing argument to xrealloc.
11748 (check_ktype): Likewise.
11750 Fri Apr 3 02:22:59 1998 Jason Merrill <jason@yorick.cygnus.com>
11752 Implement empty base optimization.
11753 * class.c (finish_struct_1): Add vbase fields earlier. Set
11754 CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty.
11755 * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns.
11756 (types_overlap_p): New fn.
11757 * tree.c (avoid_overlap): New fn.
11758 (build_base_fields): Use it to avoid overlapping empty bases.
11759 * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi.
11761 * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
11763 Re-implement allocation of base class subobjects.
11764 * tree.c (unshare_base_binfos): New fn.
11765 (layout_basetypes): Use it. Now handles offsets of both virtual and
11766 non-virtual bases, after layout_type.
11767 (layout_vbasetypes): Remove.
11768 (build_base_fields): Generate FIELD_DECLs for each non-virtual base.
11769 (build_vbase_pointer_fields): Split out from old layout_basetypes.
11770 * class.c (finish_base_struct): Lose offset handling code.
11771 Move nonvdtor warning here. Don't mess with t_binfo anymore.
11772 (finish_struct_1): Don't mess with t_binfo anymore. Use fns above.
11773 * cp-tree.h: Adjust.
11775 Thu Apr 2 14:25:13 1998 Jason Merrill <jason@yorick.cygnus.com>
11777 * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff.
11778 * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise.
11779 * class.c (duplicate_tag_error): Likewise.
11780 (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN.
11781 * tree.c (layout_vbasetypes): Update from layout_record, remove
11782 var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE.
11783 (layout_basetypes): Likewise.
11785 Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com)
11787 * class.c, Make sure system.h is included just after config.h.
11788 Delete lingering stdio and errno references too.
11789 * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise.
11791 Wed Apr 1 15:38:36 1998 Jason Merrill <jason@yorick.cygnus.com>
11793 * friend.c (is_friend): Fix access control for local classes.
11795 * class.c (is_empty_class): New fn.
11796 * call.c (build_call): Don't pass empty class objects to a function.
11798 Wed Apr 1 14:58:35 1998 Mark Mitchell <mmitchell@usa.net>
11800 * call.c (build_over_call): Do name resolution for default
11801 arguments of function templates in the scope of the templates.
11803 Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com)
11805 * call.c: Include system.h. Remove includes, declarations and
11806 defines provided by system.h.
11807 * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
11808 * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
11809 * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
11810 * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
11811 * typeck2.c, xref.c: Likewise.
11812 * Makefile.in: Dependencies updated as appropriate.
11813 * Make-lang.in: Likewise.
11815 Mon Mar 30 12:15:00 1998 Mark Mitchell <mmitchell@usa.net>
11817 * pt.c (fn_type_unification): Allow incomplete unification without
11818 an immediate error message.
11820 Mon Mar 30 08:55:42 1998 Jason Merrill <jason@yorick.cygnus.com>
11822 * tree.c (member_p): New fn.
11823 * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for
11824 initializing class members.
11826 * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'.
11827 * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX.
11829 * call.c (build_method_call): Handle non-scoped destructors, too.
11830 * pt.c (tsubst_copy): Likewise.
11832 * pt.c (print_template_context): Split out...
11833 (push_tinst_level): ...from here.
11835 * friend.c (is_friend): Don't pass a type to decl_function_context.
11837 * typeck.c (convert_for_initialization): Always hand off
11838 conversions to class type.
11840 Sun Mar 29 20:01:59 1998 Jason Merrill <jason@yorick.cygnus.com>
11842 * friend.c (is_friend): Local classes have the same access as the
11843 enclosing function.
11845 Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com)
11847 * typeck.c (expand_target_expr): Delete dead function.
11849 * search.c: Put various prototypes inside #ifdef MI_MATRIX.
11851 * repo.c (save_string): Delete dead function.
11853 * method.c (thunk_printable_name): Delete dead function.
11855 * lex.c (yynextch): Delete dead function.
11857 * expr.c (tree_extract_aggr_init): #if 0 out.
11859 * except.c (do_unwind): Delete dead function.
11860 (easy_expand_asm): Likewise.
11862 * cvt.c (build_conversion_type_1): Delete dead function.
11864 * cp-tree.h (push_expression_obstack): Declare.
11866 * call.c (source_type): #if 0 out.
11868 * class.c (alter_access): Remove unused label. Add braces
11869 around empty else clause.
11871 * lex.c (yyprint): Fix argument to printf.
11873 Sat Mar 28 17:43:52 1998 Mark Mitchell <mmitchell@usa.net>
11875 * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
11877 * pt.c (instantiate_class_template): Make sure template
11878 arguments are permanent.
11879 * init.c (resolve_offset_ref): Don't go looking around in
11882 * semantics.c: Add routines to handle expressions, and some
11883 declaration processing.
11884 * parse.y: Use them.
11885 (current_class_depth): Move declaration to cp-tree.h.
11886 * parse.c: Regenerated.
11887 * cp-tree.h: Use them.
11888 (current_class_depth): Declare.
11889 * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr.
11891 Fri Mar 27 20:23:18 1998 Mark Mitchell <mmitchell@usa.net>
11893 * error.c (dump_decl): Be a bit more explicit with template
11894 type arguments, when verbose.
11896 Fri Mar 27 18:16:40 1998 Jason Merrill <jason@yorick.cygnus.com>
11898 * inc/exception: Reorder closing braces.
11900 Fri Mar 27 13:22:18 1998 Mark Mitchell <mmitchell@usa.net>
11902 * pt.c (redeclare_class_template): New function.
11903 * cp_tree.h (redeclare_class_template): Declare it.
11904 * decl.c (xref_tag): Use it.
11906 Thu Mar 26 11:16:30 1998 Jason Merrill <jason@yorick.cygnus.com>
11908 * call.c (build_over_call): Check IS_AGGR_TYPE, not
11909 TYPE_LANG_SPECIFIC.
11910 * typeck.c (convert_arguments): Likewise.
11912 * decl.c (grokdeclarator): Remove const and volatile from type after
11913 setting constp and volatilep.
11915 * class.c (finish_struct_1): Don't warn about bool bitfield larger
11918 Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
11920 * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
11922 Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
11924 * call.c (build_object_call): Complain about ambiguous operator(),
11925 rather that crashing.
11926 (build_new_op): Likewise.
11927 (build_op_delete_call): Likewise.
11929 Thu Mar 26 10:23:24 1998 Mark Mitchell <mmitchell@usa.net>
11931 * cvt.c (perform_qualification_conversions): Use comp_target_types
11932 instead of comp_ptr_ttypes.
11934 Wed Mar 25 16:10:50 1998 Mark Mitchell <mmitchell@usa.net>
11936 * cp-tree.h (enforce_access): Declare.
11937 * call.c (enforce_access): Make it extern, not static.
11938 * class.c (alter_access): Use enforce_access; modify code for ISO
11939 compliance, rather than ARM rules.
11941 Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11943 * cp-tree.h: Fix typo.
11945 Wed Mar 25 02:01:02 1998 Jason Merrill <jason@yorick.cygnus.com>
11947 * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
11948 if (aggregate_value_p (type)).
11950 * decl2.c (constructor_name_full): Handle TYPENAME_TYPE.
11952 Tue Mar 24 16:12:01 1998 Mark Mitchell <mmitchell@usa.net>
11954 * tree.c (mapcar): When dealing with a DECL, use it's constant
11956 * pt.c (lookup_template_class): Don't mangle the names of template
11957 classes whose arguments are unknown.
11959 * pt.c (tsubst_expr): Handle GOTO_STMT correctly.
11961 Tue Mar 24 12:21:55 1998 Benjamin Kosnik <bkoz@lisa.cygnus.com>
11963 * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1.
11965 Tue Mar 24 12:21:48 1998 Jim Wilson <wilson@cygnus.com>
11967 * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for
11968 boolean_type_node to 1.
11970 Tue Mar 24 10:23:47 1998 Mark Mitchell <mmitchell@usa.net>
11972 * error.c (dump_expr): Remove unused variable `l'.
11974 * pt.c (for_each_template_parm): New function, created by
11975 converting uses_template_parms.
11976 (tree_fn_t): New typedef.
11977 (uses_template_parms): Use it.
11978 (mark_template_parm): New function.
11979 (push_template_decl): Check that the argument list of a partial
11980 specialization uses all the template parameters.
11982 * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
11983 with it; we might want it for debugging.
11984 * cp-tree.h (type_unification): Change interface.
11985 * class.c (finish_struct_1): Skip nested template types, just like
11986 ordinary nested types.
11987 (instantiate_type): Use new interface to type_unification.
11988 * lex.c (init_lex): Add __sz as opname for sizeof.
11989 * method.c (build_overload_scope_ref): New function.
11990 (build_overload_int): Handle complex expressions. Set
11991 numeric_output_need_bar if necessary.
11992 (build_overload_value): Handle non-PARM_DECL nodes; this
11993 routine is now used by build_overload_int. Remove some
11994 assignments to numeric_output_need_bar. Use
11995 build_overload_scope_ref.
11996 (build_qualified_name): Note that some template mangled names end
11997 with digits, and set numeric_output_need_bar appropriately. Use
11998 build_underscore_int.
11999 * pt.c (unify): Change interface.
12000 (type_unification_real): Likewise.
12001 (determine_specialization): Use new interfaces.
12002 (tsubst): Deal gracefully with situations in which the argument
12003 vector is not fully filled.
12004 (fn_type_unification): Use new interfaces.
12005 (type_unification): Likewise. Remove NOP_EXPR hack.
12006 (type_unification_real): Likewise.
12007 (unify): Likewise. Deal with unification of complex expressions.
12009 Mon Mar 23 12:24:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12011 * pt.c (complete_template_args): Initialize skip properly.
12013 * decl.c (make_typename_type): Revert.
12014 (make_implicit_typename): Remove.
12015 (lookup_name_real): Don't call it. Call lookup_field if we see a
12016 TYPE_DECL from a template base.
12017 * search.c (lookup_field): Do implicit typename stuff.
12019 Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
12020 Geoff Noer <noer@cygnus.com>
12022 * Makefile.in: Various fixes for building cygwin32 native toolchains.
12023 * Make-lang.in: Likewise.
12025 Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12027 * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify.
12029 Fri Mar 20 10:42:07 1998 Jason Merrill <jason@yorick.cygnus.com>
12031 * decl.c (make_implicit_typename): Rewrite removed code.
12032 (make_typename_type): Call it if the type we look up comes from
12033 a base that uses template parms.
12035 * pt.c (complete_template_args): Rewrite.
12036 (tsubst, FUNCTION_DECL): Use it.
12038 Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org)
12040 * semantics.c (finish_asm_stmt): Fix combine strings. Call
12041 c_expand_asm_operands () if output_operands, input_operands or
12042 clobbers is not NULL_TREE.
12044 Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12046 * pt.c (complete_template_args): New function.
12047 (get_bindings): Deal with specializations of function templates
12048 with return type containing parameters from outer class
12050 (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level,
12051 substitute arguments and compose a new type.
12053 Thu Mar 19 19:01:48 1998 Mark Mitchell <mmitchell@usa.net>
12055 * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new
12058 Thu Mar 19 11:51:58 1998 Jason Merrill <jason@yorick.cygnus.com>
12060 * decl.c (make_implicit_typename): Lose useless code.
12062 * call.c (standard_conversion): Handle A* -> const A* properly.
12064 * pt.c (get_bindings_real): Rename from get_bindings. Add
12065 check_rettype parm.
12066 (get_bindings): Pass 1.
12067 (get_bindings_overload): Pass 0.
12069 Wed Mar 19 09:08:12 1998 Mark Mitchell <mmitchell@usa.net>
12071 * pt.c (check_explicit_specialization): When reverting a static
12072 member function, also remove the `this' parameter from
12073 last_function_parms.
12075 Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com>
12077 * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
12078 a function context.
12080 * decl.c (store_bindings): Use free_binding_vecs.
12081 (pop_from_top_level): Likewise.
12083 Wed Mar 18 12:41:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12085 * decl.c (make_implicit_typename): Only change the type of a
12088 Wed Mar 18 10:09:51 1998 Mark Mitchell <mmitchell@usa.net>
12090 * semantics.c: New file, containing routines to perform the
12091 semantic phase of parsing.
12093 * pt.c (tsubst_expr): Likewise.
12094 * cp-tree.h: Declare the various functions in semantics.c.
12095 Provide macros to access _STMT tree nodes.
12096 * cp-tree.def: Add ASM_STMT tree node.
12097 * Makefile.in, Make-lang.in: Add dependencies on and for
12100 Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com>
12102 * pt.c (push_template_decl): Only check primary templates.
12104 * pt.c (check_explicit_specialization): Complain about default args
12105 in explicit specialization.
12107 * parse.y (nomods_initdcl0): Also call cp_finish_decl for a
12108 constructor_declarator.
12110 Tue Mar 17 14:44:54 1998 Mark Mitchell <mmitchell@usa.net>
12112 * typeck2.c (build_x_arrow): Don't crash when an aggregate type
12113 has no overloaded operator ->.
12115 * call.c (build_field_call): Don't crash when presented with a
12116 field that is actually a nested type.
12118 * decl.c (pushtag): Deal with friend class injection in local
12121 * call.c (build_object_call): Don't crash if OBJ is a
12122 pointer-to-member-function.
12124 Tue Mar 17 11:40:26 1998 Jason Merrill <jason@yorick.cygnus.com>
12126 * pt.c (push_template_decl): Complain about template with C linkage,
12127 anonymous template class.
12129 Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
12131 * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
12132 * search.c: Likewise.
12134 * lex.c (do_pending_defargs): Only call
12135 maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
12137 * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
12139 Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
12141 * parse.y: Deal with CONSTRUCTORS in new_initializers.
12143 Mon Mar 16 10:54:21 1998 Mark Mitchell <mmitchell@usa.net>
12145 * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
12146 closely mimics the behavior in parse.y.
12147 (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing
12148 into a compound statement.
12150 Sun Mar 15 02:07:26 1998 Jason Merrill <jason@yorick.cygnus.com>
12152 * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro.
12153 * pt.c (inline_needs_template_parms): New fn.
12154 (original_template): New fn.
12155 (push_inline_template_parms_recursive): New fn.
12156 (maybe_begin_member_template_processing): Use them.
12157 (maybe_end_member_template_processing): Likewise.
12158 (is_member_or_friend_template): Rename to is_member_template.
12159 Member functions of local classes are never member templates.
12161 Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12163 * lex.c (do_identifier): Handle TEMPLATE_DECL that was
12164 added in the class scope to catch redefinition error.
12166 * pt.c (reduce_template_parm_level): Also copy
12167 the DECL_TEMPLATE_PARMS field.
12169 Sun Mar 15 10:54:08 1998 Mark Mitchell <mmitchell@usa.net>
12171 * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a
12172 reduced-level template type parameter.
12174 Sun Mar 15 12:26:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
12176 * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider.
12177 (DECL_NEEDS_FINAL_OVERRIDER_P): New macro.
12178 * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P.
12179 * decl.c (duplicate_decls): Propagate it.
12180 * typeck2.c (abstract_virtuals_error): Use two loops to emit
12181 abstract virtual functions and virtual functions which need a
12182 final overrider separately.
12184 Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
12186 * lang-specs.h: Properly put brackets around array elements in
12189 * typeck.c (build_binary_op_nodefault): Correctly place parens around
12190 && and || in expression.
12192 Thu Mar 12 09:26:04 1998 Manfred Hollstein <manfred@s-direktnet.de>
12194 * call.c (default_parm_conversions): Remove prototype definition.
12195 (build_method_call): Remove unused variable result.
12197 * cvt.c (ocp_convert): Remove unused variable conversion.
12199 * decl2.c (ambiguous_decl): Add explicit parameter definition for name.
12201 * except.c (do_unwind): #if 0 definition of unused variables fcall
12204 * expr.c (extract_scalar_init): #if 0 prototype and function
12207 * init.c (expand_aggr_init_1): Remove unused variable init_type.
12208 (build_new_1): Remove unused variable t.
12210 * pt.c (instantiate_class_template): Remove unused variable newtag;
12211 cast called function return value to void.
12212 (do_decl_instantiation): Remove unused variables name and fn.
12214 * tree.c (get_type_decl): Add default return to shut up compiler from
12215 complaining control reaches end of non-void function.
12217 * typeck.c (build_x_conditional_expr): Remove unused variable rval.
12219 Thu Mar 12 09:12:15 1998 Manfred Hollstein <manfred@s-direktnet.de>
12221 * call.c (default_parm_conversions): Remove prototype definition.
12222 (build_method_call): Remove unused variable result.
12223 (build_over_call): Add default case in enumeration switch.
12225 Thu Mar 12 08:39:13 1998 Manfred Hollstein <manfred@s-direktnet.de>
12227 * decl2.c (lang_decode_option): Change j's type to size_t.
12229 * tree.c (layout_vbasetypes): record_align and desired_align are of
12230 type unsigned int; const_size and nonvirtual_const_size likewise.
12232 Wed Mar 11 07:25:20 1998 Mark Mitchell <mmitchell@usa.net>
12234 * parse.y (new_initializer): Make sure all initializers are
12237 Tue Mar 10 07:32:36 1998 Mark Mitchell <mmitchell@usa.net>
12239 * decl2.c (import_export_decl): Mark tinfo functions for
12240 cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN.
12242 Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com)
12244 * method.c: Fix typo.
12246 Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12248 * method.c: Include "system.h" to get stdlib.h, stdio.h,
12249 ctype.h, string.h, etc.
12250 (issue_nrepeats): Add default case in enumeration switch.
12251 (check_btype): Likewise.
12252 (process_overload_item): Likewise.
12254 * Makefile.in (method.o): Depend on system.h.
12256 Wed Mar 4 22:26:53 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12258 * lex.c (do_scoped_id): Fix parenthesizing.
12260 Wed Mar 4 12:11:53 1998 Michael Tiemann <tiemann@axon.cygnus.com>
12262 * rtti.c (get_tinfo_fn_dynamic): If this function is called an
12263 FLAG_RTTI is unset, initialize type info machinery and continue
12264 with FLAG_RTTI enabled.
12265 (get_typeid): Likewise.
12267 Wed Mar 4 11:47:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12269 * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
12272 Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
12274 * pt.c (finish_member_template_decl): Deal more gracefully with
12275 invalid declarations.
12277 Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
12279 * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c,
12280 cp-tree.h: Clean up more old overloading code, old RTTI code, and
12281 some formatting quirks.
12283 * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
12284 method.c, pt.c, ptree.c, typeck.c: Remove support for
12285 -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
12287 * Makefile.in: Adjust.
12289 * pt.c (unify): Don't allow reduced cv-quals when strict.
12291 * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from
12292 *type_unification* and unify.
12294 Mon Mar 2 12:11:06 1998 Jason Merrill <jason@yorick.cygnus.com>
12296 * parse.y (explicit_template_type): Remove TEMPLATE keyword.
12297 (nested_name_specifier): And add it before this use.
12298 (typename_sub0): And this use. Also add use without the keyword.
12299 (typename_sub1): Likewise.
12300 * pt.c (instantiate_class_template): Don't actually instantiate
12301 anything if our type uses template parms.
12303 Mon Mar 2 11:04:59 1998 Jim Wilson <wilson@cygnus.com>
12305 * decl.c (start_function): Don't call temporary_allocation for a
12308 Sun Mar 1 21:06:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12310 * pt.c (instantiate_class_template): Don't mess with friends if
12311 our type uses template parms.
12313 Sat Feb 28 12:06:44 1998 Jason Merrill <jason@yorick.cygnus.com>
12315 * parse.y (nested_name_specifier): Use explicit_template_type.
12316 (typename_sub): Allow a template_type, an explicit_template_type,
12317 or an implicit template type at the end.
12318 * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL.
12319 * decl.c (make_typename_type): Handle template-id where the name
12320 is a TEMPLATE_DECL.
12321 * call.c (build_scoped_method_call): Handle member template
12323 * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member
12324 destructor is represented by the type.
12326 * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro.
12327 * parse.y (nested_name_specifier): Add 'template' case.
12328 (explicit_template_type): New rule.
12329 (typename_sub): Use it.
12330 * decl.c (make_typename_type): Handle getting a template-id for NAME.
12331 * pt.c (tsubst): Likewise.
12333 Fri Feb 27 11:17:50 1998 Jason Merrill <jason@yorick.cygnus.com>
12335 * pt.c (add_to_template_args): Fix thinko.
12336 (instantiate_class_template): Call it later.
12338 * pt.c (get_class_bindings): Add outer_args parm.
12339 (most_specialized_class): Likewise.
12340 (instantiate_class_template): Pass it.
12341 (more_specialized_class): Likewise.
12342 (lookup_template_class): Get context from template if none
12344 (finish_member_template_decl): Don't do anything with a
12345 partial specialization.
12346 * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of
12348 * class.c (finish_struct): Member class templates have already been
12349 checked for name clashes.
12350 * decl.c (pushdecl_with_scope): Handle pushing at class level.
12352 Fri Feb 27 02:25:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12354 * pt.c (tsubst, TEMPLATE_DECL): Support member class templates.
12355 (tsubst, *_PARM): Support multiple levels of template classes.
12356 (instantiate_class_template): Look up the pattern from the
12358 (lookup_template_class): Handle getting a template for d1.
12359 (push_template_decl): Correct setting of 'primary'.
12360 (reduce_template_parm_level): Add 'levels' parm.
12361 (finish_member_template_decl): Support member class templates.
12362 (template_class_depth): Handle multiple levels.
12363 * parse.y (component_decl_1, fn.def2): Remove member template case.
12364 (component_decl): Add member template cases.
12365 * decl2.c (check_member_template): We now handle member template
12367 * decl.c (pushtag): Handle member templates.
12368 * method.c (do_inline_function_hair): Don't touch
12369 IDENTIFIER_GLOBAL_VALUE.
12370 * init.c (build_offset_ref): If name isn't an identifier, just
12372 * spew.c (yylex): Handle PTYPENAME like TYPENAME.
12374 * typeck.c (get_delta_difference): Do adjust for conversions to
12375 and from virtual base.
12377 Wed Feb 25 09:51:29 1998 Jason Merrill <jason@yorick.cygnus.com>
12379 * typeck.c (get_delta_difference): Give hard error for conversion
12382 * cp-tree.h: Tweak formatting.
12384 Wed Feb 25 00:35:33 1998 Jason Merrill <jason@yorick.cygnus.com>
12386 * decl.c (push_namespace): Handle redeclaration error.
12388 * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro.
12389 (IDENTIFIER_NAMESPACE_BINDINGS): New macro.
12390 (NAMESPACE_BINDING): New macro.
12391 (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING.
12394 * pt.c (push_template_decl): Use innermost_args.
12396 * decl.c (get_unique_name): Tweak from earlier in the name.
12398 Tue Feb 24 22:15:04 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
12400 * cp-tree.def: Add CPLUS_BINDING node.
12401 * cp-tree.h (tree_binding): New struct.
12402 (BINDING_SCOPE, BINDING_VALUE): New macros.
12403 (current_namespace, global_namespace): Declare extern.
12404 (struct lang_decl_flags): New field in_namespace.
12405 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros.
12406 (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros.
12407 (TREE_INDIRECT_USING): New macro.
12408 * decl2.c (current_namespace, global_namespace): Declare. The
12409 value is a NAMESPACE_DECL now, not a TREE_LIST.
12410 (is_namespace_ancestor, namespace_ancestor): New static functions.
12411 (add_using_namespace, ambiguous_decl): Likewise.
12412 (lookup_using_namespace): New support function for lookup_name.
12413 (qualified_lookup_using_namespace): New support function for
12414 do_scoped_id and lookup_namespace_name.
12415 (get_namespace_id): Mark as obsolete.
12416 (current_namespace_id): Likewise.
12417 (do_namespace_alias): Implement.
12418 (do_using_directive): Implement as call to add_using_namespace.
12419 * decl.c (binding_for_name): New function.
12420 (push_namespace, pop_namespace): Implement.
12421 (push_decl): Don't install a FUNCTION_DECL in the global branch.
12422 (lookup_namespace_name): Implement using qualified lookup.
12423 (lookup_name_real): For global scoping, lookup in
12424 global_namespace. For namespace scoping, lookup in given
12425 namespace. For unscoped lookup, iterate over namespace,
12426 considering using directives.
12427 (init_decl_processing): Initialize global_namespace.
12428 (grokvardecl): Build assembler name as static name for globals.
12429 (grokdeclarator): Remove old namespace mangling.
12430 (xref_tag): When installing a global binding for the
12431 tag, make sure we have an identifier.
12432 * method.c (build_overload_nested_name): Mangle namespaces.
12433 (build_qualified_name): Likewise.
12434 (build_decl_overload_real): Likewise.
12435 * lex.c (build_lang_decl): Set namespace for new declaration to
12437 (do_scoped_id): Find global names in global or current
12438 namespace, or using qualified namespace lookup, depending on
12440 * init.c (build_member_call): When scope is namespace, use
12441 build_x_function_call instead.
12442 (build_offset_ref): When scope is namespace, collapse processing
12443 to lookup_namespace_name instead.
12444 * error.c (dump_decl): Support NAMESPACE_DECL.
12445 * decl.c (pushdecl): Bind globals to current namespace.
12446 (push_overloaded_decl): Likewise.
12447 (lookup_tag): Likewise.
12448 (lookup_name_current_level): Likewise.
12449 (xref_tag): Likewise.
12450 (start_function): Likewise.
12451 * lex.c (do_identifier): Likewise.
12452 (identifier_typedecl_value): Likewise.
12453 (real_yylex): Likewise.
12454 * method.c (do_inline_function_hair): Likewise.
12455 * parse.y (unscoped): Likewise.
12456 * pt.c (check_explicit_specialization): Likewise.
12457 (lookup_template_class): Likewise.
12458 * rtti.c (call_void_fn): Likewise.
12459 * sig.c (build_sigtable): Likewise.
12460 * ptree.c (lang_print_xnode): New function.
12462 Tue Feb 24 01:40:24 1998 Jason Merrill <jason@yorick.cygnus.com>
12464 * pt.c (instantiate_class_template): Don't instantiate if pedantic
12465 and the args use template parms.
12467 * pt.c (push_tinst_level): If the instantiation uses template parms,
12469 * decl.c (xref_basetypes): Do call complete_type for basetypes
12470 that involve template parameters.
12472 Tue Feb 24 00:36:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12474 * typeck2.c (process_init_constructor): Fix labeled init check.
12476 Mon Feb 23 05:08:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12478 * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS
12479 argument to tsubst and friends.
12481 * pt.c (tsubst, FUNCTION_DECL): Tidy.
12483 * typeck.c (build_x_function_call): Handle static member function
12484 templates like non-templates. Handle friend templates like normal
12485 function templates.
12486 * pt.c (tsubst, *_PARM): Don't use orig_level.
12487 (get_bindings): Don't call add_to_template_args.
12488 (instantiate_template): Likewise.
12489 (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
12490 * ptree.c (print_lang_type): Print index/level for template parms.
12492 Mon Feb 23 02:52:29 1998 Mark Mitchell <mmitchell@usa.net>
12494 * Make-lang.in (cc1plus): Note that cc1plus depends on
12495 cp/cp-tree.h and cp/cp-tree.def.
12497 * cp-tree.def (TEMPLATE_CONST_PARM): Remove.
12498 (TEMPLATE_PARM_INDEX): New tree code, used to indicate a
12499 position in a template parameter list.
12500 * cp-tree.h (template_parm_index): New structure, used as the tree
12501 structure for a TEMPLATE_PARM_INDEX.
12502 (TEMPLATE_PARM_IDX): New macro.
12503 (TEMPLATE_PARM_LEVEL): Likewise.
12504 (TEMPLATE_PARM_DESCENDANTS): Likewise.
12505 (TEMPLATE_PARM_ORIG_LEVEL): Likewise.
12506 (TEMPLATE_PARM_DECL): Likewise.
12507 (TEMPLATE_TYPE_PARM_INDEX): Likewise.
12508 (TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
12509 (TEMPLATE_TYPE_DECL): Likewise.
12510 (TEMPLATE_CONST_IDX): Remove.
12511 (TEMPLATE_CONST_LEVEL): Likewise.
12512 (TEMPLATE_CONST_SET_INFO): Likewise.
12513 (TEMPLATE_TYPE_SET_INFO): Likewise.
12514 (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
12516 (TEMPLATE_TYPE_LEVEL): Likewise.
12517 * decl.c (decls_match): Call comp_template_parms, rather than
12518 expanding it inline.
12519 (duplicate_decls): If two template declarations are being merged,
12520 then their TEMPLATE_INFOs should be merged as well.
12521 (grokfndecl): Save template-id information when declaring a friend
12522 with explicit template arguments. Pass arguments to
12523 check_explicit_specialization via correct convention; at some
12524 point check_explicit_specialization changed, but these call-sites
12526 (grokdeclarator): Tidy up slightly.
12527 * decl2.c (check_classfn): Tidy up slightly. Don't assume that
12528 two template functions with the same DECL_ASSEMBLER_NAME the same,
12529 since the names are not yet mangled.
12530 * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
12531 TEMPLATE_CONST_PARM.
12532 (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the
12533 decl for a non-type parameter, rather than printing `<tparm ...>'.
12534 * friend.c (is_friend): Handle TEMPLATE_DECL friends.
12535 (do_friend): Deal with template friends.
12536 * lex.c (do_pending_inlines): Call
12537 maybe_begin_member_template_processing, rather than
12538 conditionally calling begin_member_template_processing.
12539 (process_next_inline): Likewise. Call
12540 maybe_end_member_template_processing, rather than
12541 conditionally calling end_member_template_processing.
12542 (do_pending_defargs): Likewise.
12543 (do_identifier): Use TEMPLATE_PARM_INDEX instead of
12544 TEMPLATE_CONST_PARM.
12545 * method.c (build_mangled_template_parm_index): New function.
12546 (build_overload_value): Use it.
12547 (build_overload_name): Likewise.
12548 * pt.c (finish_member_template_decl): Allow friend declarations.
12549 (template_class_depth): New function.
12550 (is_member_template): Rename, and modify, to become...
12551 (is_member_or_friend_template): New function.
12552 (end_member_template_processing): Rename, and modify, to become...
12553 (maybe_end_member_template_processing).
12554 (build_template_parm_index): New function.
12555 (reduce_template_parm_level): New function.
12556 (process_template_parm): Modify to use build_template_parm_index.
12557 (push_template_decl): Deal with friend templates.
12558 (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
12559 TEMPLATE_CONST_PARM.
12560 (tsubst_friend_function): New function.
12561 (instantiate_class_template): Generate the DECL_FRIENDLIST
12562 for a new instantiation by using tsubst_friend_function rather
12564 (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
12565 Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
12566 appropriate new macros. Use reduce_template_parm_level to
12567 generate lower-level template parameters. Handle tsubst'ing into
12568 TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget
12569 to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
12570 templates. Similarly for the template parameters for a new
12572 (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead
12573 of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them.
12574 (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
12575 (get_bindings): Call add_to_template_args if necessary.
12576 (instantiate_decl): Handle instantiations of friend templates.
12577 * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
12578 TEMPLATE_TYPE_PARM as a list of fields; it's not!
12579 * spew.c (yylex): Do a little manual constant propagation to
12582 Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com)
12584 * error.c: Include sys/types.h.
12586 Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com)
12588 * method.c (build_mangled_name): Start CPP directives in column zero.
12590 Thu Feb 19 10:36:48 1998 Jason Merrill <jason@yorick.cygnus.com>
12592 * typeck2.c (process_init_constructor): Sorry about non-trivial
12593 labeled initializers.
12594 * parse.y (initlist): Re-enable labeled initializers.
12596 Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12598 * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm,
12599 all callers changed. Rely on the new parameter instead of arg
12600 being a TREE_LIST when determine whether we are working inside
12601 template template parameter. Clean up is_type test.
12603 Thu Feb 19 10:04:12 1998 Jason Merrill <jason@yorick.cygnus.com>
12605 * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT.
12606 * typeck2.c (initializer_constant_valid_p): Allow conversions
12607 between pointers and references.
12609 1998-02-19 Brendan Kehoe <brendan@cygnus.com>
12611 * typeck.c (build_unary_op): Only warn about incr/decr a pointer
12612 if pedantic || warn_pointer_arith.
12614 Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12616 * pt.c (unify): Handle TEMPLATE_DECL.
12618 1998-02-18 Brendan Kehoe <brendan@cygnus.com>
12620 * cp-tree.h (strip_attrs): Remove decl.
12622 1998-02-18 Doug Evans <devans@cygnus.com>
12624 * decl.c (duplicate_decls): Call merge_machine_decl_attributes.
12625 Update olddecl's attributes too.
12626 (strip_attrs): Remove function.
12627 * typeck.c (common_type): Call merge_machine_type_attributes.
12629 Tue Feb 17 14:07:52 1998 Mark Mitchell <mmitchell@usa.net>
12631 * parse.y (initdcl0_innards): New grammar symbol.
12632 (nomods_initdecls, nomods_initdcl0): Change type from itype to
12633 none, since the resulting value is never used.
12634 (parse_decl): New function.
12635 (datadef): Remove redundant actions.
12636 (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards.
12637 * parse.c: Regenerated.
12639 Tue Feb 17 11:54:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12641 * parse.y (simple_stmt): Use getdecls() to check for decl.
12643 Sat Feb 14 11:50:51 1998 Manfred Hollstein <manfred@s-direktnet.de>
12645 * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
12647 (c++.install-common): Install c++filt properly as native or as cross
12649 (c++.uninstall): Add c++filt.
12651 Fri Feb 13 14:55:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12653 * call.c (standard_conversion): Fix multi-level ptr conversions.
12655 Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com>
12657 * init.c (build_new): Propagate error_mark_node up.
12659 Fri Feb 13 13:24:32 1998 Jason Merrill <jason@yorick.cygnus.com>
12661 * parse.y (simple_stmt): If the condition isn't a declaration,
12662 start the controlled block after the test.
12664 Fri Feb 13 02:26:10 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12666 * call.c (build_over_call): Convert builtin abs, labs and fabs to
12668 * decl.c (init_decl_processing): Re-enable abs, labs and fabs as
12671 Fri Feb 13 01:36:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12673 * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV.
12675 Fri Feb 13 00:21:59 1998 Jason Merrill <jason@yorick.cygnus.com>
12677 * cp-tree.h: Add access_protected_virtual_node.
12678 * class.c (init_class_processing): Initialize it.
12679 * decl.c (xref_basetypes): Use it.
12680 * parse.y (base_class_access_list): Likewise.
12682 * Make-lang.in (DEMANGLER_PROG): Add $(exeext).
12683 (c++.install-common): Install c++filt.
12685 Thu Feb 12 12:46:51 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
12687 * decl.c (shadow_tag): Give error for typedef-ing built-in types.
12689 Wed Feb 11 23:28:05 1998 Mark Mitchell <mmitchell@usa.net>
12691 * call.c (reference_binding): Use comptypes when comparing
12692 TYPE_MAIN_VARIANTS to handle non-canonical array/index types.
12694 Wed Feb 11 16:42:04 1998 Mark Mitchell <mmitchell@usa.net>
12696 * tree.c (is_overloaded_fn): Use really_overloaded_fn.
12697 (really_overloaded_fn): Move check here from is_overloaded_fn.
12698 (get_first_fn): Use really_overloaded_fn and is_overloaded_fn.
12700 Wed Feb 11 15:54:18 1998 Mark Mitchell <mmitchell@usa.net>
12702 * typeck.c (build_ptrmemfunc): Type-check pointer-to-member
12705 Mon Feb 9 22:23:31 1998 Mark Mitchell <mmitchell@usa.net>
12707 * cp-tree.h (push_template_decl): Return the decl passed in, or an
12708 equivalent duplicate.
12709 * decl.c (pushtag): Use the return value from push_template_decl.
12710 (duplicate_decls): When duplicating a template declaration, merge
12711 the DECL_TEMPLATE_RESULTs as well.
12712 (make_implicit_typename): Don't try to dive into typename types to
12713 find a context for making a new implicit typename.
12714 (start_decl): Use the return value from push_template_decl.
12715 (grokdeclarator): Complain about declarations list `const operator
12716 int'. Since we don't correctly handle in-class initializations of
12717 non-static data members, complain about this (now illegal)
12718 practice. Issue an error for initializations of non-const statics
12719 since that is illegal as well, and since we don't handle that case
12721 (start_function): Use the return value from push_template_decl.
12722 (start_method): Likewise.
12723 * decl2.c (grokfield): Likewise. Since the change to
12724 grokdeclarator ensures that all initialized fields are in fact
12725 static, remove a redundant test for TREE_PUBLIC.
12726 * parse.y (initlist): Disable labeled initializers since they do
12727 not work as per the documentation, and since they do not use the
12728 same syntax as the C front end.
12729 * pt.c (push_template_decl): Return the decl passed in, or an
12730 equivalent duplicate.
12731 (lookup_template_class): When searching in a nested context,
12732 use the right arguments.
12733 (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL.
12734 * typeck.c (build_component_ref): Assign the correct type to the
12735 result of build_vfn_ref.
12737 Tue Feb 10 23:56:46 1998 Jason Merrill <jason@yorick.cygnus.com>
12739 * pt.c (convert_nontype_argument): Fix typo.
12740 (check_explicit_specialization): Allow old-style specialization
12741 of class template members.
12743 Tue Feb 10 20:36:52 1998 Jason Merrill <jason@yorick.cygnus.com>
12744 Manfred Hollstein <manfred@s-direktnet.de>
12746 * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead
12747 when deciding to override DECL_ASSEMBLER_NAME.
12749 Tue Feb 10 15:30:55 1998 Andrew MacLeod <amacleod@torpedo.to.cygnus.com>
12751 * decl2.c (lang_f_options): Add -fsquangle to option processing list.
12752 * cp-tree.h (flag_do_squangling): Add declaration.
12753 * lang-options.h: Add -fsquangle and -fno-squangle.
12754 * method.c: Add macros and static variables for squangling.
12755 (build_overload_name): Rename to build_mangled_name, add logic for B
12756 compression, and split into process_modifiers and
12757 process_overload_item.
12758 (process_modifiers): New function, to handle constant, reference,
12760 (process_overload_item): New function, handles issue of type codes.
12761 (build_overload_name): New function, start squangling and call
12762 build_mangled_name.
12763 (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline.
12764 (start_squangling): New function to initialize squangling structs.
12765 (end_squangling): New function to destroy squangling structs.
12766 (nrepeats): Rename variable to Nrepeats.
12767 (issue_nrepeats): New function for issuing 'n' type repeats.
12768 (check_ktype): New function to check for type K name compression.
12769 (build_overload_nested_name): Add a check for K name compression.
12770 (build_qualified_name): Add a check for K name compression and don't
12771 use DECL_ASSEMBLER_NAME when squangling is on.
12772 (check_btype): New function, checks for B type compression.
12773 (build_static_name, build_decl_overload_real): Initiate squangling.
12774 (build_typename_overload, build_overload_with_type): Initiate
12777 Sun Feb 8 23:47:38 1998 scott snyder <sss@d0linux01.fnal.gov>
12779 * method.c (make_thunk): Avoid name buffer overflow.
12781 Sat Feb 7 16:48:54 1998 Jason Merrill <jason@yorick.cygnus.com>
12783 * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we
12784 don't define them yet.
12786 * parse.y (nomods_initdcl0): Add constructor_declarator case.
12788 Fri Feb 6 21:32:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
12790 * config-lang.in (diff_excludes): Use basename only.
12792 Thu Feb 5 19:10:40 1998 Jason Merrill <jason@yorick.cygnus.com>
12794 * tinfo2.cc: Add tinfo for signed char.
12796 Thu Feb 5 14:38:23 1998 Mike Stump <mrs@wrs.com>
12798 * search.c (compute_access): Handle protected constructors in derived
12799 classes as accessible.
12801 Wed Feb 4 01:26:49 1998 Jason Merrill <jason@yorick.cygnus.com>
12803 * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
12804 Call convert_from_reference sooner.
12806 Tue Feb 3 23:50:52 1998 Mark Mitchell <mmitchell@usa.net>
12808 * cvt.c (ocp_convert): Obtain the constant values from constant
12809 decls even if the destination type is the same as the type of the
12812 * decl2.c (finish_file): Make sure that static inlines with
12813 definitions are not marked DECL_EXTERNAL before returning.
12815 Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12817 * decl.c: Lose arg_looking_for_template.
12818 (lookup_name_real): Likewise.
12819 * parse.y: Lose processing_template_arg, template_arg1.
12820 (primary): Likewise.
12821 * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
12823 Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12825 * error.c (dump_decl): Fix type of default arguments for template
12826 template parameters and nontype template parameters.
12827 * parse.y (template_parm): Handle invalid default template
12828 template arguments here.
12830 * parse.y (template_parm): Use template_arg instead of PTYPENAME
12831 for default template template argument.
12832 * pt.c (coerce_template_parms): Merge default template argument
12833 codes. Can treat RECORD_TYPE as template name if it is implicitly
12834 created. Fix argument index in error message.
12835 * typeck.c (comptypes): Merge template argument comparison codes in
12836 TEMPLATE_TEMPLATE_PARM and RECORD_TYPE.
12838 Tue Jan 6 01:42:44 1998 Mumit Khan <khan@xraylith.wisc.edu>
12840 * lex.c (file_name_nondirectory): Also check for '/'.
12842 Mon Feb 2 11:24:22 1998 Mark Mitchell <mmitchell@usa.net>
12844 * parse.y (primary): Deal with statement-expressions in
12846 * pt.c (tsubst_copy): Handle BIND_EXPR.
12847 * tree.c (mapcar): Likewise.
12849 * call.c (add_template_candidate_real): Pass extra parameter to
12850 fn_type_unification.
12851 * cp-tree.h (fn_type_unification): Add parameter.
12852 * pt.c (fn_type_unification): Add additional parameter to deal with
12853 static member functions.
12854 (get_bindings): Deal with static member functions.
12856 * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro.
12857 (revert_static_member_fn): Declare.
12858 * decl.c (revert_static_member_fn): Remove declaration. Change
12859 linkage from internal to external.
12860 (cp_finish_decl): Deal with virtual functions in classes local to
12861 template functions.
12862 * decl2.c (finish_file): Don't forget to emit increment/decrement
12863 expressions in initializers for file-scope variables.
12864 * parse.y (typename_sub2): If the typename doesn't names a
12865 template, rather than a type, issue an error message.
12866 * pt.c (check_explicit_specialization): Handle specializations of
12867 static member functions.
12868 (coerce_template_parms): Handle offset references to lists of
12870 * search.c (note_debug_info_needed): Don't crash when handed a
12871 type which is being defined.
12872 * typeck.c (complete_type): Don't crash when handed NULL_TREE;
12873 that can happen with some illegal code.
12875 Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12877 * call.c (user_harshness): Initialize `code' to 0.
12878 (build_method_call): Initialize `candidates', `cp' and `len' to 0.
12879 (null_ptr_cst_p): Add parentheses around && within ||.
12880 (standard_conversion): Likewise.
12881 (z_candidate): Likewise.
12882 (build_user_type_conversion_1): Initialize `args' to NULL_TREE.
12883 (build_object_call): Likewise for `mem_args'.
12884 (build_new_op): Likewise for `mem_arglist'. Add `return' from
12885 default case in enumeration switch.
12887 * class.c (build_vtable_entry): Add explicit braces to avoid
12889 (build_class_init_list): Likewise.
12890 (finish_struct_1): Initialize `width' to 0.
12891 (instantiate_type): Initialize `name' to NULL_TREE. Add
12892 explicit braces to avoid ambiguous `else'.
12894 * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous
12897 * decl.c (grok_reference_init): Eliminate unused parameter, all
12899 (record_builtin_type): Initialize `tdecl' to NULL_TREE.
12900 (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE.
12901 (cp_finish_decl): Initialize `ttype' to NULL_TREE.
12902 (grokdeclarator): Add parentheses around && within ||. Add
12903 explicit braces to avoid ambiguous `else'.
12904 (grokparms): Initialize `type' to NULL_TREE.
12905 (xref_tag): Remove unused label `just_return'.
12906 (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE.
12907 (finish_function): Initialize `cond' and `thenclause' to NULL_TREE.
12908 (hack_incomplete_structures): Add parentheses around assignment
12909 used as truth value.
12911 * decl2.c (coerce_delete_type): Hide definition of `e3'.
12913 * error.c: Include <stdlib.h>.
12914 (dump_expr): Change the type of `i' to size_t. Remove unused
12917 * except.c (init_exception_processing): Remove unused variable `d'.
12918 (expand_throw): Likewise for `label'.
12920 * friend.c (add_friends): Add explicit braces to avoid ambiguous
12923 * init.c (sort_member_init): Initialize `last_field' to NULL_TREE.
12924 (sort_base_init): Likewise for `binfo'.
12925 (expand_member_init): Likewise for `rval'.
12926 (build_member_call): Add parentheses around assignment used as
12928 (build_offset_ref): Add explicit braces to avoid ambiguous `else'.
12929 (build_new): Initialize `nelts' to NULL_TREE. Initialize
12930 `old_immediate_size_expand' to 0.
12931 (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE.
12932 (build_vec_delete_1): Remove unused variable `block'.
12933 (expand_vec_init): Initialize `itype' to NULL_TREE.
12935 * lex.c: Include <strings.h> if we don't have <string.h>. Protect
12936 declaration of `index' and `rindex' with autoconf macros.
12937 (reinit_parse_for_expr): Remove unused variables
12938 `look_for_semicolon' and `look_for_lbrac'.
12939 (cons_up_default_function): Initialize `args' to NULL_TREE.
12940 (readescape): Initialize `firstdig' to 0.
12941 (real_yylex): Add parentheses around assignment used as truth value.
12943 * method.c: Include <strings.h> if we don't have <string.h>.
12944 Protect declaration of `index' with autoconf macro.
12946 * parse.y (primary): Add explicit braces to avoid ambiguous `else'.
12947 Initialize `type' to NULL_TREE.
12948 (structsp): Remove unused variable `id'.
12950 * pt.c (coerce_template_parms): Add explicit braces to avoid
12952 (lookup_template_class): Initialize `template' to NULL_TREE.
12953 (instantiate_class_template): Remove unused variable `name' and `e'.
12954 (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE.
12955 (do_poplevel): Initialize `saved_warn_unused' to 0.
12956 (type_unification): Remove unused varable `parm'.
12957 (unify): Likewise for `j'.
12959 * repo.c (init_repo): Add parentheses around assignment used as
12961 (finish_repo): Remove unused varable `p'.
12963 * search.c (get_binfo): Initialize `type' to NULL_TREE.
12964 (get_base_distance): Likewise.
12965 (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path'
12966 and `new_v' to NULL_TREE.
12967 (lookup_fnfields): Likewise for `rval_binfo_h'.
12968 (breadth_first_search): Add parentheses around assignment used as
12970 (get_template_base): Initialize `type' to NULL_TREE.
12972 * sig.c (append_signature_fields): Initialize `last_mfptr' to
12974 (build_signature_table_constructor): Likewise for
12975 `last_rhs_field', `pfn' and `vt_off'.
12976 (build_sigtable): Likewise for `init'.
12978 * tree.c (break_out_calls): Initialize `t2' to NULL_TREE.
12979 (propagate_binfo_offsets): Likewise for `delta'.
12980 (hash_tree_cons): Initialize hashcode to 0.
12981 (can_free): Likewise for `size'.
12982 (cp_tree_equal): Add explicit braces to avoid ambiguous `else'.
12984 * typeck.c (convert_sequence): Hide prototype.
12985 (common_type): Add explicit braces to avoid ambiguous `else'.
12986 (comp_target_types): Likewise.
12987 (build_x_function_call): Initialize `ctypeptr' to NULL_TREE.
12988 (build_function_call_real): Add explicit braces to avoid ambiguous
12990 (convert_arguments): Initialize `called_thing' to 0.
12991 (convert_for_initialization): Initialize `savew' and `savee' to 0.
12993 * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0.
12994 (digest_init): Initialize `old_tail_contents' to NULL_TREE.
12995 (build_x_arrow): Likewise for `last_rval'.
12997 * xref.c (GNU_xref_decl): Initialize `cls' to 0.
12999 Sun Feb 1 12:45:34 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
13001 * decl.c (init_decl_processing): Use set_sizetype.
13002 * decl2.c (sizetype): Don't declare.
13003 * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype.
13004 (c_sizeof_nowarn, build_binary_op_nodefault): Likewise.
13005 (build_component_addr, unary_complex_lvalue): Likewise.
13006 * rtti.c (expand_class_desc): Likewise.
13007 * class.c (get_vfield_offset): Likewise.
13009 Thu Jan 29 10:39:30 1998 Mark Mitchell <mmitchell@usa.net>
13011 * pt.c (convert_nontype_argument): Move check for is_overloaded_fn
13012 early to avoid bogus error. Handle overloaded function
13013 names provided as template arguments correctly.
13014 (coerce_template_parms): Don't mishandle overloaded functions when
13015 dealing with template template parameters.
13016 (lookup_template_class): Issue an error message, rather than
13017 crashing, when the TYPE_DECL provided is not a template type.
13019 Wed Jan 28 23:14:44 1998 Jason Merrill <jason@yorick.cygnus.com>
13021 * class.c (instantiate_type): Don't just return a known type if
13024 Wed Jan 28 11:04:07 1998 Mark Mitchell <mmitchell@usa.net>
13026 * class.c (instantiate_type): Remove handling of FUNCTION_DECL
13027 since that code could never be reached.
13029 * error.c (dump_decl): Avoid aborting in the midst of printing an
13030 error message about an illegal template declaration.
13032 * parse.y (structsp): Print an error message, rather than crashing,
13033 when a class-head does not name a class.
13035 * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE
13036 template arguments as a g++ extension.
13038 * cp-tree.def (ALIGNOF_EXPR): New tree code.
13039 * decl2.c (grok_alignof): If processing_template_decl, just store
13041 * typeck.c (c_alignof): Likewise.
13042 * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR.
13043 * error.c (dump_expr): Likewise.
13044 * pt.c (tsubst_copy): Likewise.
13045 * tree.c (cp_tree_equal): Likewise.
13046 * pt.c (uses_template_parms): Correctly determine whether or not a
13047 SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant
13048 folding can be done.
13050 * cp-tree.h (grok_enum_decls): Remove type parameter.
13051 * decl.c (grok_enum_decls): Likewise.
13052 * decl2.c (grok_x_components): Call grok_enum_decls
13053 unconditionally, since it will do nothing if there is no
13054 current_local_enum. Use the new calling sequence.
13055 * pt.c (tsubst_enum): Use the new calling sequence for
13058 * decl.c (start_function): Make member functions of local classes
13059 in extern inline functions have comdat linkage here...
13060 (grokdeclarator): Rather than here.
13062 Wed Jan 28 10:55:47 1998 Jason Merrill <jason@yorick.cygnus.com>
13064 * pt.c (convert_nontype_argument): Use decl_constant_value.
13066 Tue Jan 27 16:42:21 1998 Mark Mitchell <mmitchell@usa.net>
13068 * call.c (add_template_candidate_real): New function.
13069 (add_template_candidate): Use it.
13070 (add_template_conv_candidate): Likewise.
13071 (joust): Pass extra argument to more_specialized.
13072 * class.c (instantiate_type): Handle a single FUNCTION_DECL.
13073 (is_local_class): Remove.
13074 (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
13075 * cp-tree.h (is_local_class): Remove.
13076 (perform_array_to_pointer_conversion): Likewise.
13077 (finish_member_template_decl): Add.
13078 (check_explicit_specialization): Return a tree, not an int.
13079 (more_specialized): Take additional argument.
13080 (get_bindings): Likewise.
13081 (TI_PENDING_SPECIALIZATION_FLAG): New macro.
13082 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
13083 (perform_array_to_pointer_conversion): Remove.
13084 * decl.c (saved_scope): Add processing_specialization,
13085 processing_explicit_instantiation fields.
13086 (maybe_push_to_top_level): Save them.
13087 (pop_from_top_level): Restore them.
13088 (grokfndecl): Use new return value from
13089 check_explicit_specialization.
13090 (start_decl): Don't check flag_guiding_decls before pushing
13092 (cp_finish_decl): Remove previous (bogus) change.
13093 (grok_declarator): Use decl_function_context rather than
13095 * decl2.c (finish_file): Pass extra argument to get_bindings.
13096 (build_expr_from_tree): Let build_x_component_ref check
13097 validity of arguments rather than doing it here.
13098 * lex.c (cons_up_default_function): Remove code fooling with
13099 processing_specialization, processing_explicit_instantiation
13100 flags, as that is now done in {maybe_push_top,pop_from}_top_level.
13101 * method.c (build_overload_identifier): Mangle local classes in
13102 template functions correctly.
13103 * parse.y (finish_member_template_decl): Move to pt.c.
13104 * pt.c (finish_member_template_decl): Moved here from parse.y.
13105 (print_candidates): New function.
13106 (determine_specialization): Change interface. Properly look for
13107 most specialized versions of template candidates.
13108 (check_explicit_specialization): Fully process explicit
13110 (push_template_decl): Avoid looking at CLASSTYPE fields in
13112 (determine_overloaded_function): Remove.
13113 (convert_nontype_argument): Change name from
13114 convert_nontype_parameter. Use determine_overloaded_function
13115 instead of instantiate_type.
13116 (mangle_class_name_for_template): Handle type contexts as well as
13118 (classtype_mangled_name): Likewise.
13119 (lookup_template_class): Likewise.
13120 (tsubst): Likewise.
13121 (more_specialized): Take explict template arguments as a
13123 (most_specialized): Likewise.
13124 (get_bindings): Likewise. Check that return types match before
13125 proclaiming a function a match.
13126 (do_decl_instantiation): Remove code searching for function to
13127 instantiate; that is now done in check_explicit_specialization.
13128 (add_maybe_template): Pass extra argument to get_bindings.
13129 * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
13131 * typeck.c (build_component_ref): Check for invalid arguments.
13133 Tue Jan 27 01:44:02 1998 Jason Merrill <jason@yorick.cygnus.com>
13135 * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
13136 return_target and call_target are equivalent.
13138 * pt.c (type_unification_real): Just accept function parms that
13139 don't use any template parms.
13141 Sun Jan 25 03:30:00 1998 Jason Merrill <jason@yorick.cygnus.com>
13143 * decl.c (cp_finish_decl): When bailing on a comdat variable, also
13144 unset DECL_NOT_REALLY_EXTERN.
13146 * parse.y (typename_sub*): Fix std::.
13148 Sat Jan 24 12:13:54 1998 Jason Merrill <jason@yorick.cygnus.com>
13150 * error.c (dump_decl): Fix type default template args.
13151 (dump_type): Hand TEMPLATE_DECL off to dump_decl.
13153 Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
13155 * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
13156 (file_name_nondirectory): Use.
13158 Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
13160 * pt.c (coerce_template_parms): Don't access elements of ARGLIST
13161 that are not really present. Substitute default arguments in
13162 template template arguments. Correctly convert TEMPLATE_DECL to
13163 TEMPLATE_TEMPLATE_PARM.
13164 (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM
13165 are no longer treated specially here.
13166 * parse.y (template_template_parm): Fix copy error.
13167 * decl.c (grokdeclarator): Warn about missing `typename' for nested
13168 type created from template template parameters.
13169 * parse.y (bad_parm): Likewise
13171 * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM.
13172 (push_nested_class): Likewise.
13173 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code.
13174 * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro.
13175 (copy_template_template_parm): Declare.
13176 * decl.c (arg_looking_for_template): New variable.
13177 (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM.
13178 Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM
13179 node if arg_looking_for_template is nonzero.
13180 (pushdecl): Handle TEMPLATE_TEMPLATE_PARM.
13181 (grok_op_properties, xref_tag, xref_basetypes): Likewise.
13182 (grokdeclarator): Handle TEMPLATE_DECL.
13183 * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM.
13184 * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM.
13185 (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM.
13186 (dump_decl): Handle unnamed template type parameters.
13187 Handle template template parameters.
13188 (dump_function_name): Handle template template parameters.
13189 * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef):
13190 Handle TEMPLATE_TEMPLATE_PARM.
13191 * method.c (build_template_template_parm_names): New function.
13192 (build_template_parm_names): Handle TEMPLATE_DECL.
13193 (build_overload_nested_name, build_overload_name):
13194 Handle TEMPLATE_TEMPLATE_PARM.
13195 * parse.y (maybe_identifier): New nonterminal.
13196 (template_type_parm): Use it.
13197 (template_template_parm, template_arg1): New nonterminal.
13198 (template_parm): Add template_template_parm rules.
13199 (template_arg): Set processing_template_arg.
13200 (template_arg1): Rules moved from template_arg.
13201 (primary, nonnested_type): Set arg_looking_for_template if we are
13202 processing template arguments.
13203 * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL.
13204 (process_template_parm): Handle template template parameters.
13205 (coerce_template_parms, comp_template_args): Likewise.
13206 (mangle_class_name_for_template, lookup_template_class): Likewise.
13207 (uses_template_parms): Handle TEMPLATE_DECL and
13208 TEMPLATE_TEMPLATE_PARM.
13209 (current_template_args): Handle TEMPLATE_DECL.
13210 (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM.
13211 * search.c (dfs_walk, dfs_record_inheritance):
13212 Handle TEMPLATE_TEMPLATE_PARM.
13213 * tree.c (copy_template_template_parm): New function.
13214 (mapcar): Handle TEMPLATE_TEMPLATE_PARM.
13215 * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM.
13217 Mon Jan 19 22:40:03 1998 Mark Mitchell <mmitchell@usa.net>
13219 * decl.c (start_decl): Don't allow duplicate definitions of static
13222 * call.c (build_user_type_conversion_1): Handle user-defined
13223 template conversion operators correctly.
13225 * decl2.c (build_expr_from_tree): Issue an error message if the
13226 object in a COMPONENT_REF is a TEMPLATE_DECL.
13228 * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs.
13230 * class.c (is_local_class): New function.
13231 * cp-tree.h (is_local_class): Declare it.
13232 (last_tree): Likewise.
13233 (begin_tree): Likewise.
13234 (end_tree): Likewise.
13235 (lookup_template_class): Change prototype.
13236 * decl.c (cp_finish_decl): Check for NULL where necessary.
13237 Consider FUNCTION_DECLS to declare objects with top-level binding,
13238 when calling make_decl_rtl.
13239 (grokdeclarator): Give members of local classes internal linkage.
13240 (start_function): Remove declaration of last_tree.
13241 (finish_function): Set flag_keep_inline_functions around call to
13242 rest_of_compilation if we are processing a member function in a
13244 (start_method): Call push_template_decl for member functions of
13245 local classes in template functions.
13246 * decl2.c (import_export_decl): Don't give external linkage to
13247 instantiations of templates with internal linkage.
13248 * parse.y (last_tree): Remove declaration.
13249 (template_type): Pass extra parameter to lookup_template_class.
13250 (self_template_type): Likewise.
13251 (structsp): Move call to reset_specialization into left_curly.
13252 (left_curly): Call reset_specialization, and begin_tree.
13253 * pt.c (saved_trees): New variable.
13254 (mangle_class_name_for_template): Change prototype. Use
13255 additional function context to name local classes in templates
13257 (classtype_mangled_name): Pass the context.
13258 (push_template_decl): Handle local classes and templates, and
13259 member functions for such classes.
13260 (convert_nontype_parameter): Fix handling of pointer-to-member
13262 (lookup_template_class): Handle local classes in templates.
13263 (tsubst): Likewise. Don't assume that template instantiations
13264 have external linkage; pay attention to the template declaration.
13265 (mark_decl_instantiated): Likewise.
13266 (begin_tree): New function.
13267 (end_tree): Likewise.
13269 * decl.c (xref_basetypes): Don't call complete_type for basetypes
13270 that involve template parameters; that can lead to infinite
13271 recursion unnecessarily.
13273 * pt.c (register_specialization): Do not register specializations
13274 that aren't ready to be registered yet.
13275 (check_explicit_specialization): Handle explicit specialization of
13276 constructors and destructors.
13277 (build_template_decl): New function.
13278 (push_template_delc): Handle out-of-class specializations of
13281 * pt.c (check_explicit_specialization): Set up the template
13282 information before registering the specialization.
13283 (coerce_template_parms): Fix thinko.
13284 (tsubst): Handle specializations of member templates correctly.
13286 * class.c (finish_struct_methods): Remove calls to
13287 check_explicit_specialization from here.
13288 (finish_struct): And insert them here.
13289 * cp-tree.h (perform_qualification_conversions): New function.
13290 (perform_array_to_pointer_conversion): Likewise.
13291 (begin_explicit_instantiation): Likewise.
13292 (end_explicit_instantiation): Likewise.
13293 (determine_specialization): Renamed from
13294 determine_explicit_specialization.
13295 (comp_template_parms): New function.
13296 (processing_explicit_instantiation): New variable.
13297 * cvt.c (perform_qualification_conversions): New function.
13298 (perform_array_to_pointer_conversion): Likewise.
13299 * decl.c (duplicate_decls): Don't consider template functions
13300 alike unless they have the same parameters. Refine handling of
13301 instantiation/specialization mismatches.
13302 (start_decl): Don't call pushdecl for template specializations,
13303 since they don't affect overloading.
13304 (start_function): Likewise.
13305 (grokfndecl): Call check_explicit_specialization a little later.
13306 Don't call duplicate_decls for memberm template specializations.
13307 (grokdeclarator): Don't update template_count for classes that are
13308 themselves specializations. Remove use of `2' as parameter to
13309 grokfndecl since that value isn't used.
13310 * lex.c (cons_up_default_function): Save and restore
13311 processing_explicit_instantiation around calls to grokfield.
13312 * parse.y (finish_member_template_decl): New function.
13313 (component_decl_1): Use it.
13314 (fn.def2): Likewise.
13315 (template_arg_list_opt): New nonterminal.
13316 (template_type): Use it.
13317 (self_template_type): Likewise.
13318 (template_id): Likewise.
13319 (object_template_id): Likewise.
13320 (notype_template_declarator): Likwise.
13321 (begin_explicit_instantiation): Likewise.
13322 (end_explicit_instantiation): Likewise.
13323 (explicit_instantiation): Use them.
13324 * pt.c (coerce_template_parms): Add parameters.
13325 (processing_explicit_instantiation): New variable.
13326 (convert_nontype_parameter): New function.
13327 (determine_overloaded_function): Likewise.
13328 (begin_explicit_instantiation): Likewise.
13329 (end_explicit_instantiation): Likewise.
13330 (retrieve_specialization): Likewise.
13331 (register_specialization): Likewise.
13332 (processing_explicit_specialization): Removed.
13333 (determine_specialization): Handle specializations of member
13334 functions of template class instantiations.
13335 (check_explicit_specialization): Refine to conform to standard.
13336 (comp_template_parms): New function.
13337 (coerce_template_parms): Call convert_nontype_parameter.
13338 (tsubst): Refine handling of member templates. Use
13339 register_specialization.
13340 (instantiate_template): Use retrieve_specialization.
13341 (do_decl_instantiation): Likewise.
13342 (instantiate_decl): Likewise.
13343 (type_unification): Improve handling of explict template
13345 * tree.c (mapcar): Return error_mark_node, rather than aborting,
13346 on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
13347 * typeck.c (build_unary_op): Call determine_specialization, rather
13348 than determine_explicit_specialization.
13350 Mon Jan 19 13:18:51 1998 Jason Merrill <jason@yorick.cygnus.com>
13352 * cvt.c (build_up_reference): A TARGET_EXPR has side effects.
13354 Fri Jan 16 11:40:50 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13356 * error.c (dump_decl): For enum tags, output the tag, not its value.
13358 1998-01-13 Brendan Kehoe <brendan@cygnus.com>
13360 * decl.c (init_decl_processing): Only call init_rtti_processing
13363 Mon Jan 12 01:35:18 1998 Jason Merrill <jason@yorick.cygnus.com>
13365 * init.c (build_new_1): Split out from build_new.
13366 (build_new): Just return a NEW_EXPR.
13367 * expr.c (cplus_expand_expr): Handle NEW_EXPR.
13369 * decl2.c (get_temp_regvar): Tweak.
13371 * cp-tree.h (TREE_CALLS_NEW): Comment out.
13372 * class.c (resolves_to_fixed_type_p): Remove use.
13373 * method.c (build_opfncall): Likewise.
13374 * call.c (build_new_op): Likewise.
13376 Wed Jan 7 23:47:13 1998 Jason Merrill <jason@yorick.cygnus.com>
13378 * exception.cc (__eh_alloc, __eh_free): New fns.
13379 (__cp_push_exception, __cp_pop_exception): Use them.
13380 (__uncatch_exception): Call terminate here if no exception.
13381 * except.c (build_terminate_handler): New fn.
13382 (expand_start_catch_block): Use it.
13383 (expand_exception_blocks): Likewise.
13384 (alloc_eh_object): New fn.
13385 (expand_throw): Use it. Protect exception init with terminate.
13386 * typeck.c (build_modify_expr): Remove code that ignores trivial
13389 Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13391 * call.c (add_builtin_candidate): Add default case in enumeration
13393 (build_new_op): Likewise.
13394 (convert_like): Likewise.
13395 * cvt.c (build_expr_type_conversion): Likewise.
13396 * tree.c (real_lvalue_p): Likewise.
13397 (lvalue_p): Likewise.
13398 (cp_tree_equal): Likewise.
13399 * typeck.c (comptypes): Likewise.
13400 (build_component_ref): Likewise.
13401 (build_function_call_real): Likewise.
13402 (build_binary_op_nodefault): Likewise.
13403 (build_unary_op): Likewise.
13404 (build_modify_expr): Likewise.
13405 * typeck2.c (initializer_constant_valid_p): Likewise.
13407 Sun Dec 21 15:59:00 1997 Nick Clifton <nickc@cygnus.com>
13409 * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas.
13411 Thu Dec 18 14:51:50 1997 Mark Mitchell <mmitchell@usa.net>
13413 * pt.c (coerce_template_parms): Make sure to digest_init if
13416 * decl.c (duplicate_decls): Make the newdecl virtual if the
13417 olddecl was, just as is done with other attributes of olddecl.
13419 Thu Dec 18 14:43:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13421 * typeck.c (unary_complex_lvalue): Ignore op0 when taking the
13422 address of an OFFSET_REF.
13424 * cp-tree.def: Add AGGR_INIT_EXPR.
13425 * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
13426 AGGR_INIT_EXPR where appropriate.
13427 * expr.c (cplus_expand_expr): Likewise. Simplify.
13429 * decl2.c (finish_file): Remove call to register_exception_table.
13431 Wed Dec 17 17:08:52 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13433 * pt.c (instantiate_class_template): Don't do injection when
13434 processing_template_decl is true, as pollutes current_binding_level
13437 Wed Dec 17 21:17:39 1997 Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de>
13439 * pt.c (maybe_fold_nontype_arg): Add prototype.
13441 Tue Dec 16 10:31:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13443 * tree.c (mapcar): Handle TRY_CATCH_EXPR et al.
13444 * error.c (dump_expr): Likewise.
13446 Mon Dec 15 12:22:04 1997 Jason Merrill <jason@yorick.cygnus.com>
13448 * typeck.c (build_function_call_real): Remove "inline called before
13449 definition" pedwarn.
13451 * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg.
13453 Sun Dec 14 22:34:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13455 * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
13457 * pt.c (type_unification_real): Change __null to type void* with
13460 Sun Dec 14 20:38:35 1997 Mark Mitchell <mmitchell@usa.net>
13462 * call.c (implicit_conversion): Don't call
13463 build_user_type_conversion_1 with a NULL expr, since it will
13466 * pt.c (unify): Don't try to unify array bounds if either array is
13469 Fri Dec 12 16:09:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13471 * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at):
13472 Replace extern decls with casts.
13474 * decl.c (expand_start_early_try_stmts): Don't mess with a sequence.
13475 Update last_parm_cleanup_insn.
13476 (store_after_parms): Remove.
13477 * cp-tree.h: Adjust.
13479 Thu Dec 11 22:18:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13481 * decl2.c (comdat_linkage): Also set DECL_COMDAT.
13482 (finish_file): Check DECL_COMDAT instead of weak|one_only.
13483 (import_export_vtable): Use make_decl_one_only instead of
13484 comdat_linkage for win32 tweak.
13485 (import_export_decl): Likewise.
13486 * pt.c (mark_decl_instantiated): Likewise.
13488 * decl2.c (finish_file): Lose handling of templates in pending_statics.
13490 Thu Dec 11 21:12:09 1997 Jason Merrill <jason@yorick.cygnus.com>
13492 * decl2.c (finish_file): Lose call to expand_builtin_throw.
13493 * except.c (expand_builtin_throw): Remove.
13494 * cp-tree.h: Remove ptr_ptr_type_node.
13495 * decl.c: Likewise.
13497 Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
13499 * decl.c (ptr_ptr_type_node): Define.
13500 (init_decl_processing): Initialize it.
13501 * cp-tree.h: Declare it.
13502 * exception.cc (__cp_exception_info): Use __get_eh_info.
13503 (__cp_push_exception): Likewise.
13504 (__cp_pop_exception): Likewise.
13506 From Scott Snyder <snyder@d0sgif.fnal.gov>:
13507 * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
13509 (init_exception_processing): Removed saved_pc initialization.
13511 Wed Dec 10 11:04:45 1997 Jason Merrill <jason@yorick.cygnus.com>
13513 * pt.c (instantiate_decl): Defer all templates but inline functions.
13515 Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com>
13517 * init.c (expand_vec_init): Don't fold a list of parameters.
13519 * decl.c (copy_args_p): Handle copy elision for types with virtual
13521 * call.c (build_over_call): Likewise.
13523 Sun Dec 7 22:38:12 1997 Mark Mitchell <mmitchell@usa.net>
13525 * pt.c (lookup_template_function): Copy the template arguments,
13526 not just the list containing them, to the permanent obstack.
13528 Sun Dec 7 15:53:06 1997 Jason Merrill <jason@yorick.cygnus.com>
13530 * except.c (expand_start_catch_block): suspend_momentary for the
13533 * error.c (dump_decl): Handle LOOKUP_EXPR.
13535 Sun Dec 7 15:45:07 1997 Mark Mitchell <mmitchell@usa.net>
13537 * rtti.c (build_dynamic_cast): Copy the cast-to type to the
13538 permanent obstack if we are processing a template decl.
13539 * typeck.c (build_static_cast): Likewise.
13540 (build_const_cast): Likewise.
13541 (build_reinterpret_cast): Likewise.
13543 * pt.c (coerce_template_parms): Coerce some expressions, even
13544 when processing_template_decl.
13546 Sun Dec 7 01:46:33 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13548 * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
13549 handling of pointer difference expressions.
13551 * typeck.c (comp_target_types): Comparison of function/method types
13552 is independent of nptrs.
13554 Sun Dec 7 01:40:27 1997 Mark Mitchell <mmitchell@usa.net>
13556 * pt.c (tsubst): Avoid creating pointer to reference and
13557 reference to reference types.
13559 Sat Dec 6 01:29:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13561 * parse.y (do_id): New nonterminal.
13562 (template_id): Use it.
13564 Fri Dec 5 01:17:34 1997 Jason Merrill <jason@yorick.cygnus.com>
13566 * parse.y (template_id): do_identifier for PFUNCNAMEs, too.
13567 * spew.c (yylex): Don't do_identifier here.
13568 * decl2.c (build_expr_from_tree): Revert last change.
13570 * decl2.c (build_expr_from_tree): Expand the name for a method call.
13571 * parse.y (object_template_id): Don't try to take the DECL_NAME.
13573 Wed Dec 3 20:02:39 1997 Jason Merrill <jason@yorick.cygnus.com>
13575 * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for
13577 * call.c (build_op_delete_call): Adjust.
13579 * except.c (expand_end_catch_block): Lose rethrow region.
13580 (expand_start_catch_block): Likewise.
13581 (expand_end_catch_block): Don't expand_leftover_cleanups.
13583 Wed Dec 3 13:24:04 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13585 * pt.c (tsubst): Remove tree_cons call (places redundant info into
13586 DECL_TEMPLATE_INSTANTIATION).
13588 Wed Dec 3 11:44:52 1997 Jason Merrill <jason@yorick.cygnus.com>
13590 * tree.c (is_overloaded_fn): Handle getting a fn template.
13591 (really_overloaded_fn): Likewise.
13592 * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better.
13593 * pt.c (check_explicit_specialization): Tweak.
13594 (determine_explicit_specialization): Tweak.
13596 * tree.c, cp-tree.h (get_target_expr): New fn.
13598 Wed Dec 3 08:47:27 1997 Paul Eggert <eggert@twinsun.com>
13600 * pt.c (check_explicit_specialization): Fix misspelling in
13601 diagnostic: `preceeded'.
13602 * typeck.c (get_delta_difference): Fix misspelling in diagnostic:
13605 1997-12-02 Mark Mitchell <mmitchell@usa.net>
13607 * pt.c (determine_explicit_specialization): Avoid an internal
13608 error for bad specializations.
13610 * method.c (build_overload_value): Handle SCOPE_REF.
13612 Tue Dec 2 19:18:50 1997 Mike Stump <mrs@wrs.com>
13614 * class.c (prepare_fresh_vtable): Enable even more complex MI
13617 Tue Dec 2 01:37:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13619 * exception.cc (__check_eh_spec): Optimize a bit.
13621 * exception.cc (__cp_pop_exception): Lose handler arg.
13622 * except.c (do_pop_exception): Likewise.
13623 (push_eh_cleanup): Let the cleanup mechanism supply the handler.
13624 (expand_end_catch_block): Likewise.
13626 Fri Nov 28 01:58:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13628 * pt.c (check_explicit_specialization): Complain about using a
13629 template-id for a non-specialization.
13631 Fri Nov 28 12:35:19 1997 Scott Christley <scottc@net-community.com>
13633 * repo.c: Prototype rindex only if needed.
13634 * xref.c: Likewise.
13636 Fri Nov 28 01:56:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13638 * error.c (dump_decl): Handle TEMPLATE_ID_EXPR.
13640 Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com>
13642 * typeck.c (build_const_cast): Handle references here instead of
13643 handing off to convert_to_reference.
13645 * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
13646 TerminateFunctionCall.
13647 (init_exception_processing): Likewise. Terminate et al are now
13648 the fns, not ADDR_EXPRs.
13649 (various): Lose redundant assemble_external calls.
13650 (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/.
13652 * cp-tree.h (struct lang_decl_flags): Add comdat.
13653 (DECL_COMDAT): New macro.
13654 * decl.c (duplicate_decls): Propagate it.
13655 (cp_finish_decl): Handle it.
13656 * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs.
13658 * class.c: Remove static pending_hard_virtuals.
13659 (add_virtual_function): Take pointers to pending_virtuals
13660 and pending_hard_virtuals.
13661 (finish_struct_1): Pass them. Declare pending_hard_virtuals.
13663 Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com>
13665 * decl2.c (import_export_vtable): If we support one_only but not
13666 weak symbols, mark instantiated template vtables one_only.
13667 (import_export_decl): Likewise for tinfo functions.
13668 (finish_vtable_vardecl): Also write out vtables from explicitly
13669 instantiated template classes.
13670 * pt.c (mark_class_instantiated): Revert last change.
13672 * except.c (expand_throw): Call mark_used on the destructor.
13674 Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com)
13676 * lex.c (lang_init): Enable flag_exceptions by default if no
13677 command line switch was specified.
13679 1997-11-26 Mark Mitchell <mmitchell@usa.net>
13681 * pt.c (unify): Handle `void' template parameters in
13684 Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
13686 * rtti.c (build_dynamic_cast): Handle template case here.
13687 (build_dynamic_cast_1): Not here.
13689 * typeck2.c (digest_init): Make copies where appropriate.
13691 * decl2.c (delete_sanity): resolve_offset_ref.
13693 * except.c: Call terminate without caching so many bits.
13695 * except.c (expand_start_catch_block): Fix catching a reference
13698 Tue Nov 25 11:28:21 1997 Jason Merrill <jason@yorick.cygnus.com>
13700 * init.c (build_new): Copy size to the saveable obstack.
13702 * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the
13703 TRY_CATCH_EXPR for now.
13705 Mon Nov 24 12:15:55 1997 Jason Merrill <jason@yorick.cygnus.com>
13707 * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
13708 has DECL_LANG_SPECIFIC.
13710 * exception.cc (struct cp_eh_info): Add handlers field.
13711 (__cp_push_exception): Initialize it.
13712 (__cp_pop_exception): Decrement it. Don't pop unless it's 0.
13713 (__throw_bad_exception): Remove.
13714 * except.c (call_eh_info): Add handlers field.
13715 (get_eh_handlers): New fn.
13716 (push_eh_cleanup): Increment handlers.
13718 Fri Nov 21 12:22:07 1997 Jason Merrill <jason@yorick.cygnus.com>
13720 * except.c (expand_start_eh_spec): Use the try/catch code.
13721 (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of
13722 doing everything inline.
13723 (init_exception_processing): throw_type_match now takes
13724 const void pointers.
13725 * exception.cc (__check_eh_spec): New fn.
13726 * inc/exception: Neither terminate nor unexpected return.
13727 * decl.c: Make const_ptr_type_node public.
13728 * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly.
13730 * except.c (expand_start_catch_block): We only need the rethrow
13731 region for non-sjlj exceptions.
13732 (expand_end_catch_block): Likewise. Use outer_context_label_stack.
13734 Thu Nov 20 14:40:17 1997 Jason Merrill <jason@yorick.cygnus.com>
13736 * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
13737 (various.o): Likewise.
13738 * inc/new: Add placement deletes. Add throw specs for default new.
13739 * new.cc (set_new_handler): Move here from libgcc2.
13740 * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
13741 (new): Move from libgcc2. Throw bad_alloc.
13742 * new2.cc: Move the rest of the op news and op deletes from libgcc2.
13743 * decl.c (init_decl_processing): Update exception specs on new and
13746 * method.c (build_decl_overload_real): Don't mess with global
13749 * init.c (build_new): Check for null throw spec, not nothrow_t.
13751 * decl.c (duplicate_decls): Don't complain about different exceptions
13752 from an internal declaration.
13754 * call.c (build_op_delete_call): Fix check for member fns again.
13756 * decl2.c (import_export_decl): Interface hackery affects
13757 virtual synthesized methods.
13759 Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13761 * decl.c (start_decl): Don't just complain about a mismatched
13764 * decl.c (make_implicit_typename): Handle case where t is not
13765 actually from context.
13766 * tree.c (get_type_decl): Lose identifier case.
13767 * spew.c (yylex): Lose useless call to identifier_typedecl_value.
13768 * parse.y (nonnested_type): Just use lookup_name.
13769 (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
13771 Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
13773 * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
13774 T was built in C language context (for example, by
13775 output_func_start_profiler).
13777 Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
13779 * decl.c (make_implicit_typename): New fn.
13780 (lookup_name_real): Use it. Use current_class_type as the context.
13782 Mon Nov 17 23:42:03 1997 Bruno Haible <haible@ilog.fr>
13784 * pt.c (do_poplevel): Don't prohibit jumps into this contour.
13786 Mon Nov 17 02:01:28 1997 Jason Merrill <jason@yorick.cygnus.com>
13788 * friend.c (do_friend): Warn about non-template friends in templates.
13790 * call.c (build_op_delete_call): Fix handling of inherited delete.
13792 * search.c (dfs_record_inheritance): Ignore template type parms.
13794 Sat Nov 15 00:30:51 1997 Jason Merrill <jason@yorick.cygnus.com>
13796 * call.c (build_new_op): Fix copy error.
13797 (build_op_new_call): New fn.
13798 (build_op_delete_call): New fn.
13799 * cp-tree.h: Declare them.
13800 * init.c (build_new): Use them. Support placement delete.
13801 (build_x_delete): Use build_op_delete_call.
13802 (build_delete): Likewise.
13803 * decl2.c (delete_sanity): Likewise.
13804 (coerce_delete_type): Don't complain about placement delete.
13806 Thu Nov 13 01:52:36 1997 Jason Merrill <jason@yorick.cygnus.com>
13808 * call.c (build_new_function_call): Remove unused 'obj' parm.
13809 * cp-tree.h, typeck.c: Adjust.
13811 * init.c (build_new): Make the cleanup last longer.
13812 (expand_vec_init): Call do_pending_stack_adjust.
13814 Wed Nov 12 11:04:33 1997 Jason Merrill <jason@yorick.cygnus.com>
13816 * pt.c (do_type_instantiation): Fix typo.
13817 (mark_class_instantiated): If we support one_only but not weak
13818 symbols, don't mark this as known.
13820 * init.c (build_new): Handle vec delete in EH cleanup.
13822 Wed Nov 12 08:11:55 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13824 * call.c (build_method_call): Call complete_type before checking
13827 Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com)
13829 * decl.c (add_block_current_level): Delete.
13830 * init.c (build_vec_delete_1): Delete build_block and
13831 add_block_current_level calls.
13833 Wed Nov 12 00:48:16 1997 Jason Merrill <jason@yorick.cygnus.com>
13835 * init.c (build_new): Handle freeing allocated memory when the
13836 constructor throws.
13838 * call.c (build_new_method_call): Fix flags arg.
13840 * pt.c (do_type_instantiation): Don't try to instantiate
13842 (mark_decl_instantiated): If we support one_only but not
13843 weak symbols, mark this one_only.
13844 * decl2.c (import_export_vtable): Don't defer handling of vtables
13845 if MULTIPLE_SYMBOL_SPACES.
13847 Tue Nov 11 12:02:12 1997 Jason Merrill <jason@yorick.cygnus.com>
13849 * except.c (expand_end_catch_block): Lose call to __sjpopnthrow.
13851 Tue Nov 11 02:53:44 1997 Jason Merrill <jason@lasher.cygnus.com>
13853 * except.c (do_pop_exception): Return a value.
13855 Mon Nov 10 20:25:31 1997 Jason Merrill <jason@yorick.cygnus.com>
13857 * call.c (build_new_method_call): Handle getting a
13858 TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field
13859 if we got template parms.
13860 * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR,
13862 * decl2.c (build_expr_from_tree): Tweak last change.
13863 * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE.
13864 (maybe_fold_nontype_arg): Split out from tsubst_copy.
13865 * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR.
13867 Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
13869 * pt.c (tsubst_copy): Handle explicit template arguments in
13871 * typeck.c (build_x_function_call): Likewise.
13872 * decl2.c (build_expr_from_tree): Lookup function name if it
13875 * pt.c (tsubst): Instantiate template functions properly when
13876 template parameter does not appear in function arguments and return
13878 (comp_template_args): Handle member templates required by tsubst.
13880 Mon Nov 10 20:08:38 1997 Jason Merrill <jason@yorick.cygnus.com>
13882 * decl.c (grokdeclarator): Tweak conditions for pedwarn in
13885 Mon Nov 10 20:08:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13887 * pt.c (coerce_template_parms): Tweak error message.
13889 * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
13890 return type defaults to `int', even if there are storage-class
13893 Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13895 Complete nested exception support.
13896 * except.c (do_pop_exception): Split out...
13897 (push_eh_cleanup): From here. Handle the EH region by hand.
13898 (expand_start_catch_block): Add a new level for the catch parm.
13899 Move the rethrow region outside the two cleanup regions.
13900 Protect the initializer for the catch parm with terminate.
13901 (expand_end_catch_block): Likewise. End the region for the eh_cleanup.
13902 * exception.cc (__cp_pop_exception): Now takes two parms. Handle
13903 popping off the middle of the stack.
13904 * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
13905 WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
13906 (build_cplus_new): Only wrap CALL_EXPRs.
13907 * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
13908 the constructor call.
13910 Sun Nov 9 18:00:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13912 * Make-lang.in (c++.distdir): Make inc subdirectory.
13914 Fri Nov 7 11:57:28 1997 Jason Merrill <jason@yorick.cygnus.com>
13916 * decl2.c (finish_file): Put back some code.
13918 Thu Nov 6 11:28:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13920 * decl2.c (finish_file): Remove redundant code.
13921 * method.c (emit_thunk): Don't let the backend defer generic thunks.
13923 Wed Nov 5 23:52:50 1997 Jason Merrill <jason@yorick.cygnus.com>
13925 * except.c (call_eh_info): Split out...
13926 (push_eh_info): From here.
13927 (expand_builtin_throw): Use it.
13928 (expand_start_catch_block): Move region start back.
13930 Tue Nov 4 13:45:10 1997 Doug Evans <devans@canuck.cygnus.com>
13932 * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
13933 (real_yylex): Record wide strings using target endianness, not host.
13935 1997-11-03 Brendan Kehoe <brendan@lisa.cygnus.com>
13937 * repo.c (rindex): Add decl unconditionally.
13938 (get_base_filename, open_repo_file): Don't cast rindex.
13939 * xref.c (rindex): Add decl unconditionally.
13940 (index): Remove unused decl.
13941 (open_xref_file): Don't cast rindex.
13943 Sun Nov 2 15:04:12 1997 Jason Merrill <jason@yorick.cygnus.com>
13945 * class.c (build_vbase_path): Propagate the result type properly.
13947 1997-11-01 Brendan Kehoe <brendan@lisa.cygnus.com>
13949 * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
13950 remaining use of saved_throw_type with a call to get_eh_type.
13952 1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
13954 * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
13955 (file_name_nondirectory): New function, doing the same as the macro.
13956 (set_typedecl_interface_info): Use it instead of the macro.
13957 (check_newline): Likewise.
13958 (handle_cp_pragma): Likewise.
13960 * repo.c (get_base_filename): Cast result of rindex to char*.
13961 (open_repo_file): Likewise.
13962 * xref.c (open_xref_file): Likewise.
13963 * error.c (dump_char): Make its arg int, not char.
13965 * except.c (push_eh_info): Pass the number of fields - 1 down, not
13966 the exact number of fields.
13968 Fri Oct 31 01:47:57 1997 Jason Merrill <jason@yorick.cygnus.com>
13970 Support for nested exceptions.
13971 * tinfo2.cc (__is_pointer): New fn.
13972 * exception.cc (struct cp_eh_info): Define.
13973 (__cp_exception_info, __uncatch_exception): New fns.
13974 (__cp_push_exception, __cp_pop_exception): New fns.
13975 * except.c: Lose saved_throw_{type,value,cleanup,in_catch}.
13977 (init_exception_processing): Likewise. __eh_pc is now external.
13978 (push_eh_info): New fn.
13979 (get_eh_{info,value,type,caught}): New fns.
13980 (push_eh_cleanup): Just call __cp_pop_exception.
13981 (expand_start_catch_block): Use push_eh_info. Start the eh region
13983 (expand_end_eh_spec): Use push_eh_info.
13984 (expand_throw): Call __cp_push_exception to set up the exception info.
13985 Just pass the destructor or 0 as the cleanup. Call __uncatch_exception
13987 (expand_builtin_throw): Don't refer to empty_fndecl.
13989 Thu Oct 23 02:01:30 1997 Jason Merrill <jason@yorick.cygnus.com>
13991 * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl.
13993 1997-10-22 Brendan Kehoe <brendan@cygnus.com>
13995 * method.c (build_template_parm_names, build_decl_overload_real):
13996 Add static to definitions.
13997 * pt.c (add_to_template_args, note_template_header,
13998 processing_explicit_specialization, type_unification_real): Likewise.
13999 ({determine,check}_explicit_specialization): Use a single string for
14002 Mon Oct 20 12:06:34 1997 Jason Merrill <jason@yorick.cygnus.com>
14004 * except.c (expand_exception_blocks): Call do_pending_stack_adjust.
14005 (expand_end_catch_block): Likewise.
14006 (expand_end_eh_spec): Likewise.
14008 Mon Oct 20 11:44:20 1997 Mark Mitchell <mmitchell@usa.net>
14010 * decl.c (duplicate_decls): Handle template specializations
14012 * error.c (dump_function_name): Fix printing of specializations of
14013 member functions that are not member templates.
14014 * cp-tree.h (processing_specialization): Make global.
14015 * pt.c (processing_specialization): Likewise.
14016 * lex.c (cons_up_default_function): Save and restore
14017 processing_specialization to avoid confusion.
14019 Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14021 * decl.c (init_decl_processing): Give null_node unknown* type.
14022 * typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
14023 (common_type): Likewise.
14024 * error.c (args_as_string): Recognize null_node.
14026 Sun Oct 19 09:13:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
14028 * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
14029 (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
14031 * decl.c (init_decl_processing): Call using_eh_for_cleanups.
14033 * Make-lang.in (g++): Include prefix.o.
14035 Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
14037 * pt.c (determine_explicit_specialization): Initialize "dummy"
14038 to keep Purify quiet.
14040 Thu Oct 16 00:14:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14042 * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here.
14043 (build_overload_int): Not here.
14045 Wed Oct 15 00:35:28 1997 Mike Stump <mrs@wrs.com>
14047 * class.c (build_type_pathname): Remove.
14048 (prepare_fresh_vtable): Fix problem with complex MI vtable names.
14050 1997-10-14 Brendan Kehoe <brendan@lisa.cygnus.com>
14052 * parse.y (unary_expr): Give a pedwarn if someone tries to use the
14053 &&label GNU extension.
14055 Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
14057 * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it,
14058 so as to avoid incorrect manglings.
14059 * method.c (build_decl_overload_real): Don't mangle return types
14062 Tue Oct 14 11:46:14 1997 Jason Merrill <jason@yorick.cygnus.com>
14064 * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
14065 scratch_tree_cons): Define as macros for now.
14066 * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
14067 lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
14068 typeck2.c: Use them and the expression_obstack variants.
14070 Mon Oct 13 17:41:26 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14072 * decl.c (store_return_init): Allow classes with explicit ctors to
14073 be used with the named return values extension.
14075 Fri Oct 10 12:21:11 1997 Jason Merrill <jason@yorick.cygnus.com>
14077 * pt.c (instantiate_decl): Fix previous change.
14079 Thu Oct 9 12:08:21 1997 Jason Merrill <jason@yorick.cygnus.com>
14081 * pt.c (tsubst): Fix thinko.
14082 (instantiate_decl): Really use the original template.
14084 * call.c (build_new_method_call): Use simple constructor_name for
14087 Wed Oct 8 22:44:42 1997 Jeffrey A Law <law@cygnus.com>
14089 * method.c (build_underscore_int): Don't use ANSI specific
14092 Wed Oct 8 00:18:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14094 * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN
14095 for our key method; it might have been inlined by -O3.
14097 Tue Oct 7 23:00:12 1997 Mark Mitchell <mmitchell@usa.net>
14099 * decl.c (make_typename_type): Do not try to call lookup_field for
14100 non-aggregate types.
14102 Tue Oct 7 22:52:10 1997 Jason Merrill <jason@yorick.cygnus.com>
14104 * typeck.c (build_reinterpret_cast): Tweak.
14106 Tue Oct 7 22:45:31 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14108 * typeck.c (build_reinterpret_cast): Converting a void pointer
14109 to function pointer with a reinterpret_cast produces a warning
14110 if -pedantic is issued.
14112 Tue Oct 7 22:43:43 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
14114 * typeck.c (c_expand_return): Don't warn about returning a
14115 reference-type variable as a reference.
14117 Tue Oct 7 21:11:22 1997 Jason Merrill <jason@yorick.cygnus.com>
14119 * method.c (build_static_name): Fix typo.
14121 1997-10-07 Brendan Kehoe <brendan@lisa.cygnus.com>
14123 * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on
14124 OLDDECL before we try to do DECL_USE_TEMPLATE.
14126 Tue Oct 7 00:48:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14128 * decl.c (duplicate_decls): Don't warn about template instances.
14130 * typeck.c (mark_addressable): Lose ancient code that unsets
14133 * pt.c (do_decl_instantiation): Lose support for instantiating
14136 * call.c (build_new_function_call): Fix handling of null explicit
14138 (build_new_method_call): Likewise.
14140 Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net>
14142 * method.c (build_underscore_int): Fix typo.
14144 1997-10-06 Brendan Kehoe <brendan@lisa.cygnus.com>
14146 * tree.c (print_lang_statistics): #if 0 call to
14147 print_inline_obstack_statistics until its definition is checked in.
14149 Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14151 * decl2.c (finish_file): Move dump_tree_statistics to end.
14153 * pt.c (instantiate_decl): Look for the original template.
14154 (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
14155 of member templates.
14157 Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14159 * Makefile.in (g++FAQ.*): New rules.
14160 (CONFLICTS): Update.
14161 * g++FAQ.texi: Moved from libg++.
14163 * parse.y (PFUNCNAME): Only specify the type once.
14165 1997-10-01 Brendan Kehoe <brendan@lasher.cygnus.com>
14167 * lex.c (real_yylex): Clean up the code to fully behave the way
14168 the c-lex.c parser does for complex and real numbers.
14170 Tue Sep 30 08:51:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14172 * method.c (build_decl_overload_real): Reformat.
14174 Tue Sep 30 00:18:26 1997 Jason Merrill <jason@yorick.cygnus.com>
14176 * method.c (synthesize_method): If at_eof, determine our linkage.
14178 1997-09-29 Paul Eggert <eggert@twinsun.com>
14180 * lex.c (real_yylex): Treat `$' just like `_', except issue a
14181 diagnostic if !dollars_in_ident or if pedantic.
14183 * lang-specs.h (@c++): -ansi no longer implies -$.
14185 * decl2.c (lang_decode_option):
14186 -traditional and -ansi now do not mess with
14189 Mon Sep 29 19:57:51 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
14191 * Makefile.in (parse.o, decl.o): Also depend on
14192 $(srcdir)/../except.h $(srcdir)/../output.h.
14193 (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
14194 $(srcdir)/../except.h $(srcdir)/../output.h.
14195 (typeck.o, init.o): Also depend on $(srcdir)/../expr.h
14198 * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.
14200 * expr.c (cplus_expand_expr): Make it static.
14202 * decl2.c, init.c, typeck.c: Include "expr.h".
14203 (expand_expr): Use proper values when calling the function.
14205 Mon Sep 29 11:05:54 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14207 * lang-options.h: New -Wold-style-cast flag.
14208 * cp-tree.h (warn_old_style_cast): New variable.
14209 * decl2.c (warn_old_style_cast): Likewise.
14210 (lang_decode_option): Support -Wold-style-cast.
14211 (reparse_absdcl_as_casts): Produce old-style-cast warning.
14213 Mon Sep 29 09:20:53 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14215 * decl.c (cp_finish_decl): Allow expand_aggr_init to set
14216 TREE_USED, reset value based on already_used.
14218 * init.c (expand_member_init): Revert change.
14220 Mon Sep 29 08:57:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14222 * cp-tree.h, decl.c, decl2.c, pt.c:
14223 Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public.
14225 * decl2.c (lang_decode_option): Add missing ;.
14227 Sat Sep 27 16:22:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14229 * friend.c (do_friend): Disable injection for all template-derived
14231 * decl2.c (lang_decode_option): Handle -fguiding-decls.
14232 * parse.y (notype_template_declarator): New nonterminal.
14233 (direct_notype_declarator): Use it.
14234 (complex_direct_notype_declarator): Likewise.
14235 (object_template_id): Accept any kind of identifier after TEMPLATE.
14236 (notype_qualified_id): Don't add template declarators here.
14238 Sat Sep 27 16:21:58 1997 Mark Mitchell <mmitchell@usa.net>
14240 * call.c (add_template_candidate): Add explicit_targs parameter.
14241 (build_scoped_method_call): Use it.
14242 (build_overload_call_real): Likewise.
14243 (build_user_type_conversion_1): Likewise.
14244 (build_new_function_call): Likewise.
14245 (build_object_call): Likewise.
14246 (build_new_op): Likewise.
14247 (build_new_method_call): Likewise.
14248 (build_new_function_call): Handle TEMPLATE_ID_EXPR.
14249 (build_new_method_call): Likewise.
14251 * class.c (finish_struct_methods): Add specialization pass to
14252 determine which methods were specializing which other methods.
14253 (instantiate_type): Handle TEMPLATE_ID_EXPR.
14255 * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.
14257 * cp-tree.h (name_mangling_version): New variable.
14258 (flag_guiding_decls): Likewise.
14259 (build_template_decl_overload): New function.
14260 (begin_specialization): Likewise.
14261 (reset_specialization): Likewise.
14262 (end_specialization): Likewise.
14263 (determine_explicit_specialization): Likewise.
14264 (check_explicit_specialization): Likewise.
14265 (lookup_template_function): Likewise.
14266 (fn_type_unification): Add explicit_targs parameter.
14267 (type_unification): Likewise.
14269 * decl.c (duplicate_decls): Add smarts for explicit
14271 (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
14273 (grokfndecl): Call check_explicit_specialization.
14275 * decl2.c (lang_decode_option): Handle -fname-mangling-version.
14276 (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
14277 (check_classfn): Handle specializations.
14279 * error.c (dump_function_name): Print specialization arguments.
14281 * friend.c (do_friend): Don't call pushdecl for template
14284 * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.
14286 * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
14287 and -fno-guiding-decls.
14289 * lex.c (identifier_type): Return PFUNCNAME for template function
14292 * method.c (build_decl_overload_real): New function.
14293 (build_template_parm_names): New function.
14294 (build_overload_identifier): Use it.
14295 (build_underscore_int): New function.
14296 (build_overload_int): Use it. Add levels for template
14298 (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs.
14299 (build_overload_nested_names): Handle template type parameters.
14300 (build_template_decl_overload): New function.
14302 * parse.y (YYSTYPE): New ntype member.
14303 (nested_name_specifier): Use it.
14304 (nested_name_specifier_1): Likewise.
14305 (PFUNCNAME): New token.
14306 (template_id, object_template_id): New non-terminals.
14307 (template_parm_list): Note specializations.
14308 (template_def): Likewise.
14309 (structsp): Likewise.
14310 (fn.def2): Handle member template specializations.
14311 (component_decl_1): Likewise.
14312 (direct_notype_declarator): Handle template-ids.
14313 (component_decl_1): Likewise.
14314 (direct_notype_declarator): Handle template-ids.
14315 (primary): Handle TEMPLATE_ID_EXPR, and template-ids.
14317 * pt.c (processing_specializations): New variable.
14318 (template_header_count): Likewise.
14319 (type_unification_real): New function.
14320 (processing_explicit_specialization): Likewise.
14321 (note_template_header): Likewise.
14322 (is_member_template): Handle specializations.
14323 (end_template_decl): Call reset_specialization.
14324 (push_template_decl): Handle member template specializations.
14325 (tsubst): Likewise.
14326 (tsubst_copy): Handle TEMPLATE_ID_EXPR.
14327 (instantiate_template): Handle specializations.
14328 (instantiate_decl): Likewise.
14329 (fn_type_unification): Handle explicit_targs.
14330 (type_unification): Likewise. Allow incomplete unification
14331 without an error message, if allow_incomplete.
14332 (get_bindings): Use new calling sequence for fn_type_unification.
14334 * spew.c (yylex): Handle PFUNCNAME.
14336 * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
14337 (really_overloaded_fn): Likewise.
14338 (get_first_fn): Handle function templates.
14340 * typeck.c (build_x_function_call): Use really_overloaded_fn.
14341 Handle TEMPLATE_ID_EXPR.
14342 (build_x_unary_op): Likewise.
14343 (build_unary_op): Likewise.
14344 (mark_addressable): Templates whose address is taken are marked
14347 1997-09-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14349 * decl.c (init_decl_processing): Declare __builtin_constant_p as
14350 accepting any kind of type, not only int.
14352 Fri Sep 26 00:22:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14354 * search.c (get_matching_virtual): Notice virtual bases when sorrying
14355 about covariant returns.
14357 * parse.y (member_init): Also imply typename here. Remove ancient
14358 extension for initializing base members.
14360 Thu Sep 25 11:11:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14362 Handle multi-level typenames and implicit typename in base list.
14363 * parse.y (typename_sub{,[0-2]}): New rules.
14364 (structsp, rule TYPENAME_KEYWORD): Use typename_sub.
14365 (nonnested_type): New rule.
14366 (complete_type_name): Use it.
14367 (base_class.1): Use typename_sub and nonnested_type.
14368 (nested_name_specifier): Don't elide std:: here.
14369 * decl.c (make_typename_type): Handle getting a type for NAME.
14370 (lookup_name_real): Turn std:: into :: here.
14372 Rvalue conversions were removed in London.
14373 * call.c (is_subseq): Don't consider lvalue transformations.
14374 (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK.
14375 (joust): Re-enable ?: kludge.
14377 1997-09-22 Brendan Kehoe <brendan@lisa.cygnus.com>
14379 * decl.c (start_function): Up warning of no return type to be a
14382 Mon Sep 22 14:15:34 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14384 * init.c (expand_member_init): Don't set TREE_USED.
14385 * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
14386 set,don't clear TREE_USED wholesale.
14388 Sat Sep 20 15:31:00 1997 Jason Merrill <jason@yorick.cygnus.com>
14390 * call.c (build_over_call): Do require_complete_type before
14393 Thu Sep 18 16:47:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14395 * search.c (lookup_field): Call complete_type in all cases.
14397 * decl.c (finish_function): Just warn about flowing off the end.
14399 Wed Sep 17 10:31:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14401 * decl.c (grokparms): Don't bash a permanent list node if we're
14404 1997-09-17 Brendan Kehoe <brendan@lisa.cygnus.com>
14406 * Makefile.in (CONFLICTS): Fix s/r conflict count to 18.
14408 Tue Sep 16 14:06:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14410 * call.c (build_new_op): Give better error for syntactically
14411 correct, but semantically invalid, use of undeclared template.
14413 * call.c (compare_qual): Handle pmfs.
14415 * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
14416 after the exception spec.
14418 Mon Sep 15 11:52:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14420 * call.c (null_ptr_cst_p): Integer type, not integral type.
14422 * call.c (joust): Disable warnings until they can be moved to the
14425 Fri Sep 12 16:11:13 1997 Per Bothner <bothner@cygnus.com>
14427 * Makefile.in, config-lang.in: Convert to autoconf.
14429 Thu Sep 11 17:14:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14431 * decl.c (lookup_name_real): Add implicit 'typename' to types from
14434 * pt.c (most_specialized_class): Fix typo.
14435 (tsubst): Move constant folding to TREE_VEC case.
14437 Thu Sep 11 10:08:45 1997 Mark Mitchell <mmitchell@usa.net>
14439 * pt.c (do_poplevel): Don't warn about unused local variables
14440 while processing_template_decl since we don't always know whether
14441 or not they will need constructing/destructing.
14443 * pt.c (uses_template_parms): Check the values of an enumeration
14444 type to make sure they don't depend on template parms.
14446 * decl.c (make_typename_type): Don't lookup the field if the
14447 context uses template parms, even if we're not
14448 processing_template_decl at the moment.
14450 * pt.c (coerce_template_parms): Avoid looking at the
14451 TYPE_LANG_DECL portion of a typename type, since there won't be
14453 (tsubst): Do constant folding as necessary to make sure that
14454 arguments passed to lookup_template_class really are constants.
14456 Wed Sep 10 11:21:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14458 * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO.
14459 * decl2.c (finish_file): Only register exception tables if we
14462 * decl.c (init_decl_processing): Add __builtin_[fs]p.
14464 Tue Sep 9 19:49:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14466 * pt.c (unify): Just return 0 for a TYPENAME_TYPE.
14468 Tue Sep 9 17:57:25 1997 Mark Mitchell <mmitchell@usa.net>
14470 * error.c (dump_decl): Avoid crashing when presented with a
14471 uninitialized constant, as can occur with a template parameter.
14472 (dump_expr): Make sure that there are enough levels of
14473 current_template_parms before we start diving through them.
14475 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
14477 * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to
14480 Tue Sep 9 09:36:39 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14482 * except.c (expand_throw): Call build_delete for all
14483 exception types, not just objects with destructors.
14485 Mon Sep 8 02:33:20 1997 Jody Goldberg <jodyg@idt.net>
14487 * decl.c (current_local_enum): Remove static.
14488 * pt.c (tsubst_enum): Save and restore value of current_local_enum
14489 in case template is expanded in enum decl.
14490 (instantiate_class_template): Use new tsubst_enum signature.
14491 (tsubst_expr): Likewise.
14493 Mon Sep 8 01:21:43 1997 Mark Mitchell <mmitchell@usa.net>
14495 * pt.c (begin_member_template_processing): Take a function as
14496 argument, not a set of template arguments. Use the template
14497 parameters, rather than the arguments. Handle non-type parameters
14498 correctly. Push a binding level for the parameters so that multiple
14499 member templates using the same parameter names can be declared.
14500 (end_member_template_processing): Pop the binding level.
14501 (push_template_decl): Mark member templates as static when
14504 * lex.c (do_pending_inlines): Pass the function, not its template
14505 arguments, to begin_member_template_processing.
14506 (process_next_inline): Likewise.
14507 (do_pending_defargs): Likewise.
14509 * error.c (dump_expr): Obtain the correct declaration for a
14510 TEMPLATE_CONST_PARM.
14512 * call.c (add_template_conv_candidate): New function.
14513 (build_object_call): Handle member templates, as done in the other
14516 Sat Sep 6 10:20:27 1997 Mark Mitchell <mmitchell@usa.net>
14518 * decl.c (replace_defag): Undo previous change.
14519 * lex.c (do_pending_defargs): Deal with member templates.
14521 * pt.c (is_member_template): Avoid crashing when passed a
14522 non-function argument.
14524 Fri Sep 5 17:27:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14526 * class.c (grow_method): Remove check for redeclaration.
14528 Fri Sep 5 01:37:17 1997 Mark Mitchell <mmitchell@usa.net>
14530 * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
14531 (DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
14532 (PRIMARY_TEMPLATE_P): Use it.
14533 * call.c (build_overload_call_real): Use it.
14534 * class.c (instantiate_type): Likewise.
14535 * decl.c (decls_match): Likewise.
14536 * method.c (build_overload_identifier): Likewise.
14537 * pt.c (push_template_decl): Likewise.
14538 (classtype_mangled_name): Likewise.
14539 (lookup_template_class): Likewise.
14541 * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
14542 DECL_NTPARMS to conform to usage elsewhere.
14543 * call.c (add_template_candidate): Likewise.
14544 * class.c (instantiate_type): Likewise.
14545 * pt.c (instantiate_template): Likewise.
14546 (get_bindings): Likewise.
14548 * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
14549 is_member_template.
14551 * pt.c (unify): Undo changes to allow multiple levels of template
14553 (type_unification): Likewise.
14554 (fn_type_unification): Likewise.
14555 (get_class_bindings): Likewise.
14556 * cp-tree.h (Likewise).
14558 * decl.c (replace_defarg): Check that the type of the default
14559 parameter does not invlove a template type before complaining
14560 about the initialization.
14562 * error.c (dump_expr): Deal with template constant parameters in
14563 member templates correctly.
14565 * pt.c (is_member_template): Deal with class specializations
14567 (tsubst): Handle "partial instantiation" of member templates
14570 Wed Sep 3 12:30:24 1997 Mark Mitchell <mmitchell@usa.net>
14572 * pt.c (type_unification): Change calling sequence to allow for
14573 multiple levels of template parameters.
14574 (tsubst_expr): Likewise.
14575 (tsubst): Likewise.
14576 (tsubst_copy): Likewise.
14577 (instantiate_template): Likewise.
14579 * call.c (build_overload_call_real): Use it.
14580 (add_builtin_candidate): Use it.
14581 (build_new_method_call): Use it.
14582 * class.c (instantiate_type): Use it.
14583 * decl.c (grokdeclarator): Use it.
14584 * decl2.c (finish_file): Use it.
14585 * method.c (build_overload_identifier): Use it.
14587 * call.c (add_template_candidate): Add additional parameter for
14588 the function return type. Call fn_type_unification istead of
14590 (build_user_type_conversion_1): Handle member templates.
14591 (build_new_function_call): Likewise.
14592 (build_new_op): Likewise.
14593 (build_new_method_call): Likewise.
14595 * class.c (grow_method): Don't give an error message indicating
14596 that two member templates with the same name are ambiguous.
14597 (finish_struct): Treat member template functions just like member
14600 * cp-tree.h (check_member_template): Add declaration.
14601 (begin_member_template_processing): Likewise.
14602 (end_member_template_processing): Likewise.
14603 (fn_type_unification): Likewise.
14604 (is_member_template): Likewise.
14605 (tsubst): Change prototype.
14606 (tsubst_expr): Likewise.
14607 (tsubst_copy): Likewise.
14608 (instantiate_template): Likewise.
14609 (get_bindings): Likewise.
14611 * decl.c (decls_match): Handle multiple levels of template
14613 (pushdecl): Handle template type params just like other type
14615 (push_class_level_binding): Return immediately if the
14616 class_binding_level is NULL.
14617 (grokfndecl): If check_classfn() returns a member_template, use
14618 the result of the template, not the template itself.
14620 * decl2.c (check_member_template): New function. Check to see
14621 that the entity declared to be a member template can be one.
14622 (check_classfn): Allow redeclaration of member template functions
14623 with different types; the new functions can be specializations or
14624 explicit instantiations.
14626 * error.c (dump_decl): Handle multiple levels of template
14628 (dump_function_decl): Update to handle function templates.
14630 * lex.c (do_pending_inlines): Set up template parameter context
14631 for member templates.
14632 (process_next_inline): Likewise.
14634 * method.c (build_overload_identifier): Adjust for multiple levels
14635 of template parameters.
14637 * parse.y (fn.def2): Add member templates.
14638 (component_decl_1): Likewise.
14640 * pt.c (begin_member_template_processing): New function.
14641 (end_member_template_processing): Likewise.
14642 (is_member_template): Likewise.
14643 (fn_type_unification): Likewise.
14644 (current_template_parms): Return a vector of all the template
14645 parms, not just the innermost level of parms.
14646 (push_template_decl): Deal with the possibility of member
14648 (lookup_template_class): Likewise.
14649 (uses_template_parms): Likewise.
14650 (tsubst): Modify processing to TEMPLATE_TYPE_PARM and
14651 TEMPLATE_CONST_PARM to deal with multiple levels of template
14652 arguments. Add processing of TEMPLATE_DECL to produce new
14653 TEMPLATE_DECLs from old ones.
14654 (do_decl_instantiation): Handle member templates.
14656 * search.c (lookup_fnfields_1): Handle member template conversion
14659 * tree.c (cp_tree_equal): Check the levels, as well as the
14660 indices, of TEMPLATE_CONST_PARMs.
14662 * typeck.c (comptypes): Check the levels, as well as the indices,
14663 fo TEMPLATE_TYPE_PARMs.
14664 (build_x_function_call): Treat member templates like member
14667 Wed Sep 3 11:09:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14669 * typeck.c (c_expand_return): Always convert_for_initialization
14670 before checking for returning a pointer to local.
14672 * pt.c (type_unification): If strict and the function parm doesn't
14673 use template parms, just compare types.
14675 Wed Sep 3 10:35:49 1997 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
14677 * method.c (build_overloaded_value): Replace direct call
14678 to the floating point emulator with REAL_VALUE_TO_DECIMAL macro.
14680 Wed Sep 3 00:02:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14682 * typeck.c (convert_arguments): Don't arbitrarily choose the first
14683 of a set of overloaded functions.
14685 Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14687 * lex.c (real_yylex): Don't elide __FUNCTION__.
14689 * method.c (build_overload_value): Add in_template parm.
14690 (build_overload_int): Likewise.
14691 (build_overload_identifier): Pass it.
14693 * decl.c (duplicate_decls): Don't bash a previous template
14694 definition with a redeclaration.
14696 * pt.c (unify): float doesn't match double.
14698 * pt.c (do_type_instantiation): Handle getting a _TYPE or a
14699 TYPE_DECL. Handle getting non-template types.
14700 * parse.y (explicit_instantiation): Use typespec instead of
14701 aggr template_type.
14703 Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
14705 * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
14707 Mon Sep 1 13:19:04 1997 Eugene Mamchits <eugin@ips.ras.ru>
14709 * call.c (add_builtin_candidate): Add missing TREE_TYPE.
14710 (compare_ics): Likewise.
14712 Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14714 * call.c (joust): Warn about choosing one conversion op over
14715 another because of 'this' argument when the other return type is
14717 (source_type): New fn.
14719 * call.c (build_new_op): Strip leading REF_BIND from first operand
14720 to builtin operator.
14722 * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
14725 Thu Aug 28 09:45:23 1997 Jason Merrill <jason@yorick.cygnus.com>
14727 * call.c (null_ptr_cst_p): Remove support for (void*)0.
14729 Wed Aug 27 02:03:34 1997 Jeffrey A Law <law@cygnus.com>
14731 * typeck.c (expand_target_expr): Make definition match declaration.
14733 * class.c (get_basefndecls): Make definition match declaration.
14735 Mon Aug 25 14:30:02 1997 Jason Merrill <jason@yorick.cygnus.com>
14737 * input.c (sub_getch): Eventually give up and release the input file.
14739 * decl.c (cp_finish_decl): If #p i/i, put inline statics in the
14742 * call.c (joust): Tweak message.
14744 Sat Aug 23 18:02:59 1997 Mark Mitchell <mmitchell@usa.net>
14746 * error.c (type_as_string): Put const/volatile on template type
14747 parameters where appropriate.
14749 Sat Aug 23 17:47:22 1997 Jeffrey A Law <law@cygnus.com>
14751 * call.c (strictly_better): Make arguments unsigned ints.
14753 Thu Aug 21 18:48:44 1997 Jason Merrill <jason@yorick.cygnus.com>
14755 * lex.c (real_yylex): Refer to __complex instead of complex.
14757 Thu Aug 21 22:25:46 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
14759 * lex.c (real_yylex): Don't use getc directly.
14761 Wed Aug 20 17:25:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14763 * call.c (is_subseq): Don't try to be clever.
14765 Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
14767 * parse.y, pt.c: Include "except.h".
14768 * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
14769 error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
14770 lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
14771 sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
14774 Wed Aug 20 01:34:40 1997 Jason Merrill <jason@yorick.cygnus.com>
14776 * decl2.c (mark_vtable_entries): Instead of replacing pure
14777 virtuals with a reference to __pure_virtual, copy the decl and
14780 Tue Aug 19 02:26:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14782 * pt.c (lookup_nested_type_by_name): Handle typedef wierdness.
14784 * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com.
14786 * pt.c (instantiate_class_template): Call repo_template_used
14787 before finish_prevtable_vardecl.
14789 * call.c (is_subseq): New fn.
14790 (compare_ics): Use it.
14792 * repo.c (finish_repo): Don't crash on no args.
14794 * parse.y (named_complex_class_head_sans_basetype): Handle
14795 explicit global scope.
14796 * decl2.c (handle_class_head): New fn.
14798 * pt.c (unify): Add CONST_DECL case.
14800 Thu Aug 14 10:05:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14802 * rtti.c (permanent_obstack): Fix decl to not be a pointer.
14804 * cp-tree.h (report_type_mismatch): Add prototype.
14805 * call.c (build_overload_call_real): Remove erroneous fourth
14806 argument to report_type_mismatch.
14807 (build_user_type_conversion_1): Remove erroneous second arg to
14809 (build_new_function_call): Likewise.
14810 (build_object_call): Likewise.
14811 (build_new_op): Likewise.
14812 (build_new_method_call): Likewise.
14814 Wed Aug 13 19:19:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14816 * error.c (dump_decl): Don't bother processing a function with no
14817 DECL_LANG_SPECIFIC.
14819 * method.c (emit_thunk): Call init_function_start in the macro case.
14821 Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
14823 * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
14824 defined and used to set flag_vtable_thunks.
14826 Tue Aug 12 20:13:57 1997 Jason Merrill <jason@yorick.cygnus.com>
14828 * parse.y: Don't clear the inlines from their obstack until they've
14829 all been processed.
14831 * decl.c (duplicate_decls): Don't complain about exception
14832 specification mismatch if flag_exceptions is off.
14834 Mon Aug 11 15:01:56 1997 Marc Lehmann <pcg@goof.com>
14836 * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
14838 Sun Aug 10 12:06:09 1997 Paul Eggert <eggert@twinsun.com>
14840 * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
14841 * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
14842 Include <stdio.h> before include files that formerly used STDIO_PROTO.
14844 * decl.c, g++spec.c, lex.c, method.c, repo.c:
14845 Include "config.h" first, as per autoconf manual.
14847 Fri Aug 8 11:47:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14849 * decl.c (duplicate_decls): Tweak wording.
14850 * lex.c (do_pending_defargs): Don't die if we see a default arg
14851 that isn't a DEFAULT_ARG.
14852 * error.c (dump_expr): Handle DEFAULT_ARG.
14854 * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
14855 * lang-options.h: Add -fhandle-exceptions.
14857 * class.c (build_vtable): Vtables are artificial.
14858 (prepare_fresh_vtable): Likewise.
14860 Wed Aug 6 11:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14862 * cvt.c (ocp_convert): After converting to the target type, set
14863 LOOKUP_NO_CONVERSION.
14865 * call.c (joust): Warn about potentially confusing promotion rules
14867 * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
14869 Tue Aug 5 15:15:07 1997 Michael Meissner <meissner@cygnus.com>
14871 * exception.cc: Declare __terminate_func with noreturn attribute.
14873 Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
14875 * parse.y: Break out eat_saved_input, handle errors.
14876 (function_try_block): Use compstmt instead of compstmt_or_error.
14878 Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14880 * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
14882 Fri Jul 4 01:45:16 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14884 * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
14885 existence of cc1plus check whether $(LANGUAGES) contains C++.
14887 Wed Jul 30 13:04:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14889 * method.c (do_build_copy_constructor): When copying an anonymous
14890 union member loop around to handle nested anonymous unions. Use
14891 the offset of the member relative to the outer structure, not the
14894 Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14896 * call.c (resolve_args): New fn.
14897 (build_new_function_call): Use it.
14898 (build_object_call): Likewise.
14899 (build_new_method_call): Likewise.
14901 Mon Jul 28 16:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14903 * call.c (build_over_call): tsubst all default parms from templates.
14905 Wed Jul 23 13:36:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14907 * decl.c (struct cp_function): Add static_labelno.
14908 (push_cp_function_context): Save it.
14909 (pop_cp_function_context): Restore it.
14911 Tue Jul 22 14:43:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14913 * typeck.c (build_component_ref_1): Convert from reference.
14915 Tue Jul 22 11:06:23 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14917 * parse.y (current_declspecs, prefix_attributes): Initialize to
14920 * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil
14921 before we try to force it to be a TREE_LIST.
14922 (decl): Make sure $1.t is non-nil.
14924 Sun Jul 20 11:53:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14926 * pt.c (uses_template_parms): Handle template first-parse codes.
14928 * decl.c (cp_finish_decl): Only warn about user-defined statics.
14930 Fri Jul 18 17:56:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14932 * pt.c (unify): Handle BOOLEAN_TYPE.
14934 * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE.
14935 * pt.c (tsubst): Don't set it.
14936 * call.c (build_over_call): Use uses_template_parms.
14938 Thu Jul 17 18:06:30 1997 Jason Merrill <jason@yorick.cygnus.com>
14940 * method.c (build_overload_nested_name): Use static_labelno
14941 instead of var_labelno.
14942 (build_qualified_name): New fn.
14943 (build_overload_name): Split out from here.
14944 (build_static_name): Use build_qualified_name.
14945 * decl.c (cp_finish_decl): Statics in extern inline functions
14946 have comdat linkage.
14947 (start_function): Initialize static_labelno.
14949 Thu Jul 17 11:20:17 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14951 * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy
14952 before "all member functions in class [] are private".
14954 Wed Jul 16 23:47:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14956 * lex.c (do_scoped_id): convert_from_reference.
14957 * init.c (build_offset_ref): Likewise.
14959 Wed Jul 16 12:34:29 1997 Benjamin Kosnik <bkoz@lisa.cygnus.com>
14961 * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list.
14963 Mon Jul 14 03:23:46 1997 Jason Merrill <jason@yorick.cygnus.com>
14965 * typeck.c (get_member_function_from_ptrfunc): Promote index
14968 Sun Jul 13 00:11:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14970 * tree.c (layout_basetypes): Move non-virtual destructor warning.
14971 * decl.c (xref_basetypes): Remove non-virtual destructor warning.
14973 Sat Jul 12 12:47:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14975 * decl.c (grokdeclarator): Call add_defarg_fn for the function
14977 * lex.c (add_defarg_fn): Adjust.
14978 (do_pending_defargs): Adjust. Don't skip the first parm.
14980 Fri Jul 11 01:39:50 1997 Jason Merrill <jason@yorick.cygnus.com>
14982 * decl.c (build_enumerator): Global enumerators are also readonly.
14984 * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast.
14985 (build_dynamic_cast): Call it and convert_from_reference.
14987 * lex.c (add_defarg_fn): New fn.
14988 (snarf_defarg): Don't add to defarg_types.
14989 (do_pending_defargs): Lose defarg_types. All fns we process now
14991 * decl.c (grokfndecl): Call add_defarg_fn.
14993 * Makefile.in (CONFLICTS): Expect 18 s/r conflicts.
14994 * cp-tree.def: Add DEFAULT_ARG.
14995 * spew.c (yylex): Call snarf_defarg as appropriate.
14996 * parse.y: New tokens DEFARG and DEFARG_MARKER.
14997 (defarg_again, pending_defargs, defarg, defarg1): New rules.
14998 (structsp): Use pending_defargs.
14999 (parms, full_parm): Use defarg.
15000 * lex.c (init_lex): Initialize inline_text_firstobj.
15001 (do_pending_inlines): Never pass the obstack to feed_input.
15002 (process_next_inline): Call end_input instead of restore_pending_input.
15003 (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs,
15004 finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns.
15005 * input.c (end_input): New fn.
15006 (sub_getch): At the end of some fed input, just keep returning EOF
15007 until someone calls end_input.
15008 Remove 'obstack' field from struct input_source.
15009 * decl.c (grokparms): Handle DEFAULT_ARG.
15010 (replace_defarg): New fn.
15011 * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros.
15013 Wed Jul 9 13:44:12 1997 Jason Merrill <jason@yorick.cygnus.com>
15015 * call.c (implicit_conversion): If nothing else works, try binding
15016 an rvalue to a reference.
15018 Wed Jul 9 13:04:38 1997 Geoffrey Noer <noer@cygnus.com>
15020 * decl.c (init_decl_processing): Fix Jun 30 patch -- move
15021 ifndef for Cygwin32 to include SIGSEGV.
15023 Thu Jul 3 01:44:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15025 * class.c (finish_struct_1): Only complain about pointers without
15026 copy stuff if there are any constructors.
15028 * rtti.c (build_dynamic_cast): Call complete_type on the types.
15030 * decl.c (grokfndecl): If the function we chose doesn't actually
15033 * decl2.c (grokclassfn): Don't specify 'const int' for the
15034 artificial destructor parm.
15036 * pt.c (type_unification): If we are called recursively, nothing
15039 Mon Jun 30 17:53:21 1997 Geoffrey Noer <noer@cygnus.com>
15041 * decl.c (init_decl_processing): Stop trying to catch signals
15042 other than SIGABRT since the Cygwin32 library doesn't support
15043 them correctly yet. This fixes a situation in which g++ causes
15044 a hang on SIGSEGVs and other such signals in our Win32-hosted
15047 Mon Jun 30 14:50:01 1997 Jason Merrill <jason@yorick.cygnus.com>
15049 * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
15051 Fri Jun 27 15:18:49 1997 Jason Merrill <jason@yorick.cygnus.com>
15053 * typeck2.c (store_init_value): Always return the value if our
15054 type needs constructing.
15056 * method.c (hack_identifier): Convert class statics from
15059 Thu Jun 26 11:44:46 1997 Jason Merrill <jason@yorick.cygnus.com>
15061 * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
15063 Thu Jun 19 16:49:28 1997 Mike Stump <mrs@cygnus.com>
15065 * typeck.c (c_expand_return): Make sure we clean up temporaries at
15066 the end of return x;
15068 Thu Jun 19 12:28:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15070 * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER.
15072 Tue Jun 17 18:35:57 1997 Mike Stump <mrs@cygnus.com>
15074 * except.c (expand_builtin_throw): Add support
15075 -fno-sjlj-exceptions -fPIC exception handling on the SPARC.
15077 Mon Jun 16 01:24:37 1997 Jason Merrill <jason@yorick.cygnus.com>
15079 * repo.c (extract_string): Null-terminate.
15081 * cp-tree.h (TI_SPEC_INFO): New macro.
15082 (CLASSTYPE_TI_SPEC_INFO): New macro.
15083 * pt.c (push_template_decl): Correctly determine # of template parms
15086 * call.c (compare_ics): Really fix 'this' conversions.
15088 * pt.c (do_decl_instantiation): Don't crash on explicit inst of
15091 * pt.c (push_template_decl): Complain about mismatch in # of
15092 template parms between a class template and a member template.
15094 Sun Jun 15 02:38:20 1997 Jason Merrill <jason@yorick.cygnus.com>
15096 * method.c (synthesize_method): You can't call
15097 function_cannot_inline_p after finish_function.
15098 * decl.c (finish_function): Turn on flag_inline_functions and turn
15099 off DECL_INLINE before handing a synthesized method to the
15102 Thu Jun 12 17:35:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15104 * method.c (synthesize_method): Remove July 30 change to never set
15105 DECL_INLINE if at_eof.
15107 Thu Jun 12 15:25:08 1997 Mike Stump <mrs@cygnus.com>
15109 * xref.c (GNU_xref_member): Ensure that the node has a
15110 decl_lang_specific part before checking DECL_FRIEND_P.
15112 Thu Jun 12 12:36:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15114 * pt.c (instantiate_class_template): Diagnose non-class types used
15117 Wed Jun 11 17:33:40 1997 Jason Merrill <jason@yorick.cygnus.com>
15119 * typeck.c (build_conditional_expr): Use convert_for_initialization
15120 instead of convert_and_check.
15122 Wed Jun 11 12:31:33 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15124 * parse.y (typespec): Don't pedwarn for typeof.
15126 Tue Jun 10 00:22:09 1997 Jason Merrill <jason@yorick.cygnus.com>
15128 * repo.c (finish_repo): Only check changes if we would write a
15131 * call.c (compare_ics): Fix handling of 'this' conversions.
15133 * pt.c (do_decl_instantiation): Support static data too. Rename
15134 from do_function_instantiation.
15135 * cp-tree.h: Adjust.
15138 * repo.c (extract_string): New fn.
15139 (get_base_filename): Use it.
15140 (init_repo): Compare old args with current args.
15142 Mon Jun 9 14:25:30 1997 Mike Stump <mrs@cygnus.com>
15144 * Makefile.in, Make-lang.in: Protect C-ls with a comment
15145 character, idea from Paul Eggert <eggert@twinsun.com>.
15147 Mon Jun 9 01:52:03 1997 Jason Merrill <jason@yorick.cygnus.com>
15149 * typeck.c (c_expand_return): Be more persistent in looking for
15152 * cvt.c (build_up_reference): Use NOP_EXPR for switching from
15153 pointer to reference.
15155 * class.c (build_vbase_path): Don't do anything if PATH has no steps.
15157 Sun Jun 8 03:07:05 1997 Jason Merrill <jason@yorick.cygnus.com>
15159 * init.c (build_member_call, build_offset_ref):
15160 Use do_scoped_id instead of do_identifier.
15162 * cvt.c (convert): Remove bogosity.
15164 Sat Jun 7 20:50:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15166 * cvt.c (build_up_reference): Do checks of ARGTYPE and
15167 TARGET_TYPE before trying to use get_binfo.
15169 Fri Jun 6 17:36:39 1997 Jason Merrill <jason@yorick.cygnus.com>
15171 * cvt.c (build_up_reference): Call get_binfo to get access control.
15173 * decl2.c (import_export_decl): If we don't support weaks, leave
15176 Fri Jun 6 15:55:49 1997 Mike Stump <mrs@cygnus.com>
15178 * except.c (expand_builtin_throw): Add support for machines that
15179 cannot access globals after throw's epilogue when
15180 -fno-sjlj-exceptions is used.
15182 Thu Jun 5 16:28:43 1997 Jason Merrill <jason@yorick.cygnus.com>
15184 * parse.y: 'std::' becomes '::'.
15185 * lex.c (real_yylex): Remove 'namespace' warning.
15186 * init.c (build_member_call): Ignore 'std::'.
15187 (build_offset_ref): Likewise.
15188 * decl2.c (do_using_directive): Ignore 'using namespace std;'.
15189 (do_toplevel_using_decl): Ignore 'using std::whatever'.
15190 * decl.c (push_namespace): Just sorry.
15191 (pop_namespace): Nop.
15192 (init_decl_processing): Declare std namespace.
15194 Tue Jun 3 18:08:23 1997 Jason Merrill <jason@yorick.cygnus.com>
15196 * search.c (push_class_decls): A name which ambiguously refers to
15197 several instantiations of the same template just refers to the
15200 Tue Jun 3 12:30:40 1997 Benjamin Kosnik <bkoz@cirdan.cygnus.com>
15202 * decl.c (build_enumerator): Fix problem with unsigned long
15203 enumerated values being smashed to ints, causing overflow
15204 when computing next enumerated value (for enum values around
15207 Mon Jun 2 17:40:56 1997 Jason Merrill <jason@yorick.cygnus.com>
15209 * typeck.c (build_component_ref): Only call mark_used on a decl.
15211 Thu May 29 15:54:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15213 * typeck.c (build_c_cast): Make the check for a ptr to function
15214 more specific before possible default_conversion call.
15216 Thu May 29 13:02:06 1997 Mike Stump <mrs@cygnus.com>
15218 * except.c (expand_exception_blocks): Simplify and fix and make
15219 sure we don't end a region in a sequence, as expand_end_bindings
15222 Wed May 28 17:08:03 1997 Mike Stump <mrs@cygnus.com>
15224 * except.c (init_exception_processing): Mark terminate as not
15225 returning so that the optimizer can optimize better.
15227 Tue May 27 19:49:19 1997 Mike Stump <mrs@cygnus.com>
15229 * cvt.c (convert): Don't do any extra work, if we can avoid it
15232 Tue May 27 18:21:47 1997 Mike Stump <mrs@cygnus.com>
15234 * *.[chy]: Change cp_convert to ocp_convert, change convert to
15235 cp_convert. convert is now reserved for the backend, and doesn't
15236 have the semantics a frontend person should ever want.
15238 Fri May 23 10:58:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15240 * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled.
15241 Lose -traditional support.
15243 Thu May 22 15:41:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15245 * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype).
15247 * parse.y (self_reference): Do it for templates, too.
15248 * class.c (pushclass): Don't overload_template_name; the alias
15249 generated by build_self_reference serves the same purpose.
15251 * tree.c (list_hash): Make static, take more args.
15252 (list_hash_lookup): Likewise.
15253 (list_hash_add): Make static.
15254 (list_hash_canon): Lose.
15255 (hash_tree_cons): Only build a new node if one isn't already in the
15257 (hash_tree_chain): Use hash_tree_cons.
15258 * cp-tree.h: Adjust.
15259 * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead
15260 of calling lookup_name.
15262 Wed May 21 18:24:19 1997 Jason Merrill <jason@yorick.cygnus.com>
15264 * pt.c (instantiate_class_template): TYPE_VALUES for an enum
15265 doesn't refer to the CONST_DECLs.
15267 Tue May 20 21:09:32 1997 Bob Manson <manson@charmed.cygnus.com>
15269 * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever
15271 (expand_class_desc): Convert the last argument to a sizetype.
15273 Tue May 20 13:55:57 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15275 * gxx.gperf (__complex, __complex__, __imag, __imag__, __real,
15276 __real__): Add reswords.
15277 * hash.h: Regenerate.
15278 * lex.h (rid): Add RID_COMPLEX.
15279 (RID_LAST_MODIFIER): Set to RID_COMPLEX.
15280 * lex.c (init_lex): Add building of RID_COMPLEX.
15281 (real_yylex): General cleanup in line with what c-lex.c also has,
15282 sans the cruft for traditional; add handling of SPEC_IMAG, complex
15283 types, and imaginary numeric constants.
15284 * parse.y (REALPART, IMAGPART): Add tokens.
15285 (unary_expr): Add REALPART and IMAGPART rules.
15286 * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare.
15287 * decl.c (complex_{integer,float,double,long}_type_node): Define
15289 (init_decl_processing): Set up the types.
15290 (grokdeclarator): Add handling of RID_COMPLEX. Set and use
15291 DEFAULTED_INT instead of EXPLICIT_INT when we default to int type.
15292 * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15293 * cvt.c (cp_convert): Handle COMPLEX_TYPE.
15294 * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add
15296 * method.c (build_overload_name): Add handling of the different
15297 COMPLEX_TYPEs, prefixing them with `J'.
15298 * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE
15299 as a template parm.
15300 (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case.
15301 * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases.
15302 (mapcar): Handle COMPLEX_CST.
15303 * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE.
15304 (common_type): Add code for complex types.
15305 (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15306 (convert_for_assignment): Likewise.
15307 (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases.
15309 Mon May 19 12:26:27 1997 Jason Merrill <jason@yorick.cygnus.com>
15311 * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to
15312 tsubst_expr, as it might try to do overload resolution.
15314 Sat May 17 10:48:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15316 * pt.c (instantiate_class_template): Oops.
15318 Fri May 16 14:23:57 1997 Jason Merrill <jason@yorick.cygnus.com>
15320 * cp-tree.def: Add TAG_DEFN.
15321 * pt.c (tsubst_enum): New fn.
15322 (instantiate_class_template): Use it.
15323 (tsubst_expr): Support TAG_DEFN.
15324 (tsubst): Support local enums.
15325 (tsubst_copy): Likewise.
15326 * decl.c (finish_enum): Likewise.
15327 (start_enum): If this is a local enum, switch to permanent_obstack.
15329 Wed May 14 19:08:28 1997 Mike Stump <mrs@cygnus.com>
15331 * decl.c (store_parm_decls): Set last_parm_cleanup_insn here.
15332 (finish_function): Put the base init code for constructors just
15333 after the parm cleanup insns.
15334 (struct cp_function): Add last_parm_cleanup_insn.