1 1999-12-02 Mike Stump <mrs@wrs.com>
3 * init.c (perform_member_init): Handle parse errors better.
5 1999-12-01 Mark Mitchell <mark@codesourcery.com>
7 * cp-tree.h (min_tree_cons): Remove.
8 (scratch_ovl_cons): Likewise.
9 * decl.c (saveable_obstack): Don't declare.
10 (duplicate_decls): Tweak error-message.
11 (initialize_local_var): Explicitly mark the definition as static.
12 (finish_function): Call permanent_allocation, just so
13 that the middle-end sees the obstacks it expects.
14 (mark_cp_function_context): Likewise.
15 * init.c (build_new): Don't use min_tree_cons.
16 * lex.c (permanent_obstack): Don't declare.
17 (current_obstack, saveable_obstack): Likewise.
18 * spew.c (current_obstack, saveable_obstack): Likewise.
19 * tree.c (current_obstack, saveable_obstack): Likewise.
20 (scratch_ovl_cons): Remove.
21 (build_min_nt): Don't mess with obstacks.
22 (build_min): Likewise.
23 (min_tree_cons): Remove
24 * typeck.c (build_component_ref): Don't use scratch_ovl_cons.
25 (build_x_function_call): Likewise.
26 (build_c_cast): Don't use min_tree_cons.
28 1999-11-29 Mark Mitchell <mark@codesourcery.com>
30 * pt.c (tsubst_decl): Robustify.
32 1999-11-27 Mark Mitchell <mark@codesourcery.com>
34 * decl2.c (finish_file): Call expand_body for inline functions
35 that will be written out but that do not yet have RTL.
36 * semantics.c (expand_body): Do not generate RTL For inline
37 functions that do not yet need to be written out.
39 1999-11-25 Mark Mitchell <mark@codesourcery.com>
41 * Make-lang.in (CXX_SRCS): Add optimize.c.
42 * Makefile.in (CXX_OBJS): Add optimize.o.
43 (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
44 (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
45 (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
46 (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
47 (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
49 (optimize.o): New target.
50 * class.c: Don't include splay-tree.h.
51 * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
52 * cp-tree.h: Include splay-tree.h.
53 (DECL_UNINLINABLE): New macro.
54 (CTOR_BEGIN_P, CTOR_END_P): New macros.
55 (flag_inline_trees): New variable.
56 (local_variable_p): New function.
57 (nonstatic_local_decl_p): Likewise.
58 (optimize_function): Likewise.
59 (cplus_unsave_expr_now): Remove.
60 (copy_tree_r): Declare.
61 (remap_save_expr): Likewise.
62 * decl.c (local_variable_p): Don't
64 (local_variable_p_walkfn): New function.
65 (make_rtl_for_local_static): Remove code to try to avoid writing
67 (emit_local_var): Fix indentation.
68 (nonstatic_local_decl_p): New function.
69 (check_default_argument): Use local_variable_p_walkfn, not
70 local_variable_p, when walking the tree.
71 (start_function): Set the DECL_CONTEXT for automatically generated
73 (finish_constructor_body): Use CTOR_STMT to mark the end of a
75 * decl2.c: Don't include splay-tree.h.
76 (flag_inline_trees): Define.
77 * dump.c: Don't include
79 * except.c (expand_end_catch_block): Fix comment formatting.
80 (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
81 (expand_throw): Tidy comment.
82 * init.c (build_vec_delete_1): Use create_temporary_var.
83 * lex.c (cplus_tree_code_type): Make it static.
84 (cplus_tree_code_length): Likewise.
85 (cplus_tree_code_name): Likewise.
86 * optimize.c: New file.
87 * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
89 (setup_vtbl_ptr): Mark the beginnings of constructors with
91 (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
92 (expand_body): Call optimize_function. Save bodies if we're doing
94 * tree.c: Don't include splay-tree.h. Include insn-config.h and
96 (copy_tree_r): Make it public.
97 (statement_code_p): New function.
98 (mark_local_for_remap_r): Likewise.
99 (cp_usave_r): Likewise.
100 (cp_unsave): Likewise.
101 (build_cplus_new): Set DECL_CONTEXT for temporary variables.
102 (walk_tree): Walk into `s' class nodes. Walk statement chains.
103 (copy_tree_r): Handle 's' class nodes. Restore chains for
104 statements. Nullify scopes. Don't copy types.
105 (init_tree): Set lang_unsave to cp_unsave.
106 (remap_save_expr): Define.
107 * ir.texi: Document CTOR_STMT.
109 1999-11-24 Jason Merrill <jason@casey.cygnus.com>
111 * search.c (note_debug_info_needed): Do perform this optimization
113 (maybe_suppress_debug_info): Likewise. Start by clearing
114 TYPE_DECL_SUPPRESS_DEBUG.
116 1999-11-24 Mark Mitchell <mark@codesourcery.com>
118 * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
120 * decl2.c (finish_vtable_vardecl): Don't prune vtables here.
122 1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
124 * decl.c (pushdecl, grokdeclarator): Don't call a variadic
125 function with a non-literal format string.
127 * lex.c (do_identifier): Likewise.
129 * typeck.c (build_unary_op): Likewise.
131 1999-11-23 Mark Mitchell <mark@codesourcery.com>
133 * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
135 1999-11-22 Mark Mitchell <mark@codesourcery.com>
137 * cp-tree.def (CTOR_COMPLETE): New tree node.
138 * decl.c (finish_constructor_body): Add it, to mark the end of the
140 (finish_function): Don't call end_protect_partials here.
141 * ir.texi (CTOR_COMPLETE): Document it.
142 * semantics.c (expand_stmt): Handle it.
144 * cp-tree.def (FUNCTION_NAME): New tree node.
145 * cp-tree.h (current_function_name_declared): Tweak documentation.
146 (lang_decl_flags): Add pretty_function_p, adjust dummy.
147 (DECL_PRETTY_FUNCTION_P): New macro.
148 * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
149 etc., in a template function. Use at_function_scope_p instead of
151 * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
153 (tsubst): Handle FUNCTION_NAME.
154 (tsubst_copy): Likewise.
155 (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
156 etc. in instantiation.
157 * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
158 even in template functions.
159 (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
160 conditional scope at the top of a destructor.
162 * error.c (dump_function_decl): Use `[ with ... ]' syntax for
165 1999-11-22 Nathan Sidwell <nathan@acm.org>
167 * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
168 when actually negative.
170 * typeck.c (convert_for_assignment): Expand comment about
171 strange NULL check, moved from ...
172 (convert_for_initialization): ... here. Remove unneeded
175 1999-11-21 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
177 * cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
178 * init.c (build_vec_delete, build_vec_delete_1): Likewise.
179 Always destruct virtual bases of array components, but never
181 (build_vec_init): Adjust invocations.
182 (build_delete): Likewise.
183 * decl2.c (delete_sanity): Likewise.
185 1999-11-19 Nathan Sidwell <nathan@acm.org>
187 * cp-tree.h (grok_method_quals): Return this pointer qualifiers.
188 * decl.c (grokdeclarator): Adjust calls to grok_method_quals.
189 * decl2.c (grok_method_quals): Accept `restrict' as applying to
190 the object pointer. Return such qualifiers.
191 (grokclassfn): Apply this pointer qualifiers. Cleanup unused
194 1999-11-18 Mark Mitchell <mark@codesourcery.com>
196 * except.c (expand_end_catch_block): Fix typo.
197 (expand_exception_blocks): Simplify. Don't call
198 expand_leftover_cleanups.
200 1999-11-15 Jason Merrill <jason@casey.cygnus.com>
202 * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
203 * pt.c (tsubst, case INTEGER_TYPE): Call it.
204 Check uses_template_parms.
206 * class.c (finish_struct): If we're a local class in a template
207 function, add a TAG_DEFN.
208 * pt.c (lookup_template_class): If this is a local class in a
209 template function, call pushtag.
210 (tsubst_expr, case TAG_DEFN): Handle classes, too.
212 Emit debug info with the vtable.
213 * search.c (maybe_suppress_debug_info): New function...
214 * class.c (finish_struct_1): ...split out from here.
215 * cp-tree.h: Declare it.
216 * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
217 if we're writing out the vtable.
218 * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
219 note_debug_info_needed): #if 0 out.
221 1999-11-14 Mark Mitchell <mark@codesourcery.com>
223 * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
224 * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
226 * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
227 * decl2.c (lookup_arg_dependent): Use it.
229 * cp-tree.h (cp_finish_decl): Change prototype.
230 (finish_static_data_member_decl): Likewise.
231 (push_permanent_obstack): Remove declaration.
232 (push_expression_obstack): Likewise.
233 (push_scratch_obstack): Likewise.
234 (DECL_TEMPLATE_PARM_P): Robustify.
235 (SET_DECL_TEMPLATE_PARM_P): New macro.
236 * class.c (add_method): Don't manipulate obstacks.
237 (finish_vtbls): Likewise.
238 * cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
239 * decl.c (binding_for_name): Don't manipulate obstacks.
240 (maybe_push_to_top_level): Likewise.
241 (pop_from_top_level): Likewise.
242 (duplicate_decls): Likewise.
243 (pushdecl): Likewise.
244 (implicitly_declare): Likewise.
245 (build_typename_type): Likewise.
246 (start_decl): Likewise.
247 (cp_finish_decl): Likewise.
248 (finish_decl): Likewise.
249 (destroy_local_static): Likewise.
250 (expand_static_init): Likewise.
251 (complete_array_type): Likewise.
252 (grokvardecl): Likewise.
253 (build_ptrmemfnc_type): Likewise.
254 (grokdeclarator): Likewise.
255 (xref_tag): Likewise.
256 (xref_basetypes): Likewise.
257 (start_enum): Likewise.
258 (finish_enum): Likewise.
259 (start_function): Likewise.
260 (finish_function): Likewise.
261 (start_method): Adjust call to cp_finish_decl.
262 * decl2.c (finish_static_data_member_decl): Don't manipulate
264 (grokfield): Likewise.
265 (grokbitfield): Likewise.
266 (get_temp_name): Likewise.
267 (get_sentry): Likewise.
268 (fnish_file): Likewise.
269 (lookup_arg_dependent): Likewise.
270 * except.c (call_eh_info): Likewise.
271 (push_eh_info): Likewise.
272 (do_pop_exception): Likewise.
273 (initialize_handler_parm): Likewise.
274 (expand_end_eh_spec): Likewise.
275 (alloc_eh_object): Likewise.
276 (expand_throw): Likewise.
277 * expr.c (extract_scalar_init): Likewise.
278 * init.c (build_java_class_ref): Likewise.
279 * lex.c (get_time_identifier): Likewise.
280 (snarf_defarg): Likewise.
281 (add_defarg_fn): Likewise.
282 (is_global): Simplify.
283 (do_identifier): Don't check TREE_PERMANENT.
284 * method.c (emit_thunk): Don't manipulate obstacks.
285 * parse.y (condition): Adjust call to cp_finish_decl.
288 (initdcl0_innards): Likewise.
289 (nomods_initdcl0): Likewise.
290 * pt.c (push_inline_template_parms_recursive): Use
291 SET_DECL_TEMPLATE_PARM_P.
292 (process_template_parm): Likewise.
293 (lookup_template_class): Don't manipulate obstacks.
294 (instantiate_class_template): Adjust call to
295 finish_static_data_member_decl.
296 (tsubst_decl): Don't manipulate obstacks.
297 (tsubst_expr): Likewise.
298 (instantiate_template): Likewise.
299 (instantiate_decl): Adjust calls to cp_finish_decl.
300 * rtti.c (call_void_fn): Don't manipulate obstacks.
301 (get_tinfo_var): Likewise.
302 (get_tinfo_fn_unused): Likewise.
303 (build_dynamic_cast_1): Likewise.
304 (expand_si_desc): Likewise.
305 (expand_class_desc): Likewise.
306 (expand_ptr_desc): Likewise.
307 (expand_attr_desc): Likewise.
308 (expand_generic_desc): Likewise.
309 (synthesize_tinfo_fn): Likewise.
310 * search.c (expand_upcast_fixups): Likewise.
311 * semantics.c (finish_asm_stmt): Likewise.
312 (finish_named_return_value): Likewise.
313 (begin_class_definition): Likewise.
314 (finish_class_definition): Likewise.
315 (finish_typeof): Likewise.
316 * tree.c (build_cplus_method_type): Likewise.
317 (reverse_path): Likewise.
318 (copy_template_template_parm): Likewise.
319 (build_expr_ptr_wrapper): Likewise.
320 (push_expression_obstack): Remove.
321 (push_permanent_obstack): Likewise.
322 * typeck.c (mark_addressable): Likewise.
324 1999-11-13 Mark Mitchell <mark@codesourcery.com>
326 * call.c (build_conditional_expr): Use build_target_expr_with_type.
327 (convert_like): Likewise.
328 (build_over_call): Likewise.
329 * cp-tree.h (build_target_expr): Remove.
330 (build_target_expr_with_type): New function.
331 * cvt.c (build_up_reference): Use get_target_expr.
332 * decl.c (build_target_expr): Move to ...
333 * tree.c (build_target_expr): Here. Make it static.
334 (build_target_expr_with_type): New function. Set DECL_CONTEXT on
335 the temporary VAR_DECLs.
336 (get_target_expr): Use it.
338 1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
340 * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
341 * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
342 * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
343 * class.c (set_rtti_entry): Use it.
345 1999-11-12 Mark Mitchell <mark@codesourcery.com>
347 * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
349 * semantics.c (finish_expr_stmt): Call it here instead. Move
350 default_conversion logic to semantic-analysis time.
352 1999-11-12 Jason Merrill <jason@yorick.cygnus.com>
354 * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT.
356 Fri Nov 12 12:56:32 MST 1999 Diego Novillo <dnovillo@cygnus.com>
358 * init.c (init_init_processing): Re-instated Nov 11 patch after
361 Fri Nov 12 10:42:02 MST 1999 Diego Novillo <dnovillo@cygnus.com>
363 * init.c (init_init_processing): Undo patch from Nov 11, 1999.
364 Patch had not been approved yet.
366 1999-11-12 Mark Mitchell <mark@codesourcery.com>
368 * decl.c (compute_array_index_type): New function, split out from
370 (create_array_type_for_decl): Likewise.
371 (grokdeclarator): Use them.
373 * semantics.c (expand_stmt): Don't suspend_momentary or
376 Thu Nov 11 12:42:11 MST 1999 Diego Novillo <dnovillo@cygnus.com>
378 * init.c (init_init_processing): Header information for
379 arrays allocated via `new' should have the same alignment used by
382 1999-11-10 Mark Mitchell <mark@codesourcery.com>
384 * error.c (dump_function_name): Don't crash if given a friend
385 pseudo-instantiation.
387 * cp-tree.h (build_enumerator): Change prototype.
388 * decl.c (enum_next_value): Remove.
389 (enum_overflow): Likewise.
390 (init_decl_processing): Don't register enum_next_value as a root.
391 (start_enum): Clear TYPE_VALUES for a redefined enum.
392 (finish_enum): Reset the type of enumeration constants.
393 (build_enumerator): Fix indentation. Don't copy CONST_DECLs when
394 we don't need to. Maintain the TYPE_VALUES list and look there
395 for the previously defined enumeration constant. Let enumeration
396 constants have the type of their values until the enumeration type
398 * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
400 * parse.c: Regenerated.
401 * pt.c (tsubst_enum): Adjust according to build_enumerator changes.
403 Wed Nov 10 12:43:21 1999 Philippe De Muyter <phdm@macqel.be>
404 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
406 * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'.
408 1999-11-09 Mark Mitchell <mark@codesourcery.com>
410 * cp-tree.h (language_function): Remove x_last_dtor_insn and
411 x_last_parm_cleanup_insn.
412 * decl.c (last_dtor_insn): Remove.
413 (last_parm_cleanup_insn): Likewise.
414 (expand_start_early_try_stmts): Don't set them.
415 (store_parm_decls): Likewise.
416 (save_function_data): Or save them.
417 (mark_lang_function): Or mark them.
419 1999-11-08 Mark Mitchell <mark@codesourcery.com>
421 * decl.c (store_parm_decls): Generate cleanup code at
422 semantic-analysis time. Destroy objects in the correct order.
424 1999-11-07 Mark Mitchell <mark@codesourcery.com>
426 * cp-tree.h (begin_new_placement): Remove.
427 (finish_new_placement): Likewise.
428 * class.c (finish_struct_1): Don't suspend_momentary or
430 * decl.c (grokdeclarator): Likewise.
431 (maybe_build_cleanup_1): Likewise.
432 * except.c (push_eh_cleanup): Likewise.
433 (build_terminate_handler): Likewise.
434 * init.c (build_new_1): Likewise.
435 * parse.y (parse_decl): Change prototype.
436 (initdecls, notype_initdecls, initdcl): Don't return int.
437 (initdcl0, notype_initdcl0, initdcl0_innards): Likewise.
438 (.begin_new_placement): Remove.
439 (.finish_new_placement): Likewise.
440 (nonmomentary_expr): Likewise.
441 (suspend_mom): Likewise.
442 (condition): Don't suspend_momentary, resume_momentary, or keep
443 track of need to resume.
444 (unary_expr): Likewise.
445 (new_placement): Likewise.
447 (structsp): Likewise.
448 (new_type_id): Likewise.
449 (maybe_parmlist): Likewise.
450 (direct_after_type_declaration): Likewise.
451 (direct_new_declarator): Likewise.
452 (direct_abstract_declaration): Likewise.
453 * parse.c: Regenerated.
454 * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary.
455 * semantics.c (begin_new_placement): Remove.
456 (finish_new_placement): Likewise.
458 1999-11-05 Martin v. Löwis <loewis@informatik.hu-berlin.de>
460 * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
461 (DECL_TEMPLATE_INFO): Use it.
462 * decl.c (warn_extern_redeclared_static): Do nothing for
464 * decl2.c (mark_used): Explicitly check for function or variable.
465 * semantics.c (finish_unary_op_expr): Check whether result is also
468 1999-11-05 Mark Mitchell <mark@codesourcery.com>
470 * Makefile.in (typeck2.o): Depend on output.h.
471 * typeck2.c: Include output.h.
473 * decl.c (flag_ansi): Remove declaration.
475 * pt.c (tinst_level_tick): Make it static.
476 (last_template_error_tick): Likewise.
478 * cp-tree.h (mapcar): Remove declaration.
479 (search_tree): Likewise.
480 (walk_tree_fn): New typedef.
481 (walk_tree): New function.
482 * tree.c (bot_manip): Change prototype. Adjust to be called via
484 (bot_replace): Likewise.
485 (no_linkage_helper): Likewise.
486 (copy_tree_r): New function.
487 (search_tree): Rename, and adjust, to become ...
488 (walk_tree): New function.
490 (target_remap): Remove.
491 (target_remap_count): Likewise.
492 (break_out_target_exprs): Use walk_tree.
493 * decl.c (local_variable_p): Change prototype.
494 (check_default_argument): Use walk_tree.
495 * pt.c (for_each_template_parm_r): New function, split out from ...
496 (for_each_template_parm): Here. Use it, via walk_tree.
498 1999-11-03 Mark Mitchell <mark@codesourcery.com>
500 * class.c (check_bitfield_decl): New function, split out from
502 (check_field_decl): Likewise. Recursively examine members of
504 (finish_struct_1): Use them.
505 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
507 1999-11-02 Mark Mitchell <mark@codesourcery.com>
509 * decl.c (grokfndecl): Remove dead code.
511 * dump.c (dequeue_and_dump): Fix thinko for catch-clauses.
513 1999-11-02 Scott Snyder <snyder@fnal.gov>
515 * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
517 * pt.c (tsubst_copy): Likewise.
519 1999-11-01 Jason Merrill <jason@yorick.cygnus.com>
521 * decl2.c (maybe_make_one_only): Always make things comdat on
524 1999-10-31 Mark Mitchell <mark@codesourcery.com>
526 * decl.c (finish_function): Call free_after_parsing for functions
527 we are not immediately turning into RTL.
529 1999-10-31 Brendan Kehoe <brendan@cygnus.com>
531 * cp-tree.h (flag_dump_translation_unit): Add decl.
533 Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
535 * lex.c (yylex): Accept 'f' in mantissa of hex float constant.
537 1999-10-30 Mark Mitchell <mark@codesourcery.com>
539 * decl.c (pop_cp_function_context): Don't call free on a NULL
541 * semantics.c: Include ggc.h.
542 (expand_body): Do garbage-collection after processing a template
543 function. Clear DECL_SAVED_TREE after generating RTL for a
545 * Makefile.in (semantics.o): Depend on ggc.h.
547 1999-10-29 Mark Mitchell <mark@codesourcery.com>
549 * cp-tree.h (make_typename_type): Change prototype.
550 * decl.c (make_typename_type): Only complain if so requested.
551 * parse.y (nested_name_specifier): Adjust calls.
552 (typename_sub0): Likewise.
553 (typename_sub1): Likewise.
554 * parse.c: Regenerated.
555 * pt.c (convert_template_argument): Pass complain to
559 1999-10-28 Mark Mitchell <mark@codesourcery.com>
561 * semantics.c (finish_handler): End the scope of the handler
562 before attaching it to the statement-tree.
564 1999-10-28 Ian Lance Taylor <ian@zembu.com>
566 * rtti.c (build_dynamic_cast_1): Give a better error message for
567 an attempt to dynamic_cast from a non-polymorphic type.
569 1999-10-27 Mark Mitchell <mark@codesourcery.com>
571 * cp-tree.h (make_temp_vec): Remove.
572 (make_scratch_vec): Likewise.
573 * call.c (add_function_candidate): Use make_tree_vec.
574 (add_conv_candidate): Likewise.
575 (build_builtin_candidate): Likewise.
576 (add_template_candidate_real): Likewise.
577 * class.c (resolve_address_of_overloaded_function): Likewise.
578 * decl.c (start_function): Don't fool with the momentary obstack.
579 (finish_function): Likewise.
580 * init.c (expand_direct_vtbls_init): Likewise.
581 (begin_init_stmts): Likewise.
582 (finish_init_stmts): Likewise.
583 * pt.c (add_to_template_args): Use make_tree_vec.
584 (check_explicit_specialization): Likewise.
585 (coerce_template_parms): Likewise.
586 (lookup_template_class): Don't fool with the momentary obstack.
587 (instantiate_class_template): Likewise.
588 (tsubst_template_arg_vector): Use make_tree_vec.
589 (tsubst_aggr_type): Don't fool with the momentary obstack.
590 (tsubst_decl): Likewise. Use make_tree_vec.
591 (try_one_overload): Likewise.
592 (try_class_unification): Don't fool with the momentary obstack.
593 (get_bindings_real): Use make_tree_vec.
594 (set_mangled_name_for_template_decl): Likewise.
595 * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack.
596 * semantics.c (finish_expr_stmt): Likewise.
597 (finish_do_stmt): Likewise.
598 (finish_for_expr): Likewise.
599 (finish_switch_cond): Likewise.
600 (do_pushlevel): Likewise.
601 (do_poplevel): Likewise.
602 * tree.c (make_temp_vec): Remove.
604 * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump
605 CLEANUP_P for a TRY_BLOCK.
606 * ir.texi: Document SAVE_EXPR.
608 Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
610 * call.c (build_over_call): Check that the built-in function is
611 of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
612 * typeck.c (build_function_call_real): Similarly.
614 1999-10-26 Mark Mitchell <mark@codesourcery.com>
616 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
619 1999-10-24 Mark Mitchell <mark@codesourcery.com>
621 * decl.c (push_overloaded_decl_1): Use pushdecl.
623 * decl.c (auto_function): Replace #ifdef'd __inline with just
625 * lex.c (my_get_run_time): Likeise.
627 (identifier_type): Likewise.
628 * method.c (start_squangling): Likewise.
629 (end_squangling): Likewise.
631 (old_backref_index): Likewise.
632 (flush_repeats): Likewise.
633 (issue_ktype): Likewise.
634 * parse.y (empty_parms): Likewise.
635 * parse.c: Regenerated.
637 1999-10-21 Mark Mitchell <mark@codesourcery.com>
639 * dump.c (dequeue_and_dump): Replace several uses of
640 queue_and_dump_index with dump_child.
642 1999-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
644 * expr.c: Include tm_p.h.
646 1999-10-21 Mark Mitchell <mark@codesourcery.com>
648 * cp-tree.h (SCOPE_PARTIAL_P): New macro.
649 (pushlevel_temporary): Remove.
650 (add_scope_stmt): New function.
651 * decl.c (pushlevel_temporary): Remove.
652 (poplevel): Use add_scope_stmt.
653 (start_decl_1): Likewise.
654 * semantics.c (add_scope_stmt): New function.
655 (do_pushlevel): Use it.
656 (do_poplevel): Use it.
657 (expand_stmt): Check SCOPE_PARTIAL_P.
659 * cp-tree.def (EMPTY_CLASS_EXPR): New tree node.
660 * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR.
661 * expr.c (cplus_expand_expr): Expand it.
662 * ir.texi: Document EMPTY_CLASS_EXPR.
664 1999-10-20 Mark Mitchell <mark@codesourcery.com>
666 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template
667 parameters as having namespace scope.
669 1999-10-19 Mark Mitchell <mark@codesourcery.com>
671 * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove.
672 (mangling_flags): New type.
673 (build_overload_int): Change prototype.
674 (build_overload_value): Likewise.
675 (numeric_output_need_bar): Improve comment.
676 (mangle_expression): New function, broken out from ...
677 (build_overload_int): Here.
678 (build_overload_value): Adjust for use of mangling flags. Don't
679 warn about real-valued template parameters here. Do handle
680 complex expressions involving real-valued template parameters.
681 (build_template_parm_names): Encase non-type template parameters
682 in underscores, if necessary.
683 (process_overload_item): Remove conditional on
684 PARM_CAN_BE_ARRAY_TYPE.
686 1999-10-17 Mark Mitchell <mark@codesourcery.com>
688 * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR.
690 * ir.texi: Clean up documentation of RETURN_INIT.
692 1999-10-15 Greg McGary <gkm@gnu.org>
694 * lex.c (lang_init_options): Set flag_bounds_check as "unspecified".
695 (lang_init): Set default for flag_bounds_check if still "unspecified".
697 1999-10-13 Andrew Haley <aph@cygnus.com>
699 * class.c (finish_struct_1): Force alignment of non-bitfields to
702 Wed Oct 13 22:01:35 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
704 * typeck2.c (process_init_constructor): Handle empty constructors.
706 1999-10-13 Jason Merrill <jason@yorick.cygnus.com>
708 * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL.
710 * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size
713 1999-10-13 Mark Mitchell <mark@codesourcery.com>
715 * decl.c (make_rtl_for_local_static): Don't create register RTL
716 for addressable constants.
718 1999-10-13 Nathan Sidwell <nathan@acm.org>
720 * cp-tree.h (build_x_va_arg): Prototype new function.
721 * call.c (build_x_va_arg): Define it.
722 * parse.y (unary_expr): Call build_x_va_arg.
724 * cp-tree.h (convert_type_from_ellipsis): Prototype new function.
725 * call.c (convert_type_from_ellipsis): Define it.
726 * decl.c (init_decl_processing): Set lang_type_promotes_to.
728 * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates.
730 1999-10-11 Jason Merrill <jason@yorick.cygnus.com>
732 * class.c (fixed_type_or_null): Always set *nonnull.
734 1999-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
736 * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing
737 __GNUC__ and __GNUC_MINOR__.
739 1999-10-09 Mark Mitchell <mark@codesourcery.com>
741 * cp-tree.h (make_rtl_for_local_static): New function.
742 * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for
744 (make_rtl_for_local_static): Here.
745 * semantics.c (expand_stmt): Use make_rtl_for_local_static.
747 1999-10-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
749 * method.c: Include tm_p.h.
751 1999-10-7 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
753 * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type.
754 * lex.c (cp_make_lake_type): Likewise.
755 * tree.c (init_tree): Init make_lang_type_fn.
757 1999-10-07 Mark Mitchell <mark@codesourcery.com>
759 * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch
762 * semantics.c (expand_stmt): Don't pretend to have asmspecs for
763 local statics if we don't really have them.
765 * ir.texi: Improve documentation for STMT_EXPR. Describe
768 1999-10-07 Jason Merrill <jason@yorick.cygnus.com>
770 * class.c (build_vtable_entry_ref): Use finish_asm_stmt.
772 1999-10-07 Greg McGary <gkm@gnu.org>
774 * class.c (finish_struct_1): Use simpler method of
775 removing elements of a singly-linked list which doesn't
776 lose for classes without data members.
778 1999-10-07 Mark Mitchell <mark@codesourcery.com>
780 * friend.c (make_friend_class): Robustify.
782 * semantics.c (finish_object_call_expr): Reject calls to template
785 1999-10-06 Mark Mitchell <mark@codesourcery.com>
787 * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR.
789 * cp-tree.h (CLASSTYPE_VFIELD): Remove.
790 * call.c (build_vfield_ref): Use TYPE_VFIELD, not
792 * class.c (get_vfield_offset): Likewise.
793 (finish_base_struct): Likewise.
794 (modify_one_vtable): Likewise.
795 (fixup_vtable_deltas): Likewise.
796 (finish_struct_1): Likewise.
797 * init.c (expand_virtual_init): Likewise.
798 * search.c (lookup_field_1): Likewise.
799 (expand_upcast_fixups): Likewise.
800 * typeck.c (build_component_ref): Likewise.
801 (build_binary_op_nodefault): Likewise.
803 * dump.c (dqueue_and_dump): Dump TYPE_VFIELD.
804 * ir.texi: Document TYPE_VFIELD.
806 1999-10-06 Brendan Kehoe <brendan@cygnus.com>
808 * decl.c (grokdeclarator): Only warn about non-zero arrays if
809 !in_system_header (linux socketbits.h can give this for
810 __cmsg_data, which is using a GNU extension).
812 1999-10-05 Mark Mitchell <mark@codesourcery.com>
814 * decl2.c (start_static_storage_duration_function): Push the
815 function declaration so it ends up in namespace scope.
817 * dump.c (DUMP_CHILDREN): Remove.
818 (DUMP_BINFO): Adjust.
819 (struct dump_node_info): Remove dump_children_p.
820 (queue_and_dump_type): Remove dump_children_p parameter.
821 (queue): Don't set dump_children_p.
822 (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to
823 queue_and_dump_index.
824 (dequeue_and_dump): Unconditionally print children. Adjust calls
825 to functions mentioned above.
826 (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue.
828 * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
829 * dump.c (dequeue_and_dump): Dump them.
831 * method.c (synthesize_method): Call setup_vtbl_ptr for destructors.
833 * decl.c (start_function): Set current_in_charge_parm for
834 constructors, too, where appropriate.
835 * search.c (fixup_all_virtual_upcast_offsets): New function.
836 (expand_indirect_vtbls_init): Use it.
838 1999-10-04 Nathan Sidwell <nathan@acm.org>
840 * decl2.c (grok_alignof): Don't decay lvalues.
842 * init.c (build_new): Remove unused variable.
844 1999-10-04 Mark Mitchell <mark@codesourcery.com>
846 * cp-tree.h (struct language_function): Remove static_labelno.
847 (static_labelno): Remove macro.
848 * method.c (build_overload_nested_name): Make static_labelno
851 * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL,
852 to decide whether or not a function is defined.
854 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for
855 situations where make_node will do it automatically.
856 * decl.c (grok_reference_init): Likewise.
857 (expand_static_init): Likewise.
858 (do_static_initialization): Likewise.
859 * init.c (perform_member_init): Likewise.
860 (expand_aggr_init_1): Likewise.
861 (build_new_1): Likewise.
862 * method.c (do_build_copy_constructor): Likewise.
863 (do_build_assign_ref): Likewise.
864 * search.c (expand_upcast_fixups): Likewise.
865 * semantics.c (finish_stmt_expr): Likewise.
866 * typeck.c (build_unary_op): Likewise.
867 (check_return_expr): Likewise.
869 1999-10-04 Jason Merrill <jason@yorick.cygnus.com>
871 * init.c (build_vec_delete_1): Fold COND_EXPRs.
873 1999-10-03 Mark Mitchell <mark@codesourcery.com>
875 * cp-tree.def (VEC_INIT_EXPR): Remove.
876 * cp-tree.h (struct stmt_tree): New type.
877 (struct saved_scope): Remove firstobj. Add x_saved_tree,
879 (class_cache_firstobj): Remove.
880 (struct language_function): Remove stmts_are_full_exprs_p,
881 x_last_tree, and x_last_expr_type. Add x_stmt_tree.
882 (current_stmt_tree): New macro.
884 (last_expr_type): Likewise.
885 (doing_semantic_analysis_p): Simplify.
886 (stmts_are_full_exprs_p): Adjust.
887 (begin_tree): Remove prototype.
888 (end_tree): Likewise.
889 (begin_stmt_tree): Change prototype.
890 (finish_stmt_tree): Likewise.
891 (building_stmt_tree): Simplify.
892 * decl.c (mark_stmt_tree): New function.
893 (mark_saved_scope): Use it.
894 (start_function): Rearrange slightly to call begin_stmt_tree
896 (save_function_data): Tweak.
897 (finish_function): Adjust call to finish_stmt_tree.
898 (mark_lang_function): Use mark_stmt_tree.
899 * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
900 * init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
901 (build_vec_init): Remove creation of stand-in intializer.
902 * pt.c (begin_tree): Remove.
903 (end_tree): Likewise.
904 * semantics.c (SET_LAST_STMT): New macro. Use it throughout.
905 (begin_compound_stmt): Handle a compound-statement outside of a
907 (begin_stmt_expr): Handle a statement-expression outsidef of a
909 (finish_stmt_expr): Likewise.
910 (begin_class_definition): Don't call begin_tree.
911 (finish_inline_definitions): Don't call end_tree.
912 (begin_stmt_tree): Take a pointer to tree, not a function as input.
913 (finish_stmt_tree): Likewise.
914 * tree.c (search_tree): Don't handle VEC_INIT_EXPR.
917 * parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
918 * parse.c: Regenerated.
920 * dump.c (dqueue_and_dump): Dump bitfieldness.
922 * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for
923 bitfields, rather than DECL_BIT_FIELD.
924 * ir.texi: Document how to tell whether or not a field is a
927 * lex.c (make_lang_type): Fix typo in comment.
929 1999-10-01 Jason Merrill <jason@yorick.cygnus.com>
931 * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues.
933 1999-10-01 Mark Mitchell <mark@codesourcery.com>
935 * pt.c (tsubst_decl): If the type of a template instantiation is
936 bogus, so is the whole instantiation.
938 1999-09-30 Mark Mitchell <mark@codesourcery.com>
940 * decl.c (initialize_local_var): Handle static variables here.
941 (cp_finish_decl): Tweak handling of function-scope static
943 * semantics.c (expand_stmt): Handle DECL_STMTs for static
946 * method.c (emit_thunk): Don't crash when -fsyntax-only.
948 * cp-tree.h (lang_decl_flags): Add global_ctor_p and
949 global_dtor_p. Add init_priority.
950 (DECL_ACCESS): Adjust accordingly.
951 (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros.
952 (GLOBAL_INIT_PRIORITY): Likewise.
953 * decl.c (lang_mark_tree): Adjust accordingly.
954 (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P,
955 and GLOBAL_INIT_PRIORITY.
956 * dump.c (dequeue_and_dump): Print them.
957 * ir.texi: Document them.
959 * decl2.c (struct priority_info_s): Remove initialization_sequence
960 and destruction_sequence.
961 (start_static_storage_duration_function): Return the body of the
962 function. Convert for function-at-a-time mode.
963 (generate_inits_for_priority): Remove.
964 (finish_static_storage_duration_function): Change prototype.
965 Adjust for function-at-a-time mode.
966 (do_static_initialization): Likewise.
967 (do_static_destruction): Likewise.
968 (do_static_initialization_and_destruction): Remove.
969 (start_static_initialization_or_destruction): New function.
970 (finish_static_initialization_or_destruction): Likewise.
971 (get_priority_info): Don't manipulation initialization_sequence or
972 destruction_sequence.
973 (prune_vars_needing_no_initialization): New function.
974 (write_out_vars): Likewise.
975 (finish_file): Use the various new functions instead of the old.
977 Thu Sep 30 00:13:27 1999 Dirk Zoller <duz@rtsffm.com>
979 * cp-tree.h (warn_float_equal): Declare.
980 * decl2.c (warn_float_equal): Define.
981 (lang_decode_option): Recognize -W[no-]float-equal.
982 * typeck.c (build_binary_op_nodefault): Conditionally warn
983 about equality tests of floating point types.
985 1999-09-29 Jason Merrill <jason@yorick.cygnus.com>
987 Support normal type_info-based EH mechanisms with -fno-rtti.
988 * except.c (build_eh_type_type): Remove special -fno-rtti handling.
989 (build_eh_type_type_ref): Likewise.
990 (build_eh_type): Remove.
991 (expand_throw): Call build_eh_type_type, not build_eh_type.
992 * decl2.c (import_export_decl): Don't associate the tinfo fn with
993 the vtable if -fno-rtti.
994 * decl.c (init_decl_processing): Always init_rtti_processing.
996 * rtti.c (get_typeid): Don't complain about -fno-rtti.
998 * class.c (class_cache_obstack, class_obstack): Remove.
999 (init_class_processing): Don't initialize class_obstack.
1000 (push_cache_obstack): Remove.
1001 (pushclass): Don't call it.
1002 * cp-tree.h: Remove prototype for push_cache_obstack.
1003 * decl.c (decl_obstack, decl_stack, push_decl_level): Remove.
1004 (pushlevel_class): Don't push_decl_level.
1005 (poplevel_class): Don't pop_stack_level.
1006 (push_class_level_binding): Don't push_cache_obstack.
1007 (init_decl_processing): Don't intialize decl_obstack.
1008 * search.c (push_class_decls): Don't push_cache_obstack.
1009 * tree.c (list_hash_add): Put hash node on permanent_obstack.
1010 (hash_tree_cons): Don't mess with obstacks.
1011 (print_lang_statistics): Don't print stats for class_obstack and
1014 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1016 * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL.
1017 * ir.texi: Document DECL_EXTERNAL.
1019 * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs.
1020 * ir.texi: Document THUNK_DECLs.
1022 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c.
1023 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1024 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1025 * error.c (dump_template_bindings): Remove unused parameter.
1026 Handle multiple levels of template parameters.
1027 (dump_template_decl): Use `parms', not `args', for template
1028 parameters. Fix thinko.
1029 (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass
1030 flags to dump_template_bindings.
1031 * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h.
1032 (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise.
1033 (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise.
1034 (tsubst_copy): Clarify variable name.
1035 (most_general_template): Robustify.
1037 1999-09-29 Nathan Sidwell <nathan@acm.org>
1039 * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME
1040 to change primary template rendering.
1042 1999-09-29 Mark Mitchell <mark@codesourcery.com>
1044 * cp-tree.h (UPT_TEMPLATE): Remove.
1045 (UPT_PARMS): Likewise.
1046 (DECL_NEEDED_P): New macro.
1047 * decl2.c (finish_vtable_vardecl): Use it.
1048 (finish_objects): Don't crash with -fsyntax-only.
1049 (finish_file): Use DECL_NEEDED_P. Don't prune vtables when
1051 * pt.c (tsubst_friend_function): Remove FIXME that talks about
1053 (tsubst_expr): Correct handling of function try-blocks.
1054 * semantics.c: Include flags.h.
1055 (expand_body): Don't do RTL generation if -fsyntax-only.
1056 * Makefile.in (semantics.o): Depends on flags.h.
1058 1999-09-28 Gabriel Dos Reis <gdr@codesourcery.com>
1060 * pt.c (most_general_template): Adjust declaration.
1062 * cp-tree.h: (most_general_template): Declare.
1064 * error.c (dump_template_value): Rename to ...
1065 (dump_template_argument): This.
1066 (dump_template_argument_list): New function.
1067 (dump_type): Use it.
1068 (dump_template_parameter): New function.
1069 (dump_template_decl): Use it.
1070 (dump_template_bindings): New function.
1071 (dump_function_decl): Use it. Pretty print function template
1074 1999-09-28 Nathan Sidwell <nathan@acm.org>
1076 * decl.c (grokdeclarator): Distinguish parameter context for
1077 diagnostics. Tidy up missing type diagnostic.
1078 Diagnose `explicit' in one place. Diagnose `mutable' in one place.
1080 1999-09-28 Mark Mitchell <mark@codesourcery.com>
1082 * ir.texi: Improve documentation for TARGET_EXPR.
1084 1999-09-27 Nathan Sidwell <nathan@acm.org>
1086 Augment stringification of trees.
1087 * cp-tree.h (tree_string_flags): New error stringifying enumeration.
1088 (fndecl_as_string, type_as_string_real, args_as_string,
1089 code_as_string, language_as_string, parm_as_string,
1090 op_as_string, assop_as_string, cv_as_string): Remove.
1091 (type_as_string, decl_as_string, expr_as_string): Adjust prototype.
1092 (context_as_string): Declare new function.
1093 * error.c (cp_printers): Move definition.
1095 (OB_END_TEMPLATE_ID): Adjust.
1096 (interesting_scope_p): Remove.
1097 (dump_scope): New static function.
1098 (dump_qualifiers): Adjust prototype, reimplement.
1099 (dump_template_value): Use tree_string_flags.
1100 (dump_type_real): Move back to dump_type.
1101 (dump_type): Adjust prototype. Use tree_string_flags.
1102 (dump_aggr_type): Likewise. Use dump_template_parms.
1103 (dump_type_prefix): Adjust prototype. Use tree_string_flags.
1105 (dump_type_suffix): Adjust prototype. Use tree_string_flags.
1106 (dump_simple_decl): Likewise.
1107 (dump_decl): Likewise. Use dump_template_decl.
1108 (dump_template_decl): New static function broken out of dump_decl.
1109 (dump_function_decl): Adjust prototype. Use tree_string_flags.
1110 (dump_parameters): Likewise. Prefix space.
1111 (dump_exception_spec): Adjust prototype. Use tree_string_flags.
1112 (dump_function_name): Likewise. Use dump_template_parms.
1113 (dump_template_parms): New static function broken out of
1115 (dump_expr_list): Adjust prototype. Use tree_string_flags.
1116 (dump_expr): Likewise.
1117 (fndecl_as_string): Removed
1118 (type_as_string_real): Removed
1119 (dump_binary_op): Adjust prototype. Use tree_string_flags.
1120 (dump_unary_op): Likewise.
1121 (type_as_string): Likewise.
1122 (expr_as_string): Likewise.
1123 (decl_as_string): Likewise.
1124 (context_as_string): New function.
1125 (lang_decl_name): Adjust.
1126 (decl_to_string): New static print callback.
1127 (expr_to_string): Likewise.
1128 (fndecl_to_string): Likewise.
1129 (code_as_string): Renamed to ...
1130 (code_to_string): ... here. Adjust.
1131 (language_as_string): Renamed to ...
1132 (language_to_string): ... here. Adjust.
1133 (parm_as_string): Renamed to ...
1134 (parm_to_string): ... here.
1135 (op_as_string): Renamed to ...
1136 (op_to_string): ... here.
1137 (assop_as_string): Renamed to ...
1138 (assop_to_string): ... here.
1139 (type_to_string): New static print callback.
1140 (args_as_string): Renamed to ...
1141 (args_to_string): ... here. Adjust.
1142 (cv_as_string): Renamed to ...
1143 (cv_to_string): ... here. Adjust.
1144 * pt.c (mangle_class_name_for_template): Use tree_string_flags.
1145 (print_template_context): Likewise.
1147 1999-09-26 Mark Mitchell <mark@codesourcery.com>
1149 * cp-tree.h (expand_throw): Remove prototype.
1150 * except.c (expand_throw): Make it static. Use tree-generation
1151 functions, rather than RTL-generation functions.
1152 (build_throw): Use it.
1153 * expr.c: Include except.h.
1154 (cplus_expand_expr): Don't call expand_throw here.
1155 * Makefile.in (expr.o): Depend on except.h.
1156 * ir.texi: Update documentation for THROW_EXPR.
1158 * decl.c (start_function): Set x_dont_save_pending_sizes rather
1159 than calling get_pending_sizes.
1160 * init.c (build_new): Don't save and restore
1161 immediate_size_expand; instead, assert that it has the expected
1164 1999-09-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1166 * lex.c (compiler_error): Add missing call to va_end().
1168 1999-09-25 Mark Mitchell <mark@codesourcery.com>
1170 * dump.c (dequeue_and_dump): Handle RESULT_DECL.
1171 * ir.texi: Document RESULT_DECL and DECL_RESULT.
1173 * cp-tree.h (check_return_expr): New function.
1174 * decl.c (finish_constructor_body): New function.
1175 (pushdecl): Put global friend functions in namespace binding
1176 level, not the class binding level.
1177 (finish_destructor_body): Make sure the dtor_label is always
1178 defined. Fix typo in comment.
1179 (finish_function): Move generation of constructor-termination code
1180 to semantic-analysis time. Move generation of implicit `main'
1181 return value to semantic-analysis time.
1182 * semantics.c (finish_return_stmt): Generate goto's to
1183 ctor_label/dtor_label here. Use check_return_expr to do semantic
1184 analysis on the returned expression.
1185 * typeck.c (maybe_warn_about_returning_address_of_local): New
1186 function split out from c_expand_return.
1187 (check_return_expr): Likewise.
1188 (c_expand_return): Just generate the RTL for the return.
1190 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1192 * cp-tree.h (CPTI_CLEANUP_TYPE): New macro.
1193 (cleanup_type): Likewise.
1194 (search_tree): Change prototype.
1195 * decl.c (local_variable_p): Adjust for new interface to
1197 (check_default_argument): Likewise.
1198 * error.c (dump_expr): Handle INIT_EXPR.
1199 * except.c (expand_throw): Don't make cleanup_type a local static.
1200 * expr.c (cplus_expand_expr): Don't handle NEW_EXPR.
1201 * init.c (build_new): Call build_new_1 directly, rather than
1202 building a NEW_EXPR.
1203 (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when
1204 processing file-scope initializers.
1205 * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR.
1206 * tree.c: Include splay-tree.h
1207 (no_linkage_helper): Adjust for new interface to search_tree.
1208 (search_tree): Pass around pointers to tree nodes, rather than the
1209 nodes themselves. Handle VEC_INIT_EXPR.
1210 (no_linkage_check): Adjust for new interface to search_tree.
1211 (mapcar): Handle VEC_INIT_EXPR.
1212 (target_remap): New variable.
1213 (bot_manip): Use it.
1214 (bot_replace): New function.
1215 (break_out_target_exprs): Use it to remap all variables used in a
1216 default argument expression.
1217 * typeck.c (build_modify_expr): Don't crash when outside a
1218 function and presented with an INIT_EXPR assignment
1219 * Makefile.in (tree.o): Depend on splay-tree.h.
1221 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1223 * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than
1225 (builtin_function): New arg CLASS. Arg CODE now of type int. All
1227 Set the builtin's DECL_BUILT_IN_CLASS.
1229 1999-09-24 Mark Mitchell <mark@codesourcery.com>
1231 * decl.c (pushdecl): Don't make local declarations of extern
1232 variables give the variable a DECL_CONTEXT for the function.
1233 (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify.
1234 Don't accidentally make RTL for local declarations.
1235 (emit_local_var): Handle declarations with asm-specifiers here.
1237 1999-09-23 Mark Mitchell <mark@codesourcery.com>
1239 * ir.texi: Improve documentation for TARGET_EXPRs. Discuss
1240 STMT_IS_FULL_EXPR_P.
1242 * cp-tree.h (language_function): Add cannot_inline.
1243 * decl.c (start_function): Restore current_function_cannot_inline
1244 from the saved value.
1245 (save_function_data): Save current_function_cannot_inline.
1246 * decl2.c (start_objects): Change prototype. Build the function
1247 in function-at-a-time mode.
1248 (finish_objects): Likewise.
1249 (generate_ctor_or_dtor_function): Adjust accordingly.
1251 * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro.
1252 * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS.
1253 Don't call expand_anon_union_decl here
1254 * semantics.c (exapnd_stmt): Call it here, instead.
1255 * typeck.c (mark_addressable): Addressed variables are implicitly
1258 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1260 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro.
1261 (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise.
1262 (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK.
1263 * cp-tree.h: Add tree checking macros to various tree access
1265 * ptree.c (print_lang_decl): Test for function or variable
1266 before accessing template info.
1268 1999-09-23 Jason Merrill <jason@yorick.cygnus.com>
1270 * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node.
1271 * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__.
1272 * decl2.c (lang_f_options): Add -fshort-wchar.
1273 * cp-tree.h: Declare flag_short_wchar.
1274 * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned
1277 1999-09-23 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1279 * ir.texi: Fix formatting errors and typos.
1281 1999-09-22 Mark Mitchell <mark@codesourcery.com>
1283 * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT.
1285 * decl.c (pushdecl): Do create a binding for extern "C" functions,
1286 but not for their DECL_ASSEMBLER_NAMEs.
1287 (lookup_name_current_level): Fix formatting.
1288 (xref_tag): Likewise.
1289 * decl2.c (start_objects): Mark static constructors and
1290 destructors as used.
1292 1999-09-22 Jason Merrill <jason@yorick.cygnus.com>
1294 * decl.c (define_case_label): Don't crash if we're not in a switch.
1296 * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags.
1297 * lang-options.h: Restore -fthis-is-variable. Remove help strings
1298 for unsupported flags.
1300 1999-09-21 Jason Merrill <jason@yorick.cygnus.com>
1302 * decl2.c (lang_decode_option): Accept and ignore -finit-priority.
1303 Accept and warn about -fthis-is-variable.
1305 1999-09-21 Mark Mitchell <mark@codesourcery.com>
1307 * dump.c (dequeue_and_dump): Handle START_CATCH_STMT,
1308 CLEANUP_STMT, and SCOPE_STMT.
1310 * decl2.c (lang_decode_option): Adjust, in the wake of recent
1311 changes to option processing.
1313 1999-09-21 Martin v. Löwis <loewis@informatik.hu-berlin.de>
1315 * typeck.c (get_member_function_from_ptrfunc): Allow extraction of
1316 function pointer from pmfs with no object given.
1317 (convert_for_assignment): Do not return error when converting
1320 1999-09-21 Alex Samuel <samuel@codesourcery.com>
1322 * lex.c (internal_filename): New variable.
1323 (INTERNAL_FILENAME): New macro.
1324 (init_parse): Allocate internal_filename and mark as root. Use it
1325 instead of a string constant.
1327 1999-09-21 Nathan Sidwell <nathan@acm.org>
1329 Reimplement dynamic cast and catch matching.
1330 * cp-tree.h (get_dynamic_cast_base_type): Prototype new function
1331 * search.c (dynamic_cast_base_recurse): New function.
1332 (get_dynamic_cast_base_type): New function for dynamic cast.
1333 * rtti.c (build_dynamic_cast_1): Determine source and target
1334 class relationship. Call __dynamic_cast_2.
1335 * tinfo.h (__user_type_info::upcast): New catch dispatcher.
1336 (__user_type_info::dyncast): New dynamic cast dispatcher.
1337 (__user_type_info::sub_kind): New nested enumeration.
1338 (__user_type_info::contained_p): sub_kind predicate.
1339 (__user_type_info::contained_public_p): Likewise.
1340 (__user_type_info::contained_nonpublic_p): Likewise.
1341 (__user_type_info::contained_nonvirtual_p: Likewise.
1342 (__user_type_info::upcast_result): New nested struct.
1343 (__user_type_info::dyncast_result): New nested struct.
1344 (*::do_upcast): New catch function.
1345 (*::do_dyncast): New dynamic cast function.
1346 (__user_type_info::find_public_subobj): New dynamic cast
1348 (*::do_find_public_subobj): New dynamic cast helper function.
1349 * tinfo.cc (__user_type_info::upcast): Define catch dispatcher.
1350 (__user_type_info::dyncast): Define dynamic cast dispatcher.
1351 (*::do_upcast): Define catch function.
1352 (*::do_dyncast): Define dynamic cast function.
1353 (*::do_find_public_subobj): Define dynamic cast helper function.
1354 * tinfo2.cc (__throw_type_match_rtti_2): Use upcast.
1355 (__dynamic_cast): Backwards compatibility wrapper. Use dyncast.
1356 (__dynamic_cast_2): New dynamic cast runtime.
1358 1999-09-20 Mark Mitchell <mark@codesourcery.com>
1360 * cp-tree.h (finish_stmt_expr): Change prototype.
1361 * expr.c (cplus_expand_expr): Adjust call accordingly.
1362 * init.c (finish_init_stmts): Likewise.
1363 * parse.y (primary): Likewise.
1364 * pt.c (tsubst_copy): Likewise.
1365 * semantics.c (finish_stmt_expr): Don't take two parameters.
1366 Don't remove generated BLOCKs from the block-tree.
1368 Remove support for assigning to `this'.
1369 * NEWS: Note that fact.
1370 * class.c (build_vbase_path): Don't check flag_this_is_variable.
1371 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove.
1372 (language_function): Remove assigns_this, just_assigned_this, and
1373 x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p.
1374 (base_init_expr): Remove.
1375 (current_vcalls_possible_p): New macro.
1376 (vtbls_set_up_p): Likewise.
1377 (emit_base_init): Change prototype.
1378 * decl.c (finish_destructor_body): New function, split out from
1380 (current_function_assigns_this): Remove.
1381 (current_function_just_assigned_this): Likewise.
1382 (start_function): Don't set them.
1383 (finish_function): Don't check them. Don't emit
1384 base-initialization code here. Generate code for destructors when
1385 doing semantic analysis.
1386 (finish_stmt): Don't check current_function_just_assigned_this.
1387 * decl2.c (lang_f_options): Remove this-is-variable.
1388 (lang_decode_option): Likewise.
1389 (grokclassfn): Don't check flag_this_is_variable.
1390 * init.c (emit_base_init): Return the expression generated.
1391 (construct_virtual_bases): Don't push/pop obstacks. Fix
1393 (build_new_1): Don't check flag_this_is_variable.
1394 (get_temp_regvar): Don't set DECL_REGISTER.
1395 (build_vec_init): Don't call use_variable.
1396 * lang-options.h: Remove "-fthis-is-variable" and
1397 "-fno-this-is-variable".
1398 * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS.
1399 * search.c (expand_upcast_fixups): Use finish_expr_stmt, not
1401 * semantics.c (finish_expr_stmt_real): Rename to ...
1402 (finish_expr_stmt): This. Remove assigned_this parameter.
1403 (begin_if_stmt): Call do_pushlevel before starting the statement.
1404 (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less
1406 (setup_vtbl_ptr): Emit initialization code for bases and members
1407 at semantic-analysis time. Emit code to initialize vtables in
1409 (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real.
1410 Don't handle CTOR_INITIALIZER any more.
1411 * typeck.c (build_modify_expr): Don't check for assignments to
1413 (c_expand_return): Don't suggest assigning to `this'.
1415 * Makefile.in (decl.o): Depend on RTL_H.
1416 (decl2.o): Likewise.
1417 (class.o): Likewise.
1419 (method.o): Likewise.
1420 (search.o): Likewise.
1424 * decl.c (duplicate_decls): When a builtin function is redeclared
1425 as static, make sure it is mangled correctly.
1427 * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add
1428 detail about the statement-tree.
1430 1999-09-20 Nathan Sidwell <nathan@acm.org>
1432 * parse.y (primary): Use build_functional_cast for CV_QUALIFIER.
1434 1999-09-20 Nick Clifton <nickc@cygnus.com>
1436 * decl2.c (lang_decode_option): Extend comment.
1438 Mon Sep 20 10:49:05 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1440 * typeck.c: Include "tm_p.h".
1442 1999-09-19 Mark Mitchell <mark@codesourcery.com>
1444 * ir.texi: New file.
1446 1999-09-19 Paul Burchard <burchard@pobox.com>
1448 * semantics.c (expand_stmt): Initialize return value.
1450 1999-09-18 Paul Burchard <burchard@pobox.com>
1452 * gxxint.texi: G++ now implements namespaces.
1454 1999-09-18 Mark Mitchell <mark@codesourcery.com>
1456 * decl.c (pop_label): Don't warn about unused labels more than
1458 * semantics.c (finish_goto_stmt): Always marked used labels as
1461 * decl.c (layout_var_decl): Change prototype. Call layout_decl
1462 even when the declaration is external.
1463 (cp_finish_decl): Adjust call to layout_var_decl.
1464 * pt.c (tsubst_expr): Make sure to initialize stmt before using it.
1466 1999-09-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
1468 * typeck.c (get_member_function_from_ptrfunc): Always consider
1469 virtuality inside member pointer.
1471 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1473 Turn on function-at-a-time processing.
1474 * cp-tree.h (doing_semantic_analysis_p): New macro.
1475 (SF_DEFAULT): Define to zero, not SF_EXPAND.
1476 (start_handler_parms): Change prototype.
1477 (expand_start_catch_block): Likewise.
1478 (expand_end_catch_block): Likewise.
1479 (expand_start_eh_spec): Likewise.
1480 (expand_end_eh_spec): Declare.
1481 (finish_handler_parms): Change prototype.
1482 (begin_catch_block): Declare.
1483 (finish_handler): Change prototype.
1484 (do_pushlevel): Declare.
1485 (do_poplevel): Likewise.
1486 * decl.c (pushlevel): Don't create
1487 binding levels when not doing semantic analysis.
1488 (poplevel): Don't pop them.
1489 (pushdecl): Assert that we are never called when not doing
1491 (pushdecl_top_level): Use push_to_top_level.
1492 (make_label_decl): Don't fiddle with obstacks. Make RTL For the
1493 label when expanding.
1494 (cp_finish_decl): Only inject for-scope variables when doing
1495 semantic analysis. Add comments.
1496 (start_handler_parms): Return the handler parm.
1497 (start_function): Reorganize. Don't clear DECL_INITIAL if it is
1498 already set. Reinitialize from saved function data if available.
1499 Don't pushlevel when not doing semantic analysis.
1500 (store_parm_decls): Only generate RTL when expanding. Only
1501 pushdecl when doing semantic analysis. Set
1502 current_eh_spec_try_block if appropriate.
1503 (finish_function): Simplify. Use do_pushlevel and do_poplevel.
1504 Combine common code. Don't poplevel when not doing semantic
1506 (push_cp_function_context): Don't expand functions without an
1507 explicit call to expand_body.
1508 (mark_lang_function): Make eh_spec_try_block and
1510 * except.c (expand_end_eh_spec): Don't
1512 (process_start_catch_block): Likewise.
1513 (push_eh_cleanup): Use finish_decl_cleanup.
1514 (initialize_handler_parm): New function.
1515 (expand_start_catch_block): Use it.
1516 (expand_end_catch_block): Use tree-generation functions, not
1517 RTL-generation functions.
1518 (expand_start_eh_spec): Likewise.
1519 (expand_end_eh_spec): Likewise.
1520 (expand_exception_blocks): Simplify.
1521 (start_anon_func): Use do_pushlevel.
1522 (end_anon_func): Use do_poplvel. Call expand_body for the
1524 * expr.c (do_case): Don't call define_case_label.
1525 * init.c (create_temporary_var): Set DECL_CONTEXT for local
1527 * method.c (emit_thunk): Call expand_body for the
1529 (sythesize_method): Likewise.
1530 * parse.y (handler_args): Give it ttype.
1531 (eat_saved_input): Call expand_body.
1532 (base_init): Use do_pushlevel.
1533 (pending_inline): Call expand_body.
1534 (handler): Adjust calls to finish_handler_parms and
1536 (handler_args): Don't call expand_start_catch_block. Return the
1537 catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling.
1538 * parse.c: Regenerated.
1539 * rtti.c (synthesize_tinfo_fn): Call finish_function.
1540 * semantics.c (do_pushlevel): Give it external linkage. Build
1542 (do_poplevel): Likewise.
1543 (finish_case_label): Call define_case_label when doing semantic
1545 (finish_goto_stmt): Create RTL for labels.
1546 (finish_function_try_block): Set in_function_try_handler
1548 (finish_function_handler_sequence): Unset it.
1549 (finish_handler_parms): Use expand_start_catch_block even when
1550 building a statement-tree.
1551 (begin_catch_block): New function.
1552 (finish_handler): Move a little RTL-generation logic here.
1553 (finish_decl_cleanup): Allow cleanups for empty declarations.
1554 (finish_named_return_value): Don't pushdecl when not doing
1556 (expand_stmt): Don't do semantic analysis for variable
1557 declarations. Handle START_CATCH_STMT. Call expand_label
1558 directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust
1559 HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT.
1560 (expand_body): Let expand_stmt handle CTOR_INITIALIZER,
1561 RETURN_INIT and function try blocks.
1563 * cp-tree.h (language_function): Add x_eh_spec_try_block. Add
1564 x_scope_stmt_stack. Add x_in_charge_parm.
1565 (current_eh_spec_try_block): New macro.
1566 (current_scope_stmt_stack): Likewise.
1567 (current_in_charge_parm): Likewise.
1568 * decl.c (start_function): Initialize current_in_charge_parm.
1569 (finish_function): Use current_in_charge_parm rather than looking
1571 * search.c (expand_indirect_vtbls_init): Likewise.
1573 * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
1574 (TRY_BLOCK): Likewise.
1575 (HANDLER): Likewise.
1576 (START_CATCH_STMT): New tree node.
1577 (SCOPE_STMT): Likewise.
1578 * cp-tree.h (SCOPE_BEGIN_P): New macro.
1579 (SCOPE_NULLIFIED_P): Likewise.
1580 (struct lang_decl_flags): Add pending_inline_p. Adjust dummy.
1581 (struct lang_decl): Add saved_language_function.
1582 (DECL_PENDING_INLINE_INFO): Adjust documentation.
1583 (DECL_PENDING_INLINE_P): New macro.
1584 (TYPE_TI_ARGS): Fix typo in comment.
1585 (DECL_SAVED_TREE): Add to documentation.
1586 (DECL_SAVED_FUNCTION_DATA): New macro.
1587 (START_CATCH_TYPE): Likewise.
1588 (SCOPE_END_P): New macro.
1589 (declare_parm_level): Don't declare.
1590 * decl.c (mark_lang_function): New function, split out from
1591 mark_cp_function_context.
1592 (save_function_data): New function.
1593 (declare_parm_level): Remove.
1594 (finish_function): Use save_function_data to squirrel away
1595 important stuff for later use.
1596 (mark_cp_function_context): Use mark_function_data.
1597 (lang_mark_tree): Likewise.
1598 * lex.c (begin_definition_of_inclass_inline): Set
1599 DECL_PENDING_INLINE_P.
1600 (store_pending_inline): Clear it.
1601 * pt.c (tsubst_decl): Likewise.
1603 1999-09-17 Nathan Sidwell <nathan@acm.org>
1605 * call.c (perform_implicit_conversion): Deal with error_mark_node.
1607 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1609 * decl.c (warn_extern_redeclared_static): Don't get confused by
1610 static member functions.
1611 (duplicate_decls): Merge DECL_THIS_STATIC.
1613 * decl.c (expand_static_init): Make sure assignments to local
1614 statics actually occur.
1616 1999-09-17 Mark Mitchell <mark@codesourcery.com>
1618 * cp-tree.h (poplevel_class): Declare.
1619 * class.c (popclass): Use poplevel_class, not poplevel.
1620 * decl.c (poplevel_class): Don't make it static. Don't return a
1622 (poplevel): Don't call poplevel_class; abort in a class
1623 binding level is seen.
1624 * semantics.c (finish_translation_unit): Use pop_everything.
1625 * parse.y (member_init): Allow errors.
1626 (pending_inline): Call finish_function.
1627 * parse.c: Regenerated.
1628 * Makefile.in (CONFLICTS): Adjust.
1630 1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
1632 * error.c: Reduce code duplication.
1633 (dump_template_value): New function.
1634 (dump_type_real): Use it.
1635 (dump_decl): Likewise.
1636 (dump_function_name): Likewise.
1637 (dump_function_decl): Don't be too talkative about function return
1640 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1642 * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
1644 * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
1646 1999-09-16 Jason Merrill <jason@yorick.cygnus.com>
1648 * decl2.c (finish_file): Also call check_global_declarations for
1649 the pending_statics list.
1651 1999-09-15 Jason Merrill <jason@yorick.cygnus.com>
1653 * lex.c (cp_pragma_implementation): Allow #pragma implementation
1656 1999-09-15 Richard Henderson <rth@cygnus.com>
1658 * lex.c (mark_impl_file_chain): Follow the next chain.
1660 1999-09-15 Mark Mitchell <mark@codesourcery.com>
1662 * decl.c (warn_extern_redeclared_static): Simplify. Catch
1663 problems with extern "C" functions redeclared as static.
1664 (duplicate_decls): When a builtin is redeclared static, make the
1665 new function have internal linkage.
1667 1999-09-15 Mark Mitchell <mark@codesourcery.com>
1669 * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR.
1670 * pt.c (tsubst_copy): Likewise.
1671 * tree.c (search_tree): Likewise.
1674 1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1676 * typeck2.c (ack): Don't declare progname.
1678 1999-09-14 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
1680 * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy
1681 filenames with ggc_alloc_string.
1683 1999-09-14 Mark Mitchell <mark@codesourcery.com>
1685 * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the
1687 * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on
1689 * cvt.c (build_up_reference): Likewise.
1690 * tree.c (build_cplus_new): Likewise.
1691 (get_target_expr): Likewise.
1693 Tue Sep 14 01:45:10 1999 Marc Espie <espie@cvs.openbsd.org>
1695 * Makefile.in: Prepend $(SHELL) to move-if-change calls.
1697 1999-09-13 Mark Mitchell <mark@codesourcery.com>
1699 * cp-tree.h (build_target_expr): New function.
1700 * call.c (build_conditional_expr): Use build_target_expr.
1701 (convert_like): Likewise.
1702 (build_over_call): Likewise.
1703 * cvt.c (build_up_reference): Likewise.
1704 * decl.c (build_cleanup_on_safe_obstack): Fold into ...
1705 (destroy_local_var): Here.
1706 (build_target_expr): New function.
1707 * tree.c (build_cplus_new): Use it.
1708 (get_target_expr): Likewise.
1710 1999-09-13 Nathan Sidwell <nathan@acm.org>
1712 * typeck.c (expr_sizeof): Don't decay arrays and functions.
1713 Remove misleading comment.
1714 (build_compound_expr): Don't decay arrays.
1716 1999-09-13 Jason Merrill <jason@yorick.cygnus.com>
1718 * call.c (build_conditional_expr): Always use a TARGET_EXPR for
1719 class rvalues again.
1721 Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1723 * Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
1725 * g++spec.c: Include gcc.h.
1726 (lang_specific_driver): Constify a char*. Call xcalloc, not
1727 xmalloc/bzero. All calls to the function pointer parameter now
1728 explicitly call `fatal'.
1730 1999-09-12 Mark Mitchell <mark@codesourcery.com>
1732 * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
1733 * cvt.c (ocp_convert): Complete the from and destination types.
1734 Adjust warning about functions always being `true' in conditionals.
1735 * decl.c (duplicate_decls): Don't play funny games with abort.
1736 * error.c (dump_expr): Handle OVERLOADs.
1737 * spew.c (probe_obstack): Remove.
1738 * typeck.c (condition_conversion): Use perform_implicit_conversion.
1740 1999-09-12 Bernd Schmidt <bernds@cygnus.co.uk>
1742 * cp-tree.h (auto_function, define_function): Adjust prototypes.
1743 * decl.c (define_function): Lose FUNCTION_CODE arg. All callers
1745 (auto_function): Likewise, for CODE arg.
1746 Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to...
1747 (builtin_function): ... here.
1749 1999-09-11 Mark Mitchell <mark@codesourcery.com>
1751 * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion.
1752 (init_decl_processing): Don't set TREE_PERMANENT for the
1754 (start_decl): Don't rebuild non-permanent ARRAY_TYPEs.
1755 (grokdeclarator): Likewise.
1756 (grokparms): Don't check TREE_PERMANENT when building up lists.
1757 * decl2.c (grokfield): Don't assert TREE_PERMANENT.
1758 (mark_inline_for_output): Likewise.
1759 * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT.
1760 * init.c (build_offset_ref): Don't check TREE_PERMANENT.
1761 * lex.c (check_newline): Don't check ggc_p; it is always one.
1762 * pt.c (process_template_parm): Don't check TREE_PERMANENT.
1763 * spew.c (yylex): Don't copy_node or probe_obstacks for
1764 non-permanent CONSTANTs and STRINGs.
1765 * tree.c (build_cplus_array_type_1): Don't fuss with
1766 TREE_PERMANENT on ARRAY_TYPEs.
1768 * cp-tree.def (CLEANUP_STMT): New node.
1769 * cp-tree.h (language_function): Add name_declared.
1770 (current_function_name_declared): New macro.
1771 (CLEANUP_DECL): New macro.
1772 (CLEANUP_EXPR): Likewise.
1773 (emit_local_var): Likewise.
1774 (finish_decl_cleanup): New function.
1775 * cvt.c (build_up_reference): Simplify.
1776 (ocp_convert): Remove dead code.
1777 * decl.c (start_decl): Remove call to add_decl_stmt.
1778 (grok_reference_init): Adjust, to handle bindings temporaries to
1779 references. Remove dead code.
1780 (initialize_local_var): Don't generate RTL for
1781 declarations here, or build cleanups here. Don't fuss with
1782 obstacks. Replace expand_start_target_temps calls with explicit
1783 setting of stms_are_full_exprs_p.
1784 (destroy_local_var): New function.
1785 (emit_local_var): Likewise.
1786 (cp_finish_decl): Use them, as appropriate.
1787 (start_function): Announce template functions.
1788 (store_parm_decls): Don't call declare_function_name here.
1789 (finish_stmt): Don't start emit base-initialization code when just
1790 building the statement-tree.
1791 * init.c (create_temporary_var): Move add_decl_stmt call ...
1792 (get_temp_regvar): Here.
1793 * pt.c (tsubst_expr): Make DECL_INITIAL look like what
1794 cp_finish_decl would expect. Don't call add_decl_stmt.
1795 * semantics.c (begin_compound_stmt): Call declare_function_name,
1797 (finish_decl_cleanup): New function.
1798 (expand_stmt): Use emit_local_var to output variables.
1799 (expand_body): Set current_funtion_name_declared.
1801 1999-09-10 Mark Mitchell <mark@codesourcery.com>
1803 * cp-tree.h (finish_cleanup_try_block): New function.
1804 * semantics.c (finish_cleanup_try_block): Add comment.
1806 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1808 * cp-tree.h: Delete declarations for all tree nodes now moved to
1810 * decl.c: Delete their definitions.
1811 (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE,
1812 FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't
1814 (init_decl_processing): Call build_common_tree_nodes and
1815 build_common_tree_nodes_2 instead of building their nodes here.
1816 Don't add gc roots for them.
1818 1999-09-10 Mark Mitchell <mark@codesourcery.com>
1820 * cp-tree.h (language_function): Rename expanding_p to
1821 x_expanding_p. Rename named_label_uses to x_named_label_uses.
1822 (expanding_p): Adjust accordingly.
1823 (TREE_VIA_PRIVATE): Fix typo in comment.
1824 (DECL_REFERENCE_SLOT): Remove.
1825 (SET_DECL_REFERENCE_SLOT): Likewise.
1826 * decl.c (named_label_uses): Adjust. Remove chicken comment.
1827 (push_overloaded_decl): Don't truncate the chain of bindings when
1828 adding an overloaded function.
1829 (grok_reference_init): Don't use DECL_REFERENCE_SLOT.
1830 (initialize_local_var): Fix typo in comment.
1831 (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up.
1832 * decl2.c (start_objects): Make the fact that we are expanding
1833 the generated function right away explicit.
1834 (start_static_storage_duration_function): Likewise.
1835 (finish_file): Fix typo in comment.
1836 * init.c (build_vec_init): Correct bugs in handling cleanups.
1837 * semantics.c (maybe_convert_cond): New function.
1838 (FINISH_COND): Always store the condition, even if there's
1840 (finish_if_stmt_cond): Use maybe_convert_cond.
1841 (finish_while_stmt_cond): Likewise.
1842 (finish_do_stmt): Likewise.
1843 (finish_for_cond): Likewise.
1844 (expand_cond): Adjust.
1846 * cp-tree.h (FN_TRY_BLOCK_P): New macro.
1847 * init.c (perform_member_init): Remove obstack machinations.
1848 (expand_cleanup_for_base): Likewise.
1849 (finish_init_stmts): Mark the statement-expression as used.
1850 * method.c (emit_thunk): Use tree-generating functions, not
1852 (do_build_copy_constructor): Likewise.
1853 (do_build_assign_ref): Likewise.
1854 (synthesize_method): Likewise. Keep track of line numbers.
1855 * pt.c (tsubst_expr): Handle various kinds of try blocks.
1856 * semantics.c (expand_stmts): Remove.
1857 (begin_function_try_block): Set FN_TRY_BLOCK_P.
1858 (finish_function_try_block): Be careful rechaining
1859 function try blocks.
1860 (expand_stmt): Loop through all the statements at a given level.
1861 (exapnd_body): Be careful with line-numbers here too. Prepare for
1862 being called directly from the parser.
1864 * cp-tree.h (finish_function): Adjust prototype.
1865 * decl.c (finish_function): Return the function compiled.
1866 * pt.c (instantiate_decl): Don't play games with obstacks.
1867 * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF.
1868 (search_tree): Likewise.
1869 * typeck.c: Fix typo in comment.
1870 * typeck2.c (store_init_value): Add comment.
1872 * cp-tree.h (CPTI_ATEXIT): New macro.
1873 (atexit_node): Likewise.
1874 * decl.c (destroy_local_static): New function, broken out from ...
1875 (expand_static_init): Here.
1877 * rtti.c (get_tinfo_var): These should always be global
1878 (expand_si_desc): Use tree, not RTL, functions to generate code.
1879 (expand_class_desc): Likewise.
1880 (expand_ptr_desc): Likewise.
1881 (expand_attr_desc): Likewise.
1882 (expand_generic_desc): Likewise.
1883 (synthesize_tinfo_fn): Likewise.
1885 1999-09-09 Mark Mitchell <mark@codesourcery.com>
1887 * semantics.c (RECHAIN_STMTS): Remove `last' parameter.
1888 (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with
1890 (RECHAIN_STMST_FROM_CHAIN): Likewise.
1892 * parse.y (simple_stmt): Fix typo in last change.
1894 * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro.
1895 (STMT_IS_FULL_EXPR_P): Likewise.
1896 (STMT_LINENO_FOR_FN_P): Likewise.
1897 (prep_stmt): New function.
1898 (building_stmt_tree): Tweak for safety.
1899 * pt.c (tsubst_expr): Use prep_stmt throughout.
1900 (add_tree): Move it to semantics.c
1901 * semantics.c (add_tree): Move it here.
1902 (finish_expr_stmt_real): New function.
1903 (finish_expr_stmt): Use it.
1904 (finish_if_stmt_cond): Use FINISH_COND.
1905 (finish_while_stmt_cond): Likewise.
1906 (finish_for_cond): Likewise.
1907 (finish_stmt_tree): Tweak line-number handling.
1908 (prep_stmt): New function.
1909 (expand_stmt): Use it.
1911 * cp-tree.h (begin_switch_stmt): Adjust prototype.
1912 (finish_switch_cond): Likewise.
1913 * parse.y (simple_stmt): Adjust accordingly.
1914 * parse.c: Regenerated.
1915 * pt.c (tsubst_expr): Adjust accordingly.
1916 * semantics.c (expand_cond): New function.
1917 (FINISH_COND): New macro.
1918 (begin_switch_stmt): Build the SWITCH_STMT here.
1919 (finish_switch_stmt_cond): Not here.
1920 (expand_stmt): Adjust calls to begin_switch_stmt and
1921 finish_switch_cond. Use expand_cond throughout.
1923 * dump.c (dequeue_and_dump): Dump types for constants.
1924 Describe DECL_ARG_TYPE more intuitively.
1927 * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC.
1928 (lang_cleanup_tree): Remove.
1929 * lex.c (make_lang_type): Use ggc_alloc to allocate
1932 Reorganize per-function data.
1933 * cp-tree.h (saved_scope): Add function_decl, bindings.
1934 (language_function): Rename binding_level to bindings.
1935 (cp_function_chain): Use the current_function, not the
1936 outer_function_chain.
1937 (current_class_ptr): Make it work, even when there's no
1939 (current_class_ref): Likewise.
1940 (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New
1942 (clear_temp_name): Remove.
1943 * decl.c (check_function_type): New function, broken out from
1945 (current_binding_level): Adjust definition.
1946 (pushlevel): Simplify.
1947 (poplevel): Don't use named_label_uses when we're outside
1949 (mark_saved_scope): Mark function_decl and bindings.
1950 (maybe_push_to_top_level): Don't unconditionally push a new
1951 function context. Save bindings and the current_function_decl.
1952 Don't clear named_labels.
1953 (pop_from_top_level): Pop function context if appropriate.
1954 (init_decl_processing): Set init_lang_status and free_lang_status,
1955 rather than save_lang_status and restore_lang_status.
1956 (start_function): Take SF_* flags. Don't clear per-function data.
1957 Reorder and simplify to use new per-function data code. Add
1959 (store_parm_decls): Don't call init_function_start here.
1960 (finish_function): Adjust for new handling of per-function data.
1961 (push_cp_function_context): Simplify.
1962 (mark_cp_function_context): Change binding_level to bindings.
1963 * decl2.c (clear_temp_name): Remove.
1964 (start_objects): Use SF flags to start_function.
1965 (start_static_storage_duration_function): Likewise.
1966 * except.c (start_anon_func): Remove redundant calls to
1967 push_function_context_to. Use SF flags to start function.
1968 (end_anon_func): Remove redundant call to pop_function_context
1970 * lex.c (reinit_parse_for_function): Don't initialize per-function
1972 * method.c (emit_thunk): Clear current_function after calling
1973 assemble_end_function. Use SF flags for start_function.
1974 (synthesize_method): Use SF flags for start_function.
1975 * parse.c: Regenerated.
1976 * parse.y (fn.defpen): Likewise.
1977 (pending_inline): Clear current_function, even if something goes
1979 * pt.c (instantiate_decl): Use SF flags to start_function.
1980 Don't save and restore expanding_p.
1981 (add_tree): Handle the case where we are outside any function.
1982 (end_tree): Likewise.
1983 * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function.
1984 * semantics.c (begin_function_definition): Likewise.
1985 (expand_body): Likewise.
1987 1999-09-09 Nathan Sidwell <nathan@acm.org>
1989 * cp-tree.h (convert_to_void): Prototype new function.
1990 (require_complete_type_in_void): Remove prototype.
1991 * cvt.c (convert_to_void): New function.
1992 (ocp_convert): Use convert_to_void.
1993 * decl.c (cplus_expand_expr_stmt): Likewise, for complete
1995 * typeck.c (require_complete_type_in_void): Remove function.
1996 (build_compound_expr): Use convert_to_void.
1997 (build_static_cast): Likewise.
1998 (build_c_cast): Likewise.
1999 * semantics.c (finish_expr_stmt): Do not decay full expressions.
2001 * typeck.c (build_x_compound_expr): Add FIXME.
2003 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2005 * cp-tree.h (scratch_tree_cons): Remove.
2006 * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons,
2007 and perm_tree_cons with plain tree_cons.
2008 * class.c: Likewise.
2010 * decl2.c: Likewise.
2011 * except.c: Likewise.
2015 * method.c: Likewise.
2016 * parse.y: Likewise.
2020 * search.c: Likewise.
2021 * typeck.c: Likewise.
2022 * parse.c: Regenerated.
2023 * tree.c (build_srcloc): Simplify.
2025 1999-09-08 Mark Mitchell <mark@codesourcery.com>
2027 * cp-tree.h (lang_decl_flags): Remove permanent_attr.
2029 (LANG_DECL_PERMANENT): Remove.
2030 * decl.c (duplicate_decls): Don't mess about with obstacks trying
2032 (lang_mark_tree): Mark DECL_LANG_SPECIFIC.
2033 * lex.c (free_lang_decl_chain): Remove.
2034 (build_lang_decl): Don't use obstacks.
2035 (retrofit_lang_decl): Likewise.
2036 (copy_lang_decl): Likewise.
2038 * cp-tree.h (saved_scope): Remove old_binding_level and
2039 function_decl. Tidy up.
2040 * decl.c (mark_saved_scope): Don't set them.
2041 (maybe_push_to_top_level): Clear memory.
2043 * decl.c (layout_var_decl): Change prototype. Don't complete
2044 types for external objects.
2045 (check_initializer): Likewise. Tidy.
2046 (initialize_local_var): Complete types here.
2047 (cp_finish_decl): Not here. Reorganize a little.
2048 (grokvardecl): Don't complete types here.
2050 * decl.c (start_function): Clear last_dtor_insn and
2051 last_parm_cleanup_insn.
2052 (push_cp_function_context): Just copy over a little of
2053 the old context, not all of it.
2055 * cp-tree.h (copy_to_permanent): Remove.
2056 (permanent_p): Likewise.
2057 * decl.c (building_typename_type): Don't use copy_to_permanent.
2058 (start_decl): Likewise.
2059 (grok_reference_init): Likewise.
2060 (cp_finish_decl): Likewise.
2061 * init.c (build_new_1): Don't use mapcar.
2062 (build_vec_delete_1): Don't use copy_to_permanent.
2063 (build_vec_init): Likewise.
2064 * parse.y (primary): Likewise.
2065 * parse.c: Regenerated.
2066 * pt.c (push_template_decl_real): Don't use copy_to_permanent.
2067 (lookup_template_class): Likewise.
2068 (tsubst_friend_function): Likewise.
2069 (instantiate_class_template): Likewise.
2070 (tsubst_decl): Likewise.
2072 (instantiate_template): Likewise.
2074 * rtti.c (get_tinfo_fn): Likewise.
2075 (build_dynamic_cast): Likewise.
2076 * semantics.c (finish_if_stmt_cond): Likewise.
2077 (finish_while_stmt_cond): Likewise.
2078 (finish_do_stmt): Likewise.
2079 (finish_for_cond): Likewise.
2080 (finish_for_expr): Likewise.
2081 (finish_cleanup): Likewise.
2082 (add_decl_stmt): Likewise.
2083 (finish_named_return_value): Likewise.
2084 (finish_qualified_call_expr): Likewise.
2085 * tree.c (perm_manip): Remove.
2086 (build_exception_variant): Don't use copy_to_permanent.
2087 (permanent_p): Remove.
2088 (copy_to_permament): Remove.
2089 (build_min_nt): Don't use copy_to_permanent.
2090 (build_min): Likewise.
2091 (min_tree_cons): Likewise.
2092 * typeckc.c (build_static_cast): Likewise.
2093 (build_reinterpret_cast): Likewise.
2094 (build_const_cast): Likewise.
2096 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2098 * decl.c (ggc_p): Set it to 1.
2099 (mark_saved_scope): Add prototype.
2101 1999-09-07 Richard Henderson <rth@cygnus.com>
2103 * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete.
2104 * typeck.c (self_promoting_args_p): Delete.
2106 1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
2108 * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
2109 (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
2111 1999-09-07 Mark Mitchell <mark@codesourcery.com>
2113 * Makefile.in (tree.o): Depend on ggc.h.
2114 * class.c (make_method_vec): Remove.
2115 (free_method_vec): Likewise.
2116 (free_method_vecs): Remove.
2117 (add_method): Don't use them.
2118 * cp-tree.def (PTRMEM_CST): Make it longer.
2119 (TEMPLATE_PARM_INDEX): Make it shorter.
2120 * cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
2121 (template_parm_index): Remove RTL field.
2122 (ptrmem_cst): Add RTL field.
2123 (finish_function): Removed parameter.
2124 (process_next_inline): Change prototype.
2125 (init_cplus_unsave): Rename to init_tree.
2126 (binding_init): Remove.
2127 * decl.c (free_binding_nodes): Remove.
2128 (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P.
2129 (pop_binding): Don't use free_binding_nodes.
2130 (free_binding_vecs): Remove.
2131 (store_bindings): Don't use them.
2132 (pop_from_top_level): Likewise.
2133 (lookup_namespace_name): Simplify.
2134 (build_typename_type): Don't use obstack_free.
2135 (unqualified_namespace_lookup): Simplify.
2136 (lookup_name_real): Simplify.
2137 (start_function): Remove comment about leaks.
2138 (finish_function): Removed nested parameter. Call
2139 expand_end_bindings even when building_stmt_tree.
2140 Call ggc_push_context and ggc_pop_context around
2141 rest_of_compilation, if necessary.
2142 (mark_cp_function_context): Handle a NULL language-context.
2143 (lang_mark_false_label_stack): Fix typo.
2144 (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
2145 TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on
2146 pointer to method types.
2147 (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
2148 * decl2.c (finish_objects): Adjust call to finish_function.
2149 (finish_static_store_duration_function): Likewise.
2150 (do_nonmember_using_decl): Remove call to binding_init.
2151 * except.c (end_anon_func): Adjust call to finish_function.
2152 * lex.c (mark_impl_file_chain): New function.
2153 (init_parse): Call init_tree, not init_cplus_unsave.
2155 (cp_pramga_interface): Use xmalloc, not permalloc.
2156 (cp_pragma_implementation): Likewise.
2157 (begin_definition_of_inclass_inline): Simplify.
2158 (process_next_inline): Adjust prototype.
2159 (do_scoped_id): Don't call binding_init.
2160 (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
2161 * method.c (emit_thunk): Adjust call to finish_function.
2162 (synthesize_method): Likewise.
2163 * parse.y (%union): Add a new `pi' variant.
2164 (PRE_PARSED_FUNCTION_DECL): Use it.
2165 (fn.defpen): Likewise.
2166 (fndef): Adjust call to finish_function.
2167 * pt.c (instantiate_decl): Likewise.
2168 * rtti.c (syntheisze_tinfo_fn): Likewise.
2169 * semantics.c (expand_body): Likewise.
2170 * tree.c: Include ggc.h.
2171 (mark_list_hash): New function.
2172 (binding_init): Remove.
2173 (init_cplus_unsave): Rename to ...
2174 (init_tree): This. Add GC roots.
2176 1999-09-05 Mark Mitchell <mark@codesourcery.com>
2178 Get ready for garbage collection.
2179 * Makefile.in (CXX_TREE_H): Add varray.h
2180 (lex.o): Depend on ggc.h.
2182 (decl2.o): Likewise.
2183 (method.o): Likewise.
2184 (search.o): Likewise.
2187 * class.c: Include ggc.h.
2188 (current_class_name): Remove.
2189 (current_class_type): Likewise.
2190 (current_access_specifier): Likewise.
2191 (previous_class_type): Likewise.
2192 (previous_class_values): Likewise.
2193 (class_cache_firstobj): Likewise.
2194 (current_lang_base): Likewise.
2195 (current_lang_stack): Likewise.
2196 (current_lang_stacksize): Likewise.
2197 (lang_name_c): Likewise.
2198 (lang_name_cplusplus): Likewise.
2199 (lang_name_java): Likewise.
2200 (current_lang_name): Likewise.
2201 (base_layout_decl): Likewise.
2202 (access_default_node): Likewise.
2203 (access_public_node): Likewise.
2204 (access_protected_node): Likewise.
2205 (access_private_node): Likewise.
2206 (access_default_virtual_node): Likewise.
2207 (access_public_virtual_node): Likewise.
2208 (access_protected_virtual_node): Likewise.
2209 (access_private_virtual_node): Likewise.
2210 (signed_zero_node): Likewise.
2211 (init_class_processing): Don't build base_layout_decl.
2212 (push_lang_context): Adjust now that current_lang_base is a varray.
2213 (pop_lang_context): Likewise.
2214 * cp-tree.h: Include varray.h.
2215 (cp_global_trees): Add access_default, access_public,
2216 access_protected, access_private, access_default_virtual,
2217 access_public_virtual, access_protected_virtual,
2218 access_private_virtual, ctor_identifier, delta2_identifier,
2219 delta_identifier, dtor_identifier, in_charge_identifier,
2220 index_identifier, nelts_identifier, this_identifier,
2221 pfn_identifier, pfn_or_delta2_identifier, vptr_identifier,
2222 lang_name_c, lang_name_cplusplus, lang_name_java,
2223 empty_except_spec, null, jclass, minus_one, terminate.
2224 (saved_scope): Move here from decl.c. Define globals in terms of
2225 saved_scope: current_namespace, current_class_name,
2226 current_class_type, current_access_specifier, current_lang_stack,
2227 current_lang_base, current_lang_name, current_function_parms,
2228 current_template_parms, processing_template_decl,
2229 processing_specialization, processing_explicit_instantiation,
2230 previous_class_type, previous_class_values, class_cache_firstobj.
2231 (scope_chain): New variable.
2232 (init_pt): New function.
2233 * decl.c (current_namespace): Remove.
2234 (this_identifier, in_charge_identifier, ctor_identifier): Likewise.
2235 (dtor_identifier, pfn_identifier, index_identifier): Likewise.
2236 (delta_identifier, delta2_identifier): Likewise.
2237 (pfn_or_delta2_identifier, tag_identifier): Likewise
2238 (vt_off_identifier, empty_except_spec, null_node): Likewise.
2239 (current_function_parms, current_lang_base): Remove.
2240 (current_lang_stack, previous_class_values): Remove.
2241 (class_binding_level): Macroize.
2242 (saved_scope): Remove.
2243 (current_saved_scope): Rename to scope_chain.
2244 (mark_saved_scope): Adjust for new scope structure.
2245 (maybe_push_to_top_level): Likewise.
2246 (pop_from_top_level): Likewise.
2247 (duplicate_decls): Adjust now that current_lang_base is a varray.
2248 (build_typename_type): Call ggc_add_tree_hash_table_root.
2249 (init_decl_processing): Call init_pt. Call push_to_top_level to
2250 set up globals. Add GC roots.
2251 (xref_basetypes): Adjust now that current_lang_base is a varray.
2252 * decl.h (this_identifier): Remove.
2253 (in_charge_identifier): Likewise.
2254 * decl2.c: Don't include varray.h.
2255 (current_namespace): Remove.
2256 (init_decl2): Add GC roots.
2257 * except.c (Terminate): Remove.
2258 (init_exception_processing): Use terminate_node instead.
2259 (build_terminate_handler): Likewise.
2260 * init.c (nc_nelts_field_id): Remove.
2261 (minus_one): Likewise.
2262 (init_init_processing): Use minus_one_node and nelts_identifier
2263 instead. Add GC roots.
2264 (jclass_node): Remove.
2265 (build_new_1): Use nelts_identifier.
2266 (build_vec_init): Likewise.
2267 (build_vec_delete): Likewise.
2268 * lex.c: Include ggc.h.
2269 (defarg_fn): Move declaration early.
2270 (defarg_parms): Likewise.
2271 (init_parse): Add GC roots.
2272 (handle_cp_pragma): Remove redundant declaration of
2274 * method.c: Include ggc.h.
2275 (btypelist): Make it a varray. All uses changed.
2276 (ktypelist): Likewise.
2277 (init_method): Add GC roots.
2278 * pt.c: Don't include varray.h. Include ggc.h.
2279 (current_template_parms): Remove.
2280 (processing_template_decl): Likewise.
2281 (processing_specialization): Likewise.
2282 (processing_explicit_instantiation): Likewise.
2283 (init_pt): New function.
2284 * repo.c: Include ggc.h.
2285 (init_repo): Add GC roots.
2286 * search.c: Don't include varray.h.
2287 (_vptr_name): Remove.
2288 (lookup_field_1): Use vtpr_identifier instead.
2289 (expand_indirect_vtbls_init): Remove redundant declaration of
2290 in_charge_identifier.
2291 (init_search_processing): Use vptr_identifier.
2293 1999-09-05 Richard Henderson <rth@cygnus.com>
2294 Bernd Schmidt <bernds@cygnus.co.uk>
2295 Mark Mitchell <mark@codesourcery.com>
2297 * Makefile.in (parse.o): Depend on ggc.h.
2298 (decl2.o): Depend on ggc.h.
2299 (init.o): Depend on ggc.h.
2300 * cp-tree.h (init_decl2): Declare.
2301 (cp_parse_init): Likewise.
2302 * decl.c (ggc_p): Define to zero.
2303 (mark_saved_scope): New function.
2304 (init_decl_processing): Call cp_parse_init, and cp_decl2.
2306 (expand_static_init): Add GC roots.
2307 * decl2.c: Include ggc.h.
2308 (init_decl2): New function.
2309 * init.c: Include ggc.h.
2310 (init_init_processing): Add GC roots.
2311 * parse.y: Include ggc.h.
2312 (cp_parse_init): New function.
2314 1999-09-04 Mark Mitchell <mark@codesourcery.com>
2316 * decl.c (init_decl_processing): Set mark_lang_status.
2317 (lang_mark_false_label_stack): Adjust prototype.
2318 * decl2.c (grok_function_init): Remove extraneous declaration of
2321 * Make-lang.in (cc1plus): Remove dependency on GGC.
2322 * Makefile.in (OBJS): Don't mention ggc-simple.o.
2323 (OBJDEPS): Don't mention ggc-simple.o.
2325 * Make-lang.in (cc1plus): Depend on $(GGC).
2326 * Makefile.in (OBJS): Add ggc-simple.o.
2327 (OBJDEPS): Likewise.
2328 * cp-tree.h (language_function): Rename members to `x_' versions;
2329 we now have x_named_labels, x_ctor_label, x_dtor_label,
2330 x_base_init_list, x_member_init_list, x_base_init_expr,
2331 x_current_class_ptr, x_current_class_ref, x_last_tree,
2332 x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and
2334 (dtor_label, ctor_label, current_base_init_list,
2335 current_member_init_list, base_init_expr, current_class_ptr,
2336 current_class_ref, last_tree, last_expr_type): Adjust accordingly.
2337 * decl.c: Include ggc.h.
2338 (last_dtor_insn): Adjust to use x_ names.
2339 (last_parm_cleanup_insn): Likewise.
2340 (original_result_rtx): Likewise.
2341 (named_labels): Likewise.
2342 (mark_binding_level): New function.
2343 (mark_cp_function_context): Likewise.
2344 (mark_false_label_stack): Likewise.
2345 (lang_mark_tree): Likewise.
2346 (lang_cleanup_tree): Likewise.
2348 1999-09-03 Mark Mitchell <mark@codesourcery.com>
2350 * Makefile.in (CXX_TREE_H): Include function.h.
2351 (decl.o): Don't depend on function.h.
2352 (decl2.o): Likewise.
2353 (typeck.o): Likewise.
2355 (method.o): Likewise.
2356 * cp-tree.h: Include function.h.
2357 (cp_function): Rename to language_function. Remove next.
2358 (cp_function_chain): Make it a macro, not a variable.
2359 (push_cp_function_context): Don't declare.
2360 (pop_cp_function_context): Likewise.
2361 * decl.c: Don't include function.h.
2362 (push_cp_function_context): Make it static. Make it suitable for
2363 a save_lang_status callback.
2364 (pop_cp_function_context): Likewise.
2365 (maybe_push_to_top_level): Call push_function_context_to, not
2366 push_cp_function_context.
2367 (pop_from_top_level): Call pop_function_context_from, not
2368 pop_cp_function_context.
2369 (init_decl_processing): Set save_lang_status and
2370 restore_lang_status. Call push_function_context_to, not
2371 push_cp_function_context.
2372 (cp_function_chain): Remove.
2373 * decl2.c: Don't include function.h.
2374 * except.c: Don't include function.h.
2375 (start_anon_func): Call push_function_context_to, not
2376 push_cp_function_context.
2377 (end_anon_func): Call pop_function_context_from, not
2378 pop_cp_function_context.
2379 * init.c: Don't include function.h.
2380 * lex.c (begin_definition_of_inclass_inline): Call
2381 push_function_context_to, not push_cp_function_context.
2382 (process_next_inline): Call pop_function_context_from, not
2383 pop_cp_function_context.
2384 * method.c: Don't include function.h.
2385 (synthesize_method): Call push_function_context_to, not
2386 push_cp_function_context. Call pop_function_context_from, not
2387 pop_cp_function_context.
2388 * typeck.c: Don't include function.h.
2390 * decl.c (expand_static_init): Tweak handling of static
2391 initializations for objects without constructors.
2393 1999-09-03 Nathan Sidwell <nathan@acm.org>
2395 * typeck.c (build_indirect_ref): Reject dereference of pointer to
2398 1999-09-02 Mark Mitchell <mark@codesourcery.com>
2400 * cp-tree.h (cp_function): Move here, from decl.c.
2401 (cp_function_chain): Declare.
2402 (dtor_label): New macro, instead of variable.
2403 (ctor_label): Likewise.
2404 (current_base_init_list): Likewise.
2405 (current_member_init_list): Likewise.
2406 (base_init_expr): Likewise.
2407 (current_class_ptr): Likewise.
2408 (current_class_ref): Likewise.
2409 (last_tree): Likewise.
2410 (last_expr_type): Likewise.
2411 (current_function_returns_value): Likewise.
2412 (current_function_returns_null): Likewise.
2413 (current_function_just_assigned_this): Likewise.
2414 (current_function_parms_stored): Likewise.
2415 (temp_name_counter): Likewise.
2416 (static_labelno): Likewise.
2417 (expanding_p): Likewise.
2418 (stmts_are_full_exprs_p): Likewise.
2419 (in_function_try_handler): Likewise.
2420 (lang_type): Remove nested type_flags. All uses changed.
2421 * call.c (ctor_label): Remove.
2422 (dtor_label): Likewise.
2423 * class.c (current_class_ptr): Remove.
2424 (current_class_ref): Likewise.
2425 * decl.c (static_labelno): Remove.
2426 (dtor_label): Likewise.
2427 (last_dtor_insn): New macro, instead of variable.
2428 (last_parm_cleanup_insn): Likewise.
2429 (original_result_rtx): Likewise.
2430 (in_function_try_handler): Remove.
2431 (named_label_uses): New macro, instead of variable.
2432 (named_labels): Likewise.
2433 (current_function_returns_value): Remove.
2434 (current_function_returns_null): Likewise.
2435 (current_function_assigns_this): New macro, instead of variable.
2436 (current_function_just_assigned_this): Likewise.
2437 (current_binding_level): Likewise.
2438 (init_decl_processing): Call push_cp_function_context.
2439 (cp_function): Move to cp-tree.h
2440 (cp_function_chain): Make it global.
2441 (temp_name_counter): Remove.
2442 (push_cp_function_context): Simplify.
2443 (pop_cp_function_context): Likewise.
2444 * decl2.c (temp_name_counter): Remove.
2445 * init_c (current_base_init_list): Likewise.
2446 (current_member_init_list): Likewise.
2447 (base_init_expr): Likewise.
2448 * method.c (static_labelno): Likewise.
2449 * pt.c (last_tree): Likewise.
2450 * semantics.c (expanding_p): Likewise.
2451 (stmts_are_full_exprs_p): Likewise.
2452 (last_expr_type): Likewise.
2453 * typeck.c (dtor_label): Likewise.
2454 (ctor_label): Likewise.
2456 1999-09-01 Alex Samuel <samuel@codesourcery.com>
2458 * decl2.c (arg_assoc_template_arg): New prototype. New function.
2459 (arg_assoc_class): Use arg_assoc_template_arg for template
2461 (arg_assoc): Likewise.
2462 * pt.c (mangle_class_name_for_template): Allow member template
2465 1999-09-02 Nathan Sidwell <nathan@acm.org>
2467 * call.c (build_conditional_expr): Warn on enum mismatches.
2468 (convert_arg_to_ellipsis): Move non-pod check to after
2471 1999-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2473 * gxx.gperf (hash, is_reserved_word): Add prototypes.
2475 * init.c (build_vec_init): Initialize variable `try_block'.
2477 * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts.
2478 Likewise for bzero/memset.
2479 (token_getch, token_put_back): Add static prototypes. Remove
2480 `inline' from the definitions.
2481 (retrofit_lang_decl): Call memset, not bzero, to avoid casts.
2483 1999-09-01 Mark Mitchell <mark@codesourcery.com>
2485 * cp-tree.h (lang_type): Move align into type_flags.
2486 (CLASSTYPE_ALIGN): Adjust accordingly.
2487 * call.c (direct_reference_binding): Remove misleading comment.
2489 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2491 * parse.y (language_string): Constify.
2493 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2495 * repo.c (getpwd): Don't prototype.
2496 * xref.c (getpwd): Likewise
2498 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2500 * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
2501 Remove hacks for stuff which now comes from libiberty.
2503 1999-08-30 Jason Merrill <jason@yorick.cygnus.com>
2505 * cp-tree.h (IS_AGGR_TYPE_2): Fix typo.
2507 1999-08-30 Mark Mitchell <mark@codesourcery.com>
2509 * cp-tree.h (begin_init_stmts): Declare.
2510 (finish_init_stmts): Likewise.
2511 * cvt.c (build_up_reference): Wrap the declaration of a temporary
2512 in a statement-expression so that we will see it when expanding
2513 tree structure later.
2514 * init.c (begin_init_stmts): Don't make it static.
2515 (finish_init_stmts): Likewise.
2517 * cp-tree.h (start_handler_parms): New function.
2518 (expand_start_catch_block): Take only one parameter.
2519 (start_handler_parms): New function.
2520 * decl.c (start_handler_parms): Define it.
2521 * except.c (process_start_catch_block): Take only one parameter.
2522 Don't call grokdeclarator here.
2523 (expand_start_catch_block): Don't call grokdeclarator here,
2525 * parse.y (handler_args): Adjust call to
2526 expand_start_catch_block. Use start_handler_parms.
2527 * pt.c (push_template_decl_real): Make permanent lists have
2529 (tsubst_expr): Adjust calls to expand_start_catch_block
2531 * semantics.c (expand_stmt): Likewise.
2533 1999-08-29 Alex Samuel <samuel@codesourcery.com>
2535 * pt.c (push_template_decl_real): Use template declaration from
2536 class type if it exists.
2538 1999-08-29 Mark Mitchell <mark@codesourcery.com>
2540 * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition.
2541 (maybe_inject_for_scope_var): Declare it.
2542 (initialize_local_var): Likewise.
2543 * decl.c (maybe_inject_for_scope_var): Make it global.
2544 (initialize_local_var): Likewise. Move cleanup handling here,
2545 from cp_finish_decl.
2546 (make_rtl_for_nonlocal_decl): Use
2547 push_obstacks_nochange/pop_obstacks, rather than
2548 end_temporary_allocation/resume_temporary_allocation.
2549 (cp_finish_decl): Try to complete the type of a variable when it
2550 is declared. Move cleanup-handling to initialize_local_var.
2551 (expand_static_init): Use tree-building code, rather than
2553 * decl2.c (get_temp_name): Assert non-initializedness of
2555 * init.c (create_temporary_var): Move RTL-assigning code to ...
2556 (get_temp_regvar): Here.
2557 * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here.
2558 * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just
2559 call initialize_local_var to generate initialization code.
2561 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2563 * cp-tree.h (fndecl_as_string, type_as_string,
2564 type_as_string_real, args_as_string, decl_as_string,
2565 expr_as_string, code_as_string, language_as_string,
2566 parm_as_string, op_as_string, assop_as_string, cv_as_string,
2567 lang_decl_name, cp_file_of, lang_printable_name): Constify a char*.
2569 * errfn.c (cp_printer): Likewise.
2571 * error.c (cp_printer, fndecl_as_string, type_as_string_real,
2572 type_as_string, expr_as_string, decl_as_string, lang_decl_name,
2573 cp_file_of, code_as_string, language_as_string, parm_as_string,
2574 op_as_string, assop_as_string, args_as_string, cv_as_string):
2577 * tree.c (lang_printable_name): Likewise.
2579 1999-08-28 Richard Henderson <rth@cygnus.com>
2581 * decl2.c (arg_assoc_class): Bail if the class is a builtin type.
2583 1999-08-28 Mark Mitchell <mark@codesourcery.com>
2585 * cp-tree.h (strip_array_types): New function.
2586 * decl.c (maybe_deduce_size_from_array_init): New function, split
2587 out from cp_finish_decl.
2588 (layout_var_decl): Likewise.
2589 (maybe_commonize_var): Likewise.
2590 (maybe_inject_for_scope_var): Likewise.
2591 (initialize_local_var): Likewise.
2592 (build_cleanup_on_safe_obstack): Likewise.
2593 (check_initializer): Likewise.
2594 (make_rtl_for_nonlocal_decl): Likewise.
2595 (cp_finish_decl): Use them.
2596 * typeck.c (strip_array_types): New function.
2598 * cp-tree.def (LABEL_STMT): New tree node.
2599 * cp-tree.h (LABEL_STMT_LABEL): New macro.
2600 (shadow_label): Remove.
2601 (declare_local_label): New function.
2602 (finish_label_decl): Likewise.
2603 * decl.c (make_label_decl): New function, split out from
2605 (shadowed_labels): Remove.
2606 (binding_level): Add shadowed_labels.
2607 (clear_binding_level): Remove.
2608 (push_binding_level): Just bzero the new binding level.
2609 (pushlevel): Fix indentation.
2610 (pop_label): New function.
2611 (pop_labels): Likewise, split out from poplevel.
2612 (poplevel): Pop local labels. Use pop_labels.
2613 (maybe_push_to_top_level): Don't clear shadowed_labels.
2614 (lookup_label): Use make_label_decl.
2615 (shadow_label): Remove.
2616 (declare_local_label): New function.
2617 (define_label): Simplify.
2618 (start_function): Don't clear shadowed_labels.
2619 (cp_function): Remove shadowed_labels.
2620 (push_cp_function_context): Don't save shadowed_labels.
2621 (pop_cp_function_context): Don't restore it.
2622 * dump.c (dequeue_and_dump): Handle LABEL_STMT.
2623 * parse.y (label_decl): Use finish_label_decl.
2624 * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
2626 * semantics.c (finish_label_stmt): Add a LABEL_STMT when
2628 (finish_label_decl): New function.
2629 (expand_stmt): Handle LABEL_STMTs and local label declarations.
2631 1999-08-26 Mark Mitchell <mark@codesourcery.com>
2633 * decl.c (lookup_label): Build labels on the permanent obstack
2634 when building statement trees. Don't build RTL for labels when
2635 building statement trees.
2636 * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when
2637 building statement trees.
2638 (finish_label_stmt): Likewise.
2639 (expand_stmt): Adjust accordingly.
2640 * pt.c (tsubst_expr); Likewise.
2641 (do_decl_instantiation): Robustify.
2643 * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro.
2644 * tree.c (build_cplus_new): Set it.
2645 * expr.c (cplus_expand_expr): Use it.
2646 * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR.
2648 * decl.c (store_parm_decls): Reset immediate_size_expand.
2649 (finish_function): Likewise.
2651 * tree.c (cplus_unsave_expr_now): Don't return a value.
2653 * semantics.c (do_poplevel): Always initialize the return value.
2655 1999-08-26 Gavin Romig-Koch <gavin@cygnus.com>
2657 * cp-tree.h (cplus_unsave_expr_now) : Correct return type.
2658 * tree.h (cplus_unsave_expr_now) : Same.
2660 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2662 * decl.c (grokdeclarator): Amend comment.
2663 * except.c (expand_start_catch_block): Call push_template_decl for
2664 catch-block parameters.
2665 * method.c (synthesize_method): Build an empty compound statement
2666 for the body of a constructor.
2668 1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
2670 * tree.c (cp_build_qualified_type_real): If we're asking for the
2671 same quals we already have, just return.
2673 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2675 * cp-tree.def (SUBOBJECT): New tree node.
2676 * cp-tree.h (CLEANUP_P): New macro.
2677 (SUBOBJECT_CLEANUP): Likewise.
2678 (keep_next_level): Add parameter.
2679 (get_temp_regvar): Don't declare.
2680 (emit_base_init): Remove parameter.
2681 (expand_aggr_init): Rename to build_aggr_init.
2682 (expand_vec_init): Rename to build_vec_init.
2683 (do_pushlevel): Remove.
2684 (do_poplevel): Likewise.
2685 (finish_cleanup): New function.
2686 (finish_subobject): Likewise.
2687 (stmts_are_full_exprs_p): New variable.
2688 * decl.c (keep_next_level): Add parameter.
2689 (cp_finish_decl): Use build_aggr_init, not
2690 expand_aggr_init. Use finish_expr_stmt to expand the code.
2691 (expand_static_init): Use tree-generating, not RTL-generating,
2692 functions to handle the initialization.
2693 (start_function): Remove dead code. Always have a momentary
2694 obstack inside the function, even before hitting the first curly
2696 (cplus_expand_expr_stmt): Move calls to
2697 expand_{start,end}_target_temps into semantics.c.
2698 (cp_function): Add stmts_are_full_exprs_p.
2699 (push_cp_function_context): Save it.
2700 (pop_cp_function_context): Restore it.
2701 * decl2.c (get_temp_regvar): Move to init.c.
2702 (do_static_initialization): Use build_{aggr,vec}_init.
2703 (do_static_destruction): Fix typo in comment.
2704 * dump.c (dequeue_and_dump): Handle INIT_EXPR.
2705 * except.c (expand_throw): Use create_temporary_var.
2706 * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init.
2707 * init.c (expand_vec_init_try_block): Remove.
2708 (expand_vec_init_catch_clause): Likewise.
2709 (get_temp_regvar): New function.
2710 (begin_init_stmts): Likewise.
2711 (finish_init_stmts): Likewise.
2712 (perform_member_init): Use build_{aggr,vec}_init. Build up tree
2714 (emit_base_init): Likewise. Remove unused parameter.
2715 (expand_virtual_init): Likewise.
2716 (expand_cleanup_for_base): Use finish_subobject.
2717 (expand_aggr_vbase_init_1): Simplify.
2718 (construct_virtual_bases): Use tree-generating functions to build
2720 (expand_aggr_init): Likewise. Rename to build_aggr_init.
2721 (expand_default_init): Likewise.
2722 (expand_aggr_init_1): Likewise.
2723 (expand_vec_init): Rename to build_vec_init.
2724 * method.c (do_build_copy_constructor): Use tree-generating
2725 functions. Don't call clear_last_expr.
2726 (do_build_assign_ref): Likewise.
2727 (synthesize_method): Call clear_last_expr here.
2728 * parse.y (base_init): Don't call clear_last_expr here.
2729 (nodecls): Likewise.
2730 * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set.
2731 * semantics.c (do_pushlevel): Move to here.
2732 (do_poplevel): Likewise.
2733 (stmts_are_full_exprs_p): New variable.
2734 (finish_expr_stmt): Handle logic for temoprary cleanup here.
2735 (finish_for_stmt): Use finish_expr_stmt.
2736 (finish_cleanup): New function.
2737 (finish_function_try_block): Fix indentation.
2738 (finish_subobject): New function.
2739 (setup_vtbl_ptr): Call keep_next_level here.
2740 (finish_stmt_expr): Handle a block with no scope inside the
2741 statement-expression.
2742 (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle
2744 * tree.c (search_tree): Handle INIT_EXPR.
2746 * typeck.c (build_modify_expr): Don't build an RTL_EXPR.
2747 * typeck2.c (store_init_value): Change expand_aggr_init to
2748 build_aggr_init in comment.
2750 1999-08-25 Mark Mitchell <mark@codesourcery.com>
2752 * dump.c (dequeue_and_dump): Dump TARGET_EXPRs.
2754 1999-08-25 Nathan Sidwell <nathan@acm.org>
2756 * decl2.c (handle_class_head): Be graceful about additional
2757 scope qualifiers. Adjust comments to reflect reality.
2759 1999-08-24 Jason Merrill <jason@yorick.cygnus.com>
2761 * call.c (build_conditional_expr): Fix typo.
2762 * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an
2763 lvalue before trying to mess with the sides.
2765 * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly.
2767 Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
2769 * g++spec.c (lang_specific_driver): Add room for NULL in arglist.
2771 1999-08-23 Jason Merrill <jason@yorick.cygnus.com>
2773 * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2.
2774 Return arbitrary pointer or NULL.
2775 (check_eh_spec): Call __throw_type_match_rtti_2.
2776 * tinfo.h (*::dcast): Return int. Add valp parm.
2777 * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers.
2778 * tinfo2.cc (__throw_type_match_rtti_2): Likewise.
2779 (__throw_type_match_rtti): Now just a wrapper.
2781 * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind.
2782 (init_exception_processing): Don't initialize them.
2784 1999-08-23 Paul Burchard <burchard@pobox.com>
2786 * decl.c (check_default_argument): Fix typo.
2788 1999-08-22 Mark Mitchell <mark@codesourcery.com>
2790 * cp-tree.def (STMT_EXPR): Fix typo in node name.
2792 * dump.c (dump_next_stmt): New function.
2793 (dequeue_and_dump): Use it.
2795 * pt.c (tsubst_copy): Make sure to initialize return value for a
2796 STMT_EXPR, even when processing_template_decl.
2797 * semantics.c (finish_stmt_expr): A statement-expression whose
2798 last statement is not an expression-statement has type `void'.
2800 1999-08-20 Mark Mitchell <mark@codesourcery.com>
2802 * semantics.c (finish_stmt_expr): Fix typo in comment.
2803 * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR.
2805 * init.c (build_vec_delete_1): Make the children of a permanent
2806 BIND_EXPR permanent.
2807 * pt.c (register_specialization): Don't register a specialization
2810 1999-08-18 Andrew Haley <aph@cygnus.com>
2812 * method.c (process_overload_item): Call build_mangled_C9x_name ()
2813 for all integer parameter types larger than long long.
2815 1999-08-19 Mark Mitchell <mark@codesourcery.com>
2817 * pt.c (redeclare_class_template): Merge default template
2818 arguments in both directions.
2820 * typeck.c (common_type): Undo 1999-08-18 change. Remove
2821 compiler_error message.
2823 1999-08-19 Jason Merrill <jason@yorick.cygnus.com>
2825 * cp-tree.h: Declare flag_use_repository.
2826 * pt.c (do_decl_instantiation): Don't complain about duplicate
2827 instantiation with -frepo.
2828 (do_type_instantiation): Likewise.
2830 * pt.c (push_template_decl_real): Complain about everything
2831 that isn't a valid template.
2833 * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't
2836 1999-08-19 Mark Mitchell <mark@codesourcery.com>
2838 * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code.
2839 * decl2.c (build_expr_from_tree): Handle it.
2840 * error.c (dump_expr): Likewise.
2841 * pt.c (for_each_template_parm): Likewise.
2842 (tsubst_copy): Likewise.
2843 * tree.c (search_tree): Likewise.
2844 * semantics.c (finish_pseudo_destructor_call): Create it.
2846 1999-08-18 Mark Mitchell <mark@codesourcery.com>
2848 * search.c (setup_class_bindings): Robustify.
2849 * typeck.c (common_type): Use same_type_p, not pointer equality,
2852 * cp-tree.h (build_lang_field_decl): Remove.
2853 * class.c (build_vtable): Replace calls to build_lang_field_decl
2854 with build_lang_decl.
2855 (prepare_fresh_vtable): Likewise.
2856 (finish_struct_1): Likewise.
2857 (init_class_processing): Likewise.
2858 * decl.c (push_using_decl): Likewise.
2859 (init_decl_processsing): Likewise.
2860 (grokvardecl): Likewise.
2861 (build_ptrmemfunc_type): Likewise.
2862 (grokdeclarator): Likewise.
2863 (build_enumerator): Likewise.
2864 * decl2.c (grok_x_components): Likewise.
2865 (do_class_using_decl): Likewise.
2866 * except.c (call_eh_info): Likewise.
2867 * init.c (init_init_processing): Likewise.
2868 * rtti.c (expand_class_decl): Likewise.
2869 * tree.c (build_base_fields): Likewise.
2870 (build_vbase_pointer_fields): Likewise.
2871 * lex.c (build_lang_decl): Build declarations on the permanent
2872 obstack if we're building statmeent trees.
2873 (retrofit_lang_decl): Handle both the full lang_decl and also the
2874 smaller lang_decl_flags here.
2875 (build_lang_field_decl): Remove.
2876 * pt.c (push_template_decl_real): Issue errors for variable
2877 declarations that are not static members.
2879 1999-08-18 Richard Henderson <rth@cygnus.com>
2881 * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too.
2884 1999-08-17 Mark Mitchell <mark@codesourcery.com>
2886 * cp-tree.h (back_end_hook): New variable.
2887 * decl2.c (back_end_hook): Define it.
2888 (finish_file): If it's non-NULL, call it.
2890 * decl.c (add_decl_to_level): New function.
2891 (push_local_binding): Use it.
2892 (find_binding): Fix typo in comment.
2893 (pushdecl): Use add_decl_to_level. Put templates on the
2894 corresponding namespace-scope binding levels.
2895 * dump.c (dequeue_and_dump): Print the specializations of a
2897 * pt.c (push_template_decl_real): Don't push a template multiple
2900 1999-08-17 Mark Mitchell <mark@codesourcery.com>
2902 * cp-tree.h (CALL_DECLARATOR_PARMS): New macro.
2903 (CALL_DECLARATOR_QUALS): Likewise.
2904 (CALL_DECARATOR_EXCEPTION_SPEC): Likewise.
2905 * decl.c (grokdeclarator): Adjust to use them.
2906 * decl2.c (grokfield): Likewise.
2907 (reparse_absdcl_as_casts): Likewise.
2908 * lex.c (make_call_declarator): Likewise.
2909 (set_quals_and_spec): Likewise.
2910 * pt.c (tsubst): Likewise.
2911 * tree.c (mapcar): Remove special hack to handle third operand of
2914 1999-08-16 Mark Mitchell <mark@codesourcery.com>
2916 * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro.
2917 * class.c (build_vtable): Use build_lang_field_decl to build the
2918 VAR_DECLs for vtables.
2919 (prepare_fresh_vtable): Likewise.
2920 * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if
2921 CAN_HAVE_FULL_LANG_DECL_P.
2922 (push_using_decl): Use build_lang_decl to build USING_DECLs.
2923 (grokdeclarator): Use build_lang_decl to build TYPE_DECLs.
2924 * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P.
2925 (build_lang_field_decl): Likewise.
2926 (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much
2929 * cp-tree.def (STMT_EXPR): New tree node.
2930 * cp-tree.h (STMT_EXPR_STMT): New macro.
2931 (store_return_init): Change prototype.
2932 (finish_named_return_value): New function.
2933 (expand_stmt): Likewise.
2934 (expand_body): Likewise.
2935 (begin_stmt_tree): Likewise.
2936 (finish_stmt_tree): Likewise.
2937 (expanding_p): New variable.
2938 (last_expr_type): Likewise.
2939 (building_stmt_tree): New macro.
2940 * decl.c (start_function): Use building_stmt_tree, not
2941 processing_template_decl, where appropriate.
2942 (store_parm_decls): Likewise.
2943 (store_return_init): Move most of the body to semantics.c.
2944 (finish_function): Use building_stmt_tree.
2945 (finish_stmt): Clear last_expr_type here.
2946 (cp_function): Add expanding_p, last_tree, last_expr_type.
2947 (push_cp_function_context): Save them.
2948 (pop_cp_function_context): Restore them.
2949 * decl2.c (setup_vtbl_ptr): Move to semantics.c.
2950 * error.c (dump_expr): Handle STMT_EXPR.
2951 * except.c (expand_start_catch_block): Use building_stmt_tree.
2953 * expr.c (cplus_expand_expr): Handle STMT_EXPR.
2954 (do_case): Move add_tree call to semantics.c.
2955 * parse.y (return_init): Use finish_named_return_value.
2956 (for.init.statement): Use finish_expr_stmt.
2957 * parse.c: Regenerated.
2958 * pt.c (do_pushlevel): Move to semantics.c.
2959 (do_poplevel): Likewise.
2960 (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
2961 (tsubst_expr): Don't expand all the way to RTL here. Handle
2962 RETURN_INIT and CTOR_INITIALIZER.
2963 (instantiate_decl): Call expand_body after tsubst'ing into
2965 * semantics.c (expand_stmts): New function.
2966 (expanding_p): New variable.
2967 (last_expr_type): Likewise.
2968 (finish_expr_stmt): Use building_stmt_tree.
2969 (begin_if_stmt): Likewise.
2970 (finish_if_stmt_cond): Likewise.
2971 (finish_then_clause): Likewise.
2972 (begin_else_clause): Likewise.
2973 (finish_else_clause): Likewise.
2974 (begin_while_stmt): Likewise.
2975 (finish_while_stmt_cond): Likewise.
2976 (finish_while_stmt): Likewise.
2977 (finish_do_body): Likewise.
2978 (finish_do_stmt): Likewise.
2979 (finish_return_stmt): Likewise.
2980 (begin_for_stmt): Likewise.
2981 (fnish_for_init_stmt): Likewise.
2982 (finish_for_cond): Likewise.
2983 (finish_for_expr): Likewise.
2984 (finish_for_stmt): Likewise.
2985 (finish_break_stmt): Likewise.
2986 (finish_continue_stmt): Likewise.
2987 (finish_switch_cond): Likewise.
2988 (finish_switch_stmt): Likewise.
2989 (finish_case_label): Call add_tree here if necessary.
2990 (finish_goto_statement): Use building_stmt_tree.
2991 (begin_try_block): Likewise.
2992 (begin_function_try_block): Likewise.
2993 (finish_try_block): Likewise.
2994 (finish_function_try_block): Likewise.
2995 (finish_handler_sequence): Likewise.
2996 (finish_function_handler_sequence): Likewise.
2997 (begin_handler): Likewise.
2998 (finish_handler_parms): Likewise.
2999 (finish_handler): Likewise.
3000 (begin_compound_stmt): Likewise.
3001 (finish_compound_stmt): Likewise.
3002 (finish_asm_stmt): Likewise.
3003 (finish_label_stmt): Likewise.
3004 (finish_named_return_value): New function.
3005 (setup_vtbl_ptr): Moved here from decl2.c.
3006 (do_pushlevel): Moved here from pt.c.
3007 (do_poplevel): Likewise.
3008 (begin_stmt_expr): Use building_stmt_tree.
3009 (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR,
3010 when building_stmt_tree.
3011 (begin_stmt_tree): New function.
3012 (finish_stmt_tree): Likewise.
3013 (expand_stmt): Likewise.
3014 (expand_body): Likewise.
3015 * tree.c (build_cplus_method_type): Make sure the argument types
3016 end up on the same obstack as the METHOD_TYPE.
3017 (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR,
3018 THROW_EXPR, STMT_EXPR.
3019 (mapcar): Break out common cases. Handle COMPOUND_EXPR,
3020 MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than
3021 sorry, if an unsupported node is encountered.
3022 * typeck.c (require_complete_type_in_void): Handle BIND_EXPR.
3023 (c_expand_return): Don't call add_tree here.
3025 1999-08-15 Mark Mitchell <mark@codesourcery.com>
3027 * pt.c (check_default_tmpl_args): Don't check in local scopes.
3028 (tsubst_decl): Make sure the declaration is on a saveable
3029 obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local
3031 (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs.
3033 1999-08-14 Jason Merrill <jason@yorick.cygnus.com>
3035 Speed up Koenig lookup.
3036 * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm
3037 to return namespaces we've looked at.
3038 * decl2.c (lookup_using_namespace): Likewise.
3039 (add_function): Don't call ovl_member.
3040 (lookup_arg_dependent): Initialize k.namespaces to the list of
3041 namespaces seen in unqualified lookup.
3042 * call.c (equal_functions): Move here from tree.c.
3043 (joust): Use it to handle duplicate candidates.
3044 * tree.c (ovl_member): Use ==.
3046 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3048 * cp-tree.def (DECL_STMT): Make it smaller.
3049 * cp-tree.h (lang_decl_flags): Move saved_tree to ...
3050 (lang_decl): ... here. Add next.
3051 (DECL_SAVED_TREE): Adjust accordingly.
3052 (DECL_IMPLICIT_TYPEDEF_P): New macro.
3053 (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise.
3054 (DECL_STMT_DECL): Likewise.
3055 (create_implicit_typedef): New function.
3056 (maybe_push_decl): Likewise.
3057 (tsubst_default_argument): New function.
3058 (at_function_scope_p): Likewise.
3059 (add_decl_stmt): Likewise.
3060 (push_permanent_obstack): Likewise.
3061 * call.c (convert_default_arg): Use tsubst_default_argument.
3062 * class.c (add_method): Use push_permanent_obstack.
3063 (build_self_reference): Create a TEMPLATE_DECL for the
3064 self-reference, if necessary.
3065 * decl.c (pseudo_global_level_p): Only look at the current binding
3067 (push_binding): Use push_permanent_obstack.
3068 (create_implicit_typedef): New function.
3070 (duplicate_decls): Use push_permanent_obstack.
3071 (maybe_push_decl): New function.
3072 (start_decl): Use it. Remove dead code. Use add_decl_stmt.
3073 (start_decl_1): Remove dead code.
3074 (cp_finish_decl): Remove DECL_STMT handling here. Don't use
3075 pseudo_global_level_p.
3076 (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a
3078 (grokdeclarator): Likewise, for TYPE_DECLs. Don't use
3079 pseudo_global_level_p.
3080 * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in
3082 (get_sentry): Use push_permanent_obstack.
3083 * dump.c (dequeue_and_dump): Enable DECL_STMT.
3084 * except.c (call_eh_info): Use push_permanent_obstack.
3085 (build_eh_type_ref): Likewise.
3086 (do_pop_exception): Likewise.
3087 (expand_eh_spec): Likewise.
3088 (alloc_eh_object): Likewise.
3089 (expand_throw): Likewise.
3090 * init.c (build_java_class_ref): Likewise.
3091 * lex.c (get_time_identifier): Likewise.
3092 (free_lang_decl_chain): Correct type.
3093 (retrofit_lang_decl): Adjust accordingly.
3094 (build_lang_field_decl): Likewise.
3095 * lex.h (free_lang_decl_chain): Likewise.
3096 * parse.y (lang_extdef): Don't use pseudo_global_level_p.
3097 * parse.c: Regenerated.
3098 * pt.c (tsubst_default_arguments): New function.
3099 (retrieve_local_specialization): Likewise.
3100 (register_local_specialization): Likewise.
3101 (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use
3102 pseudo_global_level_p to determine whether or not a template is
3104 (lookup_template_class): Likewise. Use create_implicit_typedef.
3105 (instantiate_class_template): Call tsubst_default_arguments for
3106 member functions, if appropriate.
3107 (tsubst_default_argument): New function.
3108 (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs.
3109 * search.c (at_function_scope_p): New function.
3110 * semantics.c (finish_asm_stmt): Use push_permanent_obstack.
3111 (finish_label_stmt): Likewise.
3112 (add_decl_stmt): New function.
3113 (begin_class_definition): Likewise.
3114 (finish_typeof): Likewise.
3115 * tree.c (copy_template_template_parm): Likewise.
3116 (copy_to_permanent): Likewise.
3117 (push_permanent_obstack): Define.
3118 (mark_addressable): Use it.
3119 * typeck.c (mark_addressable): Likewise.
3121 1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
3123 * cp-tree.h (init_cplus_unsave): New.
3124 (cplus_unsave_expr_now): New.
3125 * lex.c (init_parse): Call init_cplus_unsave.
3126 * tree.c (init_cplus_unsave): New.
3127 (cplus_unsave_expr_now): New.
3129 1999-08-13 Mark Mitchell <mark@codesourcery.com>
3131 * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and
3132 decl_constant_value to simplify array bounds.
3134 1999-08-11 Jason Merrill <jason@yorick.cygnus.com>
3136 * lang-options.h: Add -fms-extensions.
3137 * cp-tree.h: Declare flag_ms_extensions.
3138 * decl2.c: Define it.
3139 * class.c (instantiate_type): Don't complain about taking the address
3140 of a bound member function if -fms-extensions.
3141 * typeck.c (build_unary_op): Likewise.
3142 * decl.c (grokdeclarator): Or about implicit int.
3143 * init.c (resolve_offset_ref): Or about implicit '&'.
3145 1999-08-11 Mark Mitchell <mark@codesourcery.com>
3147 * cp-tree.h (minimal_parse_mode): Remove.
3148 (finish_label_stmt): New function.
3149 * decl.c (saved_scope): Remove minimal parse mode.
3150 (maybe_push_to_top_level): Don't save it.
3151 (pop_from_top_level): Don't restore it.
3152 (define_label): Split out template-handling code to semantics.c.
3153 (start_decl): Don't use minimal_parse_mode.
3154 (cp_finish_decl): Likewise.
3155 (start_function): Don't increment it.
3156 (store_return_init): Don't use it.
3157 (finish_function): Don't decrement it.
3158 * parse.y (label_colon): Use finish_label_stmt throughout.
3159 * parse.c: Regenerated.
3160 * pt.c (minimal_parse_mode): Don't define it.
3161 (tsubst_expr): Use finish_label_stmt.
3162 * semantics.c (finish_label_stmt): New function.
3164 * dump.c (queue): Be careful when computing bitmasks.
3165 (dequeue_and_dump): Describe binfos as binfos, not as
3168 * parse.y (pedantic): Give it itype. Adjust usage accordingly
3170 * parse.c: Regenerated.
3172 * Make-lang.in (CXX_SRCS): Remove sig.c.
3173 * Makefile.in (CXX_OBJS): Remove sig.o.
3175 * cp-tree.h (CPTI_OPAQUE_TYPE): Remove.
3176 (CPTI_SIGNATURE_TYPE): Likewise.
3177 (CPTI_SIGTABLE_ENTRY_TYPE): Likewise.
3178 (opaque_type_node): Likewise.
3179 (signature_type_node): Likewise.
3180 (sigtable_entry_type): Likewise.
3181 (flag_handle_signatures): Likewise.
3182 (lang_type): Remove is_signature, is_signature_pointer,
3183 is_signature_reference, has_opaque_typedecls,
3184 sigtables_has_been_generated. Adjust dummy. Remove signature,
3185 signature_pointer_to, signature_reference_to.
3186 (IS_SIGNATURE): Remove.
3187 (SET_SIGNATURE): Remove.
3188 (CLEAR_SIGNATURE): Remove.
3189 (IS_SIGNATURE_POINTER): Remove.
3190 (IS_SIGNATURE_REFERENCE): Remove.
3191 (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove.
3192 (SIGTABLE_HAS_BEEN_GENERATED): Remove.
3193 (CLASSTYPE_SIGNATURE): Remove.
3194 (SIGNATURE_TYPE): Remove.
3195 (SIGNATURE_METHOD_VEC): Remove.
3196 (SIGNATURE_POINTER_TO): Remove.
3197 (SIGNATURE_REFERENCE_TO): Remove.
3198 (lang_decl_flags): Remove is_default_implementation. Rename
3199 memfunc_pointer_to to saved_tree.
3200 (IS_DEFAULT_IMPLEMENTATION): Remove.
3201 (DECL_MEMFUNC_POINTER_TO): Remove.
3202 (DECL_MEMFUNC_POINTING_TO): Remove.
3203 (DECL_SAVED_TREE): Adjust definition.
3204 (tag_types): Remove signature_type_node.
3205 (SIGNATURE_FIELD_NAME): Remove.
3206 (SIGNATURE_FIELD_NAME_FORMAT): Likewise.
3207 (SIGNATURE_OPTR_NAME): Likewise.
3208 (SIGNATURE_SPTR_NAME): Likewise.
3209 (SIGNATURE_POINTER_NAME): Likewise.
3210 (SIGNATURE_POINTER_NAME_FORMAT): Likewise.
3211 (SIGNATURE_REFERENCE_NAME): Likewise.
3212 (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise.
3213 (SIGTABLE_PTR_TYPE): Likewise.
3214 (SIGTABLE_NAME_FORMAT): Likewise.
3215 (SIGTABLE_NAME_FORMAT_LONG): Likewise.
3216 (SIGTABLE_TAG_NAME): Likewise.
3217 (SIGTABLE_VB_OFF_NAME): Likewise.
3218 (SIGTABLE_VT_OFF_NAME): Likewise.
3219 (finish_base_specifiers): Change prototype.
3220 (build_signature_pointer_type): Remove.
3221 (build_signature_reference_type): Remove.
3222 (build_signature_pointer_constructor): Remove.
3223 (build_signature_method_call): Remove.
3224 (build_optr_ref): Likewise.
3225 (append_signature_fields): Likewise.
3226 (signature_error): Likewise.
3227 * call.c (build_this): Remove signature support.
3228 (build_over_call): Likewise.
3229 (build_new_method_call): Likewise.
3230 * class.c (add_implicitly_declared_members): Likewise.
3231 (finish_struct_1): Likewise.
3232 (finish_struct): Likewise.
3233 * cvt.c (cp_convert_to_pointer): Likewise.
3234 (convert_to_pointer_force): Likewise.
3235 (ocp_convert): Likewise.
3236 * decl.c (sigtable_decl_p): Remove.
3237 (init_decl_processing): Remove support for signatures.
3238 (cp_finish_decl): Likewise.
3239 (grokdeclarator): Likewise.
3240 (grokparms): Likewise.
3241 (xref_tag): Likewise.
3242 (start_function): Likewise.
3243 (start_method): Likewise.
3244 * decl2.c (finish_sigtable_vardecl): Remove.
3245 (flag_handle_signatures): Remove.
3246 (lang_f_options): Remove handle-signatures.
3247 (grokfield): Remove support for signatures.
3248 (grokbitfield): Likewise.
3249 (finish_file): Likewise.
3250 (reparse_absdcl_as_casts): Likewise.
3251 * error.c (dump_type_real): Likewise.
3252 (dump_function_decl): Likewise.
3253 * friend.c (make_friend_class): Likewise.
3254 * gxx.gperf: Remove __signature__, signature, __sigof__, sigof.
3255 * hash.h: Regenerated.
3256 * init.c (build_new_1): Remove support for signatures.
3257 * lang-options.h: Remove -fhandle-signatures,
3258 -fno-handle-signatures.
3259 * lex.c (init_parse): Remove support for signatures.
3260 (yyprint): Likewise.
3261 * lex.h (rid): Remove RID_SIGNATURE.
3262 * method.c (build_decl_overload_real): Remove support for
3264 (hack_identifier): Likewise.
3265 * parse.y (base_class): Likewise.
3266 (base_class.1): Likewise.
3267 (access_specifier): Likewise.
3268 * search.c (lookup_member): Likewise.
3269 * semantics.c (finish_qualified_object_call_expr): Likewise.
3270 (finish_template_type_parm): Likewise.
3271 (begin_class_definition): Likewise.
3272 (finish_base_specifier): Likewise.
3274 * tree.c (build_cplus_method_type): Remove support for signatures.
3275 * typeck.c (require_complete_type): Likewise.
3276 (c_sizeof): Likewise.
3277 (c_alignof): Likewise.
3278 (build_object_ref): Likewise.
3279 (build_component_ref): Likewise.
3280 (build_indirect_ref): Likewise.
3281 (build_c_cast): Likewise.
3282 (build_modify_expr): Likewise.
3283 (convert_for_initialization): Likewise.
3284 * typeck2.c (signature_error): Remove.
3285 (store_init_value): Remove support for signatures.
3286 (digest_init): Likewise.
3287 (build_x_arrow): Likewise.
3288 (build_functional_cast): Likewise.
3289 * xref.c (GNU_xref_decl): Likewise.
3291 1999-08-10 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3293 * lex.c (do_identifier): Remove unnecessary lookup of class field.
3295 1999-08-09 Martin v. Loewis <martin@mira.isdn.cs.tu-berlin.de>
3297 * decl2.c (set_decl_namespace): Do not complain about non-matching
3298 decls if processing a template.
3300 1999-08-09 Mark Mitchell <mark@codesourcery.com>
3302 * decl.c (build_ptrmemfunc_type): Handle qualified
3303 pointer-to-member types here.
3304 * tree.c (cp_build_qualified_type_real): Simplify handling here.
3306 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3308 * lex.c (lang_identify): Likewise.
3310 1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
3312 * Makefile.in: Update dependencies.
3313 * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with
3315 * decl.c: Include "function.h"
3316 (cleanup_label, return_label): Delete declarations.
3317 (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX.
3318 (finish_function): Rename last_parm_insn variable to
3319 fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX.
3320 * decl2.c: Include "function.h".
3321 (rtl_expr_chain): Delete declaration.
3322 * method.c: Include "function.h"
3323 * tree.c (build_vbase_pointer_fields): Don't initialize
3324 DECL_SAVED_INSNS with NULL_RTX.
3325 * typeck.c: Include "function.h"
3327 1999-08-09 Jason Merrill <jason@yorick.cygnus.com>
3329 * semantics.c (begin_function_try_block, finish_function_try_block,
3330 finish_function_handler_sequence): New fns.
3331 * parse.y (function_try_block): Use them.
3332 * pt.c (instantiate_decl): Likewise.
3334 * cp-tree.h: Declare in_function_try_handler.
3335 * decl.c: Define it.
3336 (start_function): Clear it.
3337 (struct cp_function, push_cp_function_context): Save it.
3338 (pop_cp_function_context): Restore it.
3339 * parse.y (function_try_block): Set and clear it.
3340 * except.c (expand_end_catch_block): Rethrow if we reach the end
3341 of a function-try-block handler in a ctor or dtor.
3342 * typeck.c (c_expand_return): Complain about returning from a
3343 function-try-block handler of a ctor.
3345 * parse.y (function_try_block): Call end_protect_partials
3346 before expand_start_all_catch.
3348 1999-08-08 Jason Merrill <jason@yorick.cygnus.com>
3350 * decl.c (struct binding_level): Add eh_region field.
3351 (push_binding_level): Set it.
3352 (define_label): Complain about jumping into an EH block.
3354 * ptree.c (print_lang_type): Print the real type of a PMF.
3355 Print what exceptions a fn type throws.
3357 1999-08-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3359 * class.c (count_fields, add_fields_to_vec): Add static prototype.
3361 * cp-tree.h (opname_tab, assignop_tab, operator_name_string,
3362 get_id_2, composite_pointer_type, dump_node_to_file): Constify a
3365 * decl.c (named_label_list, cp_finish_decl, grokdeclarator):
3368 * decl2.c (finish_static_data_member_decl, grokfield): Constify a
3371 * dump.c (queue_and_dump_index, dump_int, dump_string,
3372 dump_string_field, dequeue_and_dump, dump_node_to_file): Constify
3374 (dump_stmt): Add static prototype.
3376 * errfn.c (cp_thing): Constify a char*.
3378 * error.c (dump_unary_op, dump_binary_op, aggr_variety,
3379 dump_aggr_type, dump_global_iord, dump_decl, dump_function_name,
3380 dump_expr): Constify a char*.
3382 * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc,
3383 read_line_number): Add static prototype.
3384 (opname_tab, assignop_tab, operator_name_string): Constify a char*.
3385 (real_yylex): Move label `letter' into the scope where it is used.
3387 * method.c (build_mangled_template_parm_index, build_overload_int,
3388 build_decl_overload_real, get_id_2): Constify a char*.
3390 * search.c (check_final_overrider): Make static.
3392 * typeck.c (composite_pointer_type): Constify a char*.
3394 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
3396 * pt.c (maybe_get_template_decl_from_type_decl): Make sure that
3397 we're looking at a class.
3399 * decl.c (lookup_name_real): Set the complain flag if we're
3400 looking for a namespace member.
3402 * lex.c (real_yylex): We can have a number with no digits.
3404 * cvt.c (cp_convert_to_pointer): Don't force pmf conversions.
3406 * search.c (binfo_from_vbase): New fn.
3407 * cp-tree.h: Declare it.
3408 * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion
3409 from pointer to member of virtual base.
3410 * typeck.c (get_delta_difference): Likewise.
3412 1999-08-06 Alexandre Oliva <oliva@dcc.unicamp.br>
3414 * pt.c (tsubst): Use build_index_type to build in-template array
3415 index type. Fixes g++.oliva/dwarf1.C.
3416 * decl.c (grokdeclarator): Likewise, just for consistency, as it
3417 doesn't seem to trigger the bug without it.
3419 1999-08-06 Jason Merrill <jason@yorick.cygnus.com>
3421 * typeck2.c (add_exception_specifier): Use complete_type.
3423 1999-08-06 Mark Mitchell <mark@codesourcery.com>
3425 * error.c (dump_expr): Handle EXACT_DIV_EXPR.
3426 (dump_binary_op): Bulletproof.
3427 * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR].
3428 * tree.c (search_tree): Don't enumerate all the nodes of classes
3429 `1', `2', and `<'; handle them generically. Don't be sorry about
3430 "unrecognized tree codes"; just abort.
3431 (no_linkage_check): Don't do linkage checks for templates.
3433 * tree.c (cp_build_qualified_type_real): Handle
3434 pointer-to-member-function types correctly.
3436 1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
3438 * decl.c (pushdecl): Only give an error for shadowing a parm
3439 from *this* function.
3441 Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
3443 * typeck2.c: Update URLs and mail addresses.
3445 1999-08-04 Nathan Sidwell <nathan@acm.org>
3447 * cp-tree.h (empty_except_spec): New global var.
3448 (compexcepttypes): Remove prototype.
3449 (comp_except_specs): Prototype new global function.
3450 (add_exception_specifier): Prototype new global function.
3451 * decl.c (empty_except_spec): Define new global var.
3452 (duplicate_decls): Use comp_except_specs, reword error message.
3453 (init_decl_processing): Initialize empty_except_spec.
3454 Adjust build_exception_variant calls.
3455 * parse.y (exception_specification_opt): Use empty_except_spec.
3456 (ansi_raise_identifier): Call check_for_new_type.
3457 (ansi_raise_identifiers): Use add_exception_specifier.
3458 * pt.c (tsubst): Use add_exception_specifier to build exception
3460 * search.c (check_final_overrider): New static function, broken
3461 out of get_matching_virtual. Check throw specifiers, reword
3463 (get_matching_virtual): Use check_final_overrider.
3464 * tree.c (build_exception_variant): Use comp_except_specs.
3465 * typeck.c (compexcepttypes): Remove.
3466 (comp_except_types): New static function, helper for
3467 comp_except_specs. Compare two types as exception specifiers.
3468 (comp_except_specs): New global function, compare two exception
3470 (comptypes): Adjust for comp_except_specs.
3471 * typeck2.c (add_exception_specifier): New global function.
3473 * class.c (check_for_override): Reword error message.
3475 1999-08-03 Nathan Sidwell <nathan@acm.org>
3477 * call.c (convert_arg_to_ellipsis): Use pod_type_p.
3478 * cp-tree.h (struct lang_type): Added non_pod_class flag.
3479 (CLASSTYPE_NON_POD_P): New macro to access it.
3480 * class.c (finish_struct_1): Determine non-PODness.
3481 Check for arrays of pointers (-Weffc++).
3482 Remove array inspection duplicated code.
3483 * tree.c (pod_type_p): Detect non-pod non-aggregate types.
3484 Use CLASSTYPE_NON_POD_P.
3486 1999-08-03 Nathan Sidwell <nathan@acm.org>
3488 * class.c (duplicate_tag_error): Preserve template information.
3490 1999-08-03 Nathan Sidwell <nathan@acm.org>
3492 * decl.c (start_enum): Show location of previous definition.
3493 * parse.y (enumlist_opt): New reduction.
3494 (structsp): Simplify enum rules to use enumlist_opt.
3496 1999-08-03 Jason Merrill <jason@yorick.cygnus.com>
3498 * lex.c (yyprint): Handle PFUNCNAME.
3500 * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only
3501 build_expr_from_tree on the args of a TEMPLATE_ID_EXPR.
3503 1999-08-03 Mumit Khan <khan@xraylith.wisc.edu>
3505 * decl.c (start_decl): Set attributes before duplicate_decls call.
3507 1999-08-02 Mark Mitchell <mark@codesourcery.com>
3509 * Make-lang.in (CXX_SRCS): Add dump.c.
3510 * Makefile.in (CXX_OBJS): Add dump.o.
3511 (dump.o): New target.
3512 * cp-tree.h (DECL_CONV_FN_P): Document.
3513 (DECL_OVERLOADED_OPERATOR_P): New function.
3514 (TYPE_PTRMEM_CLASS_TYPE): New macro.
3515 (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise.
3516 (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE.
3517 (ASM_VOLATILE_P): New macro.
3518 (STMT_LINENO): Likewise.
3519 (cp_namespace_decls): New function.
3520 (dump_node_to_file): New function.
3521 * decl.c (cp_namespace_decls): New function.
3522 (walk_namespaces_r): Use it.
3523 (wrapup_globals_for_namespace): Likewise.
3524 * decl2.c (flag_dump_translation_unit): New variable.
3525 (lang_decode_option): Handle -fdump-translation-unit.
3526 (finish_file): If flag_dump_translation_unit is set, dump the
3529 * lang-options.h: Add -fdump-translation-unit.
3530 * pt.c (tsubst_template_parms): Robustify.
3531 (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P.
3532 (tsubst_expr): Use STMT_LINENO.
3533 * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check
3534 for invalid cv-qualifiers even while building templates.
3536 1999-08-02 Richard Henderson <rth@cygnus.com>
3538 * call.c: Include defaults.h instead of expr.h.
3541 * typeck.c: Include defaults.h.
3543 1999-08-02 Mark Mitchell <mark@codesourcery.com>
3545 * lex.c (errorcount, sorrycount): Don't declare.
3546 * repo.c (errorcount, sorrycount): Likewise.
3547 * typeck2.c (errorcount, sorrycount): Likewise.
3549 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
3551 * call.c (convert_default_arg, build_over_call): Change all uses of
3552 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
3553 Ensure expr.h is included.
3554 * decl.c (grokparams): Ditto.
3555 * pt.c (tsubst_decl): Ditto.
3556 * typeck.c (convert_arguments): Ditto.
3558 1999-08-02 Jason Merrill <jason@yorick.cygnus.com>
3560 * class.c (mark_overriders): Fix order of args to overrides.
3561 (warn_hidden): Likewise. Fix for having virtual and non-virtual
3562 functions with the same name.
3564 1999-08-02 Richard Henderson <rth@cygnus.com>
3566 * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null.
3568 1999-08-01 Mark Mitchell <mark@codesourcery.com>
3570 * call.c (build_conditional_expr): Fix typo in comment.
3572 1999-08-01 Bernd Schmidt <bernds@cygnus.co.uk>
3574 * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack,
3575 case_stack; use in_control_zone_p.
3576 * typeck.c (c_expand_return): Likewise.
3578 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
3580 * except.c (catch_clauses): Delete declaration.
3582 1999-07-30 Mark Mitchell <mark@codesourcery.com>
3584 * call.c (build_conditional_expr): Call convert_from_reference to
3585 avoid reference/non-reference type confusion. Fix typo.
3587 1999-07-30 Richard Henderson <rth@cygnus.com>
3589 * typeck2.c (initializer_constant_valid_p): Moved to c-common.c.
3590 * cp-tree.h (initializer_constant_valid_p): Remove.
3592 1999-07-28 Mark Mitchell <mark@codesourcery.com>
3594 * call.c (conditional_conversion): Don't build BASE_CONVs for
3595 conversions between things that have the same type.
3596 (build_conditional_expr): Tweak.
3597 (convert_like): Some BASE_CONVs really do require the generation
3600 * init.c (perform_member_init): Don't go through build_modify_expr
3601 for simple initializations.
3603 1999-07-27 Jason Merrill <jason@yorick.cygnus.com>
3605 * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro.
3606 * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for
3607 virtual functions and MI. Simplify.
3609 * method.c: Remove prototype for largest_union_member.
3610 * pt.c (determine_specialization): Fix uninitialized warning.
3611 * lex.c (real_yylex): Likewise.
3613 1999-07-27 Mark Mitchell <mark@codesourcery.com>
3615 * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS
3618 * cp-tree.h (BINFO_VIRTUALS): Document new format.
3619 * class.c (modify_one_vtable): Change prototype accordingly.
3620 (modify_all_vtables): Likewise.
3621 (modify_all_direct_vtables): Likewise.
3622 (modify_all_indirect_vtables): Likewise.
3623 (build_vtable_entry_for_fn): New function.
3624 (set_rtti_entry): Simplify for new BINFO_VIRTUALS format.
3625 (modify_vtable_entry): Likewise.
3626 (add_virtual_function): Likewise.
3627 (build_vtbl_initializer): New function.
3628 (finish_vtbls): Simplify for new BINFO_VIRTUALS format.
3629 (fixup_vtable_deltas1): Likewise.
3630 (fixup_vtable_deltas): Likewise.
3631 (override_one_vtable): Likewise.
3632 (finish_struct_1): Likewise.
3634 * error.c (dump_expr): Likewise.
3635 * search.c (get_abstract_virtuals_1): Likewise.
3636 (get_abstract_virtuals): Likewise.
3637 (expand_upcast_fixups): Likewise.
3638 * tree.c (debug_binfo): Likewise.
3639 * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to
3640 __pure_virtual here.
3642 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3644 * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error
3645 as per 1999-07-26 change.
3647 * typeck.c (c_sizeof): Don't allow non-static data members.
3648 (expr_sizeof): Likewise.
3650 1999-07-26 Jason Merrill <jason@yorick.cygnus.com>
3652 * input.c (feed_input): Only touch lineno and input_filename
3653 if !USE_CPPLIB. Save the old values before setting the new ones.
3655 * input.c (feed_input): Add file, line parms.
3656 * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust.
3657 (real_yylex): Check linemode before input_redirected().
3659 * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL
3660 from op new to warning.
3662 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3664 * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion.
3665 * call.c: All uses changed.
3666 * typeck.c: Likewise.
3668 1999-07-26 Nathan Sidwell <nathan@acm.org>
3670 * exception.cc (__cplus_type_matcher): Match __eh_matcher
3673 1999-07-26 Mark Mitchell <mark@codesourcery.com>
3675 * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro.
3676 (ARITHMETIC_TYPE_P): Adjust definition for standard conformance.
3677 (strip_top_quals): Declare.
3678 (ncp_convert): Likewise.
3679 (type_after_usual_arithmetic_converions): Likewise.
3680 (composite_pointer_type): Likewise.
3681 * call.c (strip_top_quals): Don't make it static.
3682 (promoted_arithmetic_type_p): New function.
3683 (conditional_conversion): Likewise.
3684 (null_ptr_cst_p): Allow `false' as a NULL pointer constant.
3685 (standard_conversion): Use same_type_p. Don't build BASE_CONVs
3686 for converting a type to itself.
3687 (reference_binding): Honor LOOKUP_NO_TEMP_BIND.
3688 (implicit_conversion): Make sure the from and to types are
3690 (add_builtin_candidate): Correct handling of ?: operator.
3691 (add_builtin_candidates): Improve documentation.
3692 (build_conditional_expr): New function.
3693 (can_convert): Implement in terms of can_convert_arg.
3694 (ncp_convert): New function.
3695 * typeck.c (type_after_usual_arithmetic_conversions): New
3696 function, split out from common_type.
3697 (composite_pointer_type): New function, split out from
3698 build_conditional_expr.
3699 (common_type): Use type_after_usual_arithmetic_conversions.
3700 Remove redundant attribute merging.
3701 (comptypes): Tidy. Handle COMPLEX_TYPE.
3702 (build_binary_op_nodefault): Use null_ptr_cst_p.
3703 (build_conditional_expr): Remove.
3704 (convert_for_assignment): Use new conversion functions.
3706 * cp-tree.h (abstract_virtuals_error): Change declaration.
3707 * typeck2.c (abstract_virtuals_error): Check to see if an error
3708 ocurred, and return a boolean value accordingly.
3709 (build_functional_cast): Adjust accordingly.
3710 * class.c (finish_struct_1): Likewise.
3711 * cvt.c (ocp_convert): Likewise.
3712 * decl.c (cp_finish_decl): Likewise.
3713 (grokparams): Likewise.
3714 (grok_op_properties): Likewise.
3715 (start_function): Likewise.
3716 * init.c (build_new_1): Likewise.
3718 * pt.c (unify): Don't get confused by pointers-to-member functions.
3720 * search.c (build_cplus_new): Robustify.
3722 1999-07-24 Richard Henderson <rth@cygnus.com>
3724 * gxx.gperf (__builtin_va_arg): New.
3725 * parse.y (VA_ARG): New token.
3726 (unary_expr): Recognize it.
3728 Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com)
3730 * g++FAQ.texi: Deleted per Joe Buck's request.
3731 * Makefile.in: Corresponding changes.
3733 1999-07-23 Jason Merrill <jason@yorick.cygnus.com>
3735 * lex.c: Sync with C frontend.
3736 (whitespace_cr): New fn.
3737 (skip_white_space): Use it.
3738 (init_parse): Reorder.
3739 (yyprint): Support CONSTANT.
3740 (pragma_getc, pragma_ungetc): Bring back.
3741 (read_line_number): Change in_system_header directly.
3742 (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file.
3743 (parse_float): Update to C version.
3744 (yylex): Handle '$' under the letter case.
3745 Remove looking_for_typename handling.
3746 Support hex floating point constants.
3747 Follow C's lead for choosing type of integer constants.
3748 Rearrange stuff to match C frontend.
3749 (yyungetc, reinit_parse_for_block, yylex): Support indent_level.
3750 * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC.
3752 1999-07-23 Mark Mitchell <mark@codesourcery.com>
3754 * call.c (reference_binding): Tweak.
3755 (mayble_handle_implicit_object): Use direct_reference_binding to
3756 create the right implicit conversion sequence.
3758 1999-07-22 Mark Mitchell <mark@codesourcery.com>
3760 * pt.c (convert_nontype_argument): Don't call decl_constant_value
3761 if we're converting to a reference type.
3763 * call.c (NEED_TEMPORARY_P): New macro.
3764 (standard_conversion): Set it, for derived-to-base conversions.
3765 (reference_related_p): New function.
3766 (reference_compatible_p): Likewise.
3767 (convert_class_to_reference): Likewise.
3768 (direct_reference_binding): Likewise.
3769 (reference_binding): Rework for standards-compliance.
3770 (convert_like): Adjust accordingly.
3771 (maybe_handle_ref_bind): Simplify; the right conversion sequences
3772 are now built up in reference_binding.
3773 (initialize_reference): New function.
3774 * cp-tree.h (ICS_USER_FLAG): Document.
3775 (ICS_THIS_FLAG): Likewise.
3776 (ICS_BAD_FLAG): Likewise.
3777 (NEED_TEMPORARY_P): Likewise.
3778 (cp_lvalue_kind): New type.
3779 (real_lvalue_p): Return it.
3780 * error.c (dump_expr): Provide more accurate representation for
3782 * init.c (expand_default_init): Do not try to perform implicit
3783 conversions for a brace-enclosed initializer.
3784 * search.c (lookup_conversions): Document.
3785 * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate
3787 (real_lvalue_p): Adjust accordingly.
3788 (lvalue_p): Likewise.
3789 (build_cplus_new): Don't allow the creation of an abstract class.
3790 * typeck.c (convert_for_initialization): Use initialize_reference.
3792 1999-07-21 Gavin Romig-Koch <gavin@cygnus.com>
3794 * lex.c (real_yylex) : Correct the test for overflow when lexing
3797 1999-07-20 Jason Merrill <jason@yorick.cygnus.com>
3799 * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL,
3800 not DECL_BUILT_IN, to determine if a function is internally declared.
3801 (duplicate_decls): Likewise. Improve handling of builtins.
3802 (push_overloaded_decl): Remove special handling of builtins.
3804 * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P.
3806 * decl.c (grokdeclarator): Pull out decl_constant_value in
3809 * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm.
3810 * cp-tree.h, pt.c, semantics.c: Adjust.
3811 * method.c (largest_union_member): Remove.
3813 * lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
3815 * lex.c (token_getch, token_put_back): New fns.
3816 (real_yylex): Use them.
3818 * lex.c (lang_init): Generalize.
3819 (lang_init_options): Tell cpplib this is C++.
3820 (nextchar): Remove. Replace uses with put_back.
3821 (skip_white_space): Handle linemode here. Optimize for cpplib.
3822 (extend_token_buffer_to): New fn.
3823 (extend_token_buffer): Use it.
3824 (read_line_number, check_newline): Just deal with tokens.
3825 (real_yylex): More cpplib optimizations. Simplify. Don't produce
3826 EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here.
3827 * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING.
3828 * parse.y (PAREN_STAR_PAREN): Remove.
3829 * input.c: Don't use the putback machinery with cpplib.
3830 (sub_getch): Fold back into getch.
3831 (getch): Don't handle linemode here.
3832 (feed_input): Unget any text in the token buffer.
3834 * lex.c (set_typedecl_interface_info, set_vardecl_interface_info,
3835 nextyychar, nextyylval): Remove.
3837 1999-07-20 Michael Tiemann <tiemann@holodeck.cygnus.com>
3838 Jason Merrill <jason@yorick.cygnus.com>
3840 * lex.c (indent_level): New variable.
3841 (init_parse): Set cpp_token to CPP_DIRECTIVE.
3842 (consume_string): Make this smart about USE_CPPLIB.
3843 (yyungetc): Use put_back function.
3844 (pragma_getc, pragma_ungetc): Functions deleted.
3845 (check_newline): Rewrite to be intelligent about USE_CPPLIB.
3846 Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and
3848 (real_yylex): Rewrite to be intelligent about USE_CPPLIB.
3849 Also, clean up cases where we redundantly set token_buffer[0].
3850 (read_line_number): New fn.
3851 * input.c (feed_input): Use integrated cpplib if USE_CPPLIB.
3852 (end_input): Call cpp_pop_buffer if USE_CPPLIB.
3853 (sub_getch): Conditionalize out code that's not appropriate if
3855 (put_back): Rewrite in case USE_CPPLIB is defined.
3856 (input_redirected): Ditto.
3858 Tue Jul 20 11:24:19 1999 Bernd Schmidt <bernds@cygnus.co.uk>
3860 * cp-tree.h: Delete lots of declarations of tree nodes; replaced by
3861 c_global_trees and accessor macros defined in c-common.h.
3862 (cp_tree_index): New enumeration.
3863 (cp_global_trees): Declare new array. Add accessor macros for it, and
3864 delete declarations of tree nodes replaced by it.
3865 (builtin_function): Delete macro, add declaration for new function.
3867 * decl.c: Delete definitions for tree nodes that were replaced by
3868 cp_global_trees and c_global_trees.
3869 (init_decl_processing): Call c_common_nodes_and_builtins; delete code
3870 to generate the common builtins here.
3871 (builtin_function): New function.
3872 * decl2.c (abort_fndecl): Delete declaration.
3873 * except.c (expand_builtin_return_address): Delete declaration.
3874 (builtin_return_address_fndecl): Delete variable.
3875 (const_ptr_type_node): Delete declaration.
3876 * lex.c (cons_up_default_function): Delete declaration of
3878 * parse.y (void_list_node): Delete declaration.
3879 * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type):
3881 (const_string_type_node): Delete declaration.
3882 * search.c (abort_fndecl): Delete declaration.
3883 * Makefile.in: Update dependencies.
3885 1999-07-19 Mark Mitchell <mark@codesourcery.com>
3887 * pt.c (check_default_tmpl_args): Move test for missing default
3888 arguments here, from ...
3889 (end_template_parm_list): Here.
3891 1999-07-18 Mark Mitchell <mark@codesourcery.com>
3893 * decl.c (lookup_nested_type): Remove.
3894 (pushtag): Don't call it.
3896 Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com)
3898 * Makefile.in (INTERFACE): Bump to 2.
3900 1999-07-17 Alexandre Oliva <oliva@dcc.unicamp.br>
3902 * typeck2.c (my_friendly_abort): Updated URL with bug reporting
3903 instructions to gcc.gnu.org. Removed e-mail address.
3905 1999-07-17 Mark Mitchell <mark@codesourcery.com>
3907 * pt.c (determine_specialization): Tighten error-checking.
3908 (end_template_parm_list): Likewise.
3910 1999-07-14 Mark Mitchell <mark@codesourcery.com>
3912 * pt.c (check_default_tmpl_args): Handle friends defined in the
3913 class just like member functions defined in the class.
3915 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
3916 Jason Merrill <jason@yorick.cygnus.com>
3918 * cp-tree.h (struct lang_decl): Added field for storing sorted
3919 FIELD_DECLs (used in TYPE_DECLs).
3920 (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union.
3921 (DECL_SORTED_FIELDS): New macro.
3922 * class.c (method_name_cmp): New function.
3923 (finish_struct_methods): Modified to support sorting and searching
3925 (finish_struct_anon): Changed code in inner loop to use ELT rather
3926 than UELT (which required an extra indirection for every reference).
3927 (field_decl_cmp): New function to support sorting FIELD_DECLs.
3928 (finish_struct_1): Sort fields.
3929 * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them.
3930 (lookup_fnfields_1): Search sorted methods in METHOD_VEC.
3931 Also, switch to using array indexing rather than a changing pointer.
3932 * ptree.c (print_lang_decl): Handle TYPE_DECLs that have
3935 1999-07-09 Jason Merrill <jason@yorick.cygnus.com>
3937 * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style
3938 casts in system headers or extern "C" blocks.
3940 * pt.c (do_decl_instantiation): Downgrade duplicate instantiation
3943 1999-07-09 Michael Tiemann <tiemann@happy.cygnus.com>
3945 * decl2.c (write_virtuals): Deleted declaration.
3946 * cp-tree.h (write_virtuals): Deleted extern declaration.
3947 * class.c (finish_struct_1): Removed #if 0'd code that mentions
3949 * semantics.c (begin_class_definition): Rewrite code to not depend
3952 * lex.c (cp_pragma_interface): New function.
3953 (cp_pragma_implementation): Likewise.
3954 (handle_cp_pragma): Call them.
3956 * typeck.c (comptypes): Simplify C code in look_hard.
3958 * xref.c (PALLOC): Use xcalloc, not calloc.
3959 (SALLOC): Use xmalloc, not malloc.
3961 * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary.
3963 * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS
3966 * decl.c (duplicate_decls): If a redeclaration doesn't match the
3967 initial declaration, then don't save the inline info and by all
3968 means don't mark the function as a builtin function.
3970 * decl.c (lookup_name_real): Set NONCLASS to 1 if
3971 CURRENT_CLASS_TYPE is 0.
3973 * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to
3976 * ptree.c (print_lang_type): Added vtable-needs-writing.
3978 Wed Jul 7 01:26:47 1999 Alexandre Oliva <oliva@dcc.unicamp.br>
3980 * decl2.c (mark_vtable_entries): Fix check for rtti offset.
3982 1999-07-06 Gavin Romig-Koch <gavin@cygnus.com>
3984 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
3985 Merged into c-common.
3987 1999-07-05 Dave Brolley <brolley@cygnus.com>
3989 * lex.c (errorcount): Declare it.
3990 (finish_parse): Update errorcount for when using CPPLIB.
3992 1999-07-05 Mark Mitchell <mark@codesourcery.com>
3994 * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
3996 (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
3997 * decl.c (push_class_binding): Use it.
3998 (lookup_name_real): Likewise.
4000 1999-07-02 Gavin Romig-Koch <gavin@cygnus.com>
4002 * cp-tree.h (widest_integer_literal_type_node,
4003 widest_unsigned_literal_type) : New.
4004 * decl.c (widest_integer_literal_type_node,
4005 widest_unsigned_literal_type) : New.
4006 (init_decl_processing): Handle/use the two new types.
4007 * lex.c (real_yylex): Same.
4008 * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) :
4011 1999-07-01 Mark Mitchell <mark@codesourcery.com>
4013 * decl.c (grokdeclarator): Don't give names "for linkage purposes"
4014 to anonymous cv-qualified types.
4016 1999-07-01 Gavin Romig-Koch <gavin@cygnus.com>
4018 * lex.c (real_yylex) : Change integer literal overflow handling to
4021 * lex.c (real_yylex): Improve 'integer constant out of range' messages.
4023 1999-06-28 Richard Henderson <rth@cygnus.com>
4025 * decl.c (cp_finish_decl): Fix typo in cp_warning_at call.
4027 1999-06-28 Jason Merrill <jason@yorick.cygnus.com>
4029 * error.c (dump_type_real): Handle TREE_LIST again.
4031 * typeck.c (comp_target_parms): Don't complain about
4032 converting from () to (...) if !flag_strict_prototype.
4034 * decl.c (grokdeclarator): Update the names of all variants when
4037 1999-06-21 Mark Mitchell <mark@codesourcery.com>
4039 * init.c (expand_aggr_vbase_init): Rename to
4040 construct_virtual_bases. Conditionalize construction here,
4042 (emit_base_init): Here.
4044 1999-06-19 Mark Mitchell <mark@codesourcery.com>
4046 * semantics.c (finish_asm_statement): Apply decay conversions to
4049 * decl.c (expand_static_init): When building an anonymous function
4050 for use with atexit, compute its body before and after entering
4053 * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
4056 1999-06-18 Mark Mitchell <mark@codesourcery.com>
4058 * init.c (expand_aggr_vbase_init): Add flag parameter.
4059 (build_partial_cleanup_for): Remove, inlining into ..
4060 (expand_cleanup_for_base): ... here. Take flag parameter.
4061 (emit_base_init): Pass the in_chrg parameter to
4062 emit_aggr_vbase_init.
4063 (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.
4065 1999-06-16 Mark Mitchell <mark@codesourcery.com>
4067 * decl2.c (import_export_decl): Use same_type_p, rather than
4068 relying on pointer-equality for types.
4070 * method.c (do_build_copy_constructor): Simplify.
4072 * call.c (build_method_call): Remove bogus code for two-argument
4074 * init.c (build_new_1): Expand on comment, and remove dead code.
4076 * init.c (expand_cleanup_for_base): New function, split out
4078 (emit_base_init): Here.
4079 (expand_aggr_vbase_init): Use it.
4081 1999-06-15 Mark Mitchell <mark@codesourcery.com>
4083 * cp-tree.h (class_cache_firstobj): Declare.
4084 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4085 * class.c (permanent_obstack): Remove declaration.
4086 (class_cache_firstobj): Make it global.
4087 (add_method): Don't use permanent_obstack directly.
4088 (pushclass): Only free the class_cache_obstack if we know how far
4090 (maybe_push_cache_obstack): Rename to push_cache_obstack.
4091 * decl.c: Remove dead comment.
4092 (saved_scope): Add class_cache_firstobj.
4093 (push_to_top_level): Save it.
4094 (pop_from_top_level): Restore it.
4095 (push_class_level_binding): Use push_cache_obstack, not
4096 maybe_push_cache_obstack.
4097 * search.c (push_class_decls): Likewise.
4099 1999-06-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
4101 * pt.c (tsubst_friend_function): Push into namespace of friend
4102 function before pushdecl'ing it.
4104 1999-06-14 Nathan Sidwell <nathan@acm.org>
4106 * call.c (build_new_op): Remove REF_BIND from all operands.
4108 1999-06-13 Alexandre Oliva <oliva@dcc.unicamp.br>
4110 * init.c (build_new_1): Look up operator delete even if there was
4111 no explicit new placement.
4113 1999-06-08 Nathan Sidwell <nathan@acm.org>
4115 * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
4117 (build_throw): ... here. Call it.
4118 (process_start_catch_block): Call it.
4120 1999-06-07 Mark Mitchell <mark@codesourcery.com>
4122 * search.c (convert_pointer_to_single_level): Reimplement without
4125 1999-06-06 Mark Mitchell <mark@codesourcery.com>
4127 * method.c (is_back_referenceable_type): Back-reference bools when
4130 1999-06-07 Dave Brolley <brolley@cygnus.com>
4132 * lex.c (real_yylex): Replace unused bytes from bad multibyte char.
4133 * input.c (putback_buffer): New structure type.
4134 (putback): Replaces putback_char member.
4135 (putback): Replaces putback_char static variable.
4136 (feed_input): Use putback.
4137 (end_input): Use putback.
4138 (sub_getch): Use putback.
4139 (put_back): Use putback.
4141 1999-06-05 Mark Mitchell <mark@codesourcery.com>
4143 * decl.c (grokdeclarator): Fix typo in last change.
4145 1999-06-04 Jason Merrill <jason@yorick.cygnus.com>
4147 * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
4148 (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.
4150 1999-06-04 Nathan Sidwell <nathan@acm.org>
4152 * except.c (build_throw): Check throw expression validity.
4154 1999-06-03 Mark Mitchell <mark@codesourcery.com>
4156 * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
4157 just because flag_signed_bitfields is false.
4159 1999-06-03 Nathan Sidwell <nathan@acm.org>
4161 * semantics.c (begin_class_definition): Update the struct's
4163 * class.c (finish_struct): ... rather than here.
4165 * decl.c (make_typename_type): Don't rely on uninitialized
4168 1999-05-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4170 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
4172 1999-05-31 Mark Mitchell <mark@codesourcery.com>
4174 * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
4175 and friends rather than messing with current_obstack directly.
4176 (cp_build_qualified_type_real): Rework ARRAY_TYPE
4177 allocation to match practice throughout the rest of the
4180 1999-05-30 Mark Mitchell <mark@codesourcery.com>
4182 * lex.c (make_lang_type): Create TYPE_BINFO for
4183 TEMPLATE_TYPE_PARMs just like for non-template types.
4185 * decl.c (start_decl): Move checks on initialization to ...
4186 (cp_finish_decl): Here. Tidy formatting slightly.
4188 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4190 * decl.c (add_binding): Don't complain about a redeclaration of a
4191 semantically identical typedef in a local scope.
4193 1999-05-28 Nathan Sidwell <nathan@acm.org>
4195 * decl.c (complete_array_type): Allocate off same obstack. Fix
4196 DO_DEFAULT comment to match reality.
4198 * friend.c (make_friend_class): Fix diagnostic typo.
4200 1999-05-28 Mark Mitchell <mark@codesourcery.com>
4202 * decl.c (lookup_namespace_name): Handle getting a
4204 (expand_static_init): Don't call pushdecl for implicitly declared
4205 `atexit' used to register destructors.
4207 1999-05-25 Mark Mitchell <mark@codesourcery.com>
4209 * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
4212 * cp-tree.h (NAMESPACE_LEVEL): Reformat.
4213 (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes
4214 by combining TEMPLATE_INFO and LEVEL into a single union.
4215 (DECL_TEMPLATE_INFO): Reformat.
4216 (DECL_SAVED_TREE): Document.
4217 (DECL_TEMPLATE_INJECT): Remove.
4218 * class.c (finish_struct): Remove code to deal with
4219 DECL_TEMPLATE_INJECT.
4221 * decl.c (maybe_process_template_type_declaration): Handle all new
4222 types in templates uniformly.
4223 * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
4225 * pt.c (lookup_template_class): Inject template instantiations of
4226 forward-declarations.
4227 (instantiate_class_template): Remove code processing
4228 DECL_TEMPLATE_INJECT.
4230 * pt.c (lookup_template_class): Tweak lookup to find member
4233 * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
4235 * semantics.c (finish_asm_stmt): Make strings permanent if they're
4238 1999-05-25 Jason Merrill <jason@yorick.cygnus.com>
4240 * typeck.c (casts_away_constness, casts_away_constness_r): Strip both
4241 parts of pointer to data member types.
4243 1999-05-24 Mark Mitchell <mark@codesourcery.com>
4245 * decl2.c (mark_vtable_entries): Don't make a copy of a function,
4246 and then make it look like `abort'. Just use `abort' instead.
4248 * typeck.c (build_static_cast): Don't allow static_casts that cast
4250 (casts_away_constness_r): New function.
4251 (casts_away_constness): Likewise.
4253 * decl.c (lookup_tag): Remove code no longer needed after
4254 name-lookup improvements.
4255 * decl2.c (handle_class_head): Make error-recovery more robust.
4256 * friend.c (make_friend_class): Reject templated typename types.
4257 * lex.c (is_global): A template parameter isn't global.
4258 * parse.y (class_head): Robustify.
4259 * parse.c: Regenerated.
4261 1999-05-22 Mark Mitchell <mark@codesourcery.com>
4263 * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
4264 INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs.
4266 * cp-tree.h (push_nested_namespace): Declare.
4267 (pop_nested_namespace): Likewise.
4268 * decl.c (push_nested_namespace): New function.
4269 (pop_nested_namespace): Likewise.
4270 * pt.c (instantiate_class_template): Use them.
4272 * tree.c (mapcar): Handle NON_LVALUE_EXPR.
4274 * cp-tree.h (cplus_expand_constant): Declare.
4275 * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
4276 converted from one pointer-to-object type to another.
4277 * expr.c (cplus_expand_constant): Don't make it static.
4278 * typeck.c (build_component_ref): Don't crash when presented with
4279 a component which is a TEMPLATE_DECL.
4280 (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a
4281 cast from a pointer-to-member constant to its own type does not
4282 result in a valid non-type template argument.
4284 1999-05-21 Mark Mitchell <mark@codesourcery.com>
4285 Nathan Sidwell <nathan@acm.org>
4287 * Make-lang.in (cc1plus): Make it depend on gxx.gperf.
4288 * cp-tree.h: Fix typo in documentation on pointers-to-members.
4289 (cp_build_qualified_type): Make it a macro.
4290 (cp_build_qualified_type_real): Declare.
4291 * decl.c (grokdeclarator): Remove misleading comment. Avoid
4292 problem with template parameters and restrict-qualification.
4293 * gxx.gperf: Replace NORID with RID_UNUSED throughout.
4294 * hash.h: Regenerated.
4295 * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
4297 (NORID): Remove definition.
4298 * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
4299 (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs.
4300 (fn_type_unification): Check that the function type resulting from
4301 the deduction is legal.
4302 (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
4303 (unify): Use cp_build_qualified_type_real.
4304 * tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
4305 (cp_build_qualified_type): Rename to ...
4306 (cp_build_qualified_type_real): Add additional COMPLAIN parameter
4307 and modify appropriately.
4309 * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
4310 reveal optimization opportunities.
4312 * pt.c (tsubst): Don't issue error messages when we're not
4313 complaining, even if we see a qualified function type.
4314 (check_cv_quals_for_unify): Don't allow a qualified function
4317 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
4319 * class.c (instantiate_type): Downgrade errors for object-dependent
4320 memfn refs to pedwarn.
4322 1999-05-20 Mark Mitchell <mark@codesourcery.com>
4324 * decl.c (grokdeclarator): Don't treat [] as indicating a
4325 zero-sized array in a typedef.
4327 * call.c (build_object_call): Don't look at DECL_NAME for a type.
4328 (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
4329 (typeck.c): Or TYPE_MAIN_VARIANT for a type.
4331 * pt.c (for_each_template_parm): Rework to match documentation.
4332 Don't be fooled by a COMPONENT_REF with no TREE_TYPE.
4334 1999-05-20 Jason Merrill <jason@yorick.cygnus.com>
4336 * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
4338 * class.c (finish_base_struct): Allow non-COM bases for COM classes
4339 except at the leftmost position.
4340 (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
4341 Pass the binfo's class, not the most derived, to skip_rtti_stuff.
4342 * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.
4344 * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
4345 (build_cplus_new): Make sure that what we return is of the right type.
4347 1999-05-20 Mark Mitchell <mark@codesourcery.com>
4349 * cp-tree.h (make_ptrmem_cst): New function.
4350 * expr.c (cplus_expand_constant): Split out from ...
4351 (cplus_expand_expr): Here. Use cplus_expand_constant.
4352 (init_cplus_expand): Set lang_expand_constant.
4353 * pt.c (convert_nontype_argument): Use make_ptrmem_cst.
4355 * tree.c (make_ptrmem_cst): Define.
4356 * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
4357 * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.
4359 1999-05-19 Mark Mitchell <mark@codesourcery.com>
4361 * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
4363 * decl2.c (start_static_storage_duration_function): Fix comment.
4364 (finish_file): Create static storage duration functions lazily.
4366 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
4368 Implement anonymous structs.
4369 * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
4370 * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
4371 * class.c (finish_struct_1): Remove redundant check for anon struct.
4372 * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
4373 (check_tag_decl): Check for anonymous struct here.
4374 * decl2.c (build_anon_union_vars): Catch anon struct at file scope.
4375 * init.c (sort_member_init, emit_base_init): Handle getting fields
4376 as well as names in current_member_init_list.
4377 (perform_member_init): Handle getting an anon aggr.
4378 * method.c (do_build_assign_ref): Don't descend into anon aggrs.
4379 (do_build_copy_constructor): Likewise.
4381 1999-05-19 Mark Mitchell <mark@codesourcery.com>
4383 * tree.c (cp_build_qualified_type): Don't allow qualified function
4386 Wed May 19 02:50:53 1999 Arvind Sankar <arvinds@mit.edu>
4388 * gxxint.texi: Fix typo.
4390 1999-05-19 Jason Merrill <jason@yorick.cygnus.com>
4392 * call.c (find_scoped_type, resolve_scope_to_name): Lose.
4393 * class.c (finish_struct_1): Use CLASS_TYPE_P.
4394 * ptree.c (print_lang_type): Likewise.
4395 * typeck.c (build_modify_expr, c_expand_asm_operands): Use
4397 * typeck2.c (digest_init): Likewise.
4399 1999-05-18 Jason Merrill <jason@yorick.cygnus.com>
4401 * call.c (joust): Compare the types of the conv ops, not the
4402 target types of the conversions.
4404 Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
4406 * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
4409 1999-05-17 Mark Mitchell <mark@codesourcery.com>
4411 * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation.
4412 * decl.c (grokfndecl): Don't allow inline declarations of friend
4413 template specializations, or friend template specializations with
4415 * pt.c (tsubst): Handle substitution into array types that does
4416 not yield a fixed upper bound, even when not processing a
4418 (tsubst_copy): Deal with the fact that the second operand to a
4419 TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC.
4420 * search.c (marked_pushdecls_p): Don't descend into
4421 TEMPLATE_TYPE_PARMs and the like.
4422 (unmarked_pushdecls_p): Likewise.
4424 * call.c (build_over_call): Don't throw away
4425 initializations/copies of empty classes; use MODIFY_EXPR and
4426 INIT_EXPR as for non-empty classes.
4427 * class.c (finish_struct_1): Put the padding byte for an empty
4428 class on the TYPE_NONCOPIED_PARTS list for the class.
4430 1999-05-16 Mark Mitchell <mark@codesourcery.com>
4432 * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
4433 indicate a reference to a field that is a qualified name.
4435 1999-05-16 Jason Merrill <jason@yorick.cygnus.com>
4437 * decl2.c (finish_objects): Don't use .?tors.* if we don't have
4438 ASM_OUTPUT_CONSTRUCTOR.
4440 * friend.c (do_friend): Add attrlist arg. Remove support for
4441 getting a non-decl as 'decl'.
4442 * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or
4444 (grokdeclarator): Adjust.
4445 * cp-tree.h: Adjust.
4447 1999-05-16 Mark Mitchell <mark@codesourcery.com>
4449 * cp-tree.h (permanent_p): New function.
4450 * init.c (build_new_1): Use mapcar, not copy_node, to copy a
4451 possibly complex tree node.
4452 * tree.c (mapcar): Adjust comments, and follow coding standards in
4454 (permanent_p): New function.
4456 1999-05-13 Per Bothner <bothner@cygnus.com>
4458 * class.c (push_lang_context): Turn off DECL_IGNORED_P for
4459 primitive Java types, if we actually see `extern "Java"'.
4461 1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
4463 * lang-specs.h: Pass -$ to the preprocessor.
4465 1999-05-10 Jason Merrill <jason@yorick.cygnus.com>
4467 * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too.
4468 Don't bother wrapping an OFFSET_TYPE around unknown_type_node.
4469 (resolve_offset_ref): Don't handle a raw baselink.
4470 * cvt.c (build_expr_type_conversion): Likewise.
4471 * typeck.c (decay_conversion, build_c_cast, convert_for_assignment,
4472 convert_for_initialization): Likewise.
4473 * class.c (instantiate_type): Handle seeing a baselink under an
4475 * error.c (dump_expr): Likewise.
4476 * pt.c (for_each_template_parm): Likewise.
4477 (resolve_overloaded_unification): Likewise.
4478 * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise.
4479 * typeck.c (expr_sizeof): Also complain about other permutations
4480 of overloaded functions.
4482 1999-05-07 Jason Merrill <jason@yorick.cygnus.com>
4484 * init.c (resolve_offset_ref): Don't return a raw method.
4486 * typeck.c (decay_conversion): Don't handle a raw method.
4487 Resolve all OFFSET_REFs.
4488 (get_member_function_from_ptrfunc): 0 is a valid vtable index.
4489 (build_binary_op_nodefault): Handle resolving overloaded fns. Use
4490 same_type_p for pmf bits. Don't use build_binary_op to compare
4491 raw pointers to methods.
4492 (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE,
4493 to decide when to call resolve_offset_ref.
4494 (build_c_cast, convert_for_initialization): Likewise.
4495 * cvt.c (build_expr_type_conversion): Likewise.
4497 1999-05-06 Nathan Sidwell <nathan@acm.org>
4499 * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class.
4501 1999-05-05 Mark Mitchell <mark@codesourcery.com>
4503 * decl2.c (start_objects): Don't let static constructors and
4504 destructors get inlined.
4506 * parse.y (nested_name_specifier): Make sure ordinary types are
4507 complete, just like template types.
4508 * parse.c: Regenerated.
4510 * pt.c (check_explicit_specialization): Improve error messages.
4512 1999-05-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
4514 * typeck.c (string_conv_p): Use same_type_p to check whether we
4515 try to convert between char and wchar_t.
4517 1999-05-03 Mark Mitchell <mark@codesourcery.com>
4519 * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous
4520 lookup to error_mark_node here.
4521 (lookup_member): Revise documentation. Add comments. Don't set
4522 the TREE_TYPE to error_mark_node here, and don't build up an extra
4523 TREE_LIST for ambiguous lookups.
4524 (setup_class_bindings): Adjust accordingly.
4525 (push_class_decls): Revise out-of-date comments.
4527 * typeck.c (build_const_cast): Tighten checks for legality.
4529 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
4531 * init.c (build_member_call): Lookup names coming from
4532 namespace-scoped LOOKUP_EXPR.
4534 1999-05-03 Jim Blandy <jimb@zwingli.cygnus.com>
4536 * gxxint.texi: Add documentation for 'I'.
4538 1999-05-02 Martin von Löwis <loewis@informatik.hu-berlin.de>
4540 * tinfo.cc (operator==): Qualify type_info with std::.
4542 1999-05-02 Mark Mitchell <mark@codesourcery.com>
4544 * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy.
4545 (DECL_COMDAT): Remove definition.
4547 1999-05-01 Mark Mitchell <mark@codesourcery.com>
4549 * decl.c (wrapup_globals_for_namespace): Fix thinko in previous
4552 1999-04-30 Mark Mitchell <mark@codesourcery.com>
4554 * class.c (build_vtable): Use build_lang_decl when building
4555 vtables, not just build_decl.
4556 (prepare_fresh_vtable): Likewise.
4557 * decl.c (wrapup_globals_for_namespace): Mark vtables as
4558 DECL_EXTERNAL when calling wrapup_global_declarations.
4559 * decl2.c (priority_info_s): Add initializations_p and
4560 destructions_p members.
4561 (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED,
4562 when deciding what vtables to write out.
4563 (ssdf_decls): New variable.
4564 (ssdf_decls_used): Likewise.
4565 (start_static_storage_duration_function): Deal with being called
4566 multiple times. Avoid inlining this function.
4567 (generate_inits_for_priority): Deal with reuse of priority map.
4568 (get_priority_info): Clear initializations_p and destructions_p.
4569 (do_static_initialization): Tweak comment.
4570 (do_static_destruction): Likewise. Fix condition on sentries for
4572 (generate_ctor_or_dtor_function): Call all of the static storage
4574 (generate_ctor_or_dtor_function_for_priority): Check
4575 initializations_p and destructions_p to see what priorities need
4576 initialization functions.
4577 (finish_file): Rework to generate multiple static storage duration
4578 functions, rather than just one.
4580 * typeck.c (build_const_cast): Tweak last change to handle
4581 templates correctly.
4583 * typeck.c (build_const_cast): Disallow use of const_cast to
4584 anything but a pointer or reference type.
4586 1999-04-30 Nathan Sidwell <nathan@acm.org>
4588 * decl.c (cp_finish_decl): Don't permit arrays of abstract or
4591 1999-04-29 Mark Mitchell <mark@codesourcery.com>
4593 * decl2.c (do_static_destruction): Remove obsolete FIXME comment.
4594 (finish_file): Indent comments properly.
4596 1999-04-29 Richard Henderson <rth@cygnus.com>
4598 * decl2.c (do_static_initialization): Call do_pending_stack_adjust.
4599 (do_static_destruction): Likewise.
4601 1999-04-29 Nathan Sidwell <nathan@acm.org>
4603 * cp-tree.h (TYPE_NOTHROW_P): New macro.
4604 * decl2.c (delete_sanity): Warn on deleting void *.
4605 * init.c (build_new_1): Use TYPE_NOTHROW_P.
4606 * typeck.c (c_expand_return): cp_pedwarn on returning NULL from
4607 throwing operator new.
4609 1999-04-28 Nathan Sidwell <nathan@acm.org>
4611 * cp-tree.h (build_component_addr): Remove prototype.
4612 * typeck.c (build_component_addr): Make static. Remove MSG
4614 (build_component_addr): Remove MSG parameter, clean up
4616 (build_x_function_call): Use cp_error.
4617 (build_unary_op): Adjust call of build_component_addr.
4619 1999-04-28 Mark Mitchell <mark@codesourcery.com>
4621 * pt.c (tsubst_friend_class): Check for NULL.
4623 Wed Apr 28 11:42:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
4625 * search.c (binfo_for_vtable): Initialize bfvi.var.
4627 1999-04-27 Nathan Sidwell <nathan@acm.org>
4629 * rtti.c (build_x_typeid): Check rtti is enabled.
4631 1999-04-26 Mark Mitchell <mark@codesourcery.com>
4633 * search.c (is_subobject_of_p): Make sure we're looking at the
4636 1999-04-26 Marc Espie <espie@cvs.openbsd.org>
4638 * Make-lang.in (cplib2.ready): Don't depend on phony targets.
4640 1999-04-23 Mark Mitchell <mark@codesourcery.com>
4642 * decl2.c (finish_file): Tweak handling of extern inlines so that
4643 they are not unnecessarily put out.
4645 * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and
4646 such as base classes.
4648 1999-04-22 Brendan Kehoe <brendan@cygnus.com>
4650 * tree.c (build_exception_variant): Fix typo: use the chain of U,
4651 not trying V, while cycling through U.
4653 1999-04-22 Mark Mitchell <mark@codesourcery.com>
4655 * cp-tree.h (lang_decl_flags): Remove returns_first_arg and
4656 preserves_first_arg. Enlarge dummy accordingly.
4657 (DECL_TINFO_FN_P): New macro.
4658 (SET_DECL_TINFO_FN_P): Likeiwse.
4659 (DECL_RETURNS_FIRST_ARG): Remove.
4660 (DECL_PRESERVES_THIS): Likewise.
4661 (DECL_INIT_PRIORITY): New macro.
4662 (finish_struct_1): Change prototype.
4663 (cat_namespace_levels): Remove prototype.
4664 (vtable_decl_p): New prototype.
4665 (vtype_decl_p): Likewise.
4666 (sigtable_decl_p): Likewise.
4667 (walk_globals_pred): New typedef.
4668 (walk_globals_fn): Likewise.
4669 (walk_globals): New prototype.
4670 (walk_namespaces_fn): New typedef.
4671 (walk_namespaces): New prototype.
4672 (wrapup_globals_for_namespace): Likewise.
4673 (walk_vtables): Remove prototype.
4674 (walk_sigtables): Likewise.
4675 (instantiate_pending_templates): New prototype.
4676 * class.c (finish_struct_1): Don't return a value.
4677 * decl.h (pending_statics): Remove declaration.
4678 * decl.c (walk_namespaces_r): New function.
4679 (walk_globals_r): Likewise.
4680 (vtable_decl_p): Likewise.
4681 (vtype_decl_p): Likewise.
4682 (sigtable_decl_p): Likewise.
4683 (walk_namespaces): Likewise.
4684 (walk_globals_data): New type.
4685 (walk_globals): New function.
4686 (wrapup_globals_for_namespace): Likewise.
4687 (expand_static_init): Remove assertion. Remove redundancy in
4688 conditional. Don't put static data members in static_aggregates
4690 (finish_function): Remove redundancy in conditional. Don't set
4691 DECL_RETURNS_FIRST_ARG.
4692 (cat_namespace_levels): Remove.
4693 * decl2.c: Include splay-tree.h and varray.h.
4694 (priority_info_s): New structure.
4695 (finish_vtable_vardecl): Change prototype. Adjust for new calling
4697 (prune_vtable_vardecl): Likewise.
4698 (finish_sigtable_vardecl): Likewise.
4699 (setup_initp): Remove.
4702 (start_static_storage_duration_function): New function.
4703 (generate_inits_for_priority): Likewise.
4704 (finish_static_storage_duration_function): Likewise.
4705 (get_priority_info): Likewise.
4706 (do_static_initialization): Likewise.
4707 (do_static_destruction): Likewise.
4708 (do_static_initialization_and_destruction): Likewise.
4709 (generate_ctor_or_dtor_function): Likewise.
4710 (generate_ctor_and_dtor_functions_for_priority): Likewise.
4711 (pending_statics): Make it a varray.
4712 (pending_statics_used): New variable.
4713 (saved_inlines): Make it a varray.
4714 (saved_inlines_used): New variable.
4715 (finish_static_data_member): Change method of updating
4717 (mark_inline_for_output): Remove #if 0'd code. Change method of
4718 updating saved_inlines.
4719 (walk_vtables): Remove.
4720 (walk_sigtables): Likewise.
4721 (import_export_decl): Use DECL_TINFO_FN_P.
4722 (pending_templates): Remove declaration.
4723 (maybe_templates): Likewise.
4724 (static_aggregates_initp): Likewise.
4725 (setup_initp): Likewise.
4726 (finish_objects): Simplify.
4727 (INITIALIZE_P_IDENTIFIER): New macro.
4728 (PRIORITY_IDENTIFIER): New macro.
4729 (SSDF_IDENTIFIER): New macro.
4730 (initialize_p_decl): New variable.
4731 (priority_decl): Likewise.
4732 (ssdf_decl): Likewise.
4733 (priority_info_map): Likewise.
4734 (finish_file): Recode output of static intializers and other
4735 file-scope finalization tasks.
4736 * error.c (OB_END_TEMPLATE_ID): New macro.
4737 (dump_type_real): Use it.
4738 (dump_decl): Likewise.
4739 (dump_function_name): Likewise.
4740 * lex.c (set_typedecl_interface_info): Adjust for new walk_globals
4742 (check_newline): Use walk_globals, not walk_vtables.
4743 * pt.c (pending_tempalte_expansions): Remove.
4744 (set_vardecl_interface_info): Likewise.
4745 (pending_templates): Make static.
4746 (maybe_templates): Likewise.
4747 (instantiate_class_template): Adjust call to finish_struct_1.
4748 (instantiate_pending_templates): New function.
4749 * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P.
4750 * tree.c (static_aggregates_initp): Remove.
4751 (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY
4753 * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h.
4755 * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes
4756 with the RTL code RETURN.
4757 * hash.h: Regenerated.
4758 * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD.
4759 * parse.y: Replace RETURN with RETURN_KEYWORD throughout.
4760 * parse.c: Regenerated.
4761 * pt.c: Include varray.h. Include rtl.h since varray.h requires
4763 (inline_parm_levels): New variable.
4764 (inline_parm_levels_used): Likewise.
4765 (maybe_begin_member_template_processing): Update them.
4766 (maybe_end_member_template_processing): Use them, rather than
4767 guessing how many levels to pop.
4769 * decl.c (make_typename_type): Tighten error-checking.
4771 1999-04-20 Mark Mitchell <mark@codesourcery.com>
4773 * cp-tree.h (build_binary_op): Remove unneeded parameter.
4774 * class.c (build_vrable_entry_ref): Adjust call to
4776 * decl.c (expand_static_init): Likewise.
4777 (grokdeclarator): Likewise.
4778 (finish_function): Likewise.
4779 * decl2.c (delete_sanity): Likewise.
4780 (do_dtors): Likewise.
4781 (do_ctors): Likewise.
4782 * error.c (dump_type_suffix): Likewise.
4783 * expr.c (cplus_expand_expr): Likewise.
4784 * init.c (resolve_offset_ref): Likewise.
4785 (build_new): Likewise.
4786 (build_new_1): Likewise.
4787 (build_vec_delete_1): Likewise.
4788 (expand_vec_init_catch_clause): Likewise.
4789 (build_delete): Likewise.
4790 * pt.c (tsubst): Likewise.
4791 * rtti.c (synthesize_tinfo_fn): Likewise.
4792 * search.c (expand_upcast_fixups): Likewise.
4793 (expand_direct_vtbls_init): Likewise.
4794 * typeck.c (get_member_function_from_ptrfunc): Likewise.
4795 (build_binary_op_nodefault): Likewise.
4796 (point_int_sum): Likewise.
4797 (pointer_diff): Likewise.
4798 (build_unary_op): Likewise.
4799 (build_modify_expr): Likewise.
4800 (get_delta_difference): Likewise.
4801 (build_ptrmemfunc): Likewise.
4802 (expand_ptrmemfunc_cst): Likewise.
4804 1999-04-20 Jason Merrill <jason@yorick.cygnus.com>
4806 * decl.c (grokfndecl): Always call cplus_decl_attributes.
4807 * decl2.c (grokfield): Pass attrlist to grokdeclarator.
4809 1999-04-19 Mark Mitchell <mark@codesourcery.com>
4811 * cp-tree.h (finish_static_data_member_decl): New function.
4812 * decl2.c (finish_static_data_member_decl): Split out from ...
4814 * pt.c (instantiate_class_template): Use it here instead of
4816 (tsubst_decl): Don't set DECL_ASSEMBLER_NAME;
4817 finish_static_data_member_decl will do that. Explicit set
4818 DECL_EXTERNAL to match non-template processing.
4820 1999-04-18 Mark Mitchell <mark@codesourcery.com>
4822 * cp-tree.h (finish_class_definition): Add parameter.
4823 * parse.y (structsp): Use it. Don't call pop_scope here.
4824 * parse.c: Regenerated.
4825 * semantics.c (finish_class_definition): Pop it here.
4827 1999-04-17 Mark Mitchell <mark@codesourcery.com>
4829 * decl.c (xref_tag): Revise handling of nested template
4831 * pt.c (check_explicit_specialization): Tweak handling of friend
4832 templates in template classes.
4833 (tsubst_friend_class): Handle friend declarations for nested
4834 member template classes.
4836 1999-04-16 Mark Mitchell <mark@codesourcery.com>
4838 * class.c (finish_struct): Remove unused variable.
4839 (pushclass): Likewise.
4840 (invalidate_class_lookup_cache): Likewise.
4841 * cp-tree.def (TYPENAME_TYPE): Improve documentation.
4842 * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME
4843 doesn't get obliterated.
4844 (make_typename_type): Handle template classes correctly.
4846 * cp-tree.h (TREE_NONLOCAL_FLAG): Remove.
4847 (storetags): Declare.
4848 * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG.
4849 (pushclass): Likewise. Use storetags to install tag declarations,
4851 (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG.
4852 * decl.c (storetags): Make it global.
4853 (push_class_binding): Set INHERITED_VALUE_BINDING_P for an
4854 implicit typename declaration.
4855 (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG.
4856 * method.c (hack_identifier): Likewise.
4857 * search.c (lookup_member): Likewise.
4859 * decl.c (warn_about_implicit_typename_lookup): New function.
4860 (lookup_name_real): Use it. Rework handling of implicit typename
4863 1999-04-15 Mark Mitchell <mark@codesourcery.com>
4865 * cp-tree.h (lookup_nested_field): Remove.
4866 * class.c (push_nested_class): Handle UNION_TYPEs.
4867 (pop_nested_class): Likewise.
4868 * decl.c (lookup_name_real): Don't call lookup_nested_field.
4869 (start_decl): Use push_nested_class, not just pushclass.
4870 (cp_finish_decl): Use pop_nested_class, not just popclass.
4871 * search.c (lookup_nested_field): Remove.
4873 * cp-tree.h (lang_type): Add documentation.
4874 * decl2.c (handle_class_head): Create template declarations here,
4876 * parse.y (class_head): Return whether or not we entered a new
4877 scope, as well as the type named.
4878 (named_class_head): Likewise.
4879 (named_complex_class_head_sans_basetype): Likewise.
4880 (structsp): Adjust accordingly. Pop scope when required.
4881 * parse.c: Regenerated.
4882 * pt.c (check_default_tmpl_args): Robustify.
4883 (redeclare_class_template): Likewise.
4884 (instantiate_class_template): An instantiation of an
4885 anonymous union is itself an anonymous union.
4886 * semantics.c (begin_class_definition): Don't create template
4889 1999-04-15 Jason Merrill <jason@yorick.cygnus.com>
4891 * parse.y (after_type_declarator_intern): New nonterminal.
4892 (after_type_declarator): Use it.
4893 (direct_after_type_declarator): Likewise. Move above
4894 nonnested_type to fix reduce/reduce conflict resolution.
4895 (declmods): Reducing from just 'attributes' has EMPTY precedence.
4896 * Makefile.in (CONFLICTS): Update.
4898 * decl.c (define_label): Downgrade error for jumping over a
4899 non-POD decl to pedwarn.
4901 1999-04-14 Mark Mitchell <mark@codesourcery.com>
4903 * cp-tree.h (popclass): Change declaration.
4904 (pop_nested_class): Likewise.
4905 (poplevel_class): Remove declaration.
4906 * call.c (convert_default_argument): Pass no arguments to
4908 * class.c (finish_struct_1): Likewise.
4909 (finish_struct): Likewise.
4910 (popclass): Remove argument. Simplify code accordingly.
4911 (pop_nested_class): Likewise.
4912 * decl.c (poplevel_class): Declare it here, and make it static.
4913 (poplevel): Handle class scopes.
4914 (poplevel_class): Don't take an rgument. Simplify.
4915 (pop_everything): Pass no arguments to pop_nested_class.
4916 (cp_finish_decl): Pass no arguments to popclass.
4917 (grokdeclarator): Pass no arguments to pop_nested_class.
4918 (finish_function): Likewise.
4919 * decl2.c (grokfield): Likewise.
4920 (pop_scope): Pass no arguments to popclass.
4921 * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
4922 * pt.c (instantiate_class_template): Move call to pushclass, and
4923 document. Pass no arguments to popclass.
4924 (regenerate_decl_from_template): Likewise.
4926 1999-04-14 Jason Merrill <jason@yorick.cygnus.com>
4928 * typeck.c (build_unary_op): Handle taking the address of a unique
4929 bound non-static member function.
4931 1999-04-13 Martin von Loewis <loewis@informatik.hu-berlin.de>
4933 * lang-options.h (-Wdeprecated): New flag.
4934 * decl2.c (warn_deprecated): New flag.
4935 (lang_decode_option): Deprecated this-is-variable,
4936 external-templates, alt-external-templates.
4937 Support -Wdeprecated.
4938 * errfn.c (cp_deprecated): New function.
4940 1999-04-13 Jason Merrill <jason@yorick.cygnus.com>
4942 * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
4943 of the decls themselves.
4945 * pt.c (tsubst_function_type): Copy attributes over.
4947 * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority
4949 * cp-tree.h: Add prototype.
4950 * decl.c (init_decl_processing): Set valid_lang_attribute.
4952 1999-04-13 Mark Mitchell <mark@codesourcery.com>
4954 * class.c (finish_struct_1): Look at the const-ness of the field's
4955 type, not the TREE_READONLY-ness of the declaration.
4956 * method.c (synthesize_method): Likewise.
4957 * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when
4958 creating new declarations.
4960 1999-04-13 Mike Stump <mrs@wrs.com>
4962 * decl2.c (import_export_decl): Because vtables always reference
4963 virtual functions, even if they are inlined, don't allow
4964 -fno-implement-inlines to not emit them, instead, emit them with
4966 * decl.c (start_function): Likewise.
4968 1999-04-12 Jason Merrill <jason@yorick.cygnus.com>
4970 * cp-tree.h (struct lang_type): Add com_interface.
4971 (CLASSTYPE_COM_INTERFACE): New macro.
4972 * class.c (set_rtti_entry): COM interface classes have no RTTI
4973 entries in their vtables; adjust.
4974 (add_virtual_function, finish_base_struct, skip_rtti_stuff,
4975 modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
4976 finish_struct_1): Likewise.
4977 * decl2.c (mark_vtable_entries): Likewise.
4978 * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
4979 * search.c (get_abstract_virtuals_1, get_abstract_virtuals,
4980 expand_upcast_fixups): Likewise.
4981 * tree.c (debug_binfo): Likewise.
4983 * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro.
4984 * typeck.c (comptypes): If we get it, ignore attributes.
4985 * class.c (instantiate_type): Use BASELINK_P. Change complain
4986 parameter to flags; 2 means ignore attributes.
4987 * call.c (build_op_delete_call): Pass it.
4989 * decl.c (xref_tag): Only complain once about using a typedef-name
4990 with 'struct'. Downgrade to pedwarn.
4992 * decl.c (grokdeclarator): Allow [] syntax for zero-length array.
4994 * parse.y (absdcl_intern): New nonterminal.
4995 (absdcl, direct_abstract_declarator): Use it.
4997 * pt.c (lookup_template_class): Look through implict typename.
4999 1999-04-11 Mark Mitchell <mark@codesourcery.com>
5001 * friend.c (add_friend): Deal gracefully with error_mark_node.
5002 * method.c (build_overload_value): Handle pointers-to-members as
5003 template parameters.
5005 * decl.c (push_binding): Fix typo in comment.
5007 1999-04-10 Mark Mitchell <mark@codesourcery.com>
5009 * error.c (dump_type_real): If a typename is a template-id, put
5010 out the template arguments.
5011 (dump_expr): Handle TEMPLATE_ID_EXPR.
5012 * pt.c (lookup_template_class): Now that full arguments are
5013 available everywhere, remove code that tried to guess them.
5015 1999-04-09 Mark Mitchell <mark@codesourcery.com>
5017 * decl.c (make_typename_type): Complain if we don't find a type
5018 when trying to make a typename type for a non-template type.
5020 1999-04-09 Jason Merrill <jason@yorick.cygnus.com>
5022 * decl.c (start_decl): Pass attributes to grokdeclarator.
5023 (grokdeclarator): Handle attributes on constructor-syntax
5026 1999-04-08 Mark Mitchell <mark@codesourcery.com>
5028 * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands
5031 * search.c (template_self_reference_p): Tweak.
5033 1999-04-07 Mark Mitchell <mark@codesourcery.com>
5035 * init.c (build_offset_ref): Don't build yet another weird data
5036 structure to describe overloaded functions.
5038 1999-04-06 Mark Mitchell <mark@codesourcery.com>
5040 * cp-tree.h (BASELINK_P): New macro.
5041 (SET_BASELINK_P): Likewise.
5042 * init.c (build_member_call): Remove needless assignment in if
5044 * search.c (lookup_field_r): Fix handling when we are looking
5045 specifically for a type; these are not hidden by functions and
5047 (lookup_member): Use SET_BASELINK_P.
5048 * tree.c (is_overloaded_fn): Use BASELINK_P.
5049 (really_overloaed_fn): Likewise.
5050 (get_first_fn): Likewise.
5052 1999-04-05 Mark Mitchell <mark@codesourcery.com>
5054 * decl.c (lookup_name_current_level): Tweak, and improve
5057 * class.c (maybe_fixup_vptrs): Remove declaration.
5058 (build_class_init_list): Likewise.
5059 * decl.c (pushdecl_class_level): Call check_template_shadow here
5061 (push_class_level_binding): ... not here.
5062 * search.c (dfs_push_type_decls): Only avoid
5063 template-self-reference TYPE_DECLs if they are from base classes.
5065 1999-04-04 Mark Mitchell <mark@codesourcery.com>
5067 * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL
5070 1999-04-03 Jason Merrill <jason@yorick.cygnus.com>
5072 * class.c (maybe_fixup_vptrs, build_class_init_list): Lose.
5073 (finish_struct_1): Don't call build_class_init_list.
5075 1999-04-02 Mark Mitchell <mark@codesourcery.com>
5077 * tinfo.h (__class_type_info): Fix illegal declaration.
5079 * cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
5080 * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
5081 (IDENTIFIER_CLASS_VALUE): Improve documentation.
5082 (is_properly_derived_from): Declare.
5083 (invalidate_class_lookup_cache): Likewise.
5084 (maybe_maybe_note_name_used_in_class): Likewise.
5085 (note_name_declared_in_class): Likewise.
5086 (push_using_decl): Remove duplicate declaration.
5087 (id_in_current_class): Remove declaration.
5088 (push_class_binding): Change prototype.
5089 (clear_identitifer_class_values): Declare.
5090 * call.c (is_properly_derived_from): Make it global.
5091 (build_new_function_call): Be careful about updating candidates.
5092 (build_new_method_call): Handle COMPONENT_REFs. Don't crash when
5093 asked to make illegal calls.
5094 * class.c: Include splay-tree.h.
5095 (class_stack_node): Add names_used slot.
5096 (check_member_decl_is_same_in_complete_scope): Remove.
5097 (add_method): Fix comment. Push the declaration into class
5099 (finish_struct_1): When popping the class, pop the bindings too.
5100 Remove check for data member/function member conflict.
5101 (finish_struct): Remove calls to
5102 check_member_decl_is_same_in_complete_scope. Change calls to
5104 (pushclass): Clear names_used in the class stack entry.
5105 Use invalidate_class_lookup_cache to remove cached entries, rather
5106 than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE
5107 before entering a new class. Remove dead code. Don't mess with
5108 current_function_decl when pushing declarations.
5109 (invalidate_class_lookup_cache): New function, split out from ...
5110 (popclass): Here. Clean up names_used on our way out.
5111 (instantiate_type): Adjust.
5112 (build_self_reference): Don't push the declaration here.
5113 (maybe_note_name_used_in_class): New function.
5114 (note_name_declared_in_class): Likewise.
5115 * decl.c (add_binding): Change prototype.
5116 (find_class_binding_level): New function.
5117 (innermost_nonclass_level): Likewise.
5118 (current_binding_level): Update documentation.
5119 (inner_binding_level): Remove. Replace with current_binding_level
5121 (push_binding_level): Remove special handling of
5122 class_binding_level.
5123 (pop_binding_level): Likewise. Use find_class_binding_level.
5124 (suspend_binding_level): Likewise.
5125 (global_bindings_p): Use innermost_nonclass_level.
5126 (toplevel_bindings_p): Likewise.
5127 (namespace_bindings_p): Likewise.
5128 (pseudo_global_level_p): Likewise.
5129 (push_binding): Clear INHERITED_VALUE_BINDING_P.
5130 (add_binding): Check for illegal multiple declarations. Return a
5131 value indicating whether or not the new binding was legal.
5132 (push_local_binding): Skip over class binding levels. Check
5133 return value from add_binding.
5134 (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call
5135 note_name_declared_in_class.
5136 (pushlevel_class): Remove "fake out the rest of the compiler"
5138 (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
5139 (clear_identifier_class_values): New function.
5140 (pop_from_top_level): Use it.
5141 (pop_everything): Tweak.
5142 (maybe_process_template_type_declaration): Don't push the
5143 declaration for the template here.
5144 (pushtag): Don't push tag declarations into class scope here.
5145 (pushdecl): Apply DeMorgan's law for readability.
5146 (pushdecl_class_level): Remove special-case code for
5147 TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions.
5148 (push_class_level_bindng): Deal with inherited bindings.
5149 (lookup_name_real): Remove special-case code for
5150 TYPE_BEING_DEFINED, and some implicit typename magic.
5151 (grokdeclarator): Handle COMPONENT_REF for a template function.
5152 (build_enumerator): Don't call pushdecl_class_level here.
5153 (id_in_current_class): Remove.
5154 * decl2.c (grokfield): Don't call pushdecl_class_level or
5155 check_template_shadow.
5156 * errfn.c (cp_file_of): Don't declare.
5157 (cp_line_of): Likewise.
5158 * error.c (dump_decl): Handle an OVERLOAD.
5159 (cp_file_of): Likewise.
5160 (cp_line_of): Likewise.
5161 * init.c (build_member_call): Handle a COMPONENT_REF.
5162 * lex.c (do_identifier): Call maybe_note_name_used_in_class, not
5163 pushdecl_class_level.
5164 * method.c (hack_identifier): Build COMPONENT_REFs for references
5165 to member templates as well as member functions. Remove dead
5167 * parse.y (left_curly): Remove.
5168 (nonnested_type): Call maybe_note_name_used_in_class, not
5169 pushdecl_class_level.
5170 * parse.c: Regenerated.
5171 (nested_name_specifier_1): Likewise.
5172 * pt.c (check_explicit_specialization): Adjust, for robustness.
5173 (check_template_shadow): Handle OVERLOADs.
5174 (build_template_decl): Set DECL_CONSTRUCTOR_P on the
5175 TEMPLATE_DECL, if appropriate.
5176 * search.c (envelope_add_decl): Remove.
5177 (dfs_pushdecls): Likewise.
5178 (dfs_compress_decls): Likewise.
5179 (dfs_push_decls): New function.
5180 (dfs_push_type_decls): Likewise.
5181 (setup_class_bindings): Likewise.
5182 (template_self_reference_p): Likewise.
5183 (lookup_field_r): Use it.
5184 (looup_member): Remove old comment. Deal with ambiguity.
5185 (push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
5186 and remove envelope processing.
5187 * semantics.c (begin_class_definition): Let pushclass push
5188 declarations for base classes.
5189 (finish_member_declaration): Push declarations into class scope.
5190 * typeck.c (build_component_ref): Just put an OVERLOAD into the
5191 COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
5192 (build_x_function_call): Deal with OVERLOAD. Handle template-ids.
5193 * Makefile.in (class.o): Depend on splay-tree.h.
5195 Wed Mar 31 11:30:43 1999 Nathan Sidwell <nathan@acm.org>
5197 * cvt.c (convert_pointer_to_real): Use same_type_p.
5198 * typeck.c (comp_target_types): Use same_type_p.
5200 1999-03-31 Jason Merrill <jason@yorick.cygnus.com>
5202 * semantics.c (begin_inline_definitions,
5203 finish_inline_definitions): Rename from finish_default_args and
5204 begin_inline_definitions, respectively, to something that isn't a
5206 * parse.y (structsp): Adjust.
5208 * tree.c (hash_tree_cons): Remove obsolete via_* parms.
5209 (list_hash_lookup): Likewise.
5210 (hash_tree_chain): Adjust.
5211 * pt.c (tsubst): Adjust.
5212 (tsubst_arg_types): Use plain hash_tree_cons.
5213 * cp-tree.h (hash_tree_cons_simple): Lose.
5214 * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons.
5216 Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5218 * Makefile.in (hash.h): Generate using gperf language 'C', not
5219 'KR-C', so gperf uses the `const' keyword on strings.
5221 * gxx.gperf (resword): Const-ify a char*.
5223 1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
5225 * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
5226 CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES,
5227 CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH,
5228 CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
5229 CLASSTYPE_BINFO_AS_LIST): Remove cruft.
5230 * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c,
5233 1999-03-29 Jason Merrill <jason@yorick.cygnus.com>
5235 * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
5237 1999-03-28 Jason Merrill <jason@yorick.cygnus.com>
5239 * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops.
5241 1999-03-27 Mark Mitchell <mark@codesourcery.com>
5243 * cp-tree.h (add_friend): Declare.
5244 (add_friends): Likewise.
5245 * friend.c (add_friend): Make it global. Don't add to
5246 DECL_BEFRIENDING_CLASSES if the befriending class is a template.
5247 (add_friends): Make it global.
5248 (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the
5249 befriending class is a template.
5250 * parse.y (component_decl_1): Fix typo in comment.
5251 * parse.c: Regenerated.
5252 * pt.c (instantiate_class_template): Use add_friend and
5253 add_friends rather that duplicating some of their functionality
5256 1999-03-27 Jason Merrill <jason@yorick.cygnus.com>
5258 * call.c (build_field_call): Unify 'this' and non-'this' cases.
5260 * typeck.c (build_indirect_ref): Check for 'this' sooner.
5262 Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5264 * call.c (op_error): Const-ify a char*.
5265 (add_candidate, source_type, add_warning): Add static prototype.
5266 (print_z_candidates): Const-ify a char*.
5268 * class.c (resolve_address_of_overloaded_function,
5269 fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
5270 (get_vtable_name, finish_struct_1): Const-ify a char*.
5272 * cvt.c (convert_to_reference): Likewise.
5274 * decl.c (redeclaration_error_message, record_builtin_type,
5275 record_unknown_type, member_function_or_else, bad_specifiers):
5277 (find_binding, select_decl, unqualified_namespace_lookup,
5278 lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
5279 Add static prototype.
5280 (warn_extern_redeclared_static, duplicate_decls, pushdecl,
5281 implicitly_declare, record_builtin_java_type, define_function,
5282 grok_op_properties, tag_name): Const-ify a char*.
5284 * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
5285 (define_function, finish_builtin_type): Const-ify a char*.
5286 (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
5287 cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
5288 (file_name_nondirectory): Const-ify a char*.
5289 (init_filename_times): Don't prototype.
5290 (compiler_error): Prototype.
5291 (yyerror, init_repo): Const-ify a char*.
5292 (build_srcloc): Don't prototype.
5293 (build_x_indirect_ref, build_indirect_ref, build_component_addr):
5295 (warn_for_assignment): Don't prototype.
5296 (convert_for_initialization, readonly_error, check_for_new_type,
5297 GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
5300 * decl2.c (acceptable_java_type, output_vtable_inherit,
5301 setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
5302 merge_functions, decl_namespace, validate_nonmember_using_decl,
5303 do_nonmember_using_decl): Add static prototype.
5304 (lang_f_options): Const-ify a char*.
5305 (finish_builtin_type): Likewise.
5306 (add_function, arg_assoc_namespace, arg_assoc_class): Add static
5309 * errfn.c: Include cp-tree.h.
5310 (cp_thing): Add static prototype.
5311 (compiler_error): Don't protoptype.
5312 (cp_compiler_error): Cast `compiler_error' to `errorfn' before
5313 passing it to `cp_thing'.
5315 * error.c (interesting_scope_p): Add static prototype.
5317 * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
5320 * init.c (compiler_error): Don't prototype.
5321 (member_init_ok_or_else): Const-ify a char*.
5322 (build_java_class_ref): Add static prototype.
5324 * lex.c (compiler_error): Don't prototype.
5325 (get_time_identifier, interface_strcmp, extend_token_buffer,
5326 handle_cp_pragma): Const-ify a char*.
5327 (is_global, init_filename_times): Add static prototype.
5328 (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
5329 (compiler_error): Change from fixed args to variable args.
5330 (yyerror): Const-ify a char*.
5332 * parse.y (cond_stmt_keyword): Const-ify a char*.
5333 (parse_decl): Add static prototype.
5335 * pt.c (template_args_equal, print_template_context): Likewise.
5336 (print_candidates, check_default_tmpl_args): Const-ify a char*.
5337 (instantiate_class_template): Likewise.
5339 * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
5341 * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
5342 expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
5344 * search.c (lookup_field_info, lookup_member): Likewise.
5345 (lookup_member): Cast the first argument of `bzero' to a PTR.
5347 * sig.c (compiler_error): Don't prototype.
5348 (build_signature_pointer_or_reference_nam): Const-ify a char*.
5349 (get_sigtable_name, build_member_function_pointer): Likewise.
5351 * tree.c (compiler_error): Don't prototype.
5352 (no_linkage_helper, build_srcloc): Add static prototype.
5353 (build_vbase_pointer_fields): Const-ify a char*.
5354 (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
5356 * typeck.c (compiler_error): Don't prototype.
5357 (convert_for_assignment): Const-ify a char*.
5358 (comp_cv_target_types): Add static prototype.
5359 (build_x_indirect_ref, build_indirect_ref, convert_arguments,
5360 build_component_addr, build_unary_op, convert_for_initialization):
5363 * typeck2.c (ack): Add static prototype and change from fixed args
5365 (readonly_error, check_for_new_type): Const-ify a char*.
5367 * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
5368 fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
5369 (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'.
5370 (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
5371 gen_assign, GNU_xref_member): Const-ify a char*.
5373 1999-03-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
5375 * gxxint.texi: Remove old discussion on copying virtual bases.
5377 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
5379 * Make-lang.in: Remove all references to g++.o/g++.c.
5380 Link g++ from gcc.o.
5382 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
5384 * decl2.c (comdat_linkage): Treat vtables like functions.
5386 1999-03-25 Mark Mitchell <mark@codesourcery.com>
5388 * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES.
5390 1999-03-25 Nathan Sidwell <nathan@acm.org>
5392 * decl.c (init_decl_processing): Add `signed' type as a synonym
5395 1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
5397 * typeck.c (common_type): Handle cv-qual unification for pointers
5400 * decl.c (unqualified_namespace_lookup): Return error_mark_node
5402 (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing.
5403 * lex.c (do_identifier): If we got error_mark_node, call
5406 1999-03-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
5408 * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty
5411 1999-03-24 Jason Merrill <jason@yorick.cygnus.com>
5413 * decl.c (lookup_name_real): Do nested field lookup regardless of
5416 1999-03-24 Mark Mitchell <mark@codesourcery.com>
5418 * cp-tree.h (lang_type): Remove has_assignment and
5419 has_real_assignment. Add befriending_classes.
5420 (TYPE_HAS_ASSIGNMENT): Remove.
5421 (TYPE_HAS_REAL_ASSIGNMENT): Likewise.
5422 (CLASSTYPE_BEFRIENDING_CLASSES): New macro.
5423 (lang_decl): Document.
5424 (DECL_BEFRIENDING_CLASSES): New macro.
5425 (FRIEND_NAME): Move declaration to more obvious location.
5426 (FRIEND_DECLS): Likewise.
5427 * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT.
5428 * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES.
5429 (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT.
5430 (grok_op_properties): Likewise.
5431 * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS.
5432 (add_friend): Likewise. Don't do weird things with assignment
5433 operators. Update DECL_BEFRIENDING_CLASSES.
5434 (add_friends): Don't do weird things with assignment operators.
5435 (make_friend_class): Likewise. Update
5436 CLASSTYPE_BEFRIENDING_CLASSES.
5437 * pt.c (instantiate_class_template): Don't set
5438 TYPE_HAS_ASSIGNMENT.
5439 (tsubst_copy): Substitute the TREE_TYPE for more unary
5441 * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT.
5442 * search.c (protected_accessible_p): New function.
5443 (friend_accessible_p): Likewise.
5444 (accessible_p): Use them.
5446 1999-03-23 Mark Mitchell <mark@codesourcery.com>
5448 * pt.c (convert_nontype_argument): Don't create things that aren't
5449 PTRMEM_CSTs when applying a qualification conversion to a
5452 1999-03-23 Mark Mitchell <mark@codesourcery.com>
5454 * Makefile.in (OBJS): Don't mention hash.o.
5455 (OBJDEPS): Likewise.
5457 1999-03-23 Jason Merrill <jason@yorick.cygnus.com>
5459 * decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
5460 * decl.c (expand_static_init): Make sure we don't add any after
5463 * decl.c (cp_finish_decl): Move intelligence about handling
5464 DECL_COMDAT for variables from here...
5465 * decl2.c (comdat_linkage): ...to here.
5466 (maybe_make_one_only): Tweak.
5467 (import_export_decl): Call comdat_linkage for variables, too.
5468 (finish_file): Handle template statics properly.
5470 1999-03-22 Mark Mitchell <mark@codesourcery.com>
5472 * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG.
5473 Document internals of pointer-to-member-functions.
5474 (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc.
5475 (PFN_FROM_PTRMEMFUNC): Likewise.
5476 (build_type_conversion): Remove unused parameter.
5477 (build_ptrmemfunc1): Declare.
5478 (expand_ptrmemfunc_cst): New function.
5479 (delta2_from_ptrmemfunc): Likewise.
5480 (pfn_from_ptrmemfunc): Likewise.
5481 * cvt.c (cp_convert_to_pointer): Remove unused parameter to
5482 build_type_conversion. Use TYPE_PTRMEM_P for readability.
5483 (convert_to_reference): Remove unused parameter to
5484 build_type_conversion.
5485 (ocp_convert): Likewise.
5486 (build_user_type_conversion): Likewise.
5487 * error.c (dump_expr): Handle NULL pointer-to-member functions.
5488 * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions.
5489 * method.c (build_overload_value): Don't go splitting CONSTRUCTORs
5490 open when handling pointer-to-member functions.
5491 * pt.c (convert_nontype_argument): Clean up error messages. Be
5492 more stringent with pointers-to-members.
5493 * typeck.c (build_ptrmemfunc1): Don't declare. Make it global.
5494 (build_unary_op): Tidy ever-so-slightly.
5495 (build_conditional_expr): Remove extra parameter to
5496 build_type_conversion.
5497 (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function
5499 (expand_ptrmemfunc_cst): Define.
5500 (delta2_from_ptrmemfunc): Likewise.
5501 (pfn_from_ptrmemfunc): Likewise.
5503 1999-03-19 Mark Mitchell <mark@codesourcery.com>
5505 * init.c (build_member_call): Handle template-id expressions
5507 * typeck.c (build_x_function_call): Likewise.
5509 1999-03-19 Chip Salzenberg <chip@perlsupport.com>
5511 * friend.c (make_friend_class): Avoid core dump when
5512 not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
5514 1999-03-18 Jason Merrill <jason@yorick.cygnus.com>
5516 * decl.c (start_function): Suppress normal linkage heuristics
5517 for #pragma interface under MULTIPLE_SYMBOL_SPACES.
5519 1999-03-19 Alexandre Oliva <oliva@dcc.unicamp.br>
5521 * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c.
5522 ($(srcdir)/cp/parse.c): Moved from ../Makefile.in.
5524 1999-03-17 Martin von Löwis <loewis@informatik.hu-berlin.de>
5526 * parse.y (named_complex_class_head_sans_basetype):
5527 Do not push a scope for error_mark_node.
5528 (maybe_base_class_list): Likewise.
5530 * decl.c (start_decl): Check for error_mark_node as a type.
5531 Detected by g++.brendan/array-refs.C.
5532 (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C.
5533 (maybe_build_cleanup_1): Likewise. Detected by
5534 g++.jason/incomplete1.C.
5536 * tree.c (build_dummy_object): Use void_zero_node instead of the
5538 (is_dummy_object): Check for such a node.
5539 Detected by g++.bob/inherit1.C
5541 1999-03-16 Jason Merrill <jason@yorick.cygnus.com>
5543 * method.c (old_backref_index): Split out...
5544 (flush_repeats): From here. Rename back from try_old_backref.
5545 (build_mangled_name): Put back some old-style repeat handling.
5547 Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5549 * lex.c: Don't include setjmp.h.
5550 (parse_float): New static function.
5551 (pf_args): New struct.
5552 (real_yylex): Use them in call to `do_float_handler'.
5554 1999-03-15 Mark Mitchell <mark@markmitchell.com>
5556 * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
5557 * tree.c (layout_basetypes): Not here.
5558 * search.c (dfs_search): Remove; no longer used.
5560 1999-03-12 Mark Mitchell <mark@markmitchell.com>
5562 * decl2.c (validate_nonmember_using_decl): Issue sensible
5563 error-messages on bogus qualifiers.
5565 1999-03-14 Jason Merrill <jason@yorick.cygnus.com>
5567 * call.c (add_function_candidate): Fix uninitialized variable.
5569 * Makefile.in (search.o): Add dependency on varray.h.
5571 1999-03-13 Jason Merrill <jason@yorick.cygnus.com>
5573 * decl.c (duplicate_decls): Use same_type_p.
5574 * method.c (try_old_backref): Renamed from flush_repeats. Use
5575 same_type_p. Don't try to handle repeats. Return success.
5576 (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support
5577 calls from old-style code, too.
5578 (check_ktype): Use same_type_p.
5579 (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT.
5580 (build_qualified_name): Simplify logic.
5581 (process_overload_item): Strip typedefs and quals at the top.
5582 (build_mangled_name_for_type_with_Gcode): Remove call to
5583 type_canonical_variant.
5584 (build_mangled_name): Likewise. Remove support for old-style
5585 repeats, which have been disabled since 2.7.2. Don't mess with
5587 (build_decl_overload_real): Don't mess with TREE_USED.
5589 1999-03-13 Nathan Sidwell <nathan@acm.org>
5591 * error.c (cp_printers): Add 'F' escape character.
5592 (dump_type_real): Remove TREE_LIST (fnargs) printing.
5593 Functionality moved to dump_parameters.
5594 (dump_type_suffix): Use dump_parameters and dump_exception_spec.
5595 (dump_function_decl): Extend meaning of V parameter. Use
5596 dump_parameters and dump_exception_spec.
5597 (dump_parameters): New static function.
5598 (dump_exception_spec): New static function.
5599 (fndecl_as_string): Change argument semantics. Use
5600 dump_function_decl directly.
5602 * sig.c (build_signature_table_constructor): Use cp_error.
5604 1999-03-13 Martin von Löwis <loewis@informatik.hu-berlin.de>
5606 * semantics.c (finish_switch_cond): Handle error cases gracefully.
5607 Detected by g++.law/enum5.C.
5609 * typeck.c (build_modify_expr): Check for errors after resolving
5610 offsets. Detected by g++.brendan/static1.C.
5612 * decl.c (complete_array_type): Ignore initial_value if it is an
5613 error. Detected by g++.benjamin/17930.C.
5615 * typeck2.c (process_init_constructor): Return error if one argument
5616 is in error. Detected by g++.benjamin/13478.C.
5618 1999-03-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
5620 * decl.c (select_decl): Allow class templates when we need types.
5621 * decl2.c (ambiguous_decl): Likewise.
5623 1999-03-12 Mark Mitchell <mark@markmitchell.com>
5625 * lex.c (do_identifier): Correct call to enforce_access.
5626 * search.c (accessible_p): Tweak comment.
5628 1999-03-10 Mark Mitchell <mark@markmitchell.com>
5630 * semantics.c (begin_class_definition): Call build_self_reference.
5631 (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
5633 * search.c (assert_canonical_unmarked): Fix typo in prototype.
5635 * search.c (dfs_canonical_queue): New function.
5636 (dfs_assert_unmarked_p): Likewise.
5637 (assert_canonical_unmarked): Likewise.
5638 (access_in_type): Use it.
5639 (accessible_p): Likewise. Walk the whole tree when umarking.
5641 * sig.c (build_signature_table_constructor): Use accessible_p
5642 instead of compute_access.
5644 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
5646 * call.c (add_builtin_candidates): Handle overloaded conversion ops.
5648 1999-03-09 Mark Mitchell <mark@markmitchell.com>
5650 * cp-tree.h (flag_access_control): Declare.
5651 (TREE_VIA_PPUBLIC): Document.
5652 (DECL_NONSTATIC_MEMBER_P): New macro.
5653 (enforce_access): Return an indication of whether or not access
5655 (build_self_reference): Change prototype.
5656 (compute_access): Replace with ...
5657 (accessible_p): New function.
5658 (dfs_walk): Change prototype.
5659 (dfs_unmark): Likewise.
5660 (markedp): Likewise.
5661 * call.c (enforce_access): Use accessible_p.
5662 * class.c (build_self_reference): Insert the declaration into the
5663 list of members for this type, and make it public.
5664 * decl.c (xref_basetypes): Avoid ill-timed recursion.
5665 * init.c (build_offset_ref): Use lookup_member, not three separate
5666 name-lookups. Call enforce_access rather than checking for
5667 illegal accesses here.
5668 (resolve_offset_ref): Likewise.
5669 * lex.c (do_identifier): Likewise.
5670 * method.c (hack_identifier): Likewise.
5671 * parse.y (self_reference): Remove.
5672 (opt_component_decl_list): Don't use it.
5673 * parse.c: Regenerated.
5674 * pt.c (print_candidates): Generalize to handle lists of
5675 overloaded functions.
5676 (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's
5678 (get_template_base): Use new calling convention for dfs_walk.
5679 * search.c: Include varray.h. Add prototypes.
5680 (dfs_walk): Accept a data pointer to pass to the work functions.
5681 All callers changed. All work functions changed.
5682 (breadth_first_search): Rename to bfs_walk, and make consistent
5684 (dfs_walk_real): New function.
5685 (canonical_binfo): New function.
5686 (context_for_name_lookup): Likewise.
5687 (shared_marked_p): Likewise.
5688 (shared_unmarked_p): Likewise.
5689 (lokup_field_queue_p): Likewise.
5690 (lookup_field_r): Generalize to handle both functions and fields.
5691 (lookup_field): Just call lookup_member.
5692 (lookup_fnfields): Likewise.
5693 (lookup_member): Move body of lookup_field here and generalize.
5694 (dfs_accessible_queue_p): Likewise.
5695 (dfs_accessible_p): Likewise.
5696 (dfs_access_in_type): Likewise.
5697 (access_in_type): Likewise.
5698 (compute_access): Remove, and replace with ...
5699 (accessible_p): New function.
5700 (vbase_types): Remove.
5701 (vbase_decl_ptr_intermediate): Likewise.
5702 (vbase_decl_ptr): Likewise.
5703 (vbase_init_result): Likewise.
5704 (closed_envelopes): Likewise.
5705 (bvtable): Likewise.
5707 1999-03-09 Jason Merrill <jason@yorick.cygnus.com>
5709 * call.c (add_function_candidate): Check for proper number of args
5710 before checking the validity of those args.
5712 1999-03-06 Jason Merrill <jason@yorick.cygnus.com>
5714 * cp-tree.h (struct lang_type): Add anon_union field.
5715 (ANON_UNION_TYPE_P): Use it instead of examining type.
5716 (SET_ANON_UNION_TYPE_P): New macro.
5717 * decl.c (check_tag_decl): Use it.
5719 * search.c (compute_access): Handle non-type contexts earlier, and
5722 * tree.c (build_exception_variant): Use copy_to_permanent.
5724 * decl2.c (setup_initp): Give statics with no priority the default
5726 (do_dtors, do_ctors, finish_file): Remove special handling of
5727 non-prioritized statics.
5729 1999-03-05 Mark Mitchell <mark@markmitchell.com>
5731 * cp-tree.h (ANON_UNION_TYPE_P): Robustify.
5732 * decl.c (make_typename_type): Don't issue an error if an
5733 immediate lookup fails; it migt be resolved later.
5734 * friend.c (is_friend): Add comment.
5735 * search.c (breadth_first_search): Add POSTFN and DATA
5736 parameters. Tidy. All callers changed.
5737 (lookup_field_queue_p): New function.
5738 (lookup_field_r): Likewise.
5739 (lookup_field_post): Likewise.
5740 (lookup_field): Use them, via breadth_first_search, instead of
5742 (compute_access): Robustify.
5743 (lookup_fnfield_info): New structure.
5745 1999-03-05 Jason Merrill <jason@yorick.cygnus.com>
5747 * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again.
5749 1999-03-03 Jason Merrill <jason@yorick.cygnus.com>
5751 * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
5754 * decl2.c (import_export_class): Also return if
5755 CLASSTYPE_INTERFACE_ONLY is set.
5757 1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de>
5759 * decl.c (push_overloaded_decl): Only overwrite the old binding if
5761 * decl2.c (do_local_using_decl): Fix loop termination.
5763 1999-03-02 Mark Mitchell <mark@markmitchell.com>
5765 * cp-tree.h (determine_specialization): Don't declare.
5766 * pt.c (determine_specialization): Make it static. Eliminate
5767 complain parameter. Note that decl is always non-NULL now, and
5768 simplify accordingly.
5770 * decl.c (maybe_push_to_top_level): Always call
5771 push_cp_function_context.
5772 (pop_from_top_level): Always call pop_cp_function_context.
5774 1999-02-26 Nathan Sidwell <nathan@acm.org>
5776 * typeck.c (complete_type_or_else): Add VALUE arg, for helpful
5778 * cp-tree.h (complete_type_or_else): Added VALUE parameter.
5779 * init.c (build_new_1): Extra arg to complete_type_or_else.
5780 (build_delete): Likewise.
5781 * typeck.c (require_complete_type): Likewise.
5782 (pointer_int_sum): Likewise.
5783 (pointer_diff): Likewise.
5784 (build_component_ref): Likewise.
5786 * typeck2.c (incomplete_type_error): Always use cp_error.
5787 Show declaration of undefined type, if appropriate.
5788 Deal with UNKNOWN_TYPE nodes.
5790 * typeck.c (require_complete_type): Use TYPE_SIZE as
5791 size_zero_node to mean incomplete type.
5792 (require_complete_type_in_void): New function.
5793 (build_compound_expr): Call complete_type_in_void for LHS.
5794 (build_c_cast): Call complete_type_in_void for void cast.
5795 * cvt.c (ocp_convert): Call complete_type_in_void for void cast.
5796 * decl.c (cplus_expand_expr_stmt): Void expression checks moved to
5797 require_complete_type_in_void. Call it.
5798 * cp-tree.h (require_complete_type_in_void): Prototype new function.
5800 * typeck.c (convert_arguments): Use alternative format for
5801 function decls. Don't require_complete_type here. Simplify
5802 diagnostic printing.
5803 (convert_for_initialization): Don't require_complete_type on RHS yet.
5804 * call.c (convert_arg_to_ellipsis): Call require_complete_type.
5806 * call.c (build_over_call): Cope with qualified void return type.
5807 * semantics.c (finish_call_expr): Likewise.
5808 * typeck.c (build_function_call_real): Likewise.
5809 (c_expand_return): Likewise.
5810 * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
5812 * call.c (print_z_candidates): Use alternate print format, to be
5813 consistent with (pt.c) print_candidates.
5814 * method.c (hack_identifier): List candidate members.
5815 * search.c (lookup_field): Build ambiguous list, and show it, if
5818 1999-02-26 Mark Mitchell <mark@markmitchell.com>
5820 * typeck.c (decay_conversion): Don't confuse constant array
5821 variables with their initializers.
5823 * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when
5825 * pt.c (regenerate_decl_from_template): Tweak for clarity.
5826 (instantiate_decl): Mark a decl instantiated before regenerating
5827 it to avoid recursion.
5828 * tree.c (mapcar): Don't call decl_constant_value unless we know
5829 something is TREE_READONLY_DECL_P.
5831 * class.c (check_for_override): Don't stop checking when we find
5832 the first overridden function. Delete #if 0'd code.
5833 * search.c (get_matching_virtual): Likewise.
5835 1999-02-25 Richard Henderson <rth@cygnus.com>
5837 * lang-specs.h: Define __FAST_MATH__ when appropriate.
5839 1999-02-24 Mike Stump <mrs@wrs.com>
5841 * typeck.c (convert_for_assignment): Allow boolean integral constant
5842 expressions to convert to null pointer.
5844 1999-02-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
5846 * decl.c (lookup_namespace_name): Resolve namespace aliases.
5848 * class.c (push_nested_class): Allow namespaces.
5850 * decl2.c (set_decl_namespace): Add friendp parameter.
5851 * decl.c (grokfndecl): Pass it.
5852 (grokvardecl): Likewise.
5853 * cp-tree.h: Change declaration.
5855 1999-02-24 Jason Merrill <jason@yorick.cygnus.com>
5857 * pt.c (tsubst): Allow an array of explicit size zero.
5859 1999-02-23 Jason Merrill <jason@yorick.cygnus.com>
5861 * errfn.c: Change varargs code to look like toplev.c.
5863 * method.c (process_modifiers): Don't prepend 'U' for char or
5866 1999-02-20 Craig Burley <craig@jcb-sc.com>
5868 * Make-lang.in (cplib2.ready): Don't consider updating
5869 cplib2 stuff if the current directory isn't writable, as
5870 it won't work (such as during a `make install').
5872 Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org)
5874 * decl2.c (start_objects): Make file scope constructors and
5875 destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
5876 ASM_OUTPUT_DESTRUCTOR are defined.
5878 1999-02-19 Mark Mitchell <mark@markmitchell.com>
5880 * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
5881 (fn_type_unification): Adjust prototype.
5882 (lookup_fnfields_1): Declare.
5883 * call.c (add_template_candidate_real): Adjust call to
5884 fn_type_unification.
5885 * class.c (add_method): Don't allow duplicate declarations of
5886 constructors or destructors.
5887 (resolve_address_of_overloaded_function): Remove unused variable.
5888 Adjust call to fn_type_unification.
5889 * decl.c (grokfndecl): Be more robust in the face of illegal
5891 * decl2.c (check_classfn): Remove hokey handling of member
5893 * pt.c (determine_specialization): Improve comments. Adjust to
5894 handle template argument deduction as per the standard.
5895 (check_explicit_specialization): Fix comment spacing. Handle
5896 type-conversion operators correctly. Improve error-recovery.
5897 (fn_type_unification): Remove EXTRA_FN_ARG parameter.
5898 (get_bindings_real): Simplify handling of static members.
5899 * search.c (lookup_fnfields_1): Make it have external linkage.
5900 * typeck.c (compparms): Fix comment.
5901 (build_unary_op): Don't try to figure out which template
5902 specialization is being referred to when when the address-of
5903 operator is used with a template function.
5905 Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5907 * cp-tree.h (lvalue_or_else): Qualify a char* with the `const'
5908 keyword to match an analogous change at the top level.
5910 * tree.c (lvalue_or_else): Likewise.
5912 1999-02-17 Mark Mitchell <mark@markmitchell.com>
5914 * decl.c (xref_basetypes): Comment.
5915 * pt.c (instantiate_class_template): Use xref_basetypes.
5917 1999-02-16 Mark Mitchell <mark@markmitchell.com>
5919 * cp-tree.h (tsubst): Change prototype.
5920 (tsubst_expr): Likewise.
5921 (tsubst_copy): Likewise.
5922 (type_unification): Remove prototype.
5923 * call.c (convert_default_arg): Adjust call to tsubst_expr.
5924 * class.c (resolve_address_of_overloaded_function): Just use
5925 fn_type_unification.
5926 * decl.c (grokdeclarator): Adjust call to tsubst.
5927 * method.c (build_template_parm_names): Likewise.
5928 * pt.c (GTB_VIA_VIRTUAL): New macro.
5929 (GTB_IGNORE_TYPE): Likewise.
5930 (resolve_overloaded_unification): Add `complain' parameter.
5931 (try_one_overload): Likewise.
5932 (tsubst_template_arg_vector): Likewise.
5933 (tsubst_template_parms): Likewise.
5934 (tsubst_aggr_type): Likewise.
5935 (tsubst_arg_types): Likewise.
5936 (tsubst_call_declarator_parms): Likewise.
5937 (unify): Remove explicit_mask.
5938 (type_unification_real): Likewise.
5939 (get_template_base_recursive): Likewise.
5940 (coerce_template_template_parms): Provide prototype.
5941 (tsubst_function_type): Likewise.
5942 (try_class_unification): New function.
5943 All callers changed to use new complain parameter.
5944 (get_template_base): Use try_class_unification.
5945 (unify): Adjust handling of classes derived from template types.
5946 (fn_type_unification): Substitute explicit arguments before
5949 1999-02-16 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
5951 * decl.c (pushdecl): Remove dead code.
5953 1999-02-16 Jason Merrill <jason@yorick.cygnus.com>
5955 * decl2.c (finish_objects): Fix code I missed in previous change.
5957 1999-02-13 Jason Merrill <jason@yorick.cygnus.com>
5959 * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node.
5960 (grokdeclarator): Don't expect error_mark_node from grokfndecl.
5962 * pt.c (maybe_process_partial_specialization): Complain about
5963 'template <>' on non-specialization.
5965 1999-02-10 Jason Merrill <jason@yorick.cygnus.com>
5967 * decl.c (grokdeclarator): Catch wierd declarators.
5968 * decl2.c (finish_file): Don't abort because of namespace parsing
5970 (check_decl_namespace): Remove.
5972 1999-02-09 Mark Mitchell <mark@markmitchell.com>
5974 * cp-tree.h (get_template_base): Don't declare.
5975 (dfs_walk): Declare.
5976 (dfs_unmark): Likewise.
5977 (markedp): Likewise.
5978 * pt.c (unify): Remove duplicate declaration. Pass tparms and
5979 targs to get_template_base.
5980 (get_template_base_recursive): Move here from search.c. Check to
5981 see that the base found can be instantiated to form the desired
5983 (get_template_base): Likewise.
5984 (get_class_bindings): Simplify.
5985 * search.c (get_template_base_recursive): Move to pt.c.
5986 (get_template_base): Likewise.
5987 (markedp): Make it global.
5988 (dfs_walk): Likewise.
5989 (dfs_unmark): Likewise.
5991 1999-02-07 Jason Merrill <jason@yorick.cygnus.com>
5993 * pt.c (maybe_process_partial_specialization): Complain about
5994 specialization in wrong namespace.
5995 * tree.c (decl_namespace_context): New fn.
5997 1999-02-06 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
5999 * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
6000 * pt.c (coerce_template_template_parms): Handle nested
6001 template template parameters.
6003 Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com)
6005 * typeck2.c: Update email addresses.
6007 1999-02-04 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6009 * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag
6012 1999-02-04 Jason Merrill <jason@yorick.cygnus.com>
6014 * lex.c (retrofit_lang_decl): Split out...
6015 (build_lang_decl): From here.
6016 * decl.c (pushdecl): Call it for functions generated by the middle
6017 end that don't have DECL_LANG_SPECIFIC.
6018 * cp-tree.h: Declare it.
6020 * decl2.c: Remove flag_init_priority. Always enable initp stuff.
6021 (start_objects, finish_objects): Only use special
6022 init_priority code if the user specified a priority.
6023 (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
6026 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
6028 * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and
6029 mkstemp.o. Get them from libiberty now.
6030 (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o.
6032 Tue Feb 2 22:38:48 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
6034 * decl2.c (lang_decode_option): Use read_integral_parameter.
6036 1999-02-01 Mark Mitchell <mark@markmitchell.com>
6038 * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED
6039 before calling complete_type_or_else.
6041 Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6043 * input.c (inline): Don't define, its handled by system.h.
6045 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
6047 * decl2.c: Don't define flag_no_ident here. Don't process
6049 * cp-tree.h: Don't declare flag_no_ident here.
6050 * lang-specs.h: Map -Qn to -fno-ident.
6052 1999-01-28 Jason Merrill <jason@yorick.cygnus.com>
6054 * cp-tree.h (struct tree_binding): Replace scope field with a union.
6055 (BINDING_SCOPE): Adjust.
6056 * decl.c (BINDING_LEVEL): Adjust.
6058 1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
6060 * pt.c (instantiate_class_template): Set up the DECL_INITIAL of
6063 * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in
6066 * tree.c (equal_functions): Fix name in prototype.
6068 * decl.c (push_local_binding): Add FLAGS argument.
6069 (pushdecl, push_overloaded_decl): Pass it.
6070 * decl2.c (do_local_using_decl): Likewise.
6071 * cp-tree.h: Adjust prototype.
6072 * decl.c (poplevel): Fix logic.
6074 * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
6075 (poplevel): Handle that. Fix logic for removing TREE_LISTs.
6076 (cat_namespace_levels): Don't loop forever.
6078 1999-01-25 Richard Henderson <rth@cygnus.com>
6080 * typeck.c (build_reinterpret_cast): Fix typo in duplicated test.
6082 1999-01-25 Jason Merrill <jason@yorick.cygnus.com>
6084 * class.c (resolve_address_of_overloaded_function): Mark the
6085 chosen function used.
6087 * call.c (build_call): Make sure that a function coming in has
6088 been marked used already.
6089 * decl.c (expand_static_init): Call mark_used instead of
6091 * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec,
6092 alloc_eh_object, expand_throw): Likewise.
6093 * init.c (build_builtin_delete_call): Likewise.
6094 * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1,
6095 expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc,
6096 expand_generic_desc): Likewise.
6098 1999-01-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
6100 * tree.c (equal_functions): New function.
6101 (ovl_member): Call it.
6103 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6105 * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf.
6107 1999-01-25 Martin von Loewis <loewis@informatik.hu-berlin.de>
6109 * decl.c (decls_match): Return 1 if old and new are identical.
6110 (push_overloaded_decl): Set OVL_USED when PUSH_USING.
6112 1999-01-24 Jason Merrill <jason@yorick.cygnus.com>
6114 * decl.c (start_function): Make member functions one_only on windows.
6115 * decl2.c (import_export_decl): Likewise.
6117 * decl.c (grokdeclarator): Don't complain about implicit int in
6118 a system header. Change same-name field check to not complain in
6119 a system header instead of within extern "C".
6121 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6123 * cp-tree.h (PUSH_GLOBAL): New macro.
6124 (PUSH_LOCAL): Likewise.
6125 (PUSH_USING): Likewise.
6126 (namespace_bindings_p): Declare.
6127 (push_overloaded_decl): Likewise.
6128 * decl.c (push_overloaded_decl): Don't make it static. Check for
6129 illegal declarations after using declarations here.
6130 (namespace_bindings_p): Likewise.
6131 (duplicate_decls): Don't consider declarations from different
6132 namespaces to be the same.
6133 (pushdecl): Use symbolic PUSH_ constants in calls to
6134 push_overloaded_decl.
6135 (push_overloaded_decl_1): Likewise.
6136 * decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
6137 (do_nonmember_using_decl): Check for illegal using declarations
6138 after ordinary declarations here.
6139 (do_local_using_decl): Call pushdecl to insert declarations.
6141 1999-01-21 Jason Merrill <jason@yorick.cygnus.com>
6143 * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo.
6145 1999-01-21 Mark Mitchell <mark@markmitchell.com>
6147 * tree.c (build_cplus_array_type_1): Don't call build_array_type
6148 for types involving template parameters.
6150 * cp-tree.h (PARM_DECL_EXPR): Delete.
6151 (convert_default_arg): Change prototype.
6152 (check_default_argument): Declare.
6153 (search_tree): Likewise.
6154 * call.c (convert_default_arg): Take the function to which the
6155 default argument belongs as a parameter, and do any necessary
6156 instantiation here, instead of ...
6157 (build_over_call): Here.
6158 * decl.c (local_variable_p): New function.
6159 (check_default_argument): Likewise, split out and tidied from ...
6161 * error.c (dump_expr): Don't set PARM_DECL_EXPR.
6162 * pt.c (tsubst_call_declarator_parms): New function.
6163 (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing
6164 with CALL_EXPRs, rather than trying to be clever.
6165 (tsubst): Use tsubst_call_declarator_parms.
6166 * tree.c (search_tree): Don't make it static.
6167 * typeck.c (convert_arguments): Use new interface to
6168 convert_default_arg.
6170 1999-01-20 Mark Mitchell <mark@markmitchell.com>
6172 * error.c (dump_function_decl): Don't print the argument types for
6173 a function when the verbosity level is negative.
6175 * call.c (build_over_call): Check format attributes at call-time.
6177 * pt.c (tsubst_copy): Fix comment.
6178 (unify): Don't allow unification with variable-sized arrays.
6180 * semantics.c (finish_stmt_expr): When processing a template make
6181 the BIND_EXPR long-lived.
6183 1999-01-19 Jason Merrill <jason@yorick.cygnus.com>
6185 * decl2.c (finish_vtable_vardecl): Make vtables comdat here.
6186 (import_export_vtable): Not here.
6188 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6190 * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique
6191 non-static member function.
6193 1999-01-18 Nathan Sidwell <nathan@acm.org>
6195 * class.c (instantiate_type): Only diagnose illegal address of member
6196 function if complaining.
6198 * decl.c (lookup_name_real): Remove duplicate code.
6200 1999-01-18 Jason Merrill <jason@yorick.cygnus.com>
6202 * tree.c (copy_template_template_parm): Use permanent_obstack.
6204 1999-01-18 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
6206 * pt.c (unify): Remove restrictions on deduction of argument
6207 of template template parameters.
6209 1999-01-18 Nathan Sidwell <nathan@acm.org>
6211 * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs.
6213 * class.c (resolve_address_of_overloaded_function): Show list of
6214 all candidates, when none of them match.
6216 1999-01-18 Chip Salzenberg <chip@perlsupport.com>
6218 * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
6219 definition of 'casting away const' in reinterpret_cast<>.
6221 1999-01-18 Graham <grahams@rcp.co.uk>
6223 * cvt.c: Add include for decl.h, remove extern for
6224 static_aggregates which is now provided by decl.h.
6226 * Makefile.in (cvt.o): Add dependency for decl.h and missing
6227 dependencies for convert.h and flags.h.
6229 1999-01-18 Nathan Sidwell <nathan@acm.org>
6231 * decl2.c (do_dtors): Set current location to that of the
6232 decl, for sensible diagnostics and debugging.
6233 (check_classfn): Issue `incomplete type' error, if
6234 class is not defined.
6236 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6238 * cp-tree.h: Add prototype for bound_pmf_p.
6240 1999-01-16 Jason Merrill <jason@yorick.cygnus.com>
6241 Manfred Hollstein <manfred@s-direktnet.de>
6243 * decl.c (grokdeclarator): Don't make 'main(){}' an error with only
6246 1999-01-16 Nathan Sidwell <nathan@acm.org>
6248 * cp-tree.h (struct lang_type): Added has_mutable flag.
6249 (CLASSTYPE_HAS_MUTABLE): New macro to access it.
6250 (TYPE_HAS_MUTABLE_P): New macro to read it.
6251 (cp_has_mutable_p): Prototype for new function.
6252 * class.c (finish_struct_1): Set has_mutable from members.
6253 * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if
6254 it contains a mutable.
6255 * typeck.c (cp_has_mutable_p): New function.
6257 1999-01-15 Mark Mitchell <mark@markmitchell.com>
6259 * pt.c (process_template_parm): Ignore top-level qualifiers on
6260 non-type parameters.
6262 * decl.c (start_function): Use current_function_parms in the call
6263 to require_complete_type_for_parms, not the probably empty
6266 1999-01-14 Jason Merrill <jason@yorick.cygnus.com>
6268 * semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
6270 * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
6271 that we don't suppress the other copies.
6272 * lex.c (handle_cp_pragma): Likewise.
6274 1999-01-13 Mark Mitchell <mark@markmitchell.com>
6276 * decl.c (grokdeclarator): Undo 1998-12-14 change.
6277 * tree.c (build_cplus_array_type_1): Likewise.
6278 * pt.c (instantiate_class_template): Remove misleading comment.
6279 (tsubst_aggr_type): Substitute if there are template parameters,
6280 regardless of whether or not they use template arguments.
6281 (unify): Likewise, but for unification.
6283 1999-01-12 Richard Henderson <rth@cygnus.com>
6285 * cp-tree.h (flag_permissive): Declare extern.
6287 1999-01-06 Mark Mitchell <mark@markmitchell.com>
6289 * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT
6291 (lang_type): Add is_partial_instantiation. Decrease width of
6293 (PARTIAL_INSTANTIATION_P): New macro.
6294 (OPERATOR_TYPENAME_P): Remove.
6295 * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not
6296 OPERATOR_TYPENAME_P.
6297 (grok_op_properties): Likewise.
6298 * friend.c (do_friend): Handle friends that are member functions
6300 * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT.
6301 * pt.c (instantiate_class_template): Rework for clarity. Avoid
6302 leaving TYPE_BEING_DEFINED set in obscure cases. Don't do
6303 any more partial instantiation than is absolutely necessary for
6304 implicit typename. Set PARTIAL_INSTANTIATION_P.
6305 (tsubst_decl): Use IDENTIFIER_TYPENAME_P.
6306 * semantics.c (begin_class_definition): Handle partial
6307 specializations of a type that was previously partially
6310 Wed Jan 6 03:18:53 1999 Mark Elbrecht <snowball3@usa.net.
6312 * g++spec.c (LIBSTDCXX): Provide default definition.
6313 (lang_specific_driver): Use LIBSTDCXX instead of "-lstdc++".
6315 Tue Jan 5 22:11:25 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6317 * Make-lang.in (g++.o): Depend on prefix.h.
6319 1999-01-04 Jason Merrill <jason@yorick.cygnus.com>
6321 * tree.c (bound_pmf_p): New fn.
6322 * typeck.c (build_c_cast): Use it.
6324 * decl.c (grok_op_properties): Use same_type_p.
6326 Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6328 * Makefile.in (cvt.o): Depend on toplev.h.
6330 * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes.
6332 * cvt.c: Include toplev.h.
6334 * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and
6337 * init.c (expand_vec_init): Initialize variable `itype'.
6339 * lex.c (yyerror): Cast the argument passed to a ctype function to
6342 * method.c (build_mangled_C9x_name): Wrap prototype and definition
6343 in "HOST_BITS_PER_WIDE_INT >= 64".
6345 * typeck.c (build_binary_op): Mark parameter `convert_p' with
6348 1998-12-22 Mark Mitchell <mark@markmitchell.com>
6350 * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation.
6351 * tree.c (build_exception_variant): Don't crash on empty throw
6354 1998-12-18 DJ Delorie <dj@cygnus.com>
6356 * cvt.c (convert_to_reference): Check for both error_mark_node
6357 and NULL_NODE after call to convert_for_initialization.
6359 1998-12-17 Jason Merrill <jason@yorick.cygnus.com>
6361 * error.c (interesting_scope_p): New fn.
6362 (dump_simple_decl): Use it.
6363 (dump_expr, case CONSTRUCTOR): Force a & for a PMF.
6364 (dump_expr, case OFFSET_REF): Print ->* if appropriate.
6366 1998-12-16 Mark Mitchell <mark@markmitchell.com>
6368 * class.c (resolve_address_of_overloaded_function): Do conversion
6369 to correct type here, rather than ...
6370 (instantiate_type): Here.
6372 * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro.
6373 (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it.
6374 (decl_template_parm_p): Remove.
6375 * decl.c (pushdecl): Don't set DECL_CONTEXT for a template
6377 * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P.
6378 * pt.c (push_inline_template_parms_recursive): Set it.
6379 (decl_template_parm_p): Remove.
6380 (check_template_shadow): Use DECL_TEMPLATE_PARM_P.
6381 (process_template_parm): Set it.
6383 Wed Dec 16 16:33:58 1998 Dave Brolley <brolley@cygnus.com>
6385 * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus
6386 if configured with cpplib.
6388 1998-12-15 Mark Mitchell <mark@markmitchell.com>
6390 * decl.c (poplevel): Make sure ns_binding is initialized.
6392 * decl.c (finish_function): Undo inadvertent change in previous
6395 1998-12-14 Mark Mitchell <mark@markmitchell.com>
6397 * class.c (pushclass): Tweak handling of class-level bindings.
6398 (resolve_address_of_overloaded_function): Update pointer-to-member
6400 (instantiate_type): Likewise.
6401 * cvt.c (cp_convert_to_pointer): Likewise.
6402 * decl.c (pop_binding): Take the DECL to pop, not just the name.
6403 Deal with `struct stat' hack.
6404 (binding_level): Add to documentation.
6405 (push_binding): Clear BINDING_TYPE.
6406 (add_binding): New function.
6407 (push_local_binding): Use it.
6408 (push_class_binding): Likewise.
6409 (poplevel): Adjust calls to pop_binding.
6410 (poplevel_class): Likewise.
6411 (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
6412 declarations to current binding level.
6413 (push_class_level_binding): Likewise.
6414 (push_overloaded_decl): Adjust handling of OVERLOADs in local
6416 (lookup_namespace_name): Don't crash when confronted with a
6418 (lookup_name_real): Do `struct stat' hack in local binding
6420 (build_ptrmemfunc_type): Adjust documentation.
6421 (grokdeclarator): Don't avoid building real array types when
6422 processing templates unless really necessary.
6423 (finish_method): Adjust calls to pop_binding.
6424 * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
6425 not reparse_decl_as_expr.
6426 (build_expr_from_tree): Deal with a template-id as the function to
6427 call in a METHOD_CALL_EXPR.
6428 * pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
6429 (maybe_adjust_types_For_deduction): Don't do peculiar things with
6431 (resolve_overloaded_unification): Handle COMPONENT_REFs. Build
6432 pointer-to-member types where necessary.
6433 * tree.c (build_cplus_array_type_1): Don't avoid building real
6434 array types when processing templates unless really necessary.
6435 (build_exception_variant): Compare the exception lists correctly.
6437 1998-12-13 Mark Mitchell <mark@markmitchell.com>
6439 * cp-tree.def (CPLUS_BINDING): Update documentation.
6440 * cp-tree.h (LOCAL_BINDING_P): New macro.
6441 (lang_identifier): Rename local_value to bindings.
6442 (tree_binding): Make `scope' of type `void*', not `tree'.
6443 (BINDING_SCOPE): Update documentation.
6444 (IDENTIFIER_LOCAL_VALUE): Remove.
6445 (IDENTIFIER_CLASS_VALUE): Document.
6446 (IDENTIFIER_BINDING): New macro.
6447 (IDENTIFIER_VALUE): Likewise.
6448 (TIME_IDENTIFIER_TIME): Likewise.
6449 (TIME_IDENTIFIER_FILEINFO): Likewise.
6450 (IMPLICIT_TYPENAME_P): Likewise.
6451 (set_identifier_local_value): Remove.
6452 (push_local_binding): New function.
6453 (push_class_binding): Likewise.
6454 * class.c (pushclass): Update comments; use push_class_binding.
6455 * decl.c (set_identifier_local_value_with_scope): Remove.
6456 (set_identifier_local_value): Likewise.
6457 (push_binding): New function.
6458 (pop_binding): Likewise.
6459 (binding_level): Update documentation. Remove shadowed.
6460 (BINDING_LEVEL): New macro.
6461 (free_binding_nodes): New variable.
6462 (poplevel): Adjust for new name-lookup scheme. Don't mess up
6463 BLOCK_VARs when doing for-scope extension. Remove effectively
6465 (pushlevel_class): Tweak formatting.
6466 (poplevel_class): Adjust for new name-lookup scheme.
6467 (print_binding_level): Likewise.
6468 (store_bindings): Likewise.
6469 (pushdecl): Likewise.
6470 (pushdecl_class_level): Likewise.
6471 (push_class_level_binding): Likewise.
6472 (push_overloaded_decl): Update comments. Adjust for new
6474 (lookup_name_real): Likewise.
6475 (lookup_name_current_level): Likewise.
6476 (cp_finish_decl): Likewise.
6477 (require_complete_types_for_parms): Likewise. Remove misleading
6479 (grok_parms): Likewise. Don't call
6480 require_complete_types_for_parms here.
6481 (grok_ctor_properties): Don't treat templates as copy
6483 (grop_op_properties): Or as assignment operators.
6484 (start_function): Document. Adjust for new name-lookup scheme.
6485 (finish_function): Likewise.
6486 * decl2.c (do_local_using_decl): Use push_local_binding.
6487 * lex.c (begin_definition_of_inclass_inline): New function, split
6489 (do_pending_inlines): Here, and ...
6490 (process_next_inline): Here.
6491 (get_time_identifier): Use TIME_IDENTIFIER_* macros.
6492 (init_filename_times): Likewise.
6493 (extract_interface_info): Likewise.
6494 (ste_typedecl_interface_info): Likewise.
6495 (check_newline): Likewise.
6496 (dump_time_statistics): Likewise.
6497 (handle_cp_pragma): Likewise.
6498 (do_identifier): Adjust for new name-lookup scheme.
6499 * parse.y (function_try_block): Return ctor_initializer_opt value.
6501 (fn.defpen): Pass appropriate values to start_function.
6502 (pending_inline): Use functor_try_block value, and pass
6503 appropriate values to finish_function.
6504 * pt.c (is_member_template): Update documentation; remove handling
6505 of FUNCTION_DECLs. As per name, this function should deal only in
6507 (decl_template_parm_p): Change name of olddecl parameter to decl.
6508 (check_template_shadow): Adjust for new name-lookup scheme.
6509 (lookup_template_class): Likewise.
6510 (tsubst_decl): Tweak so as not to confuse member templates with
6511 copy constructors and assignment operators.
6512 (unify): Handle UNION_TYPEs.
6513 * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
6514 (lang_print_xnode): Adjust for new name-lookup scheme.
6515 * typeck.c (mark_addressable): Likewise.
6516 (c_expand_return): Likewise.
6518 1998-12-08 Jason Merrill <jason@yorick.cygnus.com>
6520 * decl.c (grokdeclarator): Allow field with same name as class
6523 * decl.c (lookup_name_real): Don't limit field lookup to types.
6524 * class.c (check_member_decl_is_same_in_complete_scope): No error
6525 if icv and x are the same.
6526 * lex.c (do_identifier): Tweak error message.
6528 1998-12-10 Mark Mitchell <mark@markmitchell.com>
6530 * decl.c (start_enum): Use push_obstacks, not
6531 end_temporary_allocation.
6532 (finish_enum): Call pop_obstacks.
6534 1998-12-10 Mark Mitchell <mark@markmitchell.com>
6536 * class.c (instantiate_type): Return error_mark_node rather than
6539 1998-12-09 Mark Mitchell <mark@markmitchell.com>
6541 * cp-tree.h (most_specialized_instantiation): New function.
6542 (print_candidates): Likewise.
6543 * class.c (validate_lhs): Remove.
6544 (resolve_address_of_overloaded_function): New function, split out
6545 and then substantially reworked, from ...
6546 (instantiate_type): Use it. Simplify.
6547 * cvt.c (convert_to_reference): Complain when caller has indicated
6548 that's the right thing to do. Don't crash if instantiate_type
6550 * pt.c: Substitute `parameters' for `paramters' throughout.
6551 (print_candidates): Don't make it static.
6552 (most_specialized_instantiation): Split out from ...
6553 (most_specialized): Here.
6555 Wed Dec 9 15:33:01 1998 Dave Brolley <brolley@cygnus.com>
6557 * lex.c (lang_init_options): Initialize cpplib.
6558 * decl2.c (parse_options,cpp_initialized): Removed.
6559 (lang_decode_option): Move initialization of cpplib to
6562 1998-12-09 Mark Mitchell <mark@markmitchell.com>
6564 * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as
6565 well as the TYPE_DECL, when a typedef name is assigned to a
6566 previously anonymous type.
6568 1998-12-08 Andrew MacLeod <amacleod@cygnus.com>
6570 * cp/except.c (call_eh_info): Use __start_cp_handler instead of
6571 __cp_eh_info for getting the eh info pointer. Add table_index to
6573 (push_eh_cleanup): Don't increment 'handlers' data field.
6574 (process_start_catch_block): Don't set the 'caught' field.
6576 * cp/exception.cc (CP_EH_INFO): New macro for getting the
6577 exception info pointer within library routines.
6578 (__cp_eh_info): Use CP_EH_INFO.
6579 (__start_cp_handler): Get exception info pointer, set caught field,
6580 and increment the handlers field. Avoids this being done by handlers.
6581 (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro.
6582 (uncaught_exception): Use CP_EH_INFO macro.
6584 Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com)
6586 * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h
6588 Mon Dec 7 17:56:06 1998 Mike Stump <mrs@wrs.com>
6590 * lex.c (check_newline): Add support for \ as `natural'
6591 characters in file names in #line to be consistent with #include
6592 handling. We support escape processing in the # 1 "..." version of
6593 the command. See also support in cp/lex.c.
6595 1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu>
6597 * cp/decl2.c: s/data/opts/ when initializing cpp_reader
6600 1998-12-07 Jason Merrill <jason@yorick.cygnus.com>
6602 * decl.c (build_typename_type): Set DECL_ARTIFICIAL.
6604 * error.c (dump_simple_decl): Also print namespace context.
6605 (dump_function_decl): Likewise.
6607 * decl2.c (ambiguous_decl): Don't print old value if it's
6610 * decl.c (lookup_name_real): Fix handling of local types shadowed
6611 by a non-type decl. Remove obsolete code.
6612 * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
6614 * lang-options.h: Add -fpermissive.
6615 * decl2.c: Likewise.
6616 * cp-tree.h: Add flag_permissive.
6617 * decl.c (init_decl_processing): If neither -fpermissive or -pedantic
6618 were specified, set flag_pedantic_errors.
6619 * call.c (build_over_call): Turn dropped qualifier messages
6621 * cvt.c (convert_to_reference): Likewise.
6622 * typeck.c (convert_for_assignment): Likewise.
6624 1998-12-05 Jason Merrill <jason@yorick.cygnus.com>
6626 * decl2.c (coerce_new_type): Use same_type_p.
6627 (coerce_delete_type): Likewise.
6629 * call.c (check_dtor_name): Return 1, not error_mark_node.
6631 1998-12-04 Jason Merrill <jason@yorick.cygnus.com>
6633 * lex.c (handle_cp_pragma): Disable #pragma interface/implementation
6634 if MULTIPLE_SYMBOL_SPACES.
6636 * pt.c (check_template_shadow): New fn.
6637 * decl2.c (grokfield): Use it.
6638 * decl.c (pushdecl): Likewise.
6639 (pushdecl_class_level): Likewise.
6640 (start_method): Likewise.
6641 (xref_tag): Don't try to use 't' if we're defining.
6643 * call.c (check_dtor_name): Just return an error_mark_node.
6644 * pt.c (lookup_template_class): Complain about using non-template here.
6645 * parse.y (apparent_template_type): Not here.
6647 * pt.c (check_explicit_specialization): Complain about specialization
6650 * lang-options.h: Add -f{no-,}implicit-inline-templates.
6652 * pt.c (convert_nontype_argument): Don't assume that any integer
6653 argument is intended to be a constant-expression.
6655 1998-12-03 Mark Mitchell <mark@markmitchell.com>
6657 * class.c (handle_using_decl): Fix comment. Don't lookup
6658 constructors in base classes.
6659 (validate_lhs): Fix typo in comment.
6660 * search.c (lookup_field_1): Don't return a USING_DECL.
6662 * cp-tree.h (DECL_ACCESS): Improve documentation.
6664 * decl.c (expand_static_init): Don't set the initialization-done
6665 flag until the initialization is done.
6667 1998-12-02 Mark Mitchell <mark@markmitchell.com>
6669 * decl2.c (validate_nonmember_using_decl): Complain about using
6670 declarations for class members.
6672 1998-11-29 Jason Merrill <jason@yorick.cygnus.com>
6674 * typeck2.c (process_init_constructor): Use same_type_p.
6676 * decl.c (check_tag_decl): Don't warn about null decl inside a
6679 * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than
6681 (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE.
6682 (resolve_overloaded_unification): Strip baselinks.
6684 Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6686 * g++spec.c: Don't prototype xmalloc.
6688 1998-11-25 Jason Merrill <jason@yorick.cygnus.com>
6690 * except.c (expand_throw): Use TYPE_PTR_P to check for pointers.
6692 * decl.c (check_tag_decl): Do complain about null friend decl at
6695 1998-11-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
6697 * lex.c (make_lang_type): Clear the whole struct lang_type, not
6698 only the first multiple of sizeof (int).
6700 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
6702 * decl.c (start_decl): An explicit specialization of a static data
6703 member is only a definition if it has an initializer.
6705 * except.c (expand_throw): Use cp_finish_decl for the throw temp.
6706 * cvt.c (build_up_reference): Pass DIRECT_BIND down into
6708 * init.c (expand_default_init): Check for DIRECT_BIND instead of
6711 * call.c (build_over_call): Use build_decl.
6713 * except.c (expand_throw): Just use convert, not
6714 build_reinterpret_cast.
6716 * lex.c (handle_generic_pragma): Use token_buffer.
6718 * decl.c (check_tag_decl): Don't complain about null friend decl.
6720 1998-11-24 Dave Pitts <dpitts@cozx.com>
6722 * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the
6724 * lex.c (check_newline): Use ISALPHA.
6725 (readescape): Use ISGRAPH.
6726 (yyerror): Use ISGRAPH.
6728 1998-11-24 Nathan Sidwell <nathan@acm.org>
6730 * search.c (get_abstract_virtuals): Do not use initial
6731 CLASSTYPE_ABSTRACT_VIRTUALS.
6732 * typeck2.c (abstract_virtuals_error): Show location of abstract
6734 * call.c (build_new_method_call): Use
6735 CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate.
6736 * class.c (finish_struct_bits): Don't bother working out whether
6737 get_abstract_virtuals will do anything, just do it.
6739 1998-11-24 Graham <grahams@rcp.co.uk>
6741 * typeck.c (build_component_ref): Remove unused statement.
6743 1998-11-24 Jason Merrill <jason@yorick.cygnus.com>
6745 * class.c (add_method): Catch invalid overloads.
6747 * class.c (add_method): Build up OVERLOADs properly for conversion ops.
6748 * search.c (lookup_conversions): Handle getting real OVERLOADs.
6749 (add_conversions): Likewise. Revert last change.
6750 * call.c (add_conv_candidate): Pass totype to add_candidate instead
6751 of fn. Don't add a new candidate if the last one was for the same
6753 (print_z_candidates): Handle getting a type as a function.
6754 (joust): If we got two conversion candidates to the same type,
6756 (build_object_call): Lose 'templates'.
6757 (build_user_type_conversion_1): Handle getting real OVERLOADs.
6759 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
6761 * typeck2.c (process_init_constructor): If there are elements
6762 that don't have initializers and they need to have constructors
6763 run, supply them with initializers.
6765 * class.c (finish_struct_1): A class with a 0-width bitfield is
6768 1998-11-23 Mark Mitchell <mark@markmitchell.com>
6770 * pt.c (instantiate_class_template): Don't try to figure out what
6771 specialization to use for a partial instantiation. Correct
6772 typos in a couple of comments. Avoid calling uses_template_parms
6775 1998-11-23 Benjamin Kosnik <bkoz@cygnus.com>
6777 * method.c (process_overload_item): Add call to
6778 build_mangled_C9x_name for intTI_type_nodes.
6779 (build_mangled_C9x_name): Add prototype, define.
6780 * decl.c (init_decl_processing): Add names for
6783 1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
6785 * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
6787 * class.c (finish_struct_1): Set things up for 0-width bitfields
6788 like we do for others.
6790 * decl.c (check_tag_decl): New fn.
6791 (shadow_tag): Split out from here.
6792 * decl2.c (grok_x_components): Call it.
6794 1998-11-22 Jason Merrill <jason@yorick.cygnus.com>
6796 * decl.c: Lose warn_about_return_type.
6797 (grokdeclarator): Always complain about implicit int, except for
6800 * decl.c (tag_name): New fn.
6801 (xref_tag): Complain about using typedef-name after class-key.
6803 * init.c (expand_vec_init): Also keep going if from_array.
6805 * tree.c (is_overloaded_fn): Also handle the output of
6808 * decl.c (grokdeclarator): Use constructor_name when comparing
6809 field name against enclosing class.
6810 * class.c (finish_struct_anon): Likewise.
6812 1998-11-22 Mark Mitchell <mark@markmitchell.com>
6814 * decl.c (poplevel): Remove code to handle KEEP == 2.
6815 (finish_function): Don't confuse BLOCK-order when
6816 processing a destructor.
6818 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
6820 * decl.c (require_complete_types_for_parms): Call layout_decl
6821 after we've completed the type.
6823 1998-11-21 Martin von Löwis <loewis@informatik.hu-berlin.de>
6825 * decl2.c (validate_nonmember_using_decl): Allow using templates
6826 from the global namespace.
6828 1998-11-21 Jason Merrill <jason@yorick.cygnus.com>
6830 Handle specifying template args to member function templates.
6831 * tree.c (build_overload): Always create an OVERLOAD for a template.
6832 * search.c (add_conversions): Handle finding an OVERLOAD.
6833 * decl2.c (check_classfn): Likewise.
6834 * lex.c (identifier_type): See through a baselink.
6835 * parse.y (do_id): Don't call do_identifier if we got a baselink.
6836 * class.c (instantiate_type, case TREE_LIST): Recurse.
6838 * decl.c (grokdeclarator): Allow a boolean constant for array
6839 bounds, odd as that sounds.
6841 * pt.c (unify): Be more strict about non-type parms, except for
6843 (UNIFY_ALLOW_INTEGER): New macro.
6845 1998-11-19 Manfred Hollstein <manfred@s-direktnet.de>
6847 * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir).
6849 1998-11-19 Jason Merrill <jason@yorick.cygnus.com>
6851 * semantics.c (begin_class_definition): Call
6852 maybe_process_partial_specialization before push_template_decl.
6853 Don't call push_template_decl for a specialization.
6854 * search.c (lookup_field): Do return a member template class.
6855 * decl2.c (handle_class_head): Handle member template classes.
6857 * decl.c (grokdeclarator): A parm type need not be complete.
6859 * pt.c (convert_nontype_argument): Fix thinko.
6861 1998-11-18 Mark Mitchell <mark@markmitchell.com>
6863 * cp-tree.h (PTRMEM_CST_CLASS): Fix typo.
6864 (global_delete_fndecl): New variable.
6865 * decl.c (global_delete_fndecl): Define it.
6866 (init_decl_processing): Set it.
6867 * init.c (build_builtin_delete_call): Use it.
6868 * tree.c (mapcar): Recursively call mapcar for the type of EXPR
6871 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
6873 * decl.c (cplus_expand_expr_stmt): Always complain about unresolved
6876 * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue.
6877 * call.c (build_object_call): Also support references to functions.
6878 * typeck.c (convert_for_initialization): Don't decay a function
6879 if the target is a reference to function.
6881 * search.c (add_conversions): Get all the overloads from a class.
6883 * decl.c (grok_ctor_properties): Complain about any constructor
6884 that will take a single arg of the class type by value.
6886 * typeck2.c (build_functional_cast): Can't create objects of
6887 abstract classes this way.
6888 * cvt.c (ocp_convert): Likewise.
6890 * decl.c (grokfndecl): Member functions of local classes are not
6893 1998-11-18 Mark Mitchell <mark@markmitchell.com>
6895 * Make-lang.in (cc1plus): Add dependency on hash.o.
6897 1998-11-18 Jason Merrill <jason@yorick.cygnus.com>
6899 * search.c (get_abstract_virtuals): Complain about virtuals with
6901 * typeck2.c (abstract_virtuals_error): Remove handling for virtuals
6902 with no final overrider.
6903 * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
6904 on virtuals with no final overrider.
6906 * lex.c (reinit_parse_for_block): Add a space after the initial ':'.
6908 * class.c (finish_struct_1): Don't remove zero-width bit-fields until
6911 * friend.c (do_friend): Don't set_mangled_name_for_decl.
6913 * class.c (finish_struct_anon): Complain about non-fields.
6914 * decl2.c (build_anon_union_vars): Likewise.
6916 * decl.c (grokdeclarator): Normal data members can't have the same
6917 name as the class, either.
6918 * class.c (finish_struct_anon): Neither can members of an
6921 1998-11-17 Mark Mitchell <mark@markmitchell.com>
6923 * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses.
6924 (TYPE_BINFO): Likewise.
6925 (IS_AGGR_TYPE): Tweak.
6926 (SET_IS_AGGR_TYPE): New macro.
6927 (CLASS_TYPE_P): Tweak.
6928 (lang_type): Group mark bitfields together. Remove linenum.
6929 (CLASSTYPE_SOURCE_LINE): Remove macro.
6930 (CLASSTYPE_MARKED_N): New macro.
6931 (SET_CLASSTYPE_MARKED_N): Likewise.
6932 (CLEAR_CLASSTYPE_MARKED_N): Likewise.
6933 (CLASS_TYPE_MARKED_*): Use them.
6934 (SET_CLASSTYPE_MARKED_*): Likewise.
6935 (CLEAR_CLASSTYPE_MARKED_*): Likewise.
6936 (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
6937 (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well.
6938 (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE.
6939 * class.c (class_cache_obstack): New variable.
6940 (class_cache_firstobj): Likewise.
6941 (finish_struct): Don't set CLASSTYPE_SOURCE_LINE.
6942 (pushclass): Free the cache, when appropriate.
6944 (maybe_push_cache_obstack): Use class_cache_obstack.
6945 * decl.c (include hash.h).
6946 (typename_hash): New function.
6947 (typename_compare): Likewise.
6948 (build_typename_type): Check the hash table to avoid creating
6950 (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE.
6951 (grokdeclarator): Use CLASS_TYPE_P.
6952 (xref_basetypes): Likewise.
6953 (start_function): Likewise. Don't put current_class_ref on the
6955 * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO
6957 * lex.c (note_got_semicolon): Use CLASS_TYPE_P.
6958 (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated
6959 fields for types other than class types. Do clear TYPE_ALIAS_SET
6960 for types other than class types, though.
6961 * method.c (build_overload_identifier): Use CLASS_TYPE_P and
6962 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
6963 * pt.c (process_template_parm): Don't set
6964 CLASSTYPE_GOT_SEMICOLON.
6965 (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
6966 Coerce arguments on the momentary obstack.
6967 (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
6968 (instantiate_class_template): Calculate template arguments on the
6969 momentary obstack. Tidy.
6970 (tsubst_template_arg_vector): Use make_temp_vec.
6971 (tsubst_aggr_type): Put template arguments on the momentary
6973 (tsubst_decl): Likewise.
6974 (tsubst): Copy the array bounds index to the permanent obstack
6975 before building index types. Use new macros.
6976 (unify): Use new macros.
6977 (do_type_instantiation): Likewise.
6978 * search.c (lookup_fnfields_1): Use new macros.
6979 (dfs_pushdecls): Build envelopes on the cache obstack.
6980 (dfs_compress_decls): Use new macros.
6981 (push_class_decls): Build on the cache obstack.
6982 * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON.
6983 * sign.c (build_signature_pointer_or_reference_type): Use
6985 * tree.c (make_binfo): Check CLASS_TYPE_P.
6986 (copy_template_template_parm): Adjust.
6987 (make_temp_vec): Use push_expression_obstack.
6988 * typeck.c (complete_type): Use new macros.
6989 (comptypes): Likewise.
6991 1998-11-17 Jason Merrill <jason@yorick.cygnus.com>
6993 * pt.c (tsubst): Add diagnostics for invalid array, reference
6994 and pointer to member types.
6996 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
6998 * typeck2.c (my_friendly_abort): Don't fatal twice in a row.
7000 * typeck.c (c_expand_start_case): Use build_expr_type_conversion.
7003 * parse.y (structsp): Fix cut-and-paste error.
7005 * init.c (build_new): Complain about non-integral size.
7007 * parse.y (unary_expr): Complain about defining types in sizeof.
7009 * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn.
7011 * rtti.c (build_x_typeid): Complain about typeid without
7012 including <typeinfo>.
7013 (get_typeid): Likewise. Complain about typeid of incomplete type.
7014 (get_tinfo_fn_dynamic): Likewise.
7015 (get_typeid_1): Not static anymore.
7016 * except.c (build_eh_type_type): Use get_typeid_1.
7018 * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to
7019 ambiguous or private bases. Fix warning for reference cast.
7021 1998-11-16 Mark Mitchell <mark@markmitchell.com>
7023 * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
7024 * decl.c (duplicate_decls): Remove special-case code to deal with
7025 template friends, and just do the obvious thing.
7026 * pt.c (register_specialization): Tweak for clarity, and also to
7027 clear DECL_INITIAL for an instantiation before it is merged with a
7029 (check_explicit_specialization): Fix indentation.
7030 (tsubst_friend_function): Handle both definitions in friend
7031 declaration and outside friend declarations.
7032 (tsubst_decl): Don't clear DECL_INITIAL for an instantiation.
7033 (regenerate_decl_from_template): Tweak accordingly.
7034 (instantiate_decl): Likewise.
7036 1998-11-16 Jason Merrill <jason@yorick.cygnus.com>
7038 * decl.c (cplus_expand_expr_stmt): Promote warning about naked
7039 member function reference to error.
7040 * cvt.c (ocp_convert): Complain about converting an overloaded
7043 * init.c (build_offset_ref): Just return a lone static member
7046 * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs,
7049 * typeck.c (build_binary_op_nodefault): Improve error handling.
7051 * decl.c (grokfndecl): Complain about making 'main' a template.
7053 * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*.
7055 * call.c (build_method_call): Handle a BIT_NOT_EXPR around a
7056 TYPE_DECL in a template.
7058 1998-11-15 Jason Merrill <jason@yorick.cygnus.com>
7060 * typeck2.c (my_friendly_abort): Add URL in the other case, too.
7062 * decl.c (struct cp_function): Add named_label_uses.
7063 (push_cp_function_context): Save it.
7064 (pop_cp_function_context): Restore it.
7065 (define_label): Also complain about jumping into the scope of
7066 non-POD objects that don't have constructors.
7067 * tree.c (pod_type_p): New fn.
7069 * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner.
7070 * rtti.c (synthesize_tinfo_fn): Call import_export_decl here.
7071 (get_tinfo_fn): Not here.
7072 * repo.c (repo_get_id): Abort if we get called for an incomplete
7075 1998-11-13 Mark Mitchell <mark@markmitchell.com>
7077 * except.c (expand_throw): Make sure first argument to
7078 __cp_push_exception is of type `void*' to avoid spurious error
7081 1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
7083 * pt.c (try_one_overload): Take orig_targs again. Only check for
7084 mismatches against them; we don't care what a previous call found.
7085 (resolve_overloaded_unification): Adjust.
7087 * search.c (lookup_field): Don't return anything for a non-type
7088 field from a dependent type.
7089 * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
7090 in an array declarator.
7091 (start_decl): Push into the class before looking for the field.
7093 1998-11-08 Mark Mitchell <mark@markmitchell.com>
7095 * method.c (build_overload_value): Handle REFERENCE_TYPE.
7097 1998-11-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
7099 * decl.c (grokdeclarator): Allow namespace-scoped members if they
7102 1998-11-08 Jason Merrill <jason@yorick.cygnus.com>
7104 * pt.c (tsubst_decl): Don't mess with the global value of an
7105 un-mangled DECL_ASSEMBLER_NAME.
7107 1998-11-03 Christopher Faylor <cgf@cygnus.com>
7109 * decl.c (init_decl_processing): Remove CYGWIN conditional
7110 since CYGWIN is now able to deal with trapping signals.
7112 Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7114 * cp-tree.h: Don't include gansidecl.h.
7115 * exception.cc: Include gansidecl.h (since we don't include config.h)
7116 * g++spec.c: Don't include gansidecl.h.
7118 1998-11-06 Mark Mitchell <mark@markmitchell.com>
7120 * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease
7122 (DECL_DEFINED_IN_CLASS_P): New macro.
7123 (TEMPLATE_PARMS_FOR_INLINE): Document.
7124 (check_static_variable_definition): New function.
7125 * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if
7127 (check_static_variable_definition): Split out from ...
7128 (grokdeclarator): Here.
7129 * pt.c (check_default_tmpl_args): New function, split out from ...
7130 (push_template_decl_real): Here.
7131 (instantiate_template): Fix comment.
7133 1998-11-04 Mark Mitchell <mark@markmitchell.com>
7135 * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued.
7136 (CP_TYPE_VOLATILE_P): Likewise.
7137 (CP_TYPE_RESTRICT_P): Likewise.
7139 1998-11-03 Mark Mitchell <mark@markmitchell.com>
7141 * pt.c (tsubst): Use build_index_type, not build_index_2_type.
7143 1998-11-02 Jason Merrill <jason@yorick.cygnus.com>
7145 * class.c (instantiate_type): Be more helpful.
7147 * decl2.c (import_export_decl): Call import_export_class.
7149 * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
7150 * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
7151 * pt.c (tsubst_copy): Likewise.
7153 1998-11-02 Mark Mitchell <mark@markmitchell.com>
7155 * init.c (expand_vec_init): Fix off-by-one error.
7157 1998-11-02 Alexandre Oliva <oliva@dcc.unicamp.br>
7159 * parse.y (apparent_template_type): New type.
7160 (named_complex_class_head_sans_basetype): Use it.
7161 * Makefile.in (CONFLICTS): One new conflict.
7162 * parse.c: Regenerated.
7164 1998-11-01 Mark Mitchell <mark@markmitchell.com>
7166 * cp-tree.h (COMPARE_STRICT): New macro.
7167 (COMPARE_BASE): Likewise.
7168 (COMPARE_RELAXED): Likewise.
7169 (COMPARE_REDECLARATION): Likewise.
7170 (same_type_p): Likewise.
7171 (same_or_base_type_p): Likewise.
7172 * call.c (standard_conversion): Use them, in place of comptypes
7173 with numeric arguments.
7174 (reference_binding): Likewise.
7175 (convert_like): Likewise.
7176 (build_over_call): Likewise.
7177 (is_subseq): Likewise.
7178 (is_properly_derived_from): Likewise.
7179 (compare_ics): Likewise.
7181 * class.c (delete_duplicate_fields_1): Likewise.
7182 (resolves_to_fixed_type_p): Likewise.
7183 (instantiate_type): Likewise. Remove #if 0'd code.
7184 * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here.
7185 (pushdecl): Likewise.
7186 (lookup_name_real): Likewise.
7187 (grokdeclarator): Likewise. Check for illegal array declarations.
7188 (grokparms): Likewise.
7189 (grok_op_properties): Likewise.
7190 * decl2.c (check_classfn): Likewise.
7191 * friend.c (is_friend): Likewise.
7192 (make_friend_class): Likewise.
7193 * init.c (expand_aggr_init): Likewise.
7194 (expand_vec_init): Likewise.
7195 * pt.c (is_member_template_class): Remove declaration.
7196 (is_specialization_of): Use COMPARE_* and new macros.
7197 (comp_template_parms): Likewise.
7198 (convert_nontype_argument): Likewise.
7199 (coerce_template_template_parms): Likewise.
7200 (template_args_equal): Likewise.
7201 (lookup_template_class): Likewise.
7202 (type_unification_real): Likewise.
7204 (get_bindings_real): Likewise.
7205 * search.c (covariant_return_p): Likewise.
7206 (get_matching_virtual): Likewise.
7207 * sig.c (match_method_types): Likewise.
7208 * tree.c (vec_binfo_member): Likewise.
7209 (cp_tree_equal): Likewise.
7210 * typeck.c (common_type): Likewise.
7211 (comp_array_types): Likewise. Get issues involving unknown array
7213 (comptypes): Update comments. Use new flags.
7214 (comp_target_types): Use new macros.
7215 (compparms): Likewise.
7216 (comp_target_parms): Likewise.
7217 (string_conv_p): Likewise.
7218 (build_component_ref): Likewise.
7219 (build_indirect_ref): Likewise.
7220 (build_conditional_expr): Likewise.
7221 (build_static_cast): Likewise.
7222 (build_reinterpret_cast): Likewise.
7223 (build_const_cast): Likewise.
7224 (build_modify_expr): Likewise.
7225 (convert_for_assignment): Likewise.
7226 (comp_ptr_ttypes_real): Likewise.
7227 (ptr_reasonably_similar): Likewise.
7228 (comp_ptr_ttypes_const): Likewise.
7230 1998-10-31 Jason Merrill <jason@yorick.cygnus.com>
7232 * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error.
7234 1998-10-30 Mark Mitchell <mark@markmitchell.com>
7236 * decl2.c (delete_sanity): Pass integer_zero_node, not
7237 integer_two_node, to build_vec_delete.
7238 * init.c (build_array_eh_cleanup): Remove.
7239 (expand_vec_init_try_block): New function.
7240 (expand_vec_init_catch_clause): Likewise.
7241 (build_vec_delete_1): Don't deal with case that auto_delete_vec
7242 might be integer_two_node anymore.
7243 (expand_vec_init): Rework for initialization-correctness and
7244 exception-correctness.
7245 * typeck2.c (process_init_constructor): Make mutual exclusivity
7246 of cases more obvious.
7248 1998-10-29 Jason Merrill <jason@yorick.cygnus.com>
7250 * decl.c (lookup_name_real): OK, only warn if not lexing.
7251 Simplify suggested fix.
7253 * cp-tree.h (IDENTIFIER_MARKED): New macro.
7254 * search.c (lookup_conversions): Use breadth_first_search.
7255 (add_conversions): Avoid adding two conversions to the same type.
7256 (breadth_first_search): Work with base binfos, rather
7257 than binfos and base indices.
7258 (get_virtual_destructor): Adjust.
7259 (tree_has_any_destructor_p): Adjust.
7260 (get_matching_virtual): Adjust.
7262 * pt.c (push_template_decl_real): Generalize check for incorrect
7263 number of template parms.
7264 (is_member_template_class): #if 0.
7266 1998-10-29 Richard Henderson <rth@cygnus.com>
7268 * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
7271 1998-10-28 Zack Weinberg <zack@rabi.phys.columbia.edu>
7273 * lex.c: Call check_newline from lang_init always. After
7274 calling cpp_start_read, set yy_cur and yy_lim to read from the
7275 cpplib token buffer.
7277 1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
7279 * class.c (instantiate_type): Don't consider templates for a normal
7282 * class.c (finish_struct_1): Don't complain about non-copy
7283 assignment ops in union members.
7285 * class.c (build_vtable): Don't pass at_eof to import_export_vtable.
7286 (prepare_fresh_vtable): Likewise.
7287 (finish_struct_1): Don't call import_export_class.
7288 * decl2.c (finish_vtable_vardecl): Do import/export stuff.
7289 (finish_prevtable_vardecl): Lose.
7290 (finish_file): Don't call it.
7291 * pt.c (instantiate_class_template): Likewise.
7292 * cp-tree.h: Remove it.
7294 * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here.
7295 * decl.c (finish_function): Not here.
7296 (start_function): Do set DECL_INITIAL.
7298 * pt.c (push_template_decl_real): Complain about default template
7299 args for enclosing classes.
7301 * call.c (add_function_candidate): Treat conversion functions
7302 as coming from the argument's class.
7303 * cp-tree.h (DECL_CONV_FN_P): New fn.
7304 (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE.
7305 * class.c (add_method): Use DECL_CONV_FN_P.
7306 * decl2.c (check_classfn): Likewise.
7307 * error.c (dump_function_name): Likewise.
7308 (dump_function_decl): Likewise.
7309 * pt.c (fn_type_unification): Likewise.
7310 * search.c (add_conversions): Likewise.
7312 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7314 * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL.
7315 * method.c (hack_identifier): Also check for using RESULT_DECL
7318 1998-10-27 Mark Mitchell <mark@markmitchell.com>
7320 * decl.c (grokdeclarator): Use type_quals, rather than constp,
7323 1998-10-27 Jason Merrill <jason@yorick.cygnus.com>
7325 * call.c (standard_conversion): instantiate_type here.
7326 (reference_binding): And here.
7327 (implicit_conversion): Not here.
7328 (build_op_delete_call): No need to cons up an OVERLOAD.
7329 * cvt.c (cp_convert_to_pointer): instantiate_type here.
7330 (convert_to_reference): And here.
7331 * decl.c (grok_reference_init): Not here.
7332 (grokparms): Or here.
7333 * typeck2.c (digest_init): Or here.
7334 * typeck.c (decay_conversion): Take the address of overloaded
7336 (require_instantiated_type): Lose.
7337 (convert_arguments): Don't handle unknown types here.
7338 (build_c_cast): Likewise.
7339 (build_binary_op): Gut.
7340 (build_conditional_expr): Don't require_instantiated_type.
7341 (build_modify_expr): Likewise.
7342 (build_static_cast): Don't instantiate_type.
7343 (build_reinterpret_cast): Likewise.
7344 (build_const_cast): Likewise.
7345 (convert_for_initialization): Likewise.
7346 (build_ptrmemfunc): Use type_unknown_p.
7347 (convert_for_assignment): Also do default_conversion on overloaded
7348 functions. Hand them off to ocp_convert.
7350 1998-10-26 Mark Mitchell <mark@markmitchell.com>
7352 * error.c (dump_decl): Deal with TEMPLATE_DECLs that are
7353 VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type.
7355 * class.c (finish_struct_1): Use build_cplus_array_type to build
7357 * decl.c (init_decl_processing): Likewise.
7358 * except.c (expand_end_eh_spec): Likewise.
7359 * search.c (expand_upcast_fixups): Simplify very slightly.
7361 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7363 * decl.c (grokdeclarator): Complain about a variable using
7364 constructor syntax coming back null from start_decl.
7366 * friend.c (make_friend_class): Complain about trying to make
7367 a non-class type a friend.
7369 * decl.c (grokfndecl): Set DECL_INITIAL for a defn here.
7370 (start_function): Not here.
7372 1998-10-26 Brendan Kehoe <brendan@cygnus.com>
7374 * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration.
7376 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7378 * typeck2.c (process_init_constructor): Only skip anonymous fields
7379 if they are bitfields.
7381 * cp-tree.def (TYPEOF_TYPE): New code.
7382 * error.c (dump_type_real): Handle it.
7383 * pt.c (tsubst): Likewise.
7384 * tree.c (search_tree): Likewise.
7385 * semantics.c (finish_typeof): New fn.
7386 * parse.y (typespec): Use it.
7387 * cp-tree.h: Declare it.
7389 1998-10-26 Manfred Hollstein <manfred@s-direktnet.de>
7391 * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional.
7393 1998-10-26 Jason Merrill <jason@yorick.cygnus.com>
7395 * typeck.c (convert_arguments): Don't handle pmf references
7398 * init.c (build_member_call): Don't try to convert to the base type
7399 if it's ambiguous or pedantic.
7401 * typeck2.c (check_for_new_type): Only depend on pedantic for
7404 1998-10-25 Mark Mitchell <mark@markmitchell.com>
7406 * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all
7407 non-converting constructors.
7409 1998-10-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
7411 * gxxint.texi: Correct documentation for n, N, Q, and B.
7413 1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
7415 * parse.y (condition): Convert VAR_DECL from reference to indirect
7418 1998-10-23 Andrew MacLeod <amacleod@cygnus.com>
7420 * exception.cc (__cp_pop_exception): Free the original exception
7421 value, not the potentially coerced one.
7423 1998-10-23 Mark Mitchell <mark@markmitchell.com>
7425 * Makefile.in (hash.h): Run gperf when necessary.
7427 * cp-tree.h (CP_TYPE_READONLY): Remove.
7428 (CP_TYPE_VOLATILE): Likewise.
7429 (CP_TYPE_QUALS): New macro.
7430 (CP_TYPE_CONST_P): Likewise.
7431 (CP_TYPE_VOLATILE_P): Likewise.
7432 (CP_TYPE_RESTRICT_P): Likewise.
7433 (CP_TYPE_CONST_NON_VOLATILE_P): Likewise.
7434 (cp_build_type_variant): Rename to ...
7435 (cp_build_qualified_type): New function.
7436 (c_apply_type_quals_to_decl): Declare.
7437 (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'.
7438 (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise.
7439 (cp_type_qual_from_rid): New function.
7440 (compparms): Remove unused parameter. All callers changed.
7441 (cp_type_quals): New function.
7442 (at_least_as_qualified_p): Likewise.
7443 (more_qualified_p): Likewise.
7445 * call.c (standard_conversion): Replace calls to
7446 cp_build_type_variant with cp_build_qualified_type. Use
7447 CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to
7448 compare them. Use CP_TYPE_* macros to check qualifiers.
7449 (reference_binding): Likewise.
7450 (implicit_conversion): Likewise.
7451 (add_builtin_candidates): Likewise.
7452 (build_over_call): Likewise.
7453 * class.c (overrides): Compare all qualifiers, not just `const',
7454 on method declarations.
7455 * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc.
7456 (convert_pointer_to_real): Likewise.
7457 (type_promotes_to): Likewise.
7458 * decl.c (check_for_uninitialized_const_var): New function.
7459 (init_decl_processing): More CP_TYPE_QUALS conversion, etc.
7460 (cp_finish_decl): Use check_for_uninitialized_const_var.
7461 (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to
7463 (grok_ctor_properties): Likewise.
7464 (grok_op_properties): Likewise.
7465 (start_function): Likewise.
7466 (rever_static_member_fn): Likewise.
7467 * decl2.c (grok_method_quals): Likewise.
7468 (grokfield): Likewise.
7469 * error.c (dump_readonly_or_volatile): Rename to ...
7470 (dump_qualifiers): New function. Handle `restrict'.
7471 (dump_type_real): Use it.
7472 (dump_aggr_type): Likewise.
7473 (dump_type_prefix): Likewise.
7474 (dump_type_suffix): Likewise.
7475 (dump_function_decl): Likewise.
7476 (cv_as_string): Likewise.
7477 * gxx.gperf: Add __restrict and __restrict__.
7478 * gxxint.texi: Document `u' as used for `__restrict', and a few
7479 other previously undocumented codes.
7480 * hash.h: Regenerated.
7481 * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc.
7482 (build_member_call): Likewise.
7483 (build_new_1): Likewise.
7484 * lex.c (init_parse): Add entry for RID_RESTRICT.
7485 (cons_up_default_function): More CP_TYPE_QUALS conversion, etc.
7486 (cp_type_qual_from_rid): Define.
7487 * lex.h (enum rid): Add RID_RESTRICT.
7488 * method.c (process_modifiers): Deal with `restrict'.
7489 * parse.y (primary): More CP_TYPE_QUALS conversion, etc.
7490 * parse.c: Regenerated.
7491 * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc.
7492 (tsubst_aggr_type): Likewise.
7494 (check_cv_quals_for_unify): Likewise.
7496 * rtti.c (init_rtti_processing): Likewise.
7497 (build_headof): Likewise.
7498 (get_tinfo_var): Likewise.
7499 (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling.
7500 (expand_class_desc): Likewise.
7501 (expand_attr_desc): Likewise.
7502 (synthesize_tinfo_fn): Likewise.
7503 * search.c (covariant_return_p): Likewise. Fix `volatile' handling.
7504 (get_matching_virtual): Likewise.
7505 (expand_upcast_fixups): Likewise.
7506 * sig.c (build_signature_pointer_or_reference_name): Take
7507 type_quals, not constp and volatilep.
7508 (build_signature_pointer_or_reference_type): Likewise.
7509 (match_method_types): More CP_TYPE_QUALS conversion, etc.
7510 (build_signature_pointer_constructor): Likewise.
7511 (build_signature_method_call): Likewise.
7512 * tree.c (build_cplus_array_type): Likewise.
7513 (cp_build_type_variant): Rename to ...
7514 (cp_build_qualified_type): New function. Deal with `__restrict'.
7515 (canonical_type_variant): More CP_TYPE_QUALS conversion, etc.
7516 (build_exception_variant): Likewise.
7518 * typeck.c (qualif_type): Likewise.
7519 (common_type): Likewise.
7520 (comptypes): Likewise.
7521 (comp_cv_target_types): Likewise.
7522 (at_least_as_qualified_p): Define.
7523 (more_qualified_p): Likewise.
7524 (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc.
7525 (compparms): Likewise.
7526 (inline_conversion): Likewise.
7527 (string_conv_p): Likewise.
7528 (build_component_ref): Likewise.
7529 (build_indirect_ref): Likewise.
7530 (build_array_ref): Likewise.
7531 (build_unary_op): Likewise.
7532 (build_conditional_expr): Likewise.
7533 (build_static_cast): Likewise.
7534 (build_c_cast): Likewise.
7535 (build_modify_expr): Likewise.
7536 (convert_For_assignment): Likewise.
7537 (comp_ptr_ttypes_real): Likewise.
7538 (cp_type_quals): New function.
7540 1998-10-23 Jason Merrill <jason@yorick.cygnus.com>
7542 * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays.
7543 (CP_TYPE_VOLATILE): Likewise.
7544 * decl.c (grokdeclarator): Use them.
7545 * tree.c (canonical_type_variant): Likewise.
7547 1998-10-22 Martin von Löwis <loewis@informatik.hu-berlin.de>
7549 * parse.y (named_class_head): Push into class while parsing the
7551 * decl2.c (push_scope, pop_scope): New functions.
7552 * cp-tree.h: Declare them.
7553 * init.c (build_new_1): Delay cleanup until end of full expression.
7555 1998-10-21 Jason Merrill <jason@yorick.cygnus.com>
7557 * typeck.c (build_component_ref): Use of a type here is an error.
7559 1998-10-19 Jason Merrill <jason@yorick.cygnus.com>
7561 Revamp references to member functions.
7562 * method.c (hack_identifier): Call build_component_ref for a
7563 reference to a member function.
7564 * typeck.c (build_component_ref): Only return a single function
7565 if it's static. Otherwise, return a COMPONENT_REF.
7566 (build_x_function_call): Handle a COMPONENT_REF.
7567 (build_unary_op): Handle all unknown-type things.
7568 * decl2.c (arg_assoc): Handle COMPONENT_REF.
7569 * class.c (instantiate_type): Complain if the function we get is a
7570 nonstatic member function. Remove code for finding "compatible"
7572 * pt.c (tsubst_copy): Handle NOP_EXPR.
7573 * tree.c (build_dummy_object): New fn.
7574 (maybe_dummy_object): New fn.
7575 (is_dummy_object): New fn.
7576 * cp-tree.h: Declare them.
7577 * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object.
7578 * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object.
7579 * init.c (build_member_call): Use maybe_dummy_object and
7581 (build_offset_ref): Use maybe_dummy_object.
7582 (resolve_offset_ref): Use is_dummy_object.
7583 * typeck.c (build_x_function_call): Call build_dummy_object.
7584 (unary_complex_lvalue): Call is_dummy_object.
7586 * typeck.c (build_component_addr): Make sure field is a field.
7588 * call.c (build_new_op): Delete obsolete code.
7590 * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args.
7592 1998-10-18 Martin von Löwis <loewis@informatik.hu-berlin.de>
7594 * decl2.c (validate_nonmember_using_decl): Fix using-directives of
7595 std if std is ignored.
7597 1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
7599 * decl.c (grokvardecl): Fix thinko.
7601 * decl.c (grokdeclarator): Embedded attrs bind to the right,
7604 * parse.y (fn.def2): Fix 'attrs' format.
7606 1998-10-18 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
7608 * Makefile.in (CONFLICTS): Update.
7609 * parse.y (expr_or_declarator_intern): New rule.
7610 (expr_or_declarator, direct_notype_declarator, primary,
7611 functional_cast): Use it.
7612 (notype_declarator_intern): New rule.
7613 (notype_declarator, complex_notype_declarator): Use it.
7615 1998-10-17 Jason Merrill <jason@yorick.cygnus.com>
7617 * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate.
7618 (grokvardecl): Likewise.
7620 Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7622 * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR).
7623 (add_method): Likewise for arguments 1 & 2 of `bcopy'.
7625 * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN.
7627 * pt.c (process_partial_specialization): Cast 1st argument of
7630 * tree.c (build_base_fields): Cast `base_align' to (int) when
7631 comparing against one.
7633 1998-10-16 Mark Mitchell <mark@markmitchell.com>
7635 * decl.c (lookup_name_real): Handle template parameters for member
7636 templates where said parameters have the same name as the
7639 * decl.c (expand_static_init): Build cleanups before entering the
7640 anonymous function used to do them to avoid access-checking
7643 * decl.c (grokfndecl): Add back call to cplus_decl_attributes
7644 accidentally removed by previous change, and make DECL_RTL here.
7645 * class.c (add_method): Don't make DECL_RTL here.
7647 * pt.c (for_each_template_parm): Don't examine uninstantiated
7650 1998-10-16 Dave Brolley <brolley@cygnus.com>
7652 * lex.c (real_yylex): Fix unaligned access of wchar_t.
7654 1998-10-16 Mark Mitchell <mark@markmitchell.com>
7656 * class.c (add_method): Fix documentation to reflect previous
7657 changes. Check for duplicate method declarations here.
7658 * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL
7659 correctly; such things never match.
7660 (grokfndecl): Don't look for duplicate methods here.
7661 * decl2.c (check_classfn): Don't assume names are mangled.
7662 Don't add bogus member function declarations to a class before the
7663 class type is complete.
7664 (grokfield): Reformat error message.
7665 * method.c (set_mangled_name_for_decl): Don't mangle names while
7666 processing_template_decl.
7668 1998-10-16 Jason Merrill <jason@yorick.cygnus.com>
7670 * typeck.c (build_indirect_ref): Complain about a pointer to data
7672 * typeck2.c (build_m_component_ref): Don't indirect a pointer to
7674 * init.c (resolve_offset_ref): Don't undo the above.
7676 * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros.
7677 (struct lang_decl_flags): Add `bitfield'.
7678 * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of
7680 * decl2.c (grokbitfield, grok_alignof): Likewise.
7681 * init.c (build_offset_ref): Likewise.
7682 * typeck.c (build_component_addr, expr_sizeof): Likewise.
7683 * cvt.c (build_up_reference): Don't crash if taking the address
7684 returns error_mark_node.
7686 * decl.c (grokfndecl): Also check ctype when checking for ::main().
7688 1998-10-15 Jason Merrill <jason@yorick.cygnus.com>
7690 * decl.c (grokfndecl): ::main and __builtin_* get C linkage.
7692 (grokdeclarator): Instead of here.
7693 * friend.c (do_friend): Lose special handling of ::main and
7695 * cp-tree.h (DECL_MAIN_P): Check for C linkage.
7697 * spew.c (yylex): Clear looking_for_typename if we got
7700 1998-10-15 Mark Mitchell <mark@markmitchell.com>
7702 * class.c (maybe_warn_about_overly_private_class): Improve error
7703 messages for class with only private constructors.
7705 * cp-tree.def (TYPENAME_TYPE): Add to documentation.
7706 * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document.
7707 (build_typename_type): New function.
7708 * decl.c (build_typename_type): Broken out from ...
7709 (make_typename_type): Use it.
7710 * search.c (lookup_field): Likewise.
7712 1998-10-14 Benjamin Kosnik <bkoz@rhino.cygnus.com>
7714 * pt.c (convert_nontype_argument): Check against type_referred_to.
7715 * decl.c (grokvardecl): Check for declarator name before building
7716 DECL_ASSEMBLER_NAME.
7718 1998-10-14 Mark Mitchell <mark@markmitchell.com>
7720 * pt.c (lookup_template_class): Add comment.
7721 (instantiate_class_template): Don't mark the _TYPE node for
7722 member class templates as an instantiation.
7724 1998-10-14 Jason Merrill <jason@yorick.cygnus.com>
7726 * decl.c (grokfndecl): Fix my thinko.
7728 1998-10-13 Jason Merrill <jason@yorick.cygnus.com>
7730 * tinfo2.cc (fast_compare): Remove.
7731 (before): Just use strcmp.
7732 * tinfo.cc (operator==): Just use strcmp.
7734 1998-10-13 Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
7736 * decl.c (grokfndecl): Don't check for linkage in `extern "C"'
7739 1998-10-13 Mark Mitchell <mark@markmitchell.com>
7741 * cp-tree.h (specializations_of_same_template_p): Remove.
7742 * search.c (get_template_base): Don't use it.
7743 (get_template_base_recursive): Likewise.
7744 * pt.c (specializations_of_same_template_p): Remove.
7745 (unify): Don't use it.
7746 (lookup_template_class): Find the correct parent when setting
7747 CLASSTYPE_TI_TEMPLATE.
7749 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
7751 * tinfo.cc (operator==): Always compare names.
7753 1998-10-12 Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
7755 * decl.c (start_function): Fix cut-and-paste error.
7757 1998-10-12 Jason Merrill <jason@yorick.cygnus.com>
7759 * inc/typeinfo: Add #pragma interface.
7760 (operator!=): Just call operator==.
7761 * tinfo.cc: Add #pragma implementation.
7762 (operator==): Move from inc/typeinfo and tinfo2.cc.
7763 Check __COMMON_UNRELIABLE instead of _WIN32.
7765 * typeck2.c (my_friendly_abort): Add URL.
7767 1998-10-12 Alastair J. Houghton <ajh8@doc.ic.ac.uk>
7769 * decl.c (start_method): Added extra parameter for attributes.
7770 * cp-tree.h (start_method): Update prototype.
7771 * parse.y (fn.def2): Update start_method parameter list.
7773 1998-10-11 Mark Mitchell <mark@markmitchell.com>
7775 * cp-tree.h (specializations_of_same_template_p): Declare.
7776 * pt.c (specializations_of_same_template_p): New function.
7778 * search.c (get_template_base): Use it.
7779 (get_template_base_recursive): Likewise.
7781 1998-10-10 Manfred Hollstein <manfred@s-direktnet.de>
7783 * decl2.c (start_objects): Add new variable `joiner' and
7784 initialize it properly.
7786 1998-10-09 Mark Mitchell <mark@markmitchell.com>
7788 * search.c (expand_upcast_fixups): Tweak to match 1998-10-07
7789 change to vtable types.
7791 * cvt.c (ocp_convert): Avoid infinite recursion caused by
7794 1998-10-08 Jason Merrill <jason@yorick.cygnus.com>
7796 * pt.c (resolve_overloaded_unification): New fn.
7797 (try_one_overload): Likewise.
7798 (unify): Don't fail on unknown type.
7799 (type_unification_real): Likewise. Use resolve_overloaded_unification
7800 to handle an overloaded argument.
7801 (template_args_equal): Split out...
7802 (comp_template_args): From here.
7803 (determine_specialization): Also allow a template with more
7804 parms than were explicitly specified.
7805 * cp-tree.h: Add template_args_equal.
7806 * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code.
7808 Thu Oct 8 15:58:30 1998 Anthony Green <green@cygnus.com>
7810 * semantics.c (finish_asm_stmt): Revert my 1998-09-28
7813 Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com)
7815 * typeck.c (unsigned_type): Only return TItype nodes when
7816 HOST_BITS_PER_WIDE_INT is >= 64 bits.
7817 (signed_type): Likewise.
7818 * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
7819 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7820 (init_decl_processing): Only create TItype nodes when
7821 HOST_BITS_PER_WIDE_INT is >= 64 bits.
7822 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare
7823 when HOST_BITS_PER_WIDE_INT is >= 64 bits.
7825 Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7827 * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf.
7828 (gxx.gperf): Update comments describing invocation flags.
7829 (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
7831 1998-10-07 Mark Mitchell <mark@markmitchell.com>
7833 * class.c (finish_struct_1): Add commentary on previous change.
7835 * cp-tree.h (vtbl_ptr_type_node): New variable.
7836 * class.c (build_vtbl_ref): Don't indirect through the vptr; it's
7837 already of the right type.
7838 (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node.
7839 Simplify code to grow vtable.
7840 * decl.c (vtbl_ptr_type_node): Define.
7841 (init_decl_processing): Initialize it.
7843 1998-10-06 Mark Mitchell <mark@markmitchell.com>
7845 * cp-tree.def (PTRMEM_CST): New tree node.
7846 * cp-tree.h (ptrmem_cst): New type.
7847 (lang_type): Remove local_typedecls.
7848 (dummy): Increase to 12 bits from 11.
7849 (CLASSTYPE_LOCAL_TYPEDECLS): Remove.
7850 (PTRMEM_CST_CLASS): New macro.
7851 (PTRMEM_CST_MEMBER): Likewise.
7852 (current_access_specifier): New variable.
7853 (current_class_type): Remove duplicate declaration.
7854 (finish_struct): Change prototype.
7855 (unreverse_member_declarations): New function.
7856 (pushdecl_class_level): Change prototype.
7857 (grok_enum_decls): Remove.
7858 (fixup_anonymous_union): New function.
7859 (grok_x_components): Change prototype.
7860 (tsubst_chain): Remove.
7861 (finish_member_template_decl): Likewise.
7862 (check_explicit_specialization): Fix indentation.
7863 (finish_class_definition): Change prototype.
7864 (finish_member_class_template): Likewise.
7865 (finish_member_declaration): New function.
7866 (check_multiple_declarators): Likewise.
7867 * class.c (class_stack_node_t): New type.
7868 (current_class_base): Remove.
7869 (current_class_stack): Change type.
7870 (current_access_specifier): New variable.
7871 (grow_method): Remove.
7872 (check_member_decl_is_same_in_complete_scope): Break out from
7874 (make_method_vec): New function.
7875 (free_method_vec): Likewise.
7876 (add_implicitly_declared_members): Break out from finish_struct_1.
7877 (free_method_vecs): New variable.
7878 (add_method): Rework for direct use from parser.
7879 (handle_using_decl): Watch for NULL_TREE while iterating through
7880 CLASSTYPE_METHOD_VEC.
7881 (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here;
7882 just do some error-checking.
7883 (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC.
7884 (finish_struct_1): Simplify. Use add_implicitly_declared_members.
7885 (finish_struct): Change prototype. Simplify; fields and methods
7886 are already set up at this point.
7887 (init_class_processing): Set up current_class_stack.
7888 (pushclass): Save current_access_specifier.
7889 (popclass): Restore it.
7890 (currently_open_class): Simplify.
7891 (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS.
7892 * decl.c (saved_scope): Add access_specifier.
7893 (maybe_push_to_top_level): Save it.
7894 (pop_from_top_level): Restore it.
7895 (maybe_process_template_type_declaration): Use
7896 finish_member_declaration.
7897 (pushtag): Likewise.
7898 (pushdecl_class_level): Don't return a value.
7899 (fixup_anonymous_union): Break out from grok_x_components.
7900 (shadow_tag): Use it.
7901 (xref_tag): Complain about using an elaborated type specifier to
7902 reference a template type parameter or typedef name.
7903 (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
7904 (current_local_enum): Remove.
7905 (build_enumerator): Call finish_member_declaration.
7906 (grok_enum_decls): Remove.
7907 * decl2.c (grok_x_components): Simplify.
7908 (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC.
7909 (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS.
7910 (merge_functions): Add to comment.
7911 (arg_assoc_type): Prototype.
7912 (arg_assoc): Pass as many arguments as there are parameters.
7913 * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of
7915 * expr.c (cpls_expand_expr): Remove dead code. Handle
7917 * friend.c (do_friend): Lookup friends when in nested classes.
7919 * init.c (build_offset_ref): Do lookup even for classes that are
7920 only partially defined.
7921 (decl_constant_value): Remove dead code.
7922 * method.c (build_overload_value): Remove hack where by TYPE was
7923 not a TYPE. Handle PTRMEM_CST.
7924 (build_template_parm_names): Don't pass a PARM_DECL where a TYPE
7926 * parse.y (components, notype_components, component_decl,
7927 component_decl_1, component_declarator, component_declarator0):
7928 Now all are itype rather than ttype. Rework to add members to
7930 (typesqpecqual_reserved): Use check_multiple_declarators.
7931 (structsp): Update class to finish_class_definition.
7932 (do_xref_defn): Unsplit into named_class_head.
7933 (access_specifier): Set current_access_specifier.
7934 * pt.c (set_current_access_from_decl): New function.
7935 (finish_member_template_decl): Don't take the parameters.
7936 (comp_template_args): Make more robust.
7937 (lookup_template_class): Don't use current_local_enum.
7938 (for_each_template_parm): Handle PTRMEM_CST.
7939 (instantiate_class_template): Use set_current_access_from_decl,
7940 finish_member_declaration and unreverse_member_declarations. Set
7941 lineno/input_filename before generating implicit member functions.
7942 (type_unification_real): Don't assume back-unification happens
7943 only for the last argument.
7944 (regenerate_decl_from_template): Call pushclass a bit earlier.
7945 (tsubst_chain): Remove.
7946 (tsubst_enum): Use set_current_access_from_decl.
7947 (set_mangled_name_for_template_decl): Fix indentation.
7948 * search.c (lookup_fnfields_1): Change iteration through
7949 CLASSTYPE_METHOD_VEC.
7950 (dfs_pushdecls): Likewise.
7951 (dfs_compress_decls): Likewise.
7952 (add_conversions): Likewise.
7953 * semantics.c (finish_class_definition): Don't take components.
7954 Change call to finish_struct.
7955 (finish_member_declaration): New function.
7956 (finish_member_class_template): Don't take template parameters.
7957 Change call to grok_x_components. Call finish_member_template_decl.
7958 (check_multiple_declarators): New function.
7959 * sig.c (append_signature_fields): Work from the TYPE_METHODS, not
7960 a passed in fieldlist.
7961 * tree.c (search_tree): Handle PTRMEM_CST.
7963 * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not
7964 INTEGER_CSTs, for pointer-to-data members.
7966 * call.c (resolve_args): Resolve template specializations, if
7969 Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7971 * Makefile.in (spew.o): Depend on toplev.h.
7973 * call.c (compare_ics): Initialize variables `deref_from_type2',
7974 `deref_to_type1' and `deref_to_type2'.
7976 * except.c (get_eh_type): Hide prototype and definition.
7977 (process_start_catch_block_old): Remove unused static prototype.
7979 * pt.c (tsubst_decl): Initialize variable `argvec'.
7981 * spew.c: Include toplev.h.
7983 1998-10-05 Jason Merrill <jason@yorick.cygnus.com>
7985 * pt.c (instantiate_decl): Do save and restore file position.
7987 1998-10-05 Martin von Löwis <loewis@informatik.hu-berlin.de>
7989 * method.c (build_decl_overload_real): Clear
7990 numeric_output_need_bar after __.
7992 1998-10-05 Nathan Sidwell <nathan@acm.org>
7994 * call.c (build_new_method_call): Issue 'incomplete type' error,
7995 if class is not defined.
7997 1998-10-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7999 * call.c (build_object_call): Move declaration of variable
8000 `fn' into the scope where it is used. Don't access variable
8001 `fn' when it is uninitialized, instead use `fns'.
8003 1998-10-04 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
8005 * errfn.c (cp_thing): Print buf as a string not as a printf format
8006 to avoid problems with the operator%. Consequently, `%%' sequences
8007 in format are copied as `%' in buf.
8009 1998-10-04 Jason Merrill <jason@yorick.cygnus.com>
8011 * pt.c (pop_tinst_level): Call extract_interface_info.
8012 (instantiate_decl): Don't save and restore file position.
8014 * decl.c (cp_finish_decl): Make statics in extern inlines and
8015 templates common, if possible and the target doesn't support weak
8018 * decl.c (grokdeclarator): Remove redundant calls to
8019 build_type_variant and some duplicated code.
8020 * sig.c (build_signature_reference_type): Only take the type parm.
8021 (build_signature_pointer_type): Likewise.
8022 * tree.c (build_cplus_method_type): Adjust.
8023 * cp-tree.h: Update.
8025 1998-10-04 Mark Mitchell <mark@markmitchell.com>
8027 * call.c (build_over_call): Make pedwarns about dropped qualifiers
8028 into full-fledged errors.
8029 * cvt.c (convert_to_reference): Likewise.
8030 * typeck.c (convert_for_assignment): Likewise.
8032 * search.c (expand_upcast_vtables): In addition to unsetting
8033 TREE_READONLY, remove top-level const type qualifier.
8035 1998-10-03 Mark Mitchell <mark@markmitchell.com>
8037 * class.c (current_class_ptr, current_class_ref): Clarify
8039 * cvt.c (ocp_convert): Don't expect fold to remove all trivial
8040 NOP type conversions.
8041 * decl.c (decls_match): Use comptypes directly; ignore
8042 qualifiers on the DECL.
8043 (duplicate_decls): Remove qualifier checks on DECL.
8044 (grokdeclarator): Make the type built up include top-level
8046 * decl2.c (do_dtors): Fix spelling error.
8047 * error.c (dump_simple_decl): Don't look at qualifiers on the decl
8048 when printing type information.
8049 * init.c (build_new_1): Add documentation. Deal with the fact
8050 that type of allocated memory now contains qualifiers.
8051 * lex.c (is_global): Improve error-recovery.
8052 * sig.c (build_member_function_pointer): Don't cast away const
8053 on fields of sigtable_entry_type.
8054 * tree.c (lvalue_type): Don't look at top-level qualifiers on
8056 * typeck.c (decay_conversion): Likewise.
8057 (build_component_ref): Make sure the type of the COMPONENT_REF
8058 contains top-level qualifiers, as appropriate. Improve
8060 (build_indirect_ref): Simplify. Don't strip top-level qualifiers.
8061 (build_array_ref): Likewise.
8062 (build_unary_op): Improve error-recovery.
8063 (unary_complex_lvalue): Make taking the address a bound member
8064 function an error, not a sorry.
8065 (build_conditional_expr): Look at the type qualifiers, not the
8066 qualifiers on the expression itself.
8068 1998-10-03 Jason Merrill <jason@yorick.cygnus.com>
8070 * decl2.c (merge_functions): Remove duplicates.
8072 * decl2.c: Add -f{no-,}implicit-inline-templates.
8073 (import_export_decl): Check it.
8075 * decl.c (lookup_name_real): Template parms also take precedence
8076 over implicit typename. Only warn if yylex.
8078 * typeck.c (build_conditional_expr): Only fold if ifexp is an
8081 * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN
8084 1998-10-01 Jason Merrill <jason@yorick.cygnus.com>
8086 * cp-tree.h (FORMAT_VBASE_NAME): New macro.
8087 * class.c (build_vbase_pointer): Use it.
8088 * rtti.c (expand_class_desc): Likewise.
8089 * tree.c (build_vbase_pointer_fields): Likewise.
8091 Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
8093 * decl.c (start_decl): Add invocation of
8094 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8095 (start_function): Add invocation of
8096 SET_DEFAULT_DECL_ATTRIBUTES, if defined.
8098 * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with
8099 HANDLE_GENERIC_PRAGMAS.
8101 1998-09-28 Anthony Green <green@cygnus.com>
8103 * semantics.c (finish_asm_stmt): Always permit volatile asms.
8105 1998-09-28 Mark Mitchell <mark@markmitchell.com>
8107 * decl.c (grokdeclarator): Tighten checks for invalid
8108 destructors. Improve error-messages and error-recovery.
8109 * decl2.c (check_classfn): Don't assume that mangled destructor
8110 names contain type information.
8112 1998-09-25 Jason Merrill <jason@yorick.cygnus.com>
8114 * search.c (get_base_distance): Remove assert.
8116 * decl2.c (build_anon_union_vars): Don't process a field with no
8118 (finish_anon_union): Also complain about local anon unions with no
8121 1998-09-25 Martin von Löwis <loewis@informatik.hu-berlin.de>
8123 * decl.c (lookup_namespace_name): If the name is a namespace,
8124 return it immediately.
8126 Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8128 * cp-tree.h (define_case_label): Remove unused parameter.
8129 (check_java_method): Likewise.
8130 (grokclassfn): Likewise.
8131 (expand_aggr_init): Likewise.
8132 (build_x_delete): Likewise.
8133 (maybe_end_member_template_processing): Likewise.
8134 (unshare_base_binfos): Add prototype.
8135 (string_conv_p): Likewise.
8136 (my_friendly_abort): Mark with ATTRIBUTE_NORETURN.
8138 * cvt.c (build_up_reference): Remove unused parameter
8139 `checkconst', all callers changed.
8140 (build_type_conversion): Mark parameter `code' with
8142 (build_expr_type_conversion): Initialize variable `conv'.
8144 * decl.c (push_namespace): Initialize variable `d'.
8145 (define_case_label): Remove unused parameter `decl', all callers
8148 * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter
8149 `argc' with ATTRIBUTE_UNUSED.
8150 (grokclassfn): Remove unused parameter `cname', all callers
8152 (check_java_method): Likewise for parameter `ctype'.
8153 (copy_assignment_arg_p): Mark parameter `virtualp' with
8155 (finish_prevtable_vardecl): Likewise for parameter `prev'.
8157 * expr.c (extract_init): Likewise for parameters `decl' and `init'.
8159 * init.c (expand_aggr_init_1): Remove unused parameter
8160 `alias_this', all callers changed.
8161 (expand_aggr_init): Likewise.
8162 (expand_default_init): Likewise.
8163 (build_new_1): Initialize variable `susp'.
8164 (build_x_delete): Remove unused parameter `type', all callers
8167 * lex.c (set_typedecl_interface_info): Mark parameter `prev' with
8169 (readescape): Use (unsigned) value in shift.
8170 (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when
8171 comparing to a signed quantity.
8173 * pt.c (maybe_end_member_template_processing): Remove unused
8174 parameter `decl', all callers changed.
8175 (check_explicit_specialization): Add braces around empty body in
8177 (current_template_args): Initialize variable `args'.
8178 (lookup_template_class): Likewise for variable `prev_local_enum'.
8179 (tsubst_decl): Likewise for variable `r'.
8180 (set_mangled_name_for_template_decl): Initialize variable
8183 * spew.c (scan_tokens): Change type of parameter `n' to unsigned.
8184 Likewise for variable `i'.
8185 (yylex): Initialize variable `trrr'.
8187 * typeck.c (compparms): Mark variable `strict' with
8190 * xref.c (simplify_type): Cast argument of ctype function to
8193 1998-09-24 Mark Mitchell <mark@markmitchell.com>
8195 * cp-tree.h (language_lvalue_valid): Remove.
8196 * decl.c (grokdeclarator): Don't disallow references to functions.
8197 * tree.c (lvalue_p_1): New function, combining duplicated
8200 (real_lvalue_p): Likewise.
8201 * typeck.c (language_lvalue_valid): Remove.
8202 (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though
8203 they don't have TREE_READONLY set.
8204 * typeck2.c (readonly_error): Add case for FUNCTION_DECLs.
8206 1998-09-24 Benjamin Kosnik <bkoz@loony.cygnus.com>
8208 * spew.c (yylex): Give diagnostic.
8209 * hash.h (is_reserved_word): Add export.
8210 * gxx.gperf: Likewise.
8211 * lex.h (rid): Add RID_EXPORT.
8212 * lex.c (init_parse): Likewise.
8214 Tue Sep 22 21:01:19 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
8216 * friend.c (do_friend): Make warning a full sentence.
8218 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8220 * parse.y (component_decl_list): Improve error-recovery.
8222 1998-09-22 Benjamin Kosnik <bkoz@loony.cygnus.com>
8224 * decl.c (make_typename_type): Move error to point where name
8225 variable can be used by dump_type.
8227 1998-09-22 Mark Mitchell <mark@markmitchell.com>
8229 * decl.c (grokfndecl): Improve error-recovery.
8230 * decl2.c (grokfield): Likewise.
8231 * pt.c (finish_member_template_decl): Likewise.
8233 1998-09-20 Martin von Löwis <loewis@informatik.hu-berlin.de>
8235 * method.c (hack_identifier): Finding multiple members is always
8238 1998-09-21 Per Bothner <bothner@cygnus.com>
8240 * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o.
8242 Mon Sep 21 01:53:05 1998 Felix Lee <flee@cygnus.com>
8244 * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
8246 1998-09-20 Mark Mitchell <mark@markmitchell.com>
8248 * class.c (maybe_warn_about_overly_private_class): Reformat.
8250 1998-09-17 Andrew MacLeod <amacleod@cygnus.com>
8252 * exception.cc (__cplus_type_matcher): Realign some code.
8254 1998-09-16 Mark Mitchell <mark@markmitchell.com>
8256 * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling.
8257 (tinfo2.o): Likewise.
8258 (exception.o): Likewise.
8260 (opnew.o): Likewise.
8261 (opnewnt.o): Likewise.
8262 (opvnew.o): Likewise.
8263 (opvnewnt.o): Likewise.
8264 (opdel.o): Likewise.
8265 (opdelnt.o): Likewise.
8266 (opvdel.o): Likewise.
8267 (opvdelnt.o): Likewise.
8269 1998-09-16 Richard Henderson <rth@cygnus.com>
8271 * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp.
8273 1998-09-15 Alexandre Oliva <oliva@dcc.unicamp.br>
8275 * call.c (build_field_call): Handle static data members too.
8277 * typeck.c (comptypes): When comparing pointer types, check
8278 whether referred types match even in strictest modes.
8280 1998-09-15 Mark Mitchell <mark@markmitchell.com>
8282 * cp-tree.h: Revert previous change.
8283 (finish_struct_methods): Remove declaration.
8284 * class.c: Revert previous change.
8285 (maybe_warn_about_overly_private_class): New function.
8286 (finish_struct_methods): Declare here, and make static. Remove
8287 unnecessary parameters. Tidy slightly. Use
8288 maybe_warn_about_overly_private_class.
8289 (finish_struct_1): Adjust. Remove check for private constructors,
8291 (finish_struct): Adjust.
8293 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8295 * except.c (expand_start_catch_block): No need to check for new
8297 (process_start_catch_block_old): Deleted.
8298 (process_start_catch_block): Add call to start_decl_1().
8299 (expand_end_catch_block): Add call to end_catch_handler().
8300 * exception.cc (__cplus_type_matcher): Only check the exception
8301 language if there is an exception table.
8303 1998-09-15 Andrew MacLeod <amacleod@cygnus.com>
8305 * search.c (expand_indirect_vtbls_init): Mark temporary stack slots
8306 as used to prevent conflicts with virtual function tables.
8308 1998-09-14 Mark Mitchell <mark@markmitchell.com>
8310 * cp-tree.h (lang_type): Add has_non_private_static_mem_fn.
8311 (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it.
8312 * class.c (maybe_class_too_private_p): New function.
8313 (finish_struct_methods): Use it.
8314 (finish_struct_1): Likewise.
8315 (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if
8318 * pt.c (check_specialization_scope): Fix spelling error.
8319 (check_explicit_specialization): Remove code to handle explicit
8320 specializations in class scope; they are now correctly diagnosed
8323 1998-09-10 Mark Mitchell <mark@markmitchell.com>
8325 * decl.c (pushdecl): Don't copy types if the
8326 DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the
8329 1998-09-09 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
8331 * class.c (get_enclosing_class): New function.
8332 (is_base_of_enclosing_class): Likewise.
8333 * cp-tree.h (get_enclosing_class): Declare.
8334 (is_base_of_enclosing_class): Likewise.
8335 * pt.c (coerce_template_parms): Use them.
8337 1998-09-09 Jason Merrill <jason@yorick.cygnus.com>
8339 * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
8340 null to decide whether to use it.
8342 * error.c (dump_type_real): Handle NAMESPACE_DECL.
8343 * parse.y (base_class.1): Avoid crash on error.
8345 1998-09-08 Martin von Löwis <loewis@informatik.hu-berlin.de>
8347 * decl.c (make_typename_type): If context is a namespace, the code
8350 1998-09-08 Mumit Khan <khan@xraylith.wisc.edu>
8352 * parse.y (nomods_initdcl0): Set up the parser stack correctly.
8354 1998-09-08 Mark Mitchell <mark@markmitchell.com>
8356 * cp-tree.h (anonymous_namespace_name): Declare.
8357 * decl.c: Define it.
8358 (push_namespace): Use anonymous_namespace_name, rather than local
8360 * error.c (dump_decl): If a namespace is named
8361 anonymous_namespace_name, call it {anonymous}.
8363 * decl.c (grokparms): Distinguish between references and pointers
8366 1998-09-08 Richard Henderson <rth@cygnus.com>
8367 Mark Mitchell <mark@markmitchell.com>
8369 * pt.c (process_partial_specialization): Consistently allocate
8370 and zero tpd.parms based on ntparms. Use tpd2.parms, not
8371 tpd.parms, where appropriate.
8373 Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com)
8375 * Makefile.in (INCLUDES): Update after recent toplevel gcc
8378 1998-09-05 Mark Mitchell <mark@markmitchell.com>
8380 * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove.
8381 * class.c (finish_struct): Remove hackery to deal with explicit
8382 specializations in class scope.
8383 * decl.c (grokfndecl): Improve error-recovery.
8384 * decl2.c (grokfield): Likewise.
8385 * pt.c (check_specialization_scope): New function.
8386 (begin_specialization): Call it.
8387 (process_partial_specialization): New function, split out from
8388 push_template_decl. Check partial specializations more
8390 (push_template_decl): Call it.
8391 (check_explicit_specialization): Don't attempt to handle explicit
8392 specializations in class scope.
8393 (template_parm_data): Document. Add current_arg and
8394 arg_uses_template_parms.
8395 (mark_template_parm): Set it.
8396 (tsubst_arg_types): Remove unused variable.
8397 * semantics.c (begin_class_definition): Tweak.
8399 1998-09-04 Mark Mitchell <mark@markmitchell.com>
8401 * inc/typeinfo (type_info::type_info(const char*)): Make
8404 * cp-tree.h (hash_tree_cons_simple): New macro.
8405 * pt.c (tsubst_arg_types): New function. Use hash_tree_cons.
8406 (coerce_template_parms): Use make_temp_vec, instead of
8407 make_tree_vec. Document this behavior.
8408 (lookup_template_class): Likewise.
8409 (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types.
8410 Remove dead code (and add assertion to check its deadness). Fix
8411 bug w.r.t. exception specifications.
8413 1998-09-03 Jason Merrill <jason@yorick.cygnus.com>
8415 * decl2.c (import_export_vtable): Always make artificials comdat.
8416 (import_export_decl): Likewise.
8417 * pt.c (mark_decl_instantiated): Likewise.
8419 1998-09-03 Mark Mitchell <mark@markmitchell.com>
8421 * cp-tree.h (finish_globally_qualified_member_call_expr):
8423 (finish_qualified_call_expr).
8424 * semantics.c: Likewise.
8425 * parse.y (primary): Use it.
8426 * method.c (hack_identifier): Remove redundant code.
8428 * init.c (resolve_offset_ref): Call convert_from_reference to
8429 handle members of reference type. Improve error recovery.
8431 1998-09-03 Benjamin Kosnik <bkoz@cygnus.com>
8433 * cp-tree.h: Declare warn_nontemplate_friend.
8434 * decl2.c (lang_decode_option): Set.
8435 * lang-options.h: Add -Wnon-template-friend.
8436 * friend.c (do_friend): Use to toggle non-template function warning.
8438 1998-09-03 Mark Mitchell <mark@markmitchell.com>
8440 * decl.c (finish_enum): Don't resolve CONST_DECLs to their
8441 corresponding INTEGER_CSTs when processing_template_decl.
8442 * pt.c (tsubst_enum): Tweak accordingly.
8444 1998-09-03 Benjamin Kosnik <bkoz@rhino.cygnus.com>
8446 * decl.c (pushdecl_class_level): Add warning here.
8449 1998-09-02 Jason Merrill <jason@yorick.cygnus.com>
8451 * cvt.c (convert_pointer_to_real): Tidy.
8452 * search.c (get_base_distance_recursive): Simplify.
8453 (get_base_distance): Likewise.
8455 * pt.c (unify): Only special-case INTEGER_TYPE if it uses template
8458 Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
8460 * lex.c (check_newline): Call HANDLE_PRAGMA before
8461 HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages
8462 if unknown pragmas are encountered.
8463 (handle_sysv_pragma): Interpret return code from
8464 handle_pragma_token (). Return success/failure indication rather
8465 than next unprocessed character.
8466 (pragma_getc): New function: retrieves characters from the
8467 input stream. Defined when HANDLE_PRAGMA is defined.
8468 (pragma_ungetc): New function: replaces characters back into the
8469 input stream. Defined when HANDLE_PRAGMA is defined.
8471 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
8473 * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands.
8474 * class.c (build_vtable_entry_ref): Likewise.
8476 1998-09-01 Mark Mitchell <mark@markmitchell.com>
8478 * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro.
8479 * decl2.c (import_export_decl): Likewise.
8480 * pt.c (instantiate_decl): Use it.
8482 1998-09-01 Jason Merrill <jason@yorick.cygnus.com>
8484 * decl.c (lookup_name_real): Also do implicit typename thing for
8485 artificial TYPE_DECLs.
8486 * search.c (lookup_field): Likewise.
8487 (lookup_fnfields, lookup_field): Adjust for implicit typename kludge.
8488 * semantics.c (begin_constructor_declarator): Use enter_scope_of.
8489 (enter_scope_of): Extract type from implicit typename.
8490 (begin_class_definition): Likewise.
8491 * lex.c (identifier_type): Handle implicit typename when checking
8494 * cp-tree.h: Declare flag_strict_prototype.
8495 * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if
8497 * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't
8498 specified, set it to the value of pedantic.
8500 1998-09-01 Mark Mitchell <mark@markmitchell.com>
8502 * decl2.c (arg_assoc): Handle template-id expressions as arguments.
8504 1998-08-31 Mark Mitchell <mark@markmitchell.com>
8506 * decl.c (finish_enum): Handle member enums of classes declared in
8509 * decl2.c (grok_x_components): Strip attributes before calling
8512 1998-08-31 Jason Merrill <jason@yorick.cygnus.com>
8514 * cp-tree.h, decl2.c: Remove support for -fall-virtual,
8515 -fenum-int-equivalence and -fno-nonnull-objects.
8516 * class.c (check_for_override): Remove support for -fall-virtual.
8517 (finish_struct_1): Likewise.
8518 * call.c (build_new_op): Remove support for -fenum-int-equivalence.
8519 * typeck.c (build_binary_op_nodefault): Likewise.
8520 * cvt.c (ocp_convert): Likewise.
8521 * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects.
8522 * class.c (build_vbase_path): Likewise.
8524 Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org)
8526 * Makefile.in (INTERFACE): New, set to 1.
8528 1998-08-30 Mark Mitchell <mark@markmitchell.com>
8530 * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when
8531 comparing with global_namespace.
8532 (dump_aggr_type): Likewise.
8534 * decl.c (grokfndecl): Issue error on declaration of friend
8535 templates with explicit template arguments.
8537 * pt.c (convert_template_argument): New function, split out
8539 (coerce_template_parms): Here.
8540 (tsubst): Attempt better error-recovery.
8542 1998-08-28 Benjamin Kosnik <bkoz@loony.cygnus.com>
8544 * pt.c (decl_template_parm_p): Add checks for
8545 TEMPLATE_TEMPLATE_PARM.
8547 1998-08-28 Mark Mitchell <mark@markmitchell.com>
8549 * lex.c (do_identifier): Fix thinko in previous change.
8551 1998-08-28 Jason Merrill <jason@yorick.cygnus.com>
8553 * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns.
8554 * decl2.c (output_vtable_inherit): Call binfo_for_vtable.
8556 1998-08-28 Richard Henderson <rth@cygnus.com>
8558 Add support for discarding unused virtual functions.
8559 * lang-options.h: Add -fvtable-gc.
8560 * cp-tree.h: Add flag_vtable_gc.
8561 * decl2.c (output_vtable_inherit): New fn.
8562 (finish_vtable_vardecl): Call it.
8563 * class.c (build_vtable_entry_ref): New fn.
8564 (build_vtbl_ref): Call it.
8566 1998-08-28 Mark Mitchell <mark@markmitchell.com>
8568 * cp-tree.h (build_enumerator): Take the enumeration type as a
8570 * decl.c (finish_enum): Don't set the TREE_TYPE for the
8571 enumeration constant values if we're processing_template_decls.
8572 Don't set the type for the CONST_DECLs either; that's done in
8574 (build_enumerator): Take the enumeration type as a
8576 * lex.c (do_identifier): Don't resolve enumeration constants while
8577 processing template declarations, even if they happen to be
8578 TEMPLATE_PARM_INDEXs.
8580 * parse.y (current_enum_type): New variable.
8581 (primary): Don't allow statement-expression in local classes just
8582 as we don't in global classes.
8583 (structsp): Use current_enum_type.
8584 (enum_list): Likewise.
8585 * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by
8586 finish_enum; they no longer occur.
8588 * cp-tree.h (finish_base_specifier): New function.
8589 * parse.y (base_class): Use it.
8590 * semantics.c (finish_base_specifier): Define it.
8592 * parse.y (structsp): Warn on use of typename outside of template
8595 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
8597 * lex.c (handle_cp_pragma): Remove #pragma vtable.
8598 * lang-options.h: Remove +e options.
8599 * decl2.c (lang_decode_option): Likewise.
8600 (import_export_vtable): Don't check write_virtuals.
8601 (finish_vtable_vardecl, finish_file): Likewise.
8602 * search.c (dfs_debug_mark): Likewise.
8603 * semantics.c (begin_class_definition): Likewise.
8604 * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise.
8606 * call.c (build_over_call): Check flag_elide_constructors.
8607 * decl2.c: flag_elide_constructors defaults to 1.
8608 * typeck.c (convert_arguments): Remove return_loc parm.
8609 (build_function_call_real): Adjust.
8611 * search.c: Tear out all mi_matrix and memoize code.
8612 (lookup_field, lookup_fnfields): Use scratch_tree_cons.
8613 * lang-options.h: Remove documentation for -fhandle-exceptions,
8614 -fmemoize-lookups and -fsave-memoized.
8615 * cp-tree.h: Lose mi_matrix and memoize support.
8616 * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized.
8617 * class.c: Lose struct class_level.
8618 (pushclass, popclass): Lose memoize support.
8619 * init.c (build_offset_ref): Likewise.
8621 Never change BINFO_INHERITANCE_CHAIN.
8622 * init.c (emit_base_init): Change modification of
8623 BINFO_INHERITANCE_CHAIN to an assert.
8624 * search.c (get_base_distance_recursive): Likewise.
8625 (get_base_distance): Likewise.
8626 (lookup_member): Likewise.
8627 (convert_pointer_to_single_level): Likewise.
8628 (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs.
8629 (lookup_fnfields): Likewise.
8630 * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos.
8631 (unshare_base_binfos): Don't call propagate_binfo_offsets.
8632 (layout_basetypes): Call propagate_binfo_offsets instead of
8633 unshare_base_binfos.
8634 * decl.c (xref_basetypes): Call unshare_base_binfos.
8635 * pt.c (instantiate_class_template): Likewise.
8636 * tree.c (reverse_path): Remove 'copy' parm; always make a
8638 * class.c (build_vbase_path): Just call it.
8639 * search.c (compute_access): Likewise. Don't re-reverse.
8641 1998-08-27 Mark Mitchell <mark@markmitchell.com>
8643 * class.c (build_vbase_path): Use reverse_path.
8644 (finish_base_struct): Move warnings for inaccessible bases to
8646 (modify_one_vtable): Remove check of TREE_USED (binfo).
8647 (fixup_vtable_deltas1): Likewise.
8648 * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here.
8649 (xref_tag): Remove binfos parameter.
8650 (make_binfo): Remove chain parameter.
8651 (reverse_path): Add copy parameter.
8652 * decl.c (init_decl_processing): Change calls to xref_tag.
8653 (xref_tag): Remove binfos parameter.
8654 (xref_basetypes): Change calls to make_binfo.
8655 * decl2.c (grok_x_components): Change calls to xref_tag.
8656 (handle_class_head): Likewise.
8657 * friend.c (do_friend): Likewise.
8658 * lex.c (make_lang_type): Change calls to make_binfo.
8659 * parse.y (structsp): Change calls to xref_tag.
8660 (named_complex_class_head_sans_basetype): Likewise.
8661 (named_class_head): Likewise.
8662 * rtti.c (init_rtti_processing): Likewise.
8663 * search.c (compute_access): Change calls to reverse_path.
8664 (dfs_get_vbase_types): Change calls to make_binfo.
8665 (get_vbase_types): Remove dead code.
8666 * tree.c (unshare_base_binfos): Change calls to make_binfo.
8667 (layout_basetypes): Warn here about inaccessible bases.
8668 (make_binfo): Remove chain parameter.
8669 (reverse_path): Add copy parameter.
8671 1998-08-27 Jason Merrill <jason@yorick.cygnus.com>
8673 * class.c: #if 0 complete_type_p.
8674 * init.c (build_java_class_ref, build_new_1): Remove unused locals.
8675 * method.c (process_overload_item): Likewise.
8676 * typeck.c (comp_target_types): Likewise.
8678 Stop sharing binfos for indirect virtual bases.
8679 * tree.c (propagate_binfo_offsets): Unshare vbases, too.
8680 (layout_basetypes): Likewise.
8681 (unshare_base_binfos): Copy vbases, too.
8682 * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED,
8683 BINFO_VBASE_INIT_MARKED): Remove obsolete macros.
8684 (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED,
8685 CLEAR_BINFO_PUSHDECLS_MARKED): New macros.
8686 * search.c (lookup_field, lookup_fnfields, lookup_member): Remove
8687 reference to BINFO_VIA_PUBLIC.
8688 (marked_pushdecls_p, unmarked_pushdecls_p): New fns.
8689 (push_class_decls): Use them.
8690 (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED.
8691 (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED.
8693 1998-08-27 Mark Mitchell <mark@markmitchell.com>
8695 * decl.c (build_enumerator): Set DECL_CONTEXT for the
8698 1998-08-26 Mark Mitchell <mark@markmitchell.com>
8700 * cp-tree.h (finish_enum): Change prototype.
8701 * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a
8702 VALUES parameter. Don't try to compute mins/maxs if
8703 processing_template_decl.
8704 * parse.y (structsp): Use new calling sequence for finish_enum.
8705 * pt.c (tsubst_enum): Likewise. Take the new type as input.
8706 (lookup_template_class): Remove unused variables. Tweak.
8707 Register enums on instantiation list before substituting
8708 enumeration constants.
8709 (tsubst_decl): Remove unused variables.
8710 (regenerate_decl_from_template): Likewise.
8712 * decl.c (duplicate_decls): Don't obliterate the
8713 DECL_TEMPLATE_INFO for a template if we're not replacing it with
8716 * lex.c (do_identifier): Fix typo in comment.
8718 Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8720 * errfn.c: Remove stdarg.h/varargs.h.
8723 1998-08-25 Brendan Kehoe <brendan@cygnus.com>
8725 * pt.c (tsubst_copy): Only do typename overloading on an
8726 IDENTIFIER_NODE that happens to look like a typename if it actually
8727 has a type for us to use.
8729 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
8731 * typeck.c (comp_cv_target_types): Split out...
8732 (comp_target_types): From here. Don't allow cv-qual changes under
8733 a pointer if nptrs == 0. Fix OFFSET_TYPE handling.
8734 (build_ptrmemfunc): Pass 1 to nptrs.
8735 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
8737 1998-08-25 Mark Mitchell <mark@markmitchell.com>
8739 * search.c (dependent_base_p): Don't compare a binfo to
8740 current_class_type; use the TREE_TYPE of the binfo instead.
8742 * cp-tree.h (CLASS_TYPE_P): Revise definition.
8744 1998-08-25 Jason Merrill <jason@yorick.cygnus.com>
8746 * decl.c (duplicate_decls): Don't complain about different
8747 exceptions from an internal decl even if pedantic.
8749 * typeck.c (convert_for_assignment): Converting from pm of vbase
8750 to derived is an error, not a sorry.
8752 * call.c (build_over_call): Use convert_pointer_to_real for 'this'.
8753 * class.c (fixed_type_or_null): Rename from
8754 resolves_to_fixed_type_p. Return the dynamic type of the
8755 expression, if fixed, or null.
8756 (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type
8757 does not match the static type.
8758 (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use
8759 resolves_to_fixed_type_p again.
8761 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8763 * pt.c (tsubst_decl): Move special case code for dealing with
8764 tricky friend templates here from ...
8765 (regenerate_decl_from_template): Here.
8767 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8769 * decl.c (start_decl): Remove redundant linkage check.
8771 1998-08-24 Gavin Romig-Koch <gavin@cygnus.com>
8773 * typeck.c (c_expand_return): Handle the case that valtype
8774 is wider than the functions return type.
8776 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8778 * cp-tree.h (CLASS_TYPE_P): New macro.
8779 * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE.
8780 * pt.c (process_template_parm): Undo previous change.
8782 1998-08-24 Benjamin Kosnik <bkoz@cygnus.com>
8784 * cp-tree.h: Declare.
8785 * pt.c (decl_template_parm_p): New function.
8786 * decl.c (pushdecl): Check decls for redeclaring template parms.
8787 (xref_tag): Make redeclaration an error, print decl.
8788 * decl2.c (grokfield): Check field_decls for redeclaration as well.
8790 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8792 * parse.y (primary): Fix up the type of string constants.
8794 1998-08-24 Mark Mitchell <mark@markmitchell.com>
8796 * typeck.c (convert_for_initialization): Move check for odd uses
8797 of NULL to avoid duplicate warnings.
8799 1998-08-24 Jason Merrill <jason@yorick.cygnus.com>
8801 * tree.c (lvalue_type): Fix for arrays.
8802 * typeck.c (string_conv_p): New fn.
8803 (convert_for_assignment): Use it.
8804 (build_unary_op): Use lvalue_type.
8805 * call.c (standard_conversion, convert_like): Use string_conv_p.
8806 (add_function_candidate): Use lvalue_type.
8807 * cvt.c (convert_to_reference): Likewise.
8808 * decl2.c (lang_decode_option): Ignore -traditional.
8809 * decl.c (init_decl_processing): flag_writable_strings inhibits
8812 1998-08-24 Andrew MacLeod <amacleod@cygnus.com>
8814 * lang-options.h (lang_options): Add fconst-strings to the list
8816 * decl2.c (lang_f_options, lang_decode_option): Likewise.
8818 1998-08-24 Nathan Sidwell <nathan@acm.org>
8820 * lex.c (real_yylex): Don't warn about long long constants if
8821 we're allowing long long.
8823 1998-08-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
8825 * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of
8826 accessing bindings directly.
8828 * search.c (my_tree_cons): Reimplement.
8830 * lang-specs.h: Remove __HONOR_STD.
8831 * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise.
8833 1998-08-23 Mark Mitchell <mark@markmitchell.com>
8835 * decl.c (grokdeclarator): Complain about in-class initialization
8836 of aggregates and/or references.
8837 * pt.c (process_template_parm): Clear IS_AGGR_TYPE for
8838 TEMPLATE_TYPE_PARMs.
8840 * decl2.c (grok_array_decl): Add comment.
8841 (mark_used): Don't instantiate an explicit instantiation.
8842 * friend.c (make_friend_class): Remove bogus comment. Fix check
8843 for partial specializations.
8844 * pt.c (check_explicit_specialization): Don't
8845 SET_DECL_EXPLICIT_INSTANTIATION here.
8846 (mark_decl_instantiated): Or here.
8847 (do_decl_instantiation): Do it here, instead. Add checks for
8848 duplicate explicit instantiations, etc. Tidy.
8849 (do_type_instantiation): Likewise.
8850 (instantiate_decl): Improve comments. Complain about explicit
8851 instantiations where no definition is available.
8853 * cp-tree.h (ansi_null_node): Remove.
8854 * call.c (build_over_call): Warn about converting NULL to an
8856 * cvt.c (build_expr_type_conversion): Likewise. Use
8857 null_ptr_cst_p instead of expanding it inline.
8858 * decl.c (ansi_null_node): Remove.
8859 (init_decl_processing): Make null_node always have integral type.
8860 * except.c (build_throw): Warn about converting NULL to an
8862 * lex.c (init_parse): Remove handling of ansi_null_node.
8863 * pt.c (type_unification_real): Don't convert NULL to void* type.
8864 * typeck.c (build_binary_op_nodefault): Fix NULL warnings.
8865 (convert_for_assignment): Warn about converting NULL to an
8867 (convert_for_initialization): Likewise.
8869 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
8871 * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn.
8872 * pt.c (coerce_template_parms): Use no_linkage_check.
8873 * decl.c (grokvardecl): Likewise.
8874 (grokfndecl): Likewise. Members of anonymous types have no linkage.
8876 * method.c (process_overload_item): Remove useless code.
8878 1998-08-20 Per Bothner <bothner@cygnus.com>
8880 Handle new'ing of Java classes.
8881 * init.c (build_class_classref): New function.
8882 (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject;
8883 constructor does not return this; don't need to exception-protect.
8885 * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag.
8886 * decl2.c (acceptable_java_type): Handle template-derived types.
8888 1998-08-20 Per Bothner <bothner@cygnus.com>
8890 * decl2.c (import_export_vtable): Suppress vtables for Java classes.
8892 1998-08-20 Mark Mitchell <mark@markmitchell.com>
8894 * decl.c (duplicate_decls): Always merge the old and new patterns
8895 for templates, regardless of whether or not the new one has
8896 DECL_INITIAL. Don't throw away specializations. Merge
8898 * pt.c (tsubst_decl): Use the right pattern when calculating the
8899 complete args for a new template instance.
8900 (do_decl_instantiation): Fix typo in comment.
8901 (regenerate_decl_from_template): Deal with tricky friend template
8903 (instantiate_decl): Likewise.
8905 Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com)
8907 * init.c (build_builtin_delete_call): Add missing assemble_external
8910 1998-08-20 Jason Merrill <jason@yorick.cygnus.com>
8912 * parse.y (notype_unqualified_id): Also accept ~A<int>.
8914 1998-08-19 Mark Mitchell <mark@markmitchell.com>
8916 * typeck.c (build_binary_op_nodefault): Warn on use of NULL in
8918 * except.c (build_throw): Warn when NULL is thrown, even with
8919 -ansi. Use ansi_null_node, rather than integer_zero_node, in the
8922 * cp-tree.h (ansi_null_node): New variable.
8923 * decl.c (ansi_null_node): New variable.
8924 (init_decl_processing): Initialize its type.
8925 * lex.c (init_parse): Initialize its value. Use ansi_null_node
8926 for null_node in non-ANSI mode.
8927 * typeck.c (build_binary_op_nodefault): Use ansi_null_node in
8928 place of null_node to avoid spurious errors.
8930 1998-08-17 Mark Mitchell <mark@markmitchell.com>
8932 * cp-tree.h (enter_scope_of): New function.
8933 * parse.y (complex_direct_notype_declarator): Use it.
8934 * semantics.c (enter_scope_of): New function.
8936 1998-08-17 Jason Merrill <jason@yorick.cygnus.com>
8938 * decl.c (grokparms): No, here.
8940 * decl.c (grokdeclarator): Catch parm with pointer to array of
8941 unknown bound here...
8942 * method.c (process_overload_item): ...not here.
8944 * gxxint.texi: Remove obsolete documentation of overloading code.
8946 * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
8947 * class.c (finish_struct_bits): Likewise.
8949 * tree.c (lvalue_type): Fix for arrays.
8950 * typeck.c (build_unary_op): Use lvalue_type.
8951 * call.c (add_function_candidate): Likewise.
8952 * cvt.c (convert_to_reference): Likewise.
8954 * decl2.c (lang_decode_option): Ignore -traditional.
8956 * init.c (build_offset_ref): Don't mess with error_mark_node.
8957 * lex.c (do_scoped_id): Use cp_error.
8959 * rtti.c (get_tinfo_fn): Don't mess with the context for now.
8961 1998-08-17 Benjamin Kosnik <bkoz@loony.cygnus.com>
8963 * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified.
8965 Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com)
8967 * cp-tree.h (set_identifier_local_value): Provide prototype.
8969 * decl2.c (do_namespace_alias): Remove unused variables `binding'
8972 Fri Aug 14 16:42:27 1998 Nick Clifton <nickc@cygnus.com>
8974 * Makefile.in: Rename BBISON to BISON so that it can be properly
8975 inherited from the parent makefile.
8977 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
8979 * lang-options.h: Add -finit-priority.
8980 * decl2.c: Likewise. Check flag_init_priority instead of
8983 * decl2.c (setup_initp): New fn.
8984 (start_objects, finish_objects, do_ctors): Handle init_priority.
8985 (do_dtors, finish_file): Likewise.
8987 1998-08-13 Jason Merrill <jason@yorick.cygnus.com>
8989 * pt.c (tsubst_copy): Hush warning.
8991 * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P.
8993 1998-08-12 Mark Mitchell <mark@markmitchell.com>
8995 * pt.c (print_template_context): Don't abort when instantiating a
8998 * decl.c (grokdeclarator): Issue errors on namespace qualified
8999 declarators in parameter lists or in class scope.
9001 1998-08-09 Mark Mitchell <mark@markmitchell.com>
9003 * pt.c (check_explicit_specialization): Don't abort on bogus
9004 explicit instantiations.
9006 1998-08-07 Mark Mitchell <mark@markmitchell.com>
9008 * typeck.c (require_complete_type): Use complete_type_or_else.
9009 (complete_type_or_else): Always return NULL_TREE on failure, as
9012 * pt.c (tsubst_aggr_type): Prototype.
9013 (tsubst_decl): New function, split out from tsubst. Set
9014 input_filename and lineno as appropriate.
9015 (pop_tinst_level): Restore the file and line number saved in
9017 (instantiate_class_template): Set input_filename and lineno as
9019 (tsubst): Move _DECL processing to tsubst_decl. Make sure the
9020 context for a TYPENAME_TYPE is complete.
9022 * decl2.c (grokbitfield): Issue errors on bitfields declared with
9024 (do_dtors): As in do_ctors, pretend to be a member of the same
9025 class as a static data member while generating a call to its
9028 * cvt.c (cp_convert_to_pointer): Handle NULL pointer
9029 conversions, even in complex virtual base class hierarchies.
9031 1998-08-06 Mark Mitchell <mark@markmitchell.com>
9033 * cp-tree.h (ENUM_TEMPLATE_INFO): New macro.
9034 (TYPE_TEMPLATE_INFO): Likewise.
9035 (SET_TYPE_TEMPLATE_INFO): Likewise.
9036 (ENUM_TI_TEMPLATE): Likewise.
9037 (ENUM_TI_ARGS): Likewise.
9038 (lookup_nested_type_by_name): Remove.
9039 * decl.c (maybe_process_template_type_declaration): Handle enums.
9040 (start_enum): Don't check for primary-template enum declarations
9042 (finish_enum): Clean up, document. Make sure template enum
9043 constants get the correct type.
9044 (build_enumerator): Copy initializers for template enumerations,
9046 (grok_enum_decls): Document.
9047 * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit
9048 better. Build LOOKUP_EXPRs for local variables, even if they are
9050 * pt.c (tsubst_enum): Remove field_chain parameter.
9051 (template_class_depth): Include the depth of surrounding function
9053 (push_template_decl): Check for primary-template enum declarations
9054 here. Deal with enumeration templates.
9055 (lookup_template_class): Likewise.
9056 (for_each_template_parm): Likewise.
9057 (instantiate_class_template): Don't call tsubst_enum directly,
9058 call tsubst instead, to instantiate enums. Deal with all
9059 field_chain issues here, not in tsubst_enum.
9060 (lookup_nested_type_by_name): Remove.
9061 (tsubst_aggr_type): Revise handling of enumeration types.
9063 (tsubst_copy): Likewise.
9064 (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs.
9066 1998-08-04 Mark Mitchell <mark@markmitchell.com>
9068 * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it
9069 uses template parameters.
9070 * method.c (build_template_parm_names): Use the full set of
9071 template arguments for tsubst'ing.
9072 (build_overload_identifier): Pass the full set of template
9073 arguments to build_template_parm_names, not just the
9075 * pt.c (TMPL_ARGS_DEPTH): Define using
9076 TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity.
9077 (NUM_TMPL_ARGS): New macro.
9078 (add_outermost_template_args): Deal with the case where the outer
9079 args will be completely discarded.
9080 (coerce_template_parms): Use the full set of template arguments
9081 for tsubst'ing. Simplify. Add some asserts. Improve
9083 (lookup_template_class): Pass the full set of template arguments
9084 to coerce_template_parms.
9085 (tsubst): Add assertion.
9086 (do_type_instantiation): Don't instantiate member template
9089 * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose
9090 name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE.
9092 1998-08-03 Jason Merrill <jason@yorick.cygnus.com>
9094 * method.c (set_mangled_name_for_decl): Change return type to void.
9096 * decl.c (lookup_name_real): A namespace-level decl takes priority
9097 over implicit typename. Avoid doing the same lookup twice.
9099 * search.c (dependent_base_p): New fn.
9100 (dfs_pushdecls, dfs_compress_decls): Use it.
9102 * typeck.c (get_member_function_from_ptrfunc): Don't try to handle
9103 virtual functions if the type doesn't have any.
9105 1998-08-03 Mark Mitchell <mark@markmitchell.com>
9107 * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it
9108 uses template parameters.
9110 1998-08-02 Mark Mitchell <mark@markmitchell.com>
9112 * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument.
9113 * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation.
9114 * lex.c (do_identifier): Don't use a second argument, or a type,
9115 when building LOOKUP_EXPRs.
9116 (do_identifier): Likewise.
9117 (do_scoped_id): Likewise.
9118 * method.c (hack_identifier): Improve error message.
9119 * pt.c (lookup_template_function): Don't needlessly call
9120 copy_to_permanent or build_min.
9121 (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if
9123 (do_decl_instantiation): Improve error message.
9124 * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy.
9125 (build_min): Copy the type to the permanent obstack, too.
9127 1998-08-01 Jason Merrill <jason@yorick.cygnus.com>
9129 * init.c (init_init_processing): Remove BI* handling.
9130 (build_builtin_call): Remove.
9131 (build_builtin_delete_call): New fn.
9132 (build_delete): Use it.
9134 1998-07-31 Mark Mitchell <mark@markmitchell.com>
9136 * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro.
9137 (maybe_check_template_type): New function.
9138 * decl.c (maybe_process_template_type_declaration): New function,
9139 split out from pushtag Call maybe_check_template_type.
9140 (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P.
9141 (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9142 * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P.
9143 * pt.c (template_class_depth_real): Generalization of ...
9144 (template_class_depth): Use it.
9145 (register_specialization): Use duplicate_decls for duplicate
9146 declarations of specializations.
9147 (maybe_check_template_type): New function.
9148 (push_template_decl_real): Fix comment.
9149 (convert_nontype_argument): Likewise.
9150 (lookup_template_class): Likewise. Avoid an infinite loop on
9152 (tsubst_friend_function): Fix comment.
9153 (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is
9155 * semantics.c (begin_function_definition): Use
9156 reset_specialization to note that template headers don't apply
9157 directly to declarations after the opening curly for a function.
9159 1998-07-29 Jason Merrill <jason@yorick.cygnus.com>
9161 * decl.c (push_overloaded_decl): Use current_namespace instead of
9162 DECL_CONTEXT (decl) to determine where we go.
9164 * decl.c (lookup_name_real): Fix typo.
9166 1998-07-28 Mark Mitchell <mark@markmitchell.com>
9168 * friend.c (is_friend): Be lenient with member functions to deal
9169 with nested friends.
9171 1998-07-28 Jason Merrill <jason@yorick.cygnus.com>
9173 * class.c (finish_struct_1): Convert integer_zero_node to
9174 ssizetype before passing it to set_rtti_entry.
9175 * typeck2.c (initializer_constant_valid_p): Allow conversion of 0
9176 of any size to a pointer.
9178 1998-07-27 Mark Mitchell <mark@markmitchell.com>
9180 * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove.
9181 (build_template_decl_overload): Remove.
9182 (set_mangled_name_for_decl): New function.
9183 (innermost_args): Remove is_spec parameter.
9184 (most_specialized, most_specialized_class): Remove declarations.
9185 (lookup_template_class): Add entering_scope parameter.
9186 (maybe_process_partial_specialization): New function.
9187 (finish_template_decl): Likewise.
9188 (finish_template_type): Likewise.
9189 * class.c (finish_struct): Clean up processing of member template
9191 * decl.c (pushtag): Fix formatting.
9192 (lookup_tag): Improve handling of pseudo-global levels.
9193 (make_typename_type): Adjust call to lookup_template_class.
9194 (shadow_tag): Use maybe_process_partial_specialization.
9195 (xref_tag): Improve handling of member friends.
9196 (start_function): Call push_nested_class before
9197 push_template_decl. Don't call push_template_decl for
9199 * decl2.c (grok_x_components): Don't call xref_tag for
9200 template instantiations. Handle UNION_TYPEs like RECORD_TYPEs.
9201 (grokclassfn): Use set_mangled_name_for_decl.
9202 (arg_assoc_class): Adjust call to innermost_args.
9203 (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL.
9204 * error.c (dump_function_name): Improve printing of template
9206 * friend.c (is_friend): Don't compare types of decls to determine
9207 friendship, unless flag_guiding_decls.
9208 (make_friend_class): Partial specializations cannot be friends.
9209 (do_friend): Use set_mangled_name_for_decl. Call
9210 push_template_decl_real instead of push_template_decl.
9211 * method.c (build_decl_overload_real): Remove prototype. Give it
9213 (build_overload_identififer): Adjust call to innermost_args.
9214 (build_template_decl_overload): Remove.
9215 (set_mangled_name_for_decl): New function.
9216 * parse.y (.finish_template_type): New non-terminal.
9217 (template_def): Use finish_template_decl. Use template_extdef
9219 (template_extdef, template_datadef): New non-terminals, containing
9220 only those rules for things which can be templates.
9222 (template_type, self_template_type): Use .finish_template_type.
9223 (named_class_head): Use maybe_process_partial_specialization.
9224 * pt.c (mangle_class_name_for_template): Remove context parameter.
9225 (get_class_bindings): Remove outer_args parameter.
9226 (complete_template_args): Remove.
9227 (add_outermost_template_args): New function.
9228 (register_specialization): Return the specialization.
9229 (unregister_specialization): New function.
9230 (tsubst_template_parms): Likewise.
9231 (most_specialized, most_specialized_class): Prototype here as
9233 (original_template): Rename to most_general_template.
9234 (tsubst_template_parms): New function.
9235 (set_mangled_name_for_template_decl): Likewise.
9236 (TMPL_ARGS_DEPTH): New macro.
9237 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust.
9238 (TMPL_ARGS_LEVEL): New macro.
9239 (SET_TMPL_ARGS_LEVEL): Likewise.
9240 (TMPL_ARG): Likewise.
9241 (SET_TMPL_ARG): Likewise.
9242 (TMPL_ARGS_DEPTH): Likewise.
9243 (finish_member_template_decl): Use finish_template_decl.
9244 (maybe_process_partial_specialization): New function, split out
9246 (inline_needs_template_parms): Use TMPL_PARMS_DEPTH.
9247 (maybe_begin_member_template_processing): Use new macros.
9248 (is_member_template): Likewise.
9249 (is_member_template_class): Likewise.
9250 (add_to_template_args): Likewise. Deal with multiple levels of
9252 (maybe_process_partial_specialization): New function.
9253 (retrieve_specialization): Add consistency check.
9254 (determine_specialization): Return full argument list.
9255 (check_explicit_specialization): Tweak friend handling. Use full
9256 argument lists. Simplify.
9257 (current_template_args): Use new macros.
9258 (push_template_decl_real): Change ill-named mainargs to specargs.
9259 Check that a partial specialization actually specializes at least
9260 one parameter. Improve friend handling. Modify for full
9262 (classtype_mangled_name): Don't mangle the names of
9264 (lookup_template_class): Add entering_scope parameter. Use it to
9265 avoid finding a template type when an instantiation is required.
9266 Simplify. Use full template arguments.
9267 (tsubst_friend_function): Use unregister_specialization. Use new
9268 macros. Use full template arguments.
9269 (tsubst_friend_class): Substitute, using tsubst_template_parms,
9270 into the template parameters before passing them to
9271 redeclare_class_template.
9272 (instantiate_class_template): Simplify. Use full template
9273 arguments. Adjust calls to get_class_bindings. Use
9274 SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling.
9275 (innermost_args): Use new macros.
9276 (tsubst_aggr_type): New function, split out from tsubst.
9277 (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling
9278 conventions for lookup_template_class. Refine handling of partial
9279 instantiations. Remove calls to complete_template_args.
9280 Simplify. Add consistency checks. Use set_mangled_name_for_decl
9281 and set_mangled_name_for_template_decl.
9282 (tsubst_copy): Use tsubst_aggr_type.
9283 (instantiate_template): Use full template arguments.
9284 (more_specialized): Improve formatting.
9285 (more_specialized_class): Adjust calls to get_class_bindings.
9286 (get_bindings_real): Don't call complete_template_args.
9287 (most_specialized): Don't overwrite input; create a new list.
9288 (most_specialized_class): Use most_general_template.
9289 (regenerate_decl_from_template): Use unregister_specialization.
9290 Use full template arguments.
9291 (instantiate_decl): Use full template arguments.
9292 (set_mangled_name_for_template_decl): New function.
9293 * semantics.c (begin_class_definition): Use
9294 maybe_process_partial_specialization.
9295 (finish_member_class_template): New function.
9296 (finish_template_decl): Likewise.
9297 (finish_template_type): Likewise.
9298 (typeck.c): Don't crash after issuing a compiler_error.
9299 * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict.
9301 1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
9303 * typeck2.c (build_functional_cast): Handle default-initialization.
9305 * call.c (build_over_call): Pass 1 to popclass.
9307 * parse.y (direct_notype_declarator): Add precedence declaration
9308 to notype_unqualified_id case.
9309 * Makefile.in (EXPECT): Adjust.
9311 * tree.c (ovl_member): Fix for single function in OVL.
9313 1998-07-27 Dave Brolley <brolley@cygnus.com>
9315 * c-lex.c (yylex): Fix boundary conditions in character literal and
9316 string literal loops.
9318 1998-07-24 Jason Merrill <jason@yorick.cygnus.com>
9320 * decl.c (lookup_name_real): OK, do return the from_obj value
9321 unless got_object depends on template parms.
9323 * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT.
9325 * pt.c (coerce_template_parms): Also complain about local enums.
9327 * cp-tree.h: Add prototype for set_identifier_local_value.
9328 * decl.c (set_identifier_local_value_with_scope): Make static,
9330 * search.c (covariant_return_p): Likewise.
9331 * except.c (build_terminate_handler, alloc_eh_object): Likewise.
9333 * call.c (build_method_call): Only pull out the type of a destructor
9334 if it's a template type parm.
9335 * decl.c (lookup_name_real): Never return the from_obj value.
9337 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
9339 * except.c (process_start_catch_block_old): Call start_decl_1 for
9341 * decl.c (start_decl_1): Avoid duplicate error.
9343 * init.c (expand_default_init): Only perform the initialization if
9344 it will do something.
9346 1998-07-23 H.J. Lu (hjl@gnu.org)
9348 * parse.y (base_class): Check for invalid base class.
9350 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
9352 * decl2.c (import_export_template): Fold in...
9353 (import_export_class): ...to here. Handle dllimport/export.
9355 * class.c (build_vtable): Pass at_eof to import_export_vtable.
9356 (prepare_fresh_vtable): Likewise.
9357 * decl2.c (import_export_class): Split out...
9358 (finish_prevtable_vardecl): From here.
9359 * class.c (finish_struct_1): Call import_export_class if at_eof.
9361 * decl.c (start_function): #if 0 mysterious code I wrote and have
9363 * rtti.c (get_tinfo_fn): If this is for a class type, set
9366 1998-07-22 Jason Merrill <jason@yorick.cygnus.com>
9368 * inc/exception: Change terminate and unexpected to ().
9370 * parse.y (named_class_head_sans_basetype_defn): A
9371 named_class_head_sans_basetype followed by '{' or ':' is a defn.
9373 1998-07-21 Jason Merrill <jason@yorick.cygnus.com>
9375 * tree.c (canonical_type_variant): New fn to handle arrays.
9376 * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove.
9377 * pt.c (unify, default case): Also fold arg. Fix array bounds case.
9378 * method.c (process_overload_item): Use build_overload_value for
9381 1998-07-20 Dave Brolley <brolley@cygnus.com>
9383 * lex.c (mbchar.h): #include it.
9384 (GET_ENVIRONMENT): New macro.
9385 (init_parse): Set character set based on LANG environment variable.
9386 (real_yylex): Handle multibyte characters in character literals.
9387 (real_yylex): Handle multibyte characters in string literals.
9389 1998-07-19 Jason Merrill <jason@yorick.cygnus.com>
9391 * lex.c (do_identifier): Look for class value even if we don't
9392 have a global value. Do implicit declaration if parsing is 2.
9393 * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
9396 1998-07-19 Mark Mitchell <mark@markmitchell.com>
9398 * decl.c (pushtag): Revert previous change.
9399 * pt.c (lookup_template_class): Don't put out debugging
9400 information for types that use template parameters.
9402 * decl.c (pushtag): Don't put out debugging information for
9403 compiler-generated typedefs.
9405 * error.c (dump_type_real): Don't crash when presented with
9406 intQI_type_node or the like.
9408 * semantics.c (finish_translation_unit): Fix spelling error in
9411 1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
9413 * decl.c (lookup_name_real): Pull out single function here.
9414 (select_decl): Not here.
9415 (unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
9417 * decl.c (qualify_lookup): Tweak again.
9419 * pt.c (lookup_template_class): Don't mess with the context of the
9421 * decl2.c (current_decl_namespace): Remove special handling for
9424 * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
9425 a member template specialization.
9427 * tree.c (ovl_member): Use decls_match to compare functions.
9428 * decl.c (decls_match): Check the context of a function.
9430 * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
9431 in Koenig lookup support rules.
9432 * semantics.c (finish_call_expr): Handle the new cases.
9434 * typeck.c (build_x_function_call): Handle overloaded methods.
9436 * decl.c (grokvardecl): Don't call build_static_name for extern "C".
9438 1998-07-16 Mark Mitchell <mark@markmitchell.com>
9440 * semantics.c (finish_object_call_expr): Revert previous change.
9441 * call.c (build_new_method_call): Likewise. Instead, convert
9442 TYPE_DECLs to IDENTIFIERs here, in the presence of templates.
9444 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
9446 * decl.c (qualify_lookup): Handle templates.
9448 * decl2.c (do_using_directive): Don't pass ancestor.
9449 * decl.c (push_using_directive): Calculate ancestor.
9451 * decl2.c (do_nonmember_using_decl): Allow for type shadowing.
9452 * decl.c (pushdecl): Move type shadowing handling from here...
9453 (duplicate_decls): ...to here.
9454 * decl.c (set_identifier_local_value_with_scope): New fn.
9456 (set_identifier_local_value, lookup_type_current_level): New fns.
9457 * decl2.c (do_local_using_decl): Handle types and binding level
9460 * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
9461 * decl.c (select_decl): Extract a lone function from an OVERLOAD.
9462 (lookup_namespace_name): Likewise.
9463 * typeck.c (build_unary_op): Not here anymore.
9465 * decl2.c (do_class_using_decl): Make sure we get an identifier.
9466 * class.c (handle_using_decl): Ignore TYPE_DECLs.
9468 * decl.c (qualify_lookup): New fn.
9469 (lookup_name_real): Use it.
9471 1998-07-16 Martin v. Loewis <loewis@informatik.hu-berlin.de>
9473 * decl2.c (add_using_namespace): When directly using a namespace
9474 that was indirect before, promote it.
9476 * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES,
9477 LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY,
9478 LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros.
9479 * decl.c (select_decl): Replace two flag parameters by one.
9480 (unqualified_namespace_lookup): Likewise, pass flag.
9481 (lookup_flags): New function.
9482 (lookup_name_real): Compute flags, pass them.
9483 (lookup_namespace_name): Call with zero-flag.
9484 * decl2.c (ambiguous_decl): Add flag parameter, complain only
9486 (lookup_using_namespace, qualified_lookup_using_namespace):
9487 Add flag parameter, pass them through.
9488 * lex.c (do_scoped_id): Call with zero-flag.
9490 1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
9492 * typeck.c (convert_for_assignment): Use comptypes.
9494 1998-07-16 Mark Mitchell <mark@markmitchell.com>
9496 * semantics.c (finish_object_call_expr): Move test for the
9497 function called being a TYPE_DECL to ...
9498 * call.c (build_new_method_call): Here.
9500 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
9502 * decl2.c (arg_assoc_class): Also look at template arguments, if any.
9503 (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST.
9505 * lex.c (looking_for_typename): Don't initialize.
9507 * decl2.c (ambiguous_decl): Clarify error message.
9509 * decl.c (push_using_directive): Iterate over namespaces used
9512 1998-07-15 Martin v. Löwis <loewis@informatik.hu-berlin.de>
9514 * decl2.c (add_using_namespace): Iterate over namespaces used
9517 * decl.c (lookup_name_real): Accept namespace aliases as locals.
9518 (cat_namespace_levels): Ignore aliases.
9519 (duplicate_decls): Ignore duplicate aliases.
9520 * decl2.c (do_namespace_alias): Process block level namespace
9521 aliases. Store alias with pushdecl. Remove odr errors.
9522 * parse.y (namespace_alias): New non-terminal.
9525 1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
9527 * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE.
9528 Handle TEMPLATE_TYPE_PARM.
9529 (arg_assoc): Rewrite.
9531 * pt.c (complete_template_args): Don't look at the context unless
9534 * method.c (build_decl_overload_real): Fix namespace handling.
9536 * typeck.c (build_unary_op): Extract a lone function from an
9539 * call.c (build_scoped_method_call): Handle getting a namespace
9540 for basetype in a destructor call.
9541 (check_dtor_name): Handle enums.
9543 * parse.y (using_directive): New nonterminal.
9544 (extdef, simple_stmt): Use it.
9546 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
9548 * decl2.c (add_function): Move error message ...
9549 (arg_assoc_namespace): ... from here.
9551 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
9553 * parse.y (namespace_qualifier): Fix multiple level handling.
9554 * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT.
9555 (arg_assoc): Don't skip the first argument of a function.
9557 Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com)
9559 * search.c (my_tree_cons): Clean up.
9561 1998-07-14 Jason Merrill <jason@yorick.cygnus.com>
9563 * call.c (joust): Don't warn about "confusing" conversions to the
9566 1998-07-14 Martin von Löwis <loewis@informatik.hu-berlin.de>
9568 * class.c (push_nested_class): Complain about namespaces.
9569 * decl.c (start_decl): Enter the object's namespace.
9570 (cp_finish_decl): Leave it.
9571 (grokdeclarator): Likewise.
9572 * decl2.c (check_decl_namespace): New function.
9573 (finish_file): Call it.
9574 * parse.y (complex_direct_notype_declarator): Set complexity
9575 of namespace-qualified ids to -1, enter the namespace.
9577 * method.c (build_template_decl_overload): Expect _DECL as first
9578 parameter. Put context temporarily into current_namespace.
9579 * pt.c (check_explicit_specialization): Change caller.
9582 * init.c (build_offset_ref): Call mark_used and
9583 convert_from_reference for namespace members.
9585 Mon Jul 13 23:25:28 1998 Martin von Löwis <loewis@informatik.hu-berlin.de>
9587 * search.c (my_tree_cons): The bitfield is at index 2.
9589 Mon Jul 13 17:21:01 1998 Nick Clifton <nickc@cygnus.com>
9591 * lang-options.h: Format changed to work with new --help support
9594 1998-07-12 Martin von Löwis <loewis@informatik.hu-berlin.de>
9596 * decl2.c (build_expr_from_tree): Change calls of do_identifier.
9597 Do Koenig lookup in CALL_EXPR.
9598 (arg_assoc): Handle error_mark.
9599 * lex.c (is_global): New function.
9600 (do_identifier): Expect arguments for Koenig lookup.
9601 * parse.y (primary): Add rules for calls of unqualified function calls.
9602 (do_id): Change call of do_identifier.
9603 * pt.c (finish_stmt_expr): Likewise.
9604 * semantics.c (finish_id_expr): Likewise.
9605 (finish_call_expr): Add integer parameter to indicate
9606 argument-dependent lookup.
9608 * decl.c (struct binding_level): New field using_directives.
9609 (push_using_decl): Not sorry anymore.
9610 (push_using_directive): New function.
9611 (lookup_tag): Use CP_DECL_CONTEXT to iterate.
9612 (unqualified_namespace_lookup): New function, code from ...
9613 (lookup_name_real): ... here.
9614 * decl2.c (lookup_using_namespace): Pass using list instead of
9616 (validate_nonmember_using_decl): New function.
9617 (do_nonmember_using_decl): New function.
9618 (do_toplevel_using_decl): Use them.
9619 (do_local_using_decl): New function.
9620 (do_using_directive): Support block-level directives.
9621 * parse.y (simple_stmt): Support using declarations and
9623 (namespace_qualifier, namespace_using_decl): New non-terminals.
9625 * xref.c (classname): New function.
9626 (GNU_xref_hier): Change class and base parameters to tree.
9627 * decl.c (xref_baseypes): Change caller.
9628 * friend.c (make_friend_class): Likewise.
9630 1998-07-12 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
9632 * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter
9635 * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a
9636 template template parameter, record its use.
9637 (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse
9638 its template arguments if exists.
9640 * pt.c (coerce_template_template_parms): New function equivalent
9641 to coerce_template_parms when IS_TMPL_PARM is true.
9642 (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter,
9643 all callers changed.
9645 (coerce_template_parms): Access ARGLIST properly when creating a
9646 new vector. Only accept implicit TYPE_DECL as valid argument for
9647 a template template parameter when it is a base class of
9648 current_class_type. Don't display error message when COMPLAIN is
9651 1998-07-12 Klaus Kaempf (kkaempf@progis.de)
9653 * repo.c (get_base_filename): Use file_name_nondirectory.
9654 (open_repo_file): Likewise.
9655 * cp-tree.h (file_name_nondirectory): Add prototype.
9657 1998-07-12 Jason Merrill <jason@yorick.cygnus.com>
9659 * friend.c (do_friend): Pull the identifier out of declarator.
9660 Use cp_error and friends.
9661 * decl2.c (qualified_lookup_using_namespace): Fix call to
9663 * decl.c (lookup_name_real): Don't call complete_type on a namespace.
9664 (grokvardecl): Use DECL_CLASS_SCOPE_P.
9665 * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner.
9666 * class.c (warn_hidden): Fix for OVERLOAD.
9667 From grahams@rcp.co.uk:
9668 * cp-tree.h (DEFARG_NODE_CHECK): New macro.
9669 (DEFARG_LENGTH, DEFARG_POINTER): Use it.
9671 Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com)
9673 * g++.1 (-traditional): Remove duplicated documentation.
9675 1998-07-11 Mark Mitchell <mark@markmitchell.com>
9677 * method.c (flush_repeats): Add nrepeats parameter.
9678 (issue_nrepeats): Likewise.
9679 (is_back_referenceable_type): New function. Don't back-reference
9680 TEMPLATE_TYPE_PARMs as well as simple types like integers.
9681 (build_mangled_name_for_type): Likewise.
9682 (build_mangled_name_for_type_with_Gcode): Likewise.
9684 (nrepeats): Likewise.
9685 (Nrepeats): Likewise.
9686 (start_squangling): Don't clear the variables removed above.
9687 (end_squangling): Likewise.
9688 (flush_repeats): Tidy. Use nrepeats parameter rather than
9690 (issue_nrepeats): Likewise, but with nrepeats global. Use
9691 is_backreferenceable_type.
9692 (build_overload_nested_name): Tidy. Add comment. Use
9693 build_mangled_name_for_type.
9694 (build_underscore_int): Comment.
9695 (build_overload_scope_ref): Use build_mangled_name_for_type.
9696 (build_overload_int): Likewise.
9697 (build_template_template_parm_names): Tidy.
9698 (build_template_parm_names): Use build_mangled_name_for_type.
9699 (build_overload_identifier): Add comments.
9700 (build_mangled_name_for_type_with_Gcode): Split out from
9702 (build_mangled_name_for_type): Use it.
9703 (build_mangled_name): Rework to use build_mangled_name_for_type
9704 and to not use global nrepeats/Nrepeats. Tidy.
9705 (process_modifiers): Tidy.
9706 (check_btype): Use is_backreferenceable_type. Add comment.
9707 Rename `node' to `type'.
9708 (process_overload_item): Set numeric_output_need_bar here.
9709 Use build_mangled_name_for_type. Tidy.
9710 (build_decl_overload_real): Tidy. Don't use Nrepeats. Use
9711 build_mangled_name_for_type.
9713 * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
9716 1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com>
9718 * cp-tree.h (warn_long_long): Define.
9719 * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for
9720 warning "ANSI C++ does not support `long long'".
9721 * decl2.c (warn_long_long): Define.
9722 (lang_decode_option): Parse -Wlong-long, -Wno-long-long options.
9724 1998-07-07 Jason Merrill <jason@yorick.cygnus.com>
9726 * decl.c (xref_tag): Handle attributes between 'class' and name.
9727 * parse.y (aggr): Likewise.
9728 * semantics.c (finish_class_definition): Likewise.
9729 * Makefile.in (EXPECTED): Adjust.
9731 * cp-tree.h: Declare flag_optional_diags and warn_multichar.
9732 * decl2.c: Define them.
9733 (lang_decode_option): Handle them.
9734 * lang-options.h: Add -foptional-diags.
9735 * class.c (finish_struct): Don't complain about multiple meanings of
9736 name if -fno-optional-diags.
9737 * decl.c (pushdecl_class_level): Likewise.
9738 * lex.c (real_yylex): Check warn_multichar.
9740 1998-07-06 Jason Merrill <jason@yorick.cygnus.com>
9742 * decl.c (lookup_tag): Use CP_DECL_CONTEXT.
9744 * tree.c (make_binfo): Fix length.
9746 1998-06-30 Benjamin Kosnik <bkoz@bliss.nabi.net>
9748 * decl2.c (lang_decode_option): Remove warn_template_debugging.
9749 * lang-options.h: Likewise.
9751 Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9753 * except.c (build_eh_type_type_ref): Remove unused variable `susp'.
9754 (process_start_catch_block): Likewise for variables
9755 `false_label_rtx', `call_rtx' and `return_value_rtx'.
9757 1998-06-29 Brendan Kehoe <brendan@cygnus.com>
9759 * tree.c (build_srcloc): Make sure we allocate this node on the
9762 Sat Jun 27 23:34:18 1998 Fred Fish <fnf@ninemoons.com>
9764 * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined.
9765 (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY.
9766 (lang_specific_driver): Only add -lm automatically if need_math is
9769 Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com)
9771 * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o
9773 Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9775 * Makefile.in (EXPR_H): New dependency variable.
9776 (decl2.o): Depend on $(EXPR_H).
9777 (typeck.o): Likewise.
9781 1998-06-25 Benjamin Kosnik <bkoz@lisa.cygnus.com>
9783 * decl.c (start_enum): Put local enums on permanent_obstack.
9785 1998-06-25 Mark Mitchell <mark@markmitchell.com>
9787 * cp-tree.h (c_get_alias_set): Declare.
9788 * decl.c (init_decl_processing): Set lang_get_alias_set.
9790 1998-06-25 Andrew MacLeod <amacleod@cygnus.com>
9792 * cp-tree.h (mark_all_runtime_matches): Add function prototype.
9793 * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED
9794 flag for all function decls which are in the exception table.
9795 * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match.
9796 * decl2.c (finish_file): Call mark_all_runtime_matches to make sure
9797 code is emitted for any referenced rtti function.
9799 1998-06-25 Dave Brolley <brolley@cygnus.com>
9801 * lang-specs.h: Use new | syntax to eliminate
9802 string concatenation.
9804 1998-06-25 Jason Merrill <jason@yorick.cygnus.com>
9806 * cp-tree.h (CP_DECL_CONTEXT): New macro.
9807 * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it.
9808 * method.c (build_overload_nested_name): Likewise.
9809 * sig.c (build_signature_pointer_or_reference_type): Don't set
9812 1998-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
9814 Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace.
9815 * cp-tree.h (FROB_CONTEXT): New macro.
9816 (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE.
9817 * decl.c (namespace_binding): Replace NULL_TREE with
9819 (set_namespace_binding, pop_namespace, lookup_name_real): Likewise.
9820 * decl2.c (is_namespace_ancestor, lookup_using_namespace):
9822 * decl.c (pushtag): Use FROB_CONTEXT.
9823 (pushdecl, make_typename_type, define_function, grokdeclarator):
9825 * decl2.c (set_decl_namespace, do_namespace_alias): Likewise.
9826 * pt.c (push_template_decl_real, lookup_template_class, tsubst):
9828 * decl2.c (decl_namespace): Return global_namespace if no context.
9829 * method.c (build_overload_nested_name): Expect null as context.
9830 * pt.c (mangle_class_name_for_template): Do nothing for null
9832 (lookup_template_class): Allow for null id_context.
9834 1998-06-25 Richard Henderson <rth@cygnus.com>
9836 * method.c (emit_thunk): Set current_function_is_thunk for the
9837 ASM_OUTPUT_MI_THUNK case as well.
9839 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
9841 * exception.cc (__cplus_type_matcher): Get a match_info pointer
9842 instead of an exception table entry as a parameter.
9844 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
9846 * parse.y (function_try_block): Don't call start_catch_handler.
9847 * except.c (call_eh_info): Remove coerced field from declaration.
9848 (build_eh_type_type_ref): New function to create an address of a
9849 rtti function for the new style exception tables.
9850 (expand_start_catch_block): Split function, this contains the
9852 (process_start_catch_block_old): New function to perform the rest
9853 of expand_start_catch_block under old style exceptions.
9854 (process_start_catch_block_old): New function to perform the rest
9855 of expand_start_catch_block under new style exceptions.
9856 (expand_end_catch_block): Only pop the false label off the stack under
9857 the old style of exceptions.
9858 * semantics.c (finish_try_block): Don't call start_catch_handler.
9859 * exception.cc (struct cp_eh_info): Add original_value field.
9860 (__cplus_type_matcher): Perform type matching on the original exception
9861 value, and if we have a match, set the current value.
9862 (__cp_push_exception): Set the original exception value.
9864 1998-06-23 Jason Merrill <jason@yorick.cygnus.com>
9866 * call.c (joust): Fix confusing conversion warning.
9868 * call.c (build_op_delete_call): Add placement parm. Check
9869 LOOKUP_SPECULATIVELY.
9870 * cp-tree.h, decl2.c, init.c: Adjust.
9871 * decl.c (finish_function): Use it.
9873 * pt.c (tsubst): Diagnose creating void fields or variables.
9875 Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9877 * call.c (build_scoped_method_call): Remove unused variable `tmp'.
9879 * cp-tree.h (check_dtor_name): Add prototype.
9881 * init.c (expand_member_init): Remove unused variables
9882 `ptr_type_node', `parm' and `rval'.
9884 * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier
9886 (lang_print_xnode): Likewise.
9888 * typeck2.c (enum_name_string): Cast argument to sprintf to long
9889 and use %ld specifier.
9891 * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC
9892 specifier in call to fprintf.
9893 (GNU_xref_member): Cast argument to sprintf to int.
9895 Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
9897 * typeck2.c (pop_init_level): Warn about implicit zero initialization
9900 Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9902 * cp-tree.h: Prototype function `check_java_method'.
9904 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
9906 * class.c (finish_struct): Make conflicting use of id a pedwarn.
9907 * decl.c (pushdecl_class_level): Likewise.
9909 1998-06-17 Mark Mitchell <mark@markmitchell.com>
9911 * pt.c (convert_nontype_argument): Issue an error when presented
9912 with an integer (real) constant that cannot be simplified to an
9915 * cp-tree.h (c_get_alias_set): Remove declaration added in
9916 1998-06-13 change that should never have been checked in.
9918 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
9920 * typeck.c (build_binary_op_nodefault): Change % in format strings
9923 * decl.c (grokvardecl): Don't build_static_name for decls that
9924 aren't at namespace scope.
9926 * init.c (perform_member_init): Catch default-initialization of
9929 1998-06-17 Mark Mitchell <mark@markmitchell.com>
9931 * errfn.c (cp_thing): Handle the `%%' formatting sequence.
9933 1998-06-17 Jason Merrill <jason@yorick.cygnus.com>
9935 * method.c (hack_identifier): Complain about getting a namespace
9937 * typeck.c (decay_conversion): Remove check for namespaces.
9938 * typeck2.c (incomplete_type_error): Likewise.
9939 * parse.y (template_arg): Add PTYPENAME expansion.
9941 1998-06-16 Andrew MacLeod <amacleod@cygnus.com>
9943 * decl.c (grokvardecl): Don't build external assembler names for
9944 TYPENAMEs in other namespaces as there is no declarator.
9945 * error.c (cp_file_of, cp_line_of): Don't extract file or line number
9946 info from DECL_CONTEXT if it is NULL.
9948 1998-06-16 Jason Merrill <jason@yorick.cygnus.com>
9950 * call.c (check_dtor_name): Split out.
9951 (build_scoped_method_call): Use it.
9952 (build_method_call): Use it.
9953 * init.c (build_offset_ref): Use it.
9955 * typeck.c (build_static_cast): Fix handling of pointers to members.
9957 * decl.c (finish_function): Just return nothing from a constructor.
9958 * typeck.c (c_expand_return): Complain about returning a void
9959 expression from a destructor.
9961 1998-06-13 Mark Mitchell <mark@markmitchell.com>
9963 * class.c (alter_access): Accept a BINFO explaining how to get
9964 from the entity whose accessed is being altered to the type doing
9966 (handle_using_decl): New function containing code split out from ...
9967 (finish_struct_1): Here.
9969 * cp-tree.h (complete_type_or_else): Declare.
9970 * init.c (build_new_1, build_delete): Use it.
9971 * typeck.c (require_complete_type): Use complete_type, rather than
9972 expanding it inline.
9973 (complete_type_or_else): New function.
9974 (build_component_ref): Use it.
9975 (pointer_int_sum): Make sure the type pointed to is complete.
9976 (pointer_diff): Likewise.
9978 * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for
9981 * search.c (get_matching_virtual): Note that member templates
9982 cannot override virtual functions.
9984 1998-06-12 Brendan Kehoe <brendan@cygnus.com>
9986 * pt.c (check_explicit_specialization): If DECLARATOR turned into
9987 an error_mark_node from lookup_template_function, return the same.
9988 (determine_specialization): Also make sure TEMPLATE_ID isn't an
9989 error_mark_node, before we try to read its operands.
9990 * decl.c (grokdeclarator): If we got an error_mark_node from
9991 check_explicit_specialization, just return it right back.
9993 1998-06-12 Mark Mitchell <mark@markmitchell.com>
9995 * class.c (instantiate_type): Don't treat template-ids that don't
9996 specify any template arguments as equivalent to ordinary
9997 identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to
9998 pointer-to-members for member templates. Tidy slightly.
9999 * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation.
10000 * init.c (build_offset_ref): Handle template-ids like ordinary
10001 identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the
10002 offset part of the OFFSET_REF.
10003 * typeck.c (build_unary_op): Change check for unknown types to
10004 look for OFFSET_REFs, not SCOPE_REFs.
10006 1998-06-11 Mark Mitchell <mark@markmitchell.com>
10008 * pt.c (is_member_template_class): New function.
10009 (push_template_decl_real): Use it.
10011 1998-06-11 Benjamin Kosnik <bkoz@elmo.cygnus.com>
10013 * friend.c (do_friend): Add support for nested classes using
10014 member functions of the enclosing class as friends.
10016 1998-06-10 Mark Mitchell <mark@markmitchell.com>
10018 * call.c (convert_default_arg): Make global, not static.
10019 (convert_arg_for_ellipsis): Split out from ...
10020 (build_over_call): Here.
10021 * cp-tree.h (convert_default_arg); Declare.
10022 (convert_arg_to_ellipsis): Likewise.
10023 (do_member_init): Remove.
10024 * init.c (do_member_init): Remove; this code is dead.
10025 (expand_member_init): Remove much of this code; it is dead.
10026 * typeck.c (convert_arguments): Use convert_default_arg and
10027 convert_arg_for_ellipsis, rather than duplicating here.
10029 * call.c (convert_like): Don't fail silently if
10030 build_user_type_conversion fails. Always return error_mark_node
10033 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10035 * search.c (covariant_return_p): Complain about ambiguous base.
10037 * typeck.c (build_component_ref): Diagnose ref to nested type.
10039 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10041 * decl.c (grokparms): Check that INIT isn't an error_mark_node
10042 before giving error about invalid type for default arg.
10044 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10046 * call.c (build_method_call): Fix thinko.
10048 1998-06-10 Dave Brolley <brolley@cygnus.com>
10050 * decl2.c (lang_decode_option): New argc/argv interface.
10051 * cp-tree.h (lang_decode_option): New argc/argv interface.
10052 * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is
10053 specified for cpplib-enabled compilers.
10054 * lex.c (lang_init): Don't check_newline for cpplib.
10055 (init_parse): Don't initialize cpplib here.
10057 1998-06-10 Brendan Kehoe <brendan@cygnus.com>
10059 * typeck.c (build_component_ref): Make sure FIELD has a lang_specific
10060 piece before checking DECL_MUTABLE_P.
10062 1998-06-10 John Carr <jfc@mit.edu>
10064 * tree.c (debug_binfo): Make printf format match arguments.
10066 * error.c (OB_PUTI): Make printf format match arguments.
10068 1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
10070 * init.c (perform_member_init): Handle default-initialization.
10072 * except.c (build_throw): Handle throwing NULL.
10074 * typeck.c (build_x_function_call): Use resolve_offset_ref.
10076 * search.c (compute_access): Only strip an anonymous union
10079 * call.c (add_builtin_candidates): Tweak.
10081 * cvt.c (build_expr_type_conversion): Restore code for conversion
10083 * decl2.c (delete_sanity): Use it. Clean up.
10085 * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons.
10087 1998-06-10 Branko Cibej <branko.cibej@hermes.si>
10089 * typeck.c (c_expand_return): Don't warn about void expressions on
10090 return statements in functions returning void.
10092 1998-06-09 Mark Mitchell <mark@markmitchell.com>
10094 * pt.c (fn_type_unification): Revise documentation. Tidy.
10095 (type_unification): Likewise.
10097 1998-06-09 Andrew MacLeod <amacleod@cygnus.com>
10099 * semantics.c (finish_try_block): Rename expand_start_catch, and delete
10101 * parse.y (function_try_block): Rename expand_start_catch, and delete
10103 * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete
10106 1998-06-09 Jason Merrill <jason@yorick.cygnus.com>
10108 * search.c (lookup_member): New fn.
10109 * class.c (finish_struct_1): Use it.
10110 * decl.c (lookup_name_real): Use it.
10112 Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10114 * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h.
10116 * cp-tree.h: Add prototype for `maybe_print_template_context' and
10117 `maybe_make_one_only'.
10119 * decl.c (auto_function): Remove unused variable `decl'.
10121 * decl2.c: Include dwarf2out.h and dwarfout.h.
10123 * lex.c: Remove redundant declarations of `set_float_handler' and
10126 1998-06-08 Andrew MacLeod <amacleod@cygnus.com>
10128 * except.c (init_exception_processing): Remove NEW_EH_MODEL compile
10129 time flag. Call __cp_eh_info instead of __cp_exception_info.
10130 * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag.
10131 (__cp_exception_info): Return offset into cp_eh_info structure to
10132 match what use to be the start of this structure.
10133 (__cp_eh_info): New function to return a pointer to cp_eh_info struct.
10134 (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL
10136 (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call
10137 __cp_eh_info instead of __cp_exception_info.
10139 1998-06-08 Jason Merrill <jason@yorick.cygnus.com>
10141 * decl.c (cp_finish_decl): Disable inlining of extern inlines
10142 with static variables.
10144 1998-06-08 Mark Mitchell <mark@markmitchell.com>
10146 * init.c (build_offset_ref): Correct previous change to use build,
10149 1998-06-07 Mark Mitchell <mark@markmitchell.com>
10151 * class.c (instantiate_type): Handle pointer-to-members where the
10152 member is a template.
10153 * init.c (build_offset_ref): Likewise.
10154 * typeck.c (build_unary_op): Likewise.
10156 1998-06-07 Richard Henderson <rth@cygnus.com>
10158 * lex.c (lang_init_options): New function.
10159 (lang_init): Remove flag_exceptions == 2 hack.
10161 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10163 * search.c (envelope_add_decl): Tweak for implicit typename.
10165 * call.c (joust): Also warn about confusing conversion op/constructor
10166 overload resolution.
10168 * spew.c (yylex): Also return the TYPE_DECL if got_object.
10169 Don't clear got_object after '~'.
10170 * call.c (build_scoped_method_call): Tweak destructor handling.
10171 (build_method_call): Likewise.
10172 * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
10173 TYPE_MAIN_VARIANT for destructors.
10174 * semantics.c (finish_object_call_expr): Complain about calling a
10177 1998-06-05 Per Bothner <bothner@cygnus.com>
10179 * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles):
10180 Define - update needed by gcc.c change.
10182 1998-06-05 Jason Merrill <jason@yorick.cygnus.com>
10184 * error.c (cp_printers): Use 'o' instead of '_' for the null entry.
10186 1998-06-05 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10188 * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare.
10189 * decl.c (lookup_name_real): Add namespaces_only parameter.
10190 If set, return only NAMESPACE_DECLs.
10191 (select_decl): Likewise.
10192 (identifier_type_value): Give additional parameter.
10193 (lookup_name_nonclass): Likewise.
10194 (lookup_name): Likewise.
10195 (find_binding): Skip namespace aliases.
10196 (binding_for_name): Likewise.
10197 (push_namespace): Check for namespace aliases.
10198 (lookup_name_namespace_only): New function.
10199 (begin_only_namespace_names, end_only_namespace_names): New functions.
10200 * decl2.c (set_decl_namespace): Skip namespace aliases.
10201 (do_using_directive): Likewise.
10202 (do_namespace_alias): Produce namespace aliases, fix alias
10204 * error.c (dump_decl): Support SCOPE_REF.
10205 * parse.y (extdef): Wrap lookup with namespace_only for namespace
10206 aliases and using declarations.
10208 1998-06-04 Jason Merrill <jason@yorick.cygnus.com>
10210 * tree.c (really_overloaded_fn): Only see through one TREE_LIST.
10212 * error.c (dump_expr): Clean up NEW_EXPR case.
10214 1998-06-04 Martin von Löwis <loewis@informatik.hu-berlin.de>
10216 Suggested by Brendan Kehoe
10217 * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
10218 treat it as using ::decl.
10220 * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.
10222 * tree.c (mapcar): Support NEW_EXPR.
10224 * error.c (dump_expr): Support NEW_EXPR.
10226 1998-06-03 Jason Merrill <jason@yorick.cygnus.com>
10228 * method.c (make_thunk): Use overload machinery to make name.
10229 * search.c (covariant_return_p): New fn.
10230 (get_matching_virtual): Use it.
10232 * init.c (build_new_1): Fix check for void.
10234 1998-06-01 Per Bothner <bothner@cygnus.com>
10236 * cp-tree.h (TYPE_FOR_JAVA): New macro.
10237 * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node,
10238 java_int_type_node, java_long_type_node, java_float_type_node,
10239 java_double_type_node, java_char_type_node, java_boolean_type_node):
10240 New "primitive" types, with predefined names __java_byte etc.
10241 (record_builtin_java_type): New function.
10242 (init_decl_processing): Make Java types with record_builtin_java_type.
10243 (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA".
10244 (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class.
10245 (grokfndecl): Call check_java_method for Java classes.
10246 * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA.
10247 (process_overload_item): Match types against specific
10248 java_XX_type_node types, rather than using is_java_type.
10249 * class.c (finish_struct_1): Don't add default copy constructor
10250 or operator= if TYPE_FOR_JAVA.
10251 (pop_lang_conext): Restore strict_prototyp proper if Java.
10252 * decl2.c (acceptable_java_type, check_java_method): New functions.
10253 * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern.
10254 (tsubst): Move common statement after if statement.
10255 * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match.
10257 1998-06-01 Jason Merrill <jason@yorick.cygnus.com>
10259 * pt.c (for_each_template_parm): Use first_rtl_op.
10261 * tree.c (build_cplus_array_type_1): Also check index_type for
10264 1998-05-31 Jason Merrill <jason@yorick.cygnus.com>
10266 * pt.c (tsubst): Always copy BINFO_BASETYPES.
10268 1998-05-29 scott snyder <snyder@d0sgif.fnal.gov>
10270 * tree.c (layout_basetypes): If we change TYPE_SIZE, change
10271 TYPE_SIZE_UNIT too.
10273 1998-05-29 Mark Mitchell <mark@markmitchell.com>
10275 * decl.c (grokdeclarator): Don't complain about in-class
10276 initialization of static consts if we don't really know the type
10279 1998-05-29 Jason Merrill <jason@yorick.cygnus.com>
10281 * cp-tree.h (DECL_DESTRUCTOR_P): New macro.
10282 * method.c (build_destructor_name): New fn.
10283 * decl2.c (maybe_retrofit_in_chrg): Split out...
10284 (grokclassfn): From here. Reorganize.
10285 * decl.c (grok_ctor_properties): Make sure ctors for types with
10286 vbases have the in_chrg parm.
10287 * pt.c (instantiate_class_template): Update
10288 TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call
10290 (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg.
10292 1998-05-28 Mark Mitchell <mark@markmitchell.com>
10294 * pt.c (instantiate_decl): Make test for whether or not static
10295 variables should be instantiated early match its comment.
10297 1998-05-28 Jason Merrill <jason@yorick.cygnus.com>
10299 * decl.c (start_decl): Always pedwarn about vacuously redeclaring
10301 (start_function): Call check_default_args.
10302 * decl2.c (grokfield): Don't call check_default_args.
10303 (check_default_args): Use cp_error_at.
10304 * lex.c (do_pending_defargs): Call check_default_args.
10306 1998-05-27 Brendan Kehoe <brendan@cygnus.com>
10308 * call.c (build_method_call): Make sure get_type_value returns
10309 something before we try to use its TYPE_MAIN_VARIANT.
10310 (build_scoped_method_call): Likewise.
10312 1998-05-27 Jason Merrill <jason@yorick.cygnus.com>
10314 * typeck2.c (digest_init): Complain about getting a TREE_LIST to
10315 initialize an array.
10317 * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and
10320 * friend.c (do_friend): Clarify template warning.
10322 1998-05-27 Mark Mitchell <mark@markmitchell.com>
10324 * decl.c (shadow_label): Don't treat decls as identifiers.
10325 (maybe_push_to_top_level): Clear shadowed_labels.
10327 * pt.c (instantiate_decl): Reset lineno and filename after calling
10328 regenerate_decl_from_template.
10330 * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
10333 1998-05-27 Kevin Buhr <buhr@stat.wisc.edu>
10335 * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE.
10337 1998-05-26 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
10339 * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes.
10340 (convert_nontype_argument): Handle cases when nontype template
10341 parameters become classes after substitution.
10343 1998-05-26 Mark Mitchell <mark@markmitchell.com>
10345 * friend.c (is_friend): Use comptypes, rather than == to compare
10346 types. Modify for new representation of template friends.
10347 (make_friend_class): Likewise.
10348 * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak.
10349 (instantiate_class_template): Deal with template friends.
10351 * decl.c (store_parm_decls): Remove redundant call to
10352 expand_main_function.
10354 1998-05-26 Benjamin Kosnik <bkoz@loony.cygnus.com>
10356 * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before
10359 1998-05-26 Per Bothner <bothner@cygnus.com>
10361 * language_as_string: Handle lang_java.
10363 1998-05-26 Jason Merrill <jason@yorick.cygnus.com>
10365 * decl.c (pushdecl): Don't copy the type_decl.
10367 1998-05-26 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10369 * class.c (pushclass): Always store TYPE_MAIN_VARIANT in
10370 current_class_type.
10371 * decl.c (grokdeclarator): Put typedefs on the type's obstack.
10373 * parse.y (complex_direct_notype_declarator): Use $1 to access
10374 scope of notype_qualified_id.
10376 1998-05-26 Dave Brolley <brolley@cygnus.com>
10378 * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib.
10379 (init_parse): Initialize cpplib interface.
10381 * Makefile.in (CXX_OBJS): Make sure dependencies never end with an
10382 empty continuation.
10384 1998-05-26 Mark Mitchell <mark@markmitchell.com>
10386 * decl.c (pushtag): Avoid crashing on erroneous input.
10388 1998-05-25 Martin v. Löwis <loewis@informatik.hu-berlin.de>
10390 * decl.c (push_namespace): Only produce one unique name for
10391 anonymous namespaces.
10392 (get_unique_name): Remove.
10394 1998-05-25 Mark Mitchell <mark@markmitchell.com>
10396 * call.c (tourney): Don't do any extra comparisons.
10398 * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions.
10400 * cp-tree.h (processing_template_parmlist): Declare.
10401 * decl.c (pushtag): Don't call push_template_decl when we
10403 * pt.c (processing_template_parmlist): New variable.
10404 (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro.
10405 (complete_template_args): Use it.
10406 (add_to_template_args): Likewise.
10407 (innermost_args): Likewise.
10408 (tsubst): Likewise.
10409 (begin_template_parm_list): Use processing_template_parmlist.
10410 (end_template_parm_list): Likewise.
10412 * cp-tree.h (ANON_UNION_TYPE_P): New macro.
10413 * decl.c (grokdeclarator): Use it.
10414 * decl2.c (grok_x_components): Likewise.
10415 * init.c (initializing_context): Likewise.
10416 * method.c (do_build_copy_constructor): Likewise.
10417 (do_build_assign_ref): Likewise.
10418 * search.c (compute_access): Likewise.
10419 * typeck.c (build_component_ref): Likewise.
10421 * decl.c (grokdeclarator): Don't give a cv-qualified version of an
10422 unnamed type a typedef name "for linkage purposes".
10424 * pt.c (lookup_template_class): Don't look at
10425 IDENTIFIER_CLASS_VALUE when there's no current_class_type.
10427 * method.c (build_overload_int): Handle error cases gracefully.
10429 * pt.c (instantiate_decl): Handle static member variables
10432 * pt.c (tsubst): Use the tsubst'd type when producing new
10433 TEMPLATE_PARM_INDEX nodes.
10435 1998-05-24 Mark Mitchell <mark@markmitchell.com>
10437 * tree.c (cp_tree_equal): Handle pointers to member functions.
10439 * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make
10440 sure the type of the REF_BIND is a reference type.
10441 (maybe_handle_ref_bind, compare_ics): Rename reference_type to
10442 target_type for clarity.
10444 * parse.y (xcond): Move call to condition_conversion ...
10445 * semantics.c (finish_for_cond): Here.
10446 * parse.c: Regenerated.
10448 1998-05-24 Jason Merrill <jason@yorick.cygnus.com>
10450 * decl.c (push_namespace): Namespaces have type void.
10451 * typeck2.c (incomplete_type_error): Complain about namespace
10452 used as expression.
10453 * typeck.c (decay_conversion): Likewise.
10455 1998-05-24 Martin von Löwis <loewis@informatik.hu-berlin.de>
10457 * error.c (dump_expr): Support namespaces.
10459 1998-05-23 Jason Merrill <jason@yorick.cygnus.com>
10461 * cp-tree.def: Add SRCLOC.
10462 * cp-tree.h: Add struct tree_srcloc and accessor macros.
10463 * tree.c (build_srcloc, build_srcloc_here): New fns.
10464 * pt.c (add_pending_template): Use build_srcloc_here.
10465 (push_tinst_level): Update last_template_error_tick before erroring.
10466 (instantiate_decl): Restore lineno and input_filename before
10467 calling add_pending_template.
10468 * decl2.c (finish_file): Set up lineno and input_filename for
10471 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
10473 * decl.c (lang_print_error_function): New fn.
10474 (init_decl_processing): Set print_error_function to use it.
10475 * errfn.c (cp_thing): Don't call maybe_print_template_context here.
10477 * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and
10480 * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for
10481 copy-initialization.
10483 * class.c (build_vtable_entry): Use int_fits_type_p.
10484 (build_vtable): Pass a signed offset to build_vtable_entry.
10485 (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1,
10486 set_rtti_entry): Likewise.
10488 1998-05-22 Per Bothner <bothner@cygnus.com>
10490 * cp-tree.h: Add comments documenting which LANG_FLAGS are used.
10491 (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used.
10493 1998-05-22 Jason Merrill <jason@yorick.cygnus.com>
10495 * pt.c (print_template_context): Use fprintf instead of cp_error.
10497 * pt.c (determine_specialization): Just return an error_mark_node.
10498 Also print the decl we want in error messages. If we complain,
10499 return error_mark_node.
10500 (tsubst_friend_function): Set lineno and input_filename so
10501 error messages will be useful.
10502 (instantiate_template): Just return an error_mark_node.
10503 (check_explicit_specialization): Don't mess with a returned
10506 * pt.c (print_template_context): Add new argument.
10507 (maybe_print_template_context): New fn.
10508 (push_tinst_level): Increment tinst_level_tick.
10509 (pop_tinst_level): Likewise.
10510 * errfn.c (cp_thing): Call maybe_print_template_context. Use
10511 xrealloc instead of xmalloc.
10513 * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT.
10515 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
10517 * pt.c (tsubst_friend_class): Don't call redeclare_class_template
10518 if the template we looked up is the same as the one we already
10521 Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
10523 * lex.c: (handle_sysv_pragma): FILE* parameter not used.
10524 (cpp_reader,parse_in): Add for cpplib.
10525 (check_newline): Call handle_sysv_pragma with new interface.
10526 (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
10528 * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
10529 (sub_getch): Call GETC for cpplib.
10531 * cp-tree.h: (get_directive_line): Different prototype for cpplib.
10532 (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
10534 * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib.
10536 1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
10538 * decl2.c (maybe_make_one_only): New fn.
10539 (import_export_vtable): Use it.
10540 (import_export_decl): Likewise.
10541 * pt.c (mark_decl_instantiated): Likewise.
10543 1998-05-21 Mark Mitchell <mmitchell@usa.net>
10545 * decl2.c (find_representative_member): Rename to ...
10546 (build_anon_union_vars): New function.
10547 (finish_anon_union): Fix stupidity of previous change.
10549 1998-05-20 Jason Merrill <jason@yorick.cygnus.com>
10551 * decl.c (grokfndecl): Handle definition of specialization in
10552 friend declaration.
10554 * error.c (dump_decl): Fix LOOKUP_EXPR handling.
10556 1998-05-20 Mark Mitchell <mmitchell@usa.net>
10558 * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P
10559 to look for type declarations.
10560 (finish_struct): Deal with templates on the CLASSTYPE_TAGS list.
10561 * cp-tree.h (DECL_DECLARES_TYPE_P): New macro.
10562 (finish_member_class_template): Declare.
10563 * decl.c (pushtag): Put member class templates on the
10564 CLASSTYPE_TAGS list, just as for ordinary member classes.
10565 (pushdecl_class_level): Use DECL_DECLARES_TYPE_P.
10566 (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with
10567 IDENTIFIER_NAMESPACE_VALUEs.
10568 * parse.y (component_decl): Move code to ...
10569 * semantics.c (finish_member_class_template): New function.
10570 Don't put member class templates on the list of components for a
10572 * parse.c: Regenerated.
10573 * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types.
10574 In fact, don't use DECL_CONTEXT at all here.
10576 1998-05-20 Martin von Loewis <loewis@informatik.hu-berlin.de>
10578 * decl.c (record_unknown_type): New function.
10579 (init_decl_processing): Call it for the unknown and global type
10582 1998-05-20 Mark Mitchell <mmitchell@usa.net>
10584 * decl2.c (find_representative_member): New function.
10585 (finish_anon_union): Use it.
10587 * cp-tree.h (MAIN_NAME_P): New macro.
10588 (DECL_MAIN_P): Likwise.
10589 * decl.c (pushdecl): Avoid crashing on redefinitions of `main'.
10590 (grokfndecl): Use the new macros.
10591 (grokdeclarator): Likewise.
10592 (start_function): Likewise.
10593 (store_parm_decls): Likewise.
10594 (finsh_function): Likewise.
10595 * friend.c (do_friend): Likewise.
10596 * typeck.c (build_function_call_real): Likewise.
10597 (build_unary_op): Likewise.
10599 Wed May 20 02:16:01 1998 Jason Merrill <jason@yorick.cygnus.com>
10601 * decl2.c (start_objects, finish_objects, do_dtors,
10602 do_ctors): Split out from...
10603 (finish_file): ...here.
10605 Tue May 19 20:36:23 1998 Jason Merrill <jason@yorick.cygnus.com>
10607 * tree.c (is_overloaded_fn): Don't abort on placeholders from
10610 Tue May 19 15:16:22 1998 Brendan Kehoe <brendan@cygnus.com>
10612 * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node.
10614 * error.c (dump_expr): Handle an ARROW_EXPR.
10616 Tue May 19 15:13:39 1998 Mark Mitchell <mmitchell@usa.net>
10618 * decl.c (saveable_obstack): Declare.
10619 (pushdecl): Copy TYPE_DECLs to the same obstack as the type they
10620 declare, if necessary.
10622 Tue May 19 14:50:27 1998 Mark Mitchell <mmitchell@usa.net>
10624 * call.c (compare_qual): Remove.
10625 (is_subseq): Tweak.
10626 (is_properly_derived_from): New function.
10627 (maybe_handle_ref_bind): Likewise.
10628 (maybe_handle_implicit_object): Likewise.
10629 (compare_ics): Modify substantially to bring into conformance with
10631 * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro.
10632 (comp_cv_qualification): Declare.
10633 (comp_cv_qual_signature): Likewise.
10634 * typeck.c (comp_cv_qualification): Likewise.
10635 (comp_cv_qual_signature): Likewise.
10637 Tue May 19 10:05:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10639 * Makefile.in (parse.o): Depend on toplev.h.
10641 * class.c (typecode_p): Remove prototype and definition.
10643 * cp-tree.h (currently_open_class, is_empty_class, member_p):
10646 * decl.c (push_overloaded_decl_top_level): Remove prototype and
10649 * errfn.c (cp_error): Cast function pointer `error' to (errorfn *)
10650 in call to `cp_thing'.
10651 (cp_warning): Likewise for function pointer `warning'.
10653 * except.c (do_function_call): Remove prototype and definition.
10654 (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL.
10656 * method.c (is_java_type): Add prototype and make it static.
10658 * parse.y: Include toplev.h.
10660 * pt.c (type_unification): Remove unused variable `arg'.
10661 (instantiate_decl): Likewise for `save_ti'.
10663 * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'.
10665 Tue May 19 02:43:25 1998 Jason Merrill <jason@yorick.cygnus.com>
10667 * init.c (build_member_call): Handle template_ids.
10668 * parse.y (primary): Add global_scope template_id.
10670 Mon May 18 23:22:52 1998 Jason Merrill <jason@yorick.cygnus.com>
10672 * decl2.c (get_sentry): Use end_temporary_allocation.
10673 Don't declare permanent_obstack.
10675 Mon May 18 12:28:44 1998 Mark Mitchell <mmitchell@usa.net>
10677 * parse.y (.finish_new_placement): New non-terminal.
10678 (unary_expr, new_type_id): Use it.
10679 * parse.c: Regenerated.
10681 Mon May 18 12:20:27 1998 Brendan Kehoe <brendan@cygnus.com>
10683 * pt.c (redeclare_class_template): Say where the original definition
10684 of the template-parameter's default argument appeared.
10686 Mon May 18 03:00:57 1998 Jason Merrill <jason@yorick.cygnus.com>
10688 * call.c (build_over_call): Tweak empty class handling.
10690 * decl.c (make_typename_type): Use currently_open_class.
10692 * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG.
10694 Mon May 18 01:43:01 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10696 * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE
10697 for a type unless it is one.
10699 * class.c (finish_struct_1): Use OVL_CURRENT in error message.
10701 Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com)
10703 * Makefile.in (program_transform_name, objdir): Define.
10705 * Makefile.in (BISON): Use bison from the build tree if it exists.
10708 Sun May 17 14:52:08 1998 Martin v. Loewis <loewis@informatik.hu-berlin.de>
10710 * typeck.c (type_unknown_p): Return true for TREE_LIST also.
10712 * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs.
10714 Sun May 17 14:51:41 1998 Jason Merrill <jason@yorick.cygnus.com>
10716 * call.c (build_scoped_method_call): Likewise.
10718 Sun May 17 13:53:48 1998 Mark Mitchell <mmitchell@usa.net>
10720 * init.c (build_new_1): Call suspend_momentary around the creation
10721 of values that must be saved for exception handling.
10722 * parse.y (.build_new_placement): New non-terminal.
10723 (unary_expr, new_placement): Use it.
10724 * parse.c: Regenerated.
10726 Sun May 17 12:32:08 1998 Jason Merrill <jason@yorick.cygnus.com>
10728 * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare
10731 * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the
10734 * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace.
10736 Fri May 15 20:28:00 1998 Jason Merrill <jason@yorick.cygnus.com>
10738 * decl.c (start_decl): Revert problem change.
10740 * Makefile.in (CONFLICTS): Fix.
10742 Fri May 15 15:34:02 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
10744 * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits.
10746 Fri May 15 00:46:05 1998 Jason Merrill <jason@yorick.cygnus.com>
10748 * class.c (finish_struct_1): Use BINFO_SIZE.
10750 * decl.c (start_decl): Use 'tem'.
10752 Thu May 14 16:30:47 1998 Andrew MacLeod <amacleod@cygnus.com>
10754 * exception.cc: Include eh-common.h.
10755 (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL.
10756 (__cplus_type_matcher): First stab at new C++ runtime type matcher.
10757 (__cp_push_exception): Initialize eh_info struct as well.
10758 * except.c: Remove local structs and include eh-common.h.
10759 (init_exception_processing): Set language and version codes.
10760 (call_eh_info): Add presence of eh_info to runtime description of
10762 (expand_end_eh_spec): Call start_catch_block() and end_catch_block().
10763 * semantics.c (finish_try_block): Call start_catch_block() and
10765 * parse.y (function_try_block): Call start_catch_block() and
10768 Thu May 14 12:27:34 1998 Brendan Kehoe <brendan@cygnus.com>
10770 * typeck.c (original_type): New function.
10771 (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2,
10772 to see if they're actually the same.
10773 * cp-tree.h (original_type): Declare.
10775 Wed May 13 12:54:30 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10777 * Makefile.in (lex.o): Depend on output.h.
10779 * call.c (add_function_candidate): Remove unused variable `cand'.
10780 (add_conv_candidate): Likewise.
10781 (build_builtin_candidate): Likewise.
10783 * cp-tree.h: Add prototype for `types_overlap_p'.
10785 * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED.
10787 * decl2.c (merge_functions): Remove unused variables `tmp' and
10790 * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED.
10791 (code_as_string): Likewise.
10792 (language_as_string): Likewise.
10793 (parm_as_string): Likewise.
10794 (op_as_string): Likewise.
10795 (assop_as_string): Likewise.
10796 (cv_as_string): Likewise.
10798 * lex.c: Include output.h.
10800 * pt.c (type_unification): Cast first argument of `bzero' to a char*.
10802 * search.c (dfs_no_overlap_yet): Mark parameter `t' with
10805 * tinfo.cc (__class_type_info::dcast): Change the type of variable
10806 `i' from int to size_t.
10808 * typeck.c (language_lvalue_valid): Mark parameter `exp' with
10811 Tue May 12 21:37:49 1998 Jason Merrill <jason@yorick.cygnus.com>
10813 * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or
10814 DECL_NAMESPACE_SCOPE_P.
10815 (lang_decl_name): Likewise.
10816 * pt.c (tsubst_friend_function, tsubst): Likewise.
10817 * decl.c (pushdecl, redeclaration_error_message, start_decl,
10818 cp_finish_decl, start_function): Likewise.
10819 * class.c (finish_struct_1): Likewise.
10820 * call.c (build_over_call): Likewise.
10821 (compare_ics): Use DERIVED_FROM_P.
10823 Tue May 12 07:24:18 1998 Mark Mitchell <mmitchell@usa.net>
10825 * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro.
10826 * method.c (build_mangled_name): Use it.
10827 (build_decl_overload_real): Likewise.
10829 * error.c (dump_simple_decl): New function, broken out from ...
10830 (dump_decl): Use it.
10832 Mon May 11 11:38:07 1998 Mark Mitchell <mmitchell@usa.net>
10834 * ptree.c (lang_print_xnode): Add missing `break'.
10836 * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE.
10838 * call.c (add_template_candidate): Adjust for changes to
10839 fn_type_unification.
10840 (add_template_candidate_real): Likewise.
10841 (add_template_conv_candidate): Likewise.
10842 (build_user_type_conversion_1): Likewise.
10843 (build_new_function_call): Likewise.
10844 (build_object_call): Likewise.
10845 (build_new_op): Likewise.
10846 (build_new_method_call): Likewise.
10847 * class.c (instantiate_type): Likewise.
10848 * cp-tree.h (unification_kind_t): New type.
10849 (fn_type_unification): Adjust prototype.
10850 (type_unificaiton): Likewise.
10851 * pt.c (UNIFY_ALLOW_NONE): New macro.
10852 (UNIFY_ALLOW_MORE_CV_QUAL): Likewise.
10853 (UNIFY_ALLOW_LESS_CV_QUAL): Likewise.
10854 (UNIFY_ALLOW_DERIVED): Likewise.
10855 (unify): Change prototype.
10856 (maybe_adjust_types_for_deduction): New function.
10857 (check_cv_quals_for_unify): Likewise.
10858 (determine_specialization): Adjust.
10859 (fn_type_unification): Likewise.
10860 (type_unification): Likewise.
10861 (type_unification_real): Likewise. Use
10862 maybe_adjust_types_for_deduction. Fix mishandling of
10863 back-unification of template functions passed as arguments. Pass
10864 appropriate combination of UNIFY_ALLOW_* to unify.
10865 (unify): Remove unused NTPARMS parameter. Use
10866 check_cv_quals_for_unify. Remove bogus code that allowed
10867 too-generous unification in order to adhere more closely to standard.
10868 (get_bindings_real): Adjust.
10869 (get_class_bindings): Likewise.
10871 * method.c (build_overload_identifier): Only use the innermost
10872 template arguments when mangling.
10873 * pt.c (tsubst_template_argument_vector): New function.
10874 (complete_template_args): Deal with the situation where the
10875 extra_args contain more than one level of arguments.
10876 (lookup_template_class): Deal with member template classes, which
10877 may have more than one level of arguments.
10878 (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE.
10879 Improve handling of member template classes. Use
10880 DECL_PRIMARY_TEMPLATE instead of inline expansion. Use
10881 tsubst_template_argument_vector where appropriate.
10882 (regenerate_decl_from_template): Break out from ...
10883 (instantiate_decl): Here.
10885 * lex.c (yyprint): Remove TYPENAME_ELLIPSIS.
10886 * parse.h: Regenerated.
10887 * parse.c: Really regenerated.
10889 * cp-tree.h (finish_unary_op_expr): New function.
10890 (finish_id_expr): Likewise.
10891 (begin_new_placement): Likewise.
10892 (finish_new_placement): Likewise.
10893 (finish_declarator): Likewise.
10894 (finish_translation_unit): Likewise.
10895 (finish_parmlist): Likewise.
10896 (begin_class_definition): Likewise.
10897 (finish_class_definition): Likewise.
10898 (finish_default_args): Likewise.
10899 (finish_inline_definitions): Likewise.
10900 * parse.y (GCC_ASM_KEYWORD): Remove.
10901 (TYPENAME_ELLIPSIS): Likewise.
10902 * parse.c: Regenerated.
10903 Use new functions in semantics.c in the actions for many rules.
10904 * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD.
10905 * hash.h: Regenerated.
10906 * semantics.c (finish_expr_stmt): Allow NULL expr.
10907 (finish_unary_op_expr): New function, containing
10908 code previously in parse.y.
10909 (finish_id_expr): Likewise.
10910 (begin_new_placement): Likewise.
10911 (finish_new_placement): Likewise.
10912 (finish_declarator): Likewise.
10913 (finish_translation_unit): Likewise.
10914 (finish_parmlist): Likewise.
10915 (begin_class_definition): Likewise.
10916 (finish_class_definition): Likewise.
10917 (finish_default_args): Likewise.
10918 (finish_inline_definitions): Likewise.
10920 Sun May 10 23:43:13 1998 Mark Mitchell <mmitchell@usa.net>
10922 * typeck.c (build_c_cast): Don't decay arrays and functions to
10923 pointer type when converting to a class type.
10925 Sun May 10 22:53:56 1998 Jason Merrill <jason@yorick.cygnus.com>
10927 * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro.
10928 (DECL_CLASS_SCOPE_P): Likewise.
10930 Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org)
10932 * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT.
10933 * decl2.c (constructor_name_full): Likewise.
10935 Sun May 10 22:48:12 1998 Mike Stump <mrs@wrs.com>
10937 * tree.c (mapcar): Add OVERLOAD support.
10939 * init.c (resolve_offset_ref): We must use basetype_path before we
10940 destroy it with a call to convert_pointer_to.
10942 Sat May 9 14:44:37 1998 Jason Merrill <jason@yorick.cygnus.com>
10944 * class.c (currently_open_class): New fn.
10945 * decl.c (lookup_name_real): Use it.
10946 * search.c (lookup_field): Likewise.
10948 Fri May 8 23:32:42 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
10950 * cp-tree.def (OVERLOAD): New node.
10951 * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE,
10952 SET_IDENTIFIER_NAMESPACE_VALUE): Define.
10953 (NAMESPACE_BINDING): Remove.
10954 (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use
10956 (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED):
10958 (tree_overload): New struct.
10959 (IDENTIFIER_TYPE_VALUE): Use identifier_type_value.
10960 (REAL_IDENTIFIER_TYPE_VALUE): Define.
10961 (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE.
10962 (lang_decl_flags): Remove in_namespace.
10963 (lang_decl): Remove chain.
10964 (DECL_CHAIN, DECL_NAMESPACE): Remove.
10965 (flag_honor_std): Declare extern.
10966 (identifier_type_value, pushdecl_namespace_level, push_using_decl,
10967 namespace_binding, set_namespace_binding,
10968 lookup_function_nonclass, cat_namespace_levels,
10969 set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons,
10970 scratch_ovl_cons, ovl_member, build_overload): Declare.
10971 (decl_list_length, get_namespace_id, current_namespace_id,
10972 overloaded_globals_p): Remove.
10973 (lookup_using_namespace, qualified_lookup_using_namespace): Change
10975 (push_scratch_obstack): New macro.
10976 * call.c (add_function_candidate): Special-case type of OVERLOAD node.
10977 (build_user_conversions_1): Iterate using OVL_NEXT for ctors,
10979 (build_new_function_call): Iterate using OVL_CHAIN.
10980 Print DECL_NAME in when reporting ambiguities.
10981 (build_object_call): Iterate using OVL_NEXT for fns, convs.
10982 (build_new_op): Call lookup_function_nonclass.
10983 Iterate using OVL_NEXT.
10984 (build_op_delete_call): Change detection of members.
10985 Do not wrap TREE_LIST around fields and single global functions.
10986 (build_over_call): Don't push a class level if the context is a
10988 (build_new_method_call): Iterate using OVL_NEXT.
10989 * class.c (add_method): Chain overloaded members using
10990 build_overload. Remove copying of method.
10991 (grow_method): When iterating through the obstack, expect OVERLOAD
10992 nodes. Chain overload members.
10993 (finish_struct_methods): Chain overload members. Unpack OVERLOAD
10994 nodes in call to get_baselinks.
10995 (duplicate_tag_error): Expect OVERLOAD nodes when unchaining.
10996 (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle
10997 fdecls that are OVERLOAD nodes.
10998 (validate_lhs): New function.
10999 (instantiate_type): Do not copy OVERLOAD nodes. Remove dead
11000 code. Use DECL_NAME in error messages. Split code between global
11001 and member function processing.
11002 * decl.c (global_type_node): New static variable.
11003 (in_std): New global.
11004 (struct binding_level): New field usings.
11005 (resume_binding_level): Assert that we are not in a class.
11006 (toplevel_bindings_p): Just check for namespace_p or
11008 (resume_level): Remove.
11009 (find_binding): New function.
11010 (binding_for_name): Call it.
11011 (namespace_binding, set_namespace_binding): New functions.
11012 (push_namespace): Associate binding level with new namespace,
11013 resume_binding_level for existing namespace. Remove old code.
11014 Fake std by counting.
11015 (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE.
11016 (maybe_push_to_top_level): Save current namespace.
11017 (pop_from_top_level): Restore saved namespace.
11018 (pop_namespace): Call suspend_binding_level. Remove old code.
11019 (cat_namespace_levels): New function.
11020 (set_identifier_type_value_with_scope): For namespace bindings,
11021 set BINDING_TYPE, and use global_type_node.
11022 Use REAL_IDENTIFIER_TYPE_VALUE otherwise.
11023 (identifier_type_value): New function.
11024 (pushtag): If no context, use current_namespace.
11025 (duplicate_decls): Don't process DECL_CHAIN.
11026 (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not
11027 already set. Never reset it to NULL_TREE. Lookup global variables
11028 in their namespace. Push overloaded templates if they are on
11030 (pushdecl_namespace_level): New function.
11031 (pushdecl_top_level): Implement using pushdecl_namespace_level.
11032 (pushdecl_using_decl): New function.
11033 (overloaded_globals_p): Remove.
11034 (push_overloaded_decl): Create OVERLOAD nodes, and iterate through
11035 them. Use namespace_binding and set_namespace_value.
11036 (redeclaration_error_message): Complain if the declarations come
11037 from different namespaces.
11038 (lookup_tag): On namespace level, look in the BINDING_TYPE.
11039 (lookup_namespace_name): Pass tree_bindings from stack. Remove
11041 (select_decl): New function.
11042 (lookup_name_real): Call it for qualified and unqualified lookup.
11043 Pass tree_bindings from the stack.
11044 If prefer_type is 1, also accept namespaces.
11045 (lookup_function_nonclass): New function.
11046 (init_decl_processing): Set the binding level of the global
11047 namespace to global_binding_level.
11048 Build a proper type list for __builtin_apply.
11049 Initialize std_node to "fake std" if flag_honor_std is set.
11050 Initialize global_type_node.
11051 Allocated bad_alloc in namespace std if flag_honor_std.
11052 (define_function): Set the DECL_CONTEXT to the current_namespace.
11053 (start_decl): A namespace is not considered as a context here. If
11054 the DECL_CONTEXT is a namespace, push the decl.
11055 (cp_finish_decl): Check for namespaces used as initializers.
11056 (grokfndecl): Add namespace parameter. Remove processing of
11058 (grokvardecl): Add namespace parameter.
11059 (grokdeclarator): Process SCOPEs that are namespaces. For
11060 mangling, temporarily set the DECL_CONTEXT on anonymous structs.
11061 (start_function): Check for contexts that are namespaces.
11062 Set context for declarations that have not been pushed.
11063 (store_parm_decls): Check for ::main only.
11064 (finish_function): Likewise.
11065 (start_method): Check for contexts that are namespaces.
11066 (start_method): Remove DECL_CHAIN processing.
11067 * decl2.c (flag_honor_std): Declare.
11068 (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given.
11069 (decl_namespace_list): New static global.
11070 (grok_x_components): Ignore namespaces as type contexts.
11071 (check_classfn): Expect OVERLOAD nodes.
11072 (grokfield): Remove DECL_CHAIN processing.
11073 (finish_file): Call cat_namespace_levels.
11074 (merge_functions): New function.
11075 (ambiguous_decl): Rewrite.
11076 (lookup_using_namespace): Produce tree_bindings.
11077 (qualified_lookup_using_namespace): Likewise.
11078 (set_decl_namespace, decl_namespace, current_decl_namespace,
11079 push_decl_namespace, pop_decl_namespace): New functions.
11080 (arg_lookup): New struct.
11081 (add_function, arg_assoc_namespace, arg_assoc_class,
11082 arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent):
11084 (get_namespace_id, current_namespace_id): Remove.
11085 (do_toplevel_using_decl): Rewrite.
11086 (do_class_using_decl): Complain about namespace qualifiers.
11087 (do_using_directive): Sorry if not on namespace level. Complain
11088 about unknown namespaces.
11089 * error.c (dump_aggr_type): Check for namespace contexts.
11090 * except.c (init_exception_processing): Push terminate into std.
11091 * friend.c (is_friend): A namespace is not a context, here.
11092 * init.c (expand_member_init): Remove DECL_CHAIN processing.
11093 (build_offset_ref): Process OVERLOAD nodes.
11094 * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std.
11095 * lex.c (identifier_type): Loop using OVL_CHAIN.
11096 (see_typename): Set looking_for_typename to 2.
11097 (real_yylex): Likewise.
11098 (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs.
11099 (do_scoped_id): Expect OVERLOAD nodes.
11100 Change calling convention for qualified_lookup_using_namespace.
11101 (build_lang_decl): Don't set in_namespace anymore.
11102 * method.c (typevec_size): New global.
11103 (build_overload_nested_name): Return if global_namespace.
11104 Otherwise, always expect a declaration context.
11105 (build_qualified_name): Likewise.
11106 Make sure we don't write beyond typevec_size.
11107 (build_decl_overload_real): Likewise.
11108 Allocate one extra slot for the namespace.
11109 (hack_identifier): Mark code dead.
11110 Process OVERLOAD and NAMESPACE_DECL nodes.
11111 * parse.y (program): Pop namespaces until in global namespace.
11112 (extdef): In a using-declaration, don't discard the identifier if
11113 there is no declaration.
11114 (left_curly): Ignore type contexts which are namespaces.
11115 (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type
11117 * pt.c (template_class_depth): Expect types to be namespaces.
11118 (determine_specialization): Simplify by expecting OVERLOAD nodes.
11119 (push_template_decl): Push into namespace level.
11120 Reset ctx if it is a namespace.
11121 Set DECL_CONTEXT to current_namespace if not set already.
11122 Ignore real contexts that are namespaces.
11123 (mangle_class_name_for_template): Skip global_namespace.
11124 Mangle other namespaces as declarations.
11125 (lookup_template_function): Set type of OVERLOAD nodes to unknown.
11126 (lookup_template_class): Push into namespace of context.
11127 If the context is a namespace, set it to global_namespace.
11128 Use id_context for mangling.
11129 (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes.
11130 (tsubst_friend_function): Ignore namespace contexts.
11131 Push into namespace level.
11132 (tsubst): Handle NAMESPACE_DECL nodes.
11133 Remove DECL_CHAIN processing.
11134 (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes.
11135 * ptree.c (print_lang_identifier): Print bindings.
11136 (lang_print_xnode): Print OVERLOAD nodes.
11137 * rtti.c (init_rtti_processing): Push type_info into std.
11138 * search.c (lookup_fnfields_here): Expect OVERLOAD nodes.
11139 (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual,
11140 dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions,
11141 lookup_fnfields_here): Likewise.
11142 Process all nodes, instead of going through TREE_CHAIN.
11143 * sig.c (build_signature_pointer_or_reference_type): Set context
11144 to global_namespace.
11145 (build_signature_table_constructor): Expect OVERLOAD nodes.
11146 * spew.c (yylex): Save old setting of looking_for_typename.
11147 * tree.c (decl_list_length): Remove.
11148 (binding_init): New function.
11149 (count_functions): Rewrite.
11150 (is_overloaded_fn): Expect OVERLOAD nodes.
11151 (really_overloaded_fn, get_first_fn, lvalue_type): Likewise.
11152 (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after,
11153 ovl_member): New functions.
11154 * typeck.c (require_complete_type): Expect OVERLOAD nodes.
11155 (type_unknown_p): Likewise.
11156 (require_instantiated_type): Likewise.
11157 (build_component_ref): Declare code dead.
11158 (build_x_function_call): Create and expect OVERLOAD nodes.
11159 (build_function_call_real): Check for ::main only.
11160 (build_unary_op): Likewise. Expect OVERLOAD nodes.
11161 (convert_for_assignment): Check for TREE_LIST before accessing
11163 * decl.c (duplicate_decls): Check for namespace bindings instead
11164 of global bindings.
11165 (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real,
11166 lookup_name_current_level, start_decl, xref_tag,
11167 finish_enum): Likewise.
11168 * init.c (build_offset_ref): Likewise.
11169 * search.c (lookup_field): Likewise.
11170 (lookup_fnfields): Likewise.
11171 (dfs_debug_mark): Likewise.
11172 * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE.
11173 (poplevel_class, pop_from_top_level): Likewise.
11174 * decl2.c (finish_method): Likewise.
11175 * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE.
11176 * decl.c (record_builtin_type): Likewise.
11177 (init_decl_processing, grokfndecl): Likewise.
11178 * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise.
11179 (make_lang_type): Likewise.
11180 * parse.y (make_thunk): Likewise.
11181 * pt.c (tsubst): Likewise.
11182 * tree.c (debug_binfo): Likewise.
11183 * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h,
11184 tinfo2.cc, inc/new.h: Add std qualifications.
11185 * inc/new: Wrap with namespace std if __HONOR_STD.
11186 * inc/typeinfo: Likewise.
11188 Fri May 8 00:43:50 1998 Jason Merrill <jason@yorick.cygnus.com>
11190 * call.c (build_user_type_conversion_1): Handle second_conv
11191 properly for templates.
11193 Thu May 7 17:09:25 1998 Andrew MacLeod <amacleod@cygnus.com>
11195 * method.c (build_decl_overload_real): Set TREE_USED flag to
11196 zero for build_type_variants nodes as well.
11198 Wed May 6 19:27:09 1998 Jason Merrill <jason@yorick.cygnus.com>
11200 * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE.
11202 Wed May 6 16:49:48 1998 Jim Wilson <wilson@cygnus.com>
11204 * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o,
11205 except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o,
11206 rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o,
11207 xref.o): Add toplev.h dependencies.
11209 Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com)
11211 * errfn.c (cp_error, cp_warning): Remove declarations for
11212 error and warning respectively.
11214 Wed May 6 14:28:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11216 * error.c: Convert to using ctype macros defined in system.h.
11217 * method.c: Likewise.
11218 * xref.c: Likewise.
11219 * lex.c: Likewise. Also remove redundant system header stuff.
11221 Wed May 6 06:36:41 1998 Robert Lipe <robertl@dgii.com>
11223 * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c,
11224 expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c,
11225 search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c,
11226 xref.c: Add include of toplev.h.
11228 Wed May 6 02:33:39 1998 Jason Merrill <jason@yorick.cygnus.com>
11230 * tree.c (perm_manip): Also regenerate the RTL of an extern.
11231 (copy_to_permanent): Use end_temporary_allocation.
11233 Tue May 5 23:54:04 1998 Jason Merrill <jason@yorick.cygnus.com>
11235 * init.c (expand_vec_init): The initialization of each array
11236 element is a full-expression.
11238 Tue May 5 18:24:13 1998 Andrew MacLeod <amacleod@cygnus.com>
11240 * method.c (build_mangled_name): Add a call to build_type_variant
11241 to get the right type.
11243 Tue May 5 01:25:03 1998 Jason Merrill <jason@yorick.cygnus.com>
11245 * Makefile.in: Add .SUFFIXES.
11247 * cp-tree.def: Remove NAMESPACE_DECL.
11249 Sun May 3 01:32:14 1998 Jason Merrill <jason@yorick.cygnus.com>
11251 * call.c (build_over_call): Do evaluate arg even if it has empty
11253 * decl.c (start_function): Don't push a member function.
11255 Thu Apr 30 18:59:23 1998 Jim Wilson <wilson@cygnus.com>
11257 * Makefile.in (g++FAQ.info): Put -o option before input file.
11259 Thu Apr 30 13:05:33 1998 Andrew MacLeod <amacleod@cygnus.com>
11261 * gxxint.texi: Add info for squangling codes K and B.
11263 Tue Apr 28 13:22:01 1998 Mark Mitchell <mmitchell@usa.net>
11265 * semantics.c (begin_stmt_expr): Avoid duplicating the effect of
11266 the expression in templates.
11267 (finish_stmt_expr): Likewise.
11269 1998-04-28 Brendan Kehoe <brendan@cygnus.com>
11271 * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int.
11273 Mon Apr 27 13:58:10 1998 Mark Mitchell <mmitchell@usa.net>
11275 * decl.c (maybe_push_to_top_level): Always clear
11276 current_template_parms and processing_template_decl.
11277 (pushtag): Remove check of current_class_type and some comments,
11278 since maybe_push_to_top_level no longer creates confusion.
11280 Sun Apr 26 12:10:18 1998 Mark Mitchell <mmitchell@usa.net>
11282 * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro.
11283 (DECL_CLASS_TEMPLATE_P): Likewise.
11284 (DECL_PRIMARY_TEMPLATE): Likewise.
11285 (PRIMARY_TEMPLATE_P): Use it.
11286 (push_template_decl_real): New function.
11287 (redeclare_class_template): Take new template parameters as
11289 (is_specialization_of): New function.
11290 (comp_template_args): Declare.
11291 * decl.c (pushtag): Handle friend template classes.
11292 (xref_tag): Likewise. Use new calling convention for
11293 redeclare_class_template.
11294 * decl2.c (grok_x_components): Handle friend templates.
11295 * friend.c (is_friend): Use is_specialization_of where
11296 appropriate. Deal with friend class templates.
11297 (make_friend_class): Let a class template be friends with itself.
11298 * pt.c (comp_template_args): Remove declaration.
11299 (tsubst_friend_class): New function.
11300 (push_template_decl_real): New function.
11301 (push_template_decl): Use it.
11302 (redeclare_class_template): Adjust for new calling convention.
11303 (comp_template_args): Give it external linkage.
11304 (instantiate_class_type): Use tsubst_friend_class to deal
11305 with friend templates.
11306 * typeck.c (comptypes): Use comp_template_args, rather than
11307 expanding it inline.
11308 * parse.y (component_decl): Handle a nested template type
11309 like other component type declarations.
11311 * pt.c (check_explicit_specialization): Handle overloaded
11312 constructors correctly.
11314 * pt.c (mabybe_get_template_decl_from_type_decl): New function.
11315 (lookup_template_class): Use it.
11317 Thu Apr 23 21:19:06 1998 Jason Merrill <jason@yorick.cygnus.com>
11319 * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops.
11320 * cp-tree.h: Add WRAPPER support.
11321 * call.c (add_candidate): Split out from add_*_candidate fns.
11322 (build_over_call): Take the candidate instead of function and args.
11323 Enforce access control here. Emit overload warnings here.
11324 (add_warning): New fn.
11325 (joust): Add WARN parm. If not set, call add_warning instead of
11326 printing a warning. Re-enable some warnings.
11327 (tourney): Pass it.
11328 (convert_like): Adjust.
11329 (build_new_op): Adjust.
11330 (build_new_function_call): Adjust.
11331 (build_user_type_conversion_1): Adjust.
11332 (USER_CONV_FN): Adjust.
11333 * tree.c (build_expr_wrapper, build_expr_ptr_wrapper,
11334 build_int_wrapper): New fns.
11336 Thu Apr 23 18:27:53 1998 Mark P. Mitchell <mmitchell@usa.net>
11338 * pt.c (unify): Fix typo in previous change.
11340 Thu Apr 23 09:32:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11342 * error.c (dump_type_real): Declare canonical_name.
11344 * typeck.c (comp_target_types): Fix PMFs.
11346 Wed Apr 22 13:24:48 1998 Mark Mitchell <mmitchell@usa.net>
11348 * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for
11349 the DECL_RESULTs of a member TEMPLATE_DECL, not just the
11352 * pt.c (tsubst): Decrease the template-level of
11353 TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a
11354 TEMPLATE_PARM_INDEX.
11355 (template_decl_level): New function.
11356 (unify): Make sure to record unifications for template
11357 parameters, even when the parameters exactly match the arguments.
11358 Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
11359 TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that
11360 aren't from the level we're currently working on.
11362 Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net>
11364 * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory.
11366 * decl2.c (check_member_template): Set DECL_IGNORED for member
11367 class templates, too.
11369 * decl2.c (grokfield): Remangle the name of a member TYPE_DECL.
11371 Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
11373 * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function.
11375 Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com)
11377 * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare.
11378 * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
11379 (init_decl_processing): Handle TI types.
11380 * typeck.c (unsigned_type, signed_type): Handle TI types.
11382 Sat Apr 18 15:25:21 1998 Jim Wilson <wilson@cygnus.com>
11384 * g++spec.c (lang_specific_driver): New argument in_added_libraries.
11385 New local added_libraries. Increment count when add library to
11388 Fri Apr 17 21:25:00 1998 Mark Mitchell <mmitchell@usa.net>
11390 * cp-tree.h (type_as_string_real): New function.
11391 * pt.c (mangle_class_name_for_template): Use it.
11392 * error.c (dump_aggr_type): Change prototype.
11393 (dump_type_prefix): Likewise.
11394 (dump_type_suffix): Likewise.
11395 (dump_type_real): Convert from dump_type. If desired, the
11396 "canonica" name of a typedef, i.e., the name of the underlying
11397 type, can be printed.
11398 (dump_type): Call dump_type_real.
11400 Fri Apr 17 14:30:45 1998 Jason Merrill <jason@yorick.cygnus.com>
11402 * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks.
11404 * typeck.c (comp_target_types): Tweak pedantic case.
11405 (comp_target_parms): Tweak pedantic case. Clean up somewhat.
11406 Return -1 or 1 instead of 1 or 2.
11407 (compparms): Remove STRICT handling.
11408 (convert_for_assignment): Fix handling of pmfs.
11410 Fri Apr 17 14:04:16 1998 Mark Mitchell <mmitchell@usa.net>
11412 * typeck.c (comp_target_types): Handle references like pointers.
11413 (comp_target_parms): Note that return code from comp_target_types
11414 can be negative to indicate failure.
11416 Fri Apr 17 09:10:52 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
11418 * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG),
11419 which requires a working target compiler to build.
11421 Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com)
11423 * tree.c (avoid_overlap): Add prototype.
11425 * spew.c (num_tokens): Add prototype.
11426 (nth_noken, add_token, consume_token, debug_yychar): Likewise.
11428 * search.c (dfs_check_overlap): Add prototype.
11429 (dfs_no_overlap_yet): Likewise.
11431 * pt.c (original_template): Add prototype.
11432 (inline_needs_template_parms): Likewise.
11433 (push_inline_template_parms_recursive): Likewise.
11434 (retrieve_specialization, register_specialization): Likewise.
11435 (print_candidates, reduce_template_parm_level): Likewise.
11436 (build_template_decl, mark_template_parm): Likewise.
11437 (tsubst_friend_function, get_bindings_real): Likewise.
11439 * method.c (start_squangling): Add prototype.
11440 (end_squangling, check_ktype, issue_ktype): Likewise.
11441 (build_overloaded_scope_ref, check_btype): Likewise.
11442 (build_mangled_template_parm_index): Likewise.
11444 * lex.c (init_cpp_parse): Add prototype.
11445 (handle_cp_pragma, handle_sysv_pragma): Likewise.
11446 (reduce_cmp, token_cmp): Likewise.
11448 * except.c (call_eh_info): Add prototype.
11449 (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise.
11450 (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise.
11452 * decl2.c (is_namespace_ancestor): Add prototype.
11453 (namespace_ancestor, add_using_namespace): Likewise.
11454 (ambiguous_decl): Likewise.
11456 * decl.c (indent): Add prototype.
11458 * call.c (add_template_candidate_real): Add prototype.
11460 Fri Apr 17 01:57:12 1998 Jason Merrill <jason@yorick.cygnus.com>
11462 * decl2.c (build_expr_from_tree): Just return a PMF.
11464 Fri Apr 17 00:45:12 1998 Mark Mitchell <mmitchell@usa.net>
11466 * typeck2.c (process_init_constructor): Don't strip cv-qualifiers
11467 when doing initializations.
11469 * pt.c (unify): Use comptypes to compare type args.
11471 Fri Apr 17 00:24:22 1998 Jason Merrill <jason@yorick.cygnus.com>
11473 * decl.c (duplicate_decls): Fix check for when it's safe to free
11476 * pt.c (mangle_class_name_for_template): Don't pass a typedef type
11479 Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com)
11481 * pt.c (build_template_parm_index): Add prototype.
11483 * search.c (my_tree_cons): Don't clear words outside the
11484 newly allocated node.
11486 Wed Apr 15 15:34:44 1998 Dave Brolley <brolley@cygnus.com>
11488 * lex.c (init_parse): Now returns char* containing the filename.
11490 Wed Apr 15 13:20:06 1998 John Carr <jfc@mit.edu>
11491 Jeff Law <law@cygnus.com>
11493 * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer
11496 Sun Apr 12 22:31:19 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
11498 * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION.
11500 Fri Apr 10 12:16:49 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
11502 * decl.c (duplicate_decls): Don't warn for redundant decls if
11503 friend: let add_friend take care of it.
11505 Thu Apr 9 02:40:48 1998 Jason Merrill <jason@yorick.cygnus.com>
11507 * sig.c (build_signature_pointer_constructor): Don't set
11508 TREE_HAS_CONSTRUCTOR for a signature pointer.
11509 * cvt.c (ocp_convert): Don't force a temporary for internal structs.
11510 * init.c (resolve_offset_ref): Warn about implicit & on pmfs
11512 * typeck.c (build_unary_op): Only allow taking the address of a
11514 * typeck2.c (digest_init): Simplify.
11515 (store_init_value): Don't pedwarn about using { } for pmfs.
11517 Thu Apr 9 22:16:57 1998 Per Bothner <bothner@cygnus.com>
11519 * cp-tree.h (start_decl): Update prototype.
11520 * decl.c (start_decl): Like the C version, new parameters
11521 for the attributes. Call cplus_decl_attributes here,
11522 (pushdecl): Like C version, do build_type_copy if TYPE_DECL,
11523 (grokdeclarator): Pass NULL for new start_decl arguments.
11524 * pt.c (tsubst_expr): Likewise.
11525 * parse.y: Merge cplus_decl_attribute calls into start_decl calls.
11526 * typeck.c (common_type): Check TYPE_MAIN_VARIANT.
11527 * lex.c (build_lang_decl): Add lang_name_java.
11528 * class.c (push_lang_context): Add lang_name_java.
11529 * method.c (build_mangled_name): Check for is_java_type.
11531 Thu Apr 9 22:16:57 1998 Benjamin Kosnik <bkoz@loony.cygnus.com>
11533 * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT.
11534 * call.c (build_scoped_method_call): Check for TREE_CODE for
11535 VOID_TYPE instead of type == void_type_node.
11536 (build_method_call): Likewise.
11537 * decl.c (lookup_name_real): Likewise.
11538 (grokdeclarator): Likewise.
11539 (start_decl): Likewise.
11540 (grokparms): Likewise.
11541 (start_function): Likewise.
11542 (finish_function): Likewise.
11543 (start_method): Likewise.
11545 Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com)
11547 * lex.c (finput): New variable.
11548 (init_cpp_parse): Renamed from init_parse.
11549 (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished.
11550 (finish_parse): New function.
11551 * cp-tree.h (init_lex, init_parse): Remove declarations.
11553 Mon Apr 6 02:25:05 1998 Jason Merrill <jason@yorick.cygnus.com>
11555 * call.c (build_call): Still evaluate the actual argument.
11556 * class.c (is_empty_class): Update for -fnew-abi.
11558 * decl2.c: -fnew-abi implies -fsquangle.
11560 * method.c (do_build_assign_ref): Don't do anything to copy
11562 (do_build_copy_constructor): Likewise.
11563 * call.c (build_over_call): Likewise.
11565 Sat Apr 4 18:43:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11567 * tree.c (avoid_overlap): Return a value.
11569 Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com)
11571 * method.c (check_btype): Add missing argument to xrealloc.
11572 (check_ktype): Likewise.
11574 Fri Apr 3 02:22:59 1998 Jason Merrill <jason@yorick.cygnus.com>
11576 Implement empty base optimization.
11577 * class.c (finish_struct_1): Add vbase fields earlier. Set
11578 CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty.
11579 * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns.
11580 (types_overlap_p): New fn.
11581 * tree.c (avoid_overlap): New fn.
11582 (build_base_fields): Use it to avoid overlapping empty bases.
11583 * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi.
11585 * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs.
11587 Re-implement allocation of base class subobjects.
11588 * tree.c (unshare_base_binfos): New fn.
11589 (layout_basetypes): Use it. Now handles offsets of both virtual and
11590 non-virtual bases, after layout_type.
11591 (layout_vbasetypes): Remove.
11592 (build_base_fields): Generate FIELD_DECLs for each non-virtual base.
11593 (build_vbase_pointer_fields): Split out from old layout_basetypes.
11594 * class.c (finish_base_struct): Lose offset handling code.
11595 Move nonvdtor warning here. Don't mess with t_binfo anymore.
11596 (finish_struct_1): Don't mess with t_binfo anymore. Use fns above.
11597 * cp-tree.h: Adjust.
11599 Thu Apr 2 14:25:13 1998 Jason Merrill <jason@yorick.cygnus.com>
11601 * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff.
11602 * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise.
11603 * class.c (duplicate_tag_error): Likewise.
11604 (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN.
11605 * tree.c (layout_vbasetypes): Update from layout_record, remove
11606 var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE.
11607 (layout_basetypes): Likewise.
11609 Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com)
11611 * class.c, Make sure system.h is included just after config.h.
11612 Delete lingering stdio and errno references too.
11613 * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise.
11615 Wed Apr 1 15:38:36 1998 Jason Merrill <jason@yorick.cygnus.com>
11617 * friend.c (is_friend): Fix access control for local classes.
11619 * class.c (is_empty_class): New fn.
11620 * call.c (build_call): Don't pass empty class objects to a function.
11622 Wed Apr 1 14:58:35 1998 Mark Mitchell <mmitchell@usa.net>
11624 * call.c (build_over_call): Do name resolution for default
11625 arguments of function templates in the scope of the templates.
11627 Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com)
11629 * call.c: Include system.h. Remove includes, declarations and
11630 defines provided by system.h.
11631 * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise.
11632 * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise.
11633 * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise.
11634 * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise.
11635 * typeck2.c, xref.c: Likewise.
11636 * Makefile.in: Dependencies updated as appropriate.
11637 * Make-lang.in: Likewise.
11639 Mon Mar 30 12:15:00 1998 Mark Mitchell <mmitchell@usa.net>
11641 * pt.c (fn_type_unification): Allow incomplete unification without
11642 an immediate error message.
11644 Mon Mar 30 08:55:42 1998 Jason Merrill <jason@yorick.cygnus.com>
11646 * tree.c (member_p): New fn.
11647 * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for
11648 initializing class members.
11650 * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'.
11651 * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX.
11653 * call.c (build_method_call): Handle non-scoped destructors, too.
11654 * pt.c (tsubst_copy): Likewise.
11656 * pt.c (print_template_context): Split out...
11657 (push_tinst_level): ...from here.
11659 * friend.c (is_friend): Don't pass a type to decl_function_context.
11661 * typeck.c (convert_for_initialization): Always hand off
11662 conversions to class type.
11664 Sun Mar 29 20:01:59 1998 Jason Merrill <jason@yorick.cygnus.com>
11666 * friend.c (is_friend): Local classes have the same access as the
11667 enclosing function.
11669 Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com)
11671 * typeck.c (expand_target_expr): Delete dead function.
11673 * search.c: Put various prototypes inside #ifdef MI_MATRIX.
11675 * repo.c (save_string): Delete dead function.
11677 * method.c (thunk_printable_name): Delete dead function.
11679 * lex.c (yynextch): Delete dead function.
11681 * expr.c (tree_extract_aggr_init): #if 0 out.
11683 * except.c (do_unwind): Delete dead function.
11684 (easy_expand_asm): Likewise.
11686 * cvt.c (build_conversion_type_1): Delete dead function.
11688 * cp-tree.h (push_expression_obstack): Declare.
11690 * call.c (source_type): #if 0 out.
11692 * class.c (alter_access): Remove unused label. Add braces
11693 around empty else clause.
11695 * lex.c (yyprint): Fix argument to printf.
11697 Sat Mar 28 17:43:52 1998 Mark Mitchell <mmitchell@usa.net>
11699 * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs.
11701 * pt.c (instantiate_class_template): Make sure template
11702 arguments are permanent.
11703 * init.c (resolve_offset_ref): Don't go looking around in
11706 * semantics.c: Add routines to handle expressions, and some
11707 declaration processing.
11708 * parse.y: Use them.
11709 (current_class_depth): Move declaration to cp-tree.h.
11710 * parse.c: Regenerated.
11711 * cp-tree.h: Use them.
11712 (current_class_depth): Declare.
11713 * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr.
11715 Fri Mar 27 20:23:18 1998 Mark Mitchell <mmitchell@usa.net>
11717 * error.c (dump_decl): Be a bit more explicit with template
11718 type arguments, when verbose.
11720 Fri Mar 27 18:16:40 1998 Jason Merrill <jason@yorick.cygnus.com>
11722 * inc/exception: Reorder closing braces.
11724 Fri Mar 27 13:22:18 1998 Mark Mitchell <mmitchell@usa.net>
11726 * pt.c (redeclare_class_template): New function.
11727 * cp_tree.h (redeclare_class_template): Declare it.
11728 * decl.c (xref_tag): Use it.
11730 Thu Mar 26 11:16:30 1998 Jason Merrill <jason@yorick.cygnus.com>
11732 * call.c (build_over_call): Check IS_AGGR_TYPE, not
11733 TYPE_LANG_SPECIFIC.
11734 * typeck.c (convert_arguments): Likewise.
11736 * decl.c (grokdeclarator): Remove const and volatile from type after
11737 setting constp and volatilep.
11739 * class.c (finish_struct_1): Don't warn about bool bitfield larger
11742 Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
11744 * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
11746 Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
11748 * call.c (build_object_call): Complain about ambiguous operator(),
11749 rather that crashing.
11750 (build_new_op): Likewise.
11751 (build_op_delete_call): Likewise.
11753 Thu Mar 26 10:23:24 1998 Mark Mitchell <mmitchell@usa.net>
11755 * cvt.c (perform_qualification_conversions): Use comp_target_types
11756 instead of comp_ptr_ttypes.
11758 Wed Mar 25 16:10:50 1998 Mark Mitchell <mmitchell@usa.net>
11760 * cp-tree.h (enforce_access): Declare.
11761 * call.c (enforce_access): Make it extern, not static.
11762 * class.c (alter_access): Use enforce_access; modify code for ISO
11763 compliance, rather than ARM rules.
11765 Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11767 * cp-tree.h: Fix typo.
11769 Wed Mar 25 02:01:02 1998 Jason Merrill <jason@yorick.cygnus.com>
11771 * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing
11772 if (aggregate_value_p (type)).
11774 * decl2.c (constructor_name_full): Handle TYPENAME_TYPE.
11776 Tue Mar 24 16:12:01 1998 Mark Mitchell <mmitchell@usa.net>
11778 * tree.c (mapcar): When dealing with a DECL, use it's constant
11780 * pt.c (lookup_template_class): Don't mangle the names of template
11781 classes whose arguments are unknown.
11783 * pt.c (tsubst_expr): Handle GOTO_STMT correctly.
11785 Tue Mar 24 12:21:55 1998 Benjamin Kosnik <bkoz@lisa.cygnus.com>
11787 * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1.
11789 Tue Mar 24 12:21:48 1998 Jim Wilson <wilson@cygnus.com>
11791 * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for
11792 boolean_type_node to 1.
11794 Tue Mar 24 10:23:47 1998 Mark Mitchell <mmitchell@usa.net>
11796 * error.c (dump_expr): Remove unused variable `l'.
11798 * pt.c (for_each_template_parm): New function, created by
11799 converting uses_template_parms.
11800 (tree_fn_t): New typedef.
11801 (uses_template_parms): Use it.
11802 (mark_template_parm): New function.
11803 (push_template_decl): Check that the argument list of a partial
11804 specialization uses all the template parameters.
11806 * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done
11807 with it; we might want it for debugging.
11808 * cp-tree.h (type_unification): Change interface.
11809 * class.c (finish_struct_1): Skip nested template types, just like
11810 ordinary nested types.
11811 (instantiate_type): Use new interface to type_unification.
11812 * lex.c (init_lex): Add __sz as opname for sizeof.
11813 * method.c (build_overload_scope_ref): New function.
11814 (build_overload_int): Handle complex expressions. Set
11815 numeric_output_need_bar if necessary.
11816 (build_overload_value): Handle non-PARM_DECL nodes; this
11817 routine is now used by build_overload_int. Remove some
11818 assignments to numeric_output_need_bar. Use
11819 build_overload_scope_ref.
11820 (build_qualified_name): Note that some template mangled names end
11821 with digits, and set numeric_output_need_bar appropriately. Use
11822 build_underscore_int.
11823 * pt.c (unify): Change interface.
11824 (type_unification_real): Likewise.
11825 (determine_specialization): Use new interfaces.
11826 (tsubst): Deal gracefully with situations in which the argument
11827 vector is not fully filled.
11828 (fn_type_unification): Use new interfaces.
11829 (type_unification): Likewise. Remove NOP_EXPR hack.
11830 (type_unification_real): Likewise.
11831 (unify): Likewise. Deal with unification of complex expressions.
11833 Mon Mar 23 12:24:37 1998 Jason Merrill <jason@yorick.cygnus.com>
11835 * pt.c (complete_template_args): Initialize skip properly.
11837 * decl.c (make_typename_type): Revert.
11838 (make_implicit_typename): Remove.
11839 (lookup_name_real): Don't call it. Call lookup_field if we see a
11840 TYPE_DECL from a template base.
11841 * search.c (lookup_field): Do implicit typename stuff.
11843 Sun Mar 22 00:50:42 1998 Nick Clifton <nickc@cygnus.com>
11844 Geoff Noer <noer@cygnus.com>
11846 * Makefile.in: Various fixes for building cygwin32 native toolchains.
11847 * Make-lang.in: Likewise.
11849 Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11851 * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify.
11853 Fri Mar 20 10:42:07 1998 Jason Merrill <jason@yorick.cygnus.com>
11855 * decl.c (make_implicit_typename): Rewrite removed code.
11856 (make_typename_type): Call it if the type we look up comes from
11857 a base that uses template parms.
11859 * pt.c (complete_template_args): Rewrite.
11860 (tsubst, FUNCTION_DECL): Use it.
11862 Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org)
11864 * semantics.c (finish_asm_stmt): Fix combine strings. Call
11865 c_expand_asm_operands () if output_operands, input_operands or
11866 clobbers is not NULL_TREE.
11868 Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11870 * pt.c (complete_template_args): New function.
11871 (get_bindings): Deal with specializations of function templates
11872 with return type containing parameters from outer class
11874 (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level,
11875 substitute arguments and compose a new type.
11877 Thu Mar 19 19:01:48 1998 Mark Mitchell <mmitchell@usa.net>
11879 * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new
11882 Thu Mar 19 11:51:58 1998 Jason Merrill <jason@yorick.cygnus.com>
11884 * decl.c (make_implicit_typename): Lose useless code.
11886 * call.c (standard_conversion): Handle A* -> const A* properly.
11888 * pt.c (get_bindings_real): Rename from get_bindings. Add
11889 check_rettype parm.
11890 (get_bindings): Pass 1.
11891 (get_bindings_overload): Pass 0.
11893 Wed Mar 19 09:08:12 1998 Mark Mitchell <mmitchell@usa.net>
11895 * pt.c (check_explicit_specialization): When reverting a static
11896 member function, also remove the `this' parameter from
11897 last_function_parms.
11899 Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com>
11901 * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
11902 a function context.
11904 * decl.c (store_bindings): Use free_binding_vecs.
11905 (pop_from_top_level): Likewise.
11907 Wed Mar 18 12:41:43 1998 Jason Merrill <jason@yorick.cygnus.com>
11909 * decl.c (make_implicit_typename): Only change the type of a
11912 Wed Mar 18 10:09:51 1998 Mark Mitchell <mmitchell@usa.net>
11914 * semantics.c: New file, containing routines to perform the
11915 semantic phase of parsing.
11917 * pt.c (tsubst_expr): Likewise.
11918 * cp-tree.h: Declare the various functions in semantics.c.
11919 Provide macros to access _STMT tree nodes.
11920 * cp-tree.def: Add ASM_STMT tree node.
11921 * Makefile.in, Make-lang.in: Add dependencies on and for
11924 Wed Mar 18 00:24:10 1998 Jason Merrill <jason@yorick.cygnus.com>
11926 * pt.c (push_template_decl): Only check primary templates.
11928 * pt.c (check_explicit_specialization): Complain about default args
11929 in explicit specialization.
11931 * parse.y (nomods_initdcl0): Also call cp_finish_decl for a
11932 constructor_declarator.
11934 Tue Mar 17 14:44:54 1998 Mark Mitchell <mmitchell@usa.net>
11936 * typeck2.c (build_x_arrow): Don't crash when an aggregate type
11937 has no overloaded operator ->.
11939 * call.c (build_field_call): Don't crash when presented with a
11940 field that is actually a nested type.
11942 * decl.c (pushtag): Deal with friend class injection in local
11945 * call.c (build_object_call): Don't crash if OBJ is a
11946 pointer-to-member-function.
11948 Tue Mar 17 11:40:26 1998 Jason Merrill <jason@yorick.cygnus.com>
11950 * pt.c (push_template_decl): Complain about template with C linkage,
11951 anonymous template class.
11953 Mon Mar 16 12:10:39 1998 Jason Merrill <jason@yorick.cygnus.com>
11955 * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX.
11956 * search.c: Likewise.
11958 * lex.c (do_pending_defargs): Only call
11959 maybe_{begin,end}_member_template_processing for FUNCTION_DECLs.
11961 * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al.
11963 Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
11965 * parse.y: Deal with CONSTRUCTORS in new_initializers.
11967 Mon Mar 16 10:54:21 1998 Mark Mitchell <mmitchell@usa.net>
11969 * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more
11970 closely mimics the behavior in parse.y.
11971 (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing
11972 into a compound statement.
11974 Sun Mar 15 02:07:26 1998 Jason Merrill <jason@yorick.cygnus.com>
11976 * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro.
11977 * pt.c (inline_needs_template_parms): New fn.
11978 (original_template): New fn.
11979 (push_inline_template_parms_recursive): New fn.
11980 (maybe_begin_member_template_processing): Use them.
11981 (maybe_end_member_template_processing): Likewise.
11982 (is_member_or_friend_template): Rename to is_member_template.
11983 Member functions of local classes are never member templates.
11985 Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
11987 * lex.c (do_identifier): Handle TEMPLATE_DECL that was
11988 added in the class scope to catch redefinition error.
11990 * pt.c (reduce_template_parm_level): Also copy
11991 the DECL_TEMPLATE_PARMS field.
11993 Sun Mar 15 10:54:08 1998 Mark Mitchell <mmitchell@usa.net>
11995 * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a
11996 reduced-level template type parameter.
11998 Sun Mar 15 12:26:02 1998 Manfred Hollstein <manfred@s-direktnet.de>
12000 * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider.
12001 (DECL_NEEDS_FINAL_OVERRIDER_P): New macro.
12002 * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P.
12003 * decl.c (duplicate_decls): Propagate it.
12004 * typeck2.c (abstract_virtuals_error): Use two loops to emit
12005 abstract virtual functions and virtual functions which need a
12006 final overrider separately.
12008 Thu Mar 12 09:39:40 1998 Manfred Hollstein <manfred@s-direktnet.de>
12010 * lang-specs.h: Properly put brackets around array elements in
12013 * typeck.c (build_binary_op_nodefault): Correctly place parens around
12014 && and || in expression.
12016 Thu Mar 12 09:26:04 1998 Manfred Hollstein <manfred@s-direktnet.de>
12018 * call.c (default_parm_conversions): Remove prototype definition.
12019 (build_method_call): Remove unused variable result.
12021 * cvt.c (ocp_convert): Remove unused variable conversion.
12023 * decl2.c (ambiguous_decl): Add explicit parameter definition for name.
12025 * except.c (do_unwind): #if 0 definition of unused variables fcall
12028 * expr.c (extract_scalar_init): #if 0 prototype and function
12031 * init.c (expand_aggr_init_1): Remove unused variable init_type.
12032 (build_new_1): Remove unused variable t.
12034 * pt.c (instantiate_class_template): Remove unused variable newtag;
12035 cast called function return value to void.
12036 (do_decl_instantiation): Remove unused variables name and fn.
12038 * tree.c (get_type_decl): Add default return to shut up compiler from
12039 complaining control reaches end of non-void function.
12041 * typeck.c (build_x_conditional_expr): Remove unused variable rval.
12043 Thu Mar 12 09:12:15 1998 Manfred Hollstein <manfred@s-direktnet.de>
12045 * call.c (default_parm_conversions): Remove prototype definition.
12046 (build_method_call): Remove unused variable result.
12047 (build_over_call): Add default case in enumeration switch.
12049 Thu Mar 12 08:39:13 1998 Manfred Hollstein <manfred@s-direktnet.de>
12051 * decl2.c (lang_decode_option): Change j's type to size_t.
12053 * tree.c (layout_vbasetypes): record_align and desired_align are of
12054 type unsigned int; const_size and nonvirtual_const_size likewise.
12056 Wed Mar 11 07:25:20 1998 Mark Mitchell <mmitchell@usa.net>
12058 * parse.y (new_initializer): Make sure all initializers are
12061 Tue Mar 10 07:32:36 1998 Mark Mitchell <mmitchell@usa.net>
12063 * decl2.c (import_export_decl): Mark tinfo functions for
12064 cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN.
12066 Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com)
12068 * method.c: Fix typo.
12070 Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12072 * method.c: Include "system.h" to get stdlib.h, stdio.h,
12073 ctype.h, string.h, etc.
12074 (issue_nrepeats): Add default case in enumeration switch.
12075 (check_btype): Likewise.
12076 (process_overload_item): Likewise.
12078 * Makefile.in (method.o): Depend on system.h.
12080 Wed Mar 4 22:26:53 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12082 * lex.c (do_scoped_id): Fix parenthesizing.
12084 Wed Mar 4 12:11:53 1998 Michael Tiemann <tiemann@axon.cygnus.com>
12086 * rtti.c (get_tinfo_fn_dynamic): If this function is called an
12087 FLAG_RTTI is unset, initialize type info machinery and continue
12088 with FLAG_RTTI enabled.
12089 (get_typeid): Likewise.
12091 Wed Mar 4 11:47:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12093 * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes
12096 Wed Mar 4 11:28:08 1998 Mark Mitchell <mmitchell@usa.net>
12098 * pt.c (finish_member_template_decl): Deal more gracefully with
12099 invalid declarations.
12101 Tue Mar 3 01:38:17 1998 Jason Merrill <jason@yorick.cygnus.com>
12103 * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c,
12104 cp-tree.h: Clean up more old overloading code, old RTTI code, and
12105 some formatting quirks.
12107 * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c,
12108 method.c, pt.c, ptree.c, typeck.c: Remove support for
12109 -fno-ansi-overloading and overloading METHOD_CALL_EXPR.
12111 * Makefile.in: Adjust.
12113 * pt.c (unify): Don't allow reduced cv-quals when strict.
12115 * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from
12116 *type_unification* and unify.
12118 Mon Mar 2 12:11:06 1998 Jason Merrill <jason@yorick.cygnus.com>
12120 * parse.y (explicit_template_type): Remove TEMPLATE keyword.
12121 (nested_name_specifier): And add it before this use.
12122 (typename_sub0): And this use. Also add use without the keyword.
12123 (typename_sub1): Likewise.
12124 * pt.c (instantiate_class_template): Don't actually instantiate
12125 anything if our type uses template parms.
12127 Mon Mar 2 11:04:59 1998 Jim Wilson <wilson@cygnus.com>
12129 * decl.c (start_function): Don't call temporary_allocation for a
12132 Sun Mar 1 21:06:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12134 * pt.c (instantiate_class_template): Don't mess with friends if
12135 our type uses template parms.
12137 Sat Feb 28 12:06:44 1998 Jason Merrill <jason@yorick.cygnus.com>
12139 * parse.y (nested_name_specifier): Use explicit_template_type.
12140 (typename_sub): Allow a template_type, an explicit_template_type,
12141 or an implicit template type at the end.
12142 * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL.
12143 * decl.c (make_typename_type): Handle template-id where the name
12144 is a TEMPLATE_DECL.
12145 * call.c (build_scoped_method_call): Handle member template
12147 * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member
12148 destructor is represented by the type.
12150 * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro.
12151 * parse.y (nested_name_specifier): Add 'template' case.
12152 (explicit_template_type): New rule.
12153 (typename_sub): Use it.
12154 * decl.c (make_typename_type): Handle getting a template-id for NAME.
12155 * pt.c (tsubst): Likewise.
12157 Fri Feb 27 11:17:50 1998 Jason Merrill <jason@yorick.cygnus.com>
12159 * pt.c (add_to_template_args): Fix thinko.
12160 (instantiate_class_template): Call it later.
12162 * pt.c (get_class_bindings): Add outer_args parm.
12163 (most_specialized_class): Likewise.
12164 (instantiate_class_template): Pass it.
12165 (more_specialized_class): Likewise.
12166 (lookup_template_class): Get context from template if none
12168 (finish_member_template_decl): Don't do anything with a
12169 partial specialization.
12170 * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of
12172 * class.c (finish_struct): Member class templates have already been
12173 checked for name clashes.
12174 * decl.c (pushdecl_with_scope): Handle pushing at class level.
12176 Fri Feb 27 02:25:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12178 * pt.c (tsubst, TEMPLATE_DECL): Support member class templates.
12179 (tsubst, *_PARM): Support multiple levels of template classes.
12180 (instantiate_class_template): Look up the pattern from the
12182 (lookup_template_class): Handle getting a template for d1.
12183 (push_template_decl): Correct setting of 'primary'.
12184 (reduce_template_parm_level): Add 'levels' parm.
12185 (finish_member_template_decl): Support member class templates.
12186 (template_class_depth): Handle multiple levels.
12187 * parse.y (component_decl_1, fn.def2): Remove member template case.
12188 (component_decl): Add member template cases.
12189 * decl2.c (check_member_template): We now handle member template
12191 * decl.c (pushtag): Handle member templates.
12192 * method.c (do_inline_function_hair): Don't touch
12193 IDENTIFIER_GLOBAL_VALUE.
12194 * init.c (build_offset_ref): If name isn't an identifier, just
12196 * spew.c (yylex): Handle PTYPENAME like TYPENAME.
12198 * typeck.c (get_delta_difference): Do adjust for conversions to
12199 and from virtual base.
12201 Wed Feb 25 09:51:29 1998 Jason Merrill <jason@yorick.cygnus.com>
12203 * typeck.c (get_delta_difference): Give hard error for conversion
12206 * cp-tree.h: Tweak formatting.
12208 Wed Feb 25 00:35:33 1998 Jason Merrill <jason@yorick.cygnus.com>
12210 * decl.c (push_namespace): Handle redeclaration error.
12212 * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro.
12213 (IDENTIFIER_NAMESPACE_BINDINGS): New macro.
12214 (NAMESPACE_BINDING): New macro.
12215 (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING.
12218 * pt.c (push_template_decl): Use innermost_args.
12220 * decl.c (get_unique_name): Tweak from earlier in the name.
12222 Tue Feb 24 22:15:04 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
12224 * cp-tree.def: Add CPLUS_BINDING node.
12225 * cp-tree.h (tree_binding): New struct.
12226 (BINDING_SCOPE, BINDING_VALUE): New macros.
12227 (current_namespace, global_namespace): Declare extern.
12228 (struct lang_decl_flags): New field in_namespace.
12229 (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros.
12230 (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros.
12231 (TREE_INDIRECT_USING): New macro.
12232 * decl2.c (current_namespace, global_namespace): Declare. The
12233 value is a NAMESPACE_DECL now, not a TREE_LIST.
12234 (is_namespace_ancestor, namespace_ancestor): New static functions.
12235 (add_using_namespace, ambiguous_decl): Likewise.
12236 (lookup_using_namespace): New support function for lookup_name.
12237 (qualified_lookup_using_namespace): New support function for
12238 do_scoped_id and lookup_namespace_name.
12239 (get_namespace_id): Mark as obsolete.
12240 (current_namespace_id): Likewise.
12241 (do_namespace_alias): Implement.
12242 (do_using_directive): Implement as call to add_using_namespace.
12243 * decl.c (binding_for_name): New function.
12244 (push_namespace, pop_namespace): Implement.
12245 (push_decl): Don't install a FUNCTION_DECL in the global branch.
12246 (lookup_namespace_name): Implement using qualified lookup.
12247 (lookup_name_real): For global scoping, lookup in
12248 global_namespace. For namespace scoping, lookup in given
12249 namespace. For unscoped lookup, iterate over namespace,
12250 considering using directives.
12251 (init_decl_processing): Initialize global_namespace.
12252 (grokvardecl): Build assembler name as static name for globals.
12253 (grokdeclarator): Remove old namespace mangling.
12254 (xref_tag): When installing a global binding for the
12255 tag, make sure we have an identifier.
12256 * method.c (build_overload_nested_name): Mangle namespaces.
12257 (build_qualified_name): Likewise.
12258 (build_decl_overload_real): Likewise.
12259 * lex.c (build_lang_decl): Set namespace for new declaration to
12261 (do_scoped_id): Find global names in global or current
12262 namespace, or using qualified namespace lookup, depending on
12264 * init.c (build_member_call): When scope is namespace, use
12265 build_x_function_call instead.
12266 (build_offset_ref): When scope is namespace, collapse processing
12267 to lookup_namespace_name instead.
12268 * error.c (dump_decl): Support NAMESPACE_DECL.
12269 * decl.c (pushdecl): Bind globals to current namespace.
12270 (push_overloaded_decl): Likewise.
12271 (lookup_tag): Likewise.
12272 (lookup_name_current_level): Likewise.
12273 (xref_tag): Likewise.
12274 (start_function): Likewise.
12275 * lex.c (do_identifier): Likewise.
12276 (identifier_typedecl_value): Likewise.
12277 (real_yylex): Likewise.
12278 * method.c (do_inline_function_hair): Likewise.
12279 * parse.y (unscoped): Likewise.
12280 * pt.c (check_explicit_specialization): Likewise.
12281 (lookup_template_class): Likewise.
12282 * rtti.c (call_void_fn): Likewise.
12283 * sig.c (build_sigtable): Likewise.
12284 * ptree.c (lang_print_xnode): New function.
12286 Tue Feb 24 01:40:24 1998 Jason Merrill <jason@yorick.cygnus.com>
12288 * pt.c (instantiate_class_template): Don't instantiate if pedantic
12289 and the args use template parms.
12291 * pt.c (push_tinst_level): If the instantiation uses template parms,
12293 * decl.c (xref_basetypes): Do call complete_type for basetypes
12294 that involve template parameters.
12296 Tue Feb 24 00:36:43 1998 Jason Merrill <jason@yorick.cygnus.com>
12298 * typeck2.c (process_init_constructor): Fix labeled init check.
12300 Mon Feb 23 05:08:55 1998 Jason Merrill <jason@yorick.cygnus.com>
12302 * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS
12303 argument to tsubst and friends.
12305 * pt.c (tsubst, FUNCTION_DECL): Tidy.
12307 * typeck.c (build_x_function_call): Handle static member function
12308 templates like non-templates. Handle friend templates like normal
12309 function templates.
12310 * pt.c (tsubst, *_PARM): Don't use orig_level.
12311 (get_bindings): Don't call add_to_template_args.
12312 (instantiate_template): Likewise.
12313 (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate.
12314 * ptree.c (print_lang_type): Print index/level for template parms.
12316 Mon Feb 23 02:52:29 1998 Mark Mitchell <mmitchell@usa.net>
12318 * Make-lang.in (cc1plus): Note that cc1plus depends on
12319 cp/cp-tree.h and cp/cp-tree.def.
12321 * cp-tree.def (TEMPLATE_CONST_PARM): Remove.
12322 (TEMPLATE_PARM_INDEX): New tree code, used to indicate a
12323 position in a template parameter list.
12324 * cp-tree.h (template_parm_index): New structure, used as the tree
12325 structure for a TEMPLATE_PARM_INDEX.
12326 (TEMPLATE_PARM_IDX): New macro.
12327 (TEMPLATE_PARM_LEVEL): Likewise.
12328 (TEMPLATE_PARM_DESCENDANTS): Likewise.
12329 (TEMPLATE_PARM_ORIG_LEVEL): Likewise.
12330 (TEMPLATE_PARM_DECL): Likewise.
12331 (TEMPLATE_TYPE_PARM_INDEX): Likewise.
12332 (TEMPLATE_TYPE_ORIG_LEVEL): Likewise.
12333 (TEMPLATE_TYPE_DECL): Likewise.
12334 (TEMPLATE_CONST_IDX): Remove.
12335 (TEMPLATE_CONST_LEVEL): Likewise.
12336 (TEMPLATE_CONST_SET_INFO): Likewise.
12337 (TEMPLATE_TYPE_SET_INFO): Likewise.
12338 (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX
12340 (TEMPLATE_TYPE_LEVEL): Likewise.
12341 * decl.c (decls_match): Call comp_template_parms, rather than
12342 expanding it inline.
12343 (duplicate_decls): If two template declarations are being merged,
12344 then their TEMPLATE_INFOs should be merged as well.
12345 (grokfndecl): Save template-id information when declaring a friend
12346 with explicit template arguments. Pass arguments to
12347 check_explicit_specialization via correct convention; at some
12348 point check_explicit_specialization changed, but these call-sites
12350 (grokdeclarator): Tidy up slightly.
12351 * decl2.c (check_classfn): Tidy up slightly. Don't assume that
12352 two template functions with the same DECL_ASSEMBLER_NAME the same,
12353 since the names are not yet mangled.
12354 * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of
12355 TEMPLATE_CONST_PARM.
12356 (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the
12357 decl for a non-type parameter, rather than printing `<tparm ...>'.
12358 * friend.c (is_friend): Handle TEMPLATE_DECL friends.
12359 (do_friend): Deal with template friends.
12360 * lex.c (do_pending_inlines): Call
12361 maybe_begin_member_template_processing, rather than
12362 conditionally calling begin_member_template_processing.
12363 (process_next_inline): Likewise. Call
12364 maybe_end_member_template_processing, rather than
12365 conditionally calling end_member_template_processing.
12366 (do_pending_defargs): Likewise.
12367 (do_identifier): Use TEMPLATE_PARM_INDEX instead of
12368 TEMPLATE_CONST_PARM.
12369 * method.c (build_mangled_template_parm_index): New function.
12370 (build_overload_value): Use it.
12371 (build_overload_name): Likewise.
12372 * pt.c (finish_member_template_decl): Allow friend declarations.
12373 (template_class_depth): New function.
12374 (is_member_template): Rename, and modify, to become...
12375 (is_member_or_friend_template): New function.
12376 (end_member_template_processing): Rename, and modify, to become...
12377 (maybe_end_member_template_processing).
12378 (build_template_parm_index): New function.
12379 (reduce_template_parm_level): New function.
12380 (process_template_parm): Modify to use build_template_parm_index.
12381 (push_template_decl): Deal with friend templates.
12382 (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of
12383 TEMPLATE_CONST_PARM.
12384 (tsubst_friend_function): New function.
12385 (instantiate_class_template): Generate the DECL_FRIENDLIST
12386 for a new instantiation by using tsubst_friend_function rather
12388 (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL.
12389 Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the
12390 appropriate new macros. Use reduce_template_parm_level to
12391 generate lower-level template parameters. Handle tsubst'ing into
12392 TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget
12393 to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created
12394 templates. Similarly for the template parameters for a new
12396 (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead
12397 of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them.
12398 (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM.
12399 (get_bindings): Call add_to_template_args if necessary.
12400 (instantiate_decl): Handle instantiations of friend templates.
12401 * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a
12402 TEMPLATE_TYPE_PARM as a list of fields; it's not!
12403 * spew.c (yylex): Do a little manual constant propagation to
12406 Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com)
12408 * error.c: Include sys/types.h.
12410 Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com)
12412 * method.c (build_mangled_name): Start CPP directives in column zero.
12414 Thu Feb 19 10:36:48 1998 Jason Merrill <jason@yorick.cygnus.com>
12416 * typeck2.c (process_init_constructor): Sorry about non-trivial
12417 labeled initializers.
12418 * parse.y (initlist): Re-enable labeled initializers.
12420 Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12422 * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm,
12423 all callers changed. Rely on the new parameter instead of arg
12424 being a TREE_LIST when determine whether we are working inside
12425 template template parameter. Clean up is_type test.
12427 Thu Feb 19 10:04:12 1998 Jason Merrill <jason@yorick.cygnus.com>
12429 * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT.
12430 * typeck2.c (initializer_constant_valid_p): Allow conversions
12431 between pointers and references.
12433 1998-02-19 Brendan Kehoe <brendan@cygnus.com>
12435 * typeck.c (build_unary_op): Only warn about incr/decr a pointer
12436 if pedantic || warn_pointer_arith.
12438 Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12440 * pt.c (unify): Handle TEMPLATE_DECL.
12442 1998-02-18 Brendan Kehoe <brendan@cygnus.com>
12444 * cp-tree.h (strip_attrs): Remove decl.
12446 1998-02-18 Doug Evans <devans@cygnus.com>
12448 * decl.c (duplicate_decls): Call merge_machine_decl_attributes.
12449 Update olddecl's attributes too.
12450 (strip_attrs): Remove function.
12451 * typeck.c (common_type): Call merge_machine_type_attributes.
12453 Tue Feb 17 14:07:52 1998 Mark Mitchell <mmitchell@usa.net>
12455 * parse.y (initdcl0_innards): New grammar symbol.
12456 (nomods_initdecls, nomods_initdcl0): Change type from itype to
12457 none, since the resulting value is never used.
12458 (parse_decl): New function.
12459 (datadef): Remove redundant actions.
12460 (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards.
12461 * parse.c: Regenerated.
12463 Tue Feb 17 11:54:16 1998 Jason Merrill <jason@yorick.cygnus.com>
12465 * parse.y (simple_stmt): Use getdecls() to check for decl.
12467 Sat Feb 14 11:50:51 1998 Manfred Hollstein <manfred@s-direktnet.de>
12469 * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New
12471 (c++.install-common): Install c++filt properly as native or as cross
12473 (c++.uninstall): Add c++filt.
12475 Fri Feb 13 14:55:37 1998 Jason Merrill <jason@yorick.cygnus.com>
12477 * call.c (standard_conversion): Fix multi-level ptr conversions.
12479 Fri Feb 13 14:06:22 1998 Mike Stump <mrs@wrs.com>
12481 * init.c (build_new): Propagate error_mark_node up.
12483 Fri Feb 13 13:24:32 1998 Jason Merrill <jason@yorick.cygnus.com>
12485 * parse.y (simple_stmt): If the condition isn't a declaration,
12486 start the controlled block after the test.
12488 Fri Feb 13 02:26:10 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
12490 * call.c (build_over_call): Convert builtin abs, labs and fabs to
12492 * decl.c (init_decl_processing): Re-enable abs, labs and fabs as
12495 Fri Feb 13 01:36:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12497 * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV.
12499 Fri Feb 13 00:21:59 1998 Jason Merrill <jason@yorick.cygnus.com>
12501 * cp-tree.h: Add access_protected_virtual_node.
12502 * class.c (init_class_processing): Initialize it.
12503 * decl.c (xref_basetypes): Use it.
12504 * parse.y (base_class_access_list): Likewise.
12506 * Make-lang.in (DEMANGLER_PROG): Add $(exeext).
12507 (c++.install-common): Install c++filt.
12509 Thu Feb 12 12:46:51 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com>
12511 * decl.c (shadow_tag): Give error for typedef-ing built-in types.
12513 Wed Feb 11 23:28:05 1998 Mark Mitchell <mmitchell@usa.net>
12515 * call.c (reference_binding): Use comptypes when comparing
12516 TYPE_MAIN_VARIANTS to handle non-canonical array/index types.
12518 Wed Feb 11 16:42:04 1998 Mark Mitchell <mmitchell@usa.net>
12520 * tree.c (is_overloaded_fn): Use really_overloaded_fn.
12521 (really_overloaded_fn): Move check here from is_overloaded_fn.
12522 (get_first_fn): Use really_overloaded_fn and is_overloaded_fn.
12524 Wed Feb 11 15:54:18 1998 Mark Mitchell <mmitchell@usa.net>
12526 * typeck.c (build_ptrmemfunc): Type-check pointer-to-member
12529 Mon Feb 9 22:23:31 1998 Mark Mitchell <mmitchell@usa.net>
12531 * cp-tree.h (push_template_decl): Return the decl passed in, or an
12532 equivalent duplicate.
12533 * decl.c (pushtag): Use the return value from push_template_decl.
12534 (duplicate_decls): When duplicating a template declaration, merge
12535 the DECL_TEMPLATE_RESULTs as well.
12536 (make_implicit_typename): Don't try to dive into typename types to
12537 find a context for making a new implicit typename.
12538 (start_decl): Use the return value from push_template_decl.
12539 (grokdeclarator): Complain about declarations list `const operator
12540 int'. Since we don't correctly handle in-class initializations of
12541 non-static data members, complain about this (now illegal)
12542 practice. Issue an error for initializations of non-const statics
12543 since that is illegal as well, and since we don't handle that case
12545 (start_function): Use the return value from push_template_decl.
12546 (start_method): Likewise.
12547 * decl2.c (grokfield): Likewise. Since the change to
12548 grokdeclarator ensures that all initialized fields are in fact
12549 static, remove a redundant test for TREE_PUBLIC.
12550 * parse.y (initlist): Disable labeled initializers since they do
12551 not work as per the documentation, and since they do not use the
12552 same syntax as the C front end.
12553 * pt.c (push_template_decl): Return the decl passed in, or an
12554 equivalent duplicate.
12555 (lookup_template_class): When searching in a nested context,
12556 use the right arguments.
12557 (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL.
12558 * typeck.c (build_component_ref): Assign the correct type to the
12559 result of build_vfn_ref.
12561 Tue Feb 10 23:56:46 1998 Jason Merrill <jason@yorick.cygnus.com>
12563 * pt.c (convert_nontype_argument): Fix typo.
12564 (check_explicit_specialization): Allow old-style specialization
12565 of class template members.
12567 Tue Feb 10 20:36:52 1998 Jason Merrill <jason@yorick.cygnus.com>
12568 Manfred Hollstein <manfred@s-direktnet.de>
12570 * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead
12571 when deciding to override DECL_ASSEMBLER_NAME.
12573 Tue Feb 10 15:30:55 1998 Andrew MacLeod <amacleod@torpedo.to.cygnus.com>
12575 * decl2.c (lang_f_options): Add -fsquangle to option processing list.
12576 * cp-tree.h (flag_do_squangling): Add declaration.
12577 * lang-options.h: Add -fsquangle and -fno-squangle.
12578 * method.c: Add macros and static variables for squangling.
12579 (build_overload_name): Rename to build_mangled_name, add logic for B
12580 compression, and split into process_modifiers and
12581 process_overload_item.
12582 (process_modifiers): New function, to handle constant, reference,
12584 (process_overload_item): New function, handles issue of type codes.
12585 (build_overload_name): New function, start squangling and call
12586 build_mangled_name.
12587 (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline.
12588 (start_squangling): New function to initialize squangling structs.
12589 (end_squangling): New function to destroy squangling structs.
12590 (nrepeats): Rename variable to Nrepeats.
12591 (issue_nrepeats): New function for issuing 'n' type repeats.
12592 (check_ktype): New function to check for type K name compression.
12593 (build_overload_nested_name): Add a check for K name compression.
12594 (build_qualified_name): Add a check for K name compression and don't
12595 use DECL_ASSEMBLER_NAME when squangling is on.
12596 (check_btype): New function, checks for B type compression.
12597 (build_static_name, build_decl_overload_real): Initiate squangling.
12598 (build_typename_overload, build_overload_with_type): Initiate
12601 Sun Feb 8 23:47:38 1998 scott snyder <sss@d0linux01.fnal.gov>
12603 * method.c (make_thunk): Avoid name buffer overflow.
12605 Sat Feb 7 16:48:54 1998 Jason Merrill <jason@yorick.cygnus.com>
12607 * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we
12608 don't define them yet.
12610 * parse.y (nomods_initdcl0): Add constructor_declarator case.
12612 Fri Feb 6 21:32:25 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
12614 * config-lang.in (diff_excludes): Use basename only.
12616 Thu Feb 5 19:10:40 1998 Jason Merrill <jason@yorick.cygnus.com>
12618 * tinfo2.cc: Add tinfo for signed char.
12620 Thu Feb 5 14:38:23 1998 Mike Stump <mrs@wrs.com>
12622 * search.c (compute_access): Handle protected constructors in derived
12623 classes as accessible.
12625 Wed Feb 4 01:26:49 1998 Jason Merrill <jason@yorick.cygnus.com>
12627 * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code):
12628 Call convert_from_reference sooner.
12630 Tue Feb 3 23:50:52 1998 Mark Mitchell <mmitchell@usa.net>
12632 * cvt.c (ocp_convert): Obtain the constant values from constant
12633 decls even if the destination type is the same as the type of the
12636 * decl2.c (finish_file): Make sure that static inlines with
12637 definitions are not marked DECL_EXTERNAL before returning.
12639 Tue Feb 3 22:43:42 1998 Jason Merrill <jason@yorick.cygnus.com>
12641 * decl.c: Lose arg_looking_for_template.
12642 (lookup_name_real): Likewise.
12643 * parse.y: Lose processing_template_arg, template_arg1.
12644 (primary): Likewise.
12645 * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too.
12647 Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12649 * error.c (dump_decl): Fix type of default arguments for template
12650 template parameters and nontype template parameters.
12651 * parse.y (template_parm): Handle invalid default template
12652 template arguments here.
12654 * parse.y (template_parm): Use template_arg instead of PTYPENAME
12655 for default template template argument.
12656 * pt.c (coerce_template_parms): Merge default template argument
12657 codes. Can treat RECORD_TYPE as template name if it is implicitly
12658 created. Fix argument index in error message.
12659 * typeck.c (comptypes): Merge template argument comparison codes in
12660 TEMPLATE_TEMPLATE_PARM and RECORD_TYPE.
12662 Tue Jan 6 01:42:44 1998 Mumit Khan <khan@xraylith.wisc.edu>
12664 * lex.c (file_name_nondirectory): Also check for '/'.
12666 Mon Feb 2 11:24:22 1998 Mark Mitchell <mmitchell@usa.net>
12668 * parse.y (primary): Deal with statement-expressions in
12670 * pt.c (tsubst_copy): Handle BIND_EXPR.
12671 * tree.c (mapcar): Likewise.
12673 * call.c (add_template_candidate_real): Pass extra parameter to
12674 fn_type_unification.
12675 * cp-tree.h (fn_type_unification): Add parameter.
12676 * pt.c (fn_type_unification): Add additional parameter to deal with
12677 static member functions.
12678 (get_bindings): Deal with static member functions.
12680 * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro.
12681 (revert_static_member_fn): Declare.
12682 * decl.c (revert_static_member_fn): Remove declaration. Change
12683 linkage from internal to external.
12684 (cp_finish_decl): Deal with virtual functions in classes local to
12685 template functions.
12686 * decl2.c (finish_file): Don't forget to emit increment/decrement
12687 expressions in initializers for file-scope variables.
12688 * parse.y (typename_sub2): If the typename doesn't names a
12689 template, rather than a type, issue an error message.
12690 * pt.c (check_explicit_specialization): Handle specializations of
12691 static member functions.
12692 (coerce_template_parms): Handle offset references to lists of
12694 * search.c (note_debug_info_needed): Don't crash when handed a
12695 type which is being defined.
12696 * typeck.c (complete_type): Don't crash when handed NULL_TREE;
12697 that can happen with some illegal code.
12699 Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12701 * call.c (user_harshness): Initialize `code' to 0.
12702 (build_method_call): Initialize `candidates', `cp' and `len' to 0.
12703 (null_ptr_cst_p): Add parentheses around && within ||.
12704 (standard_conversion): Likewise.
12705 (z_candidate): Likewise.
12706 (build_user_type_conversion_1): Initialize `args' to NULL_TREE.
12707 (build_object_call): Likewise for `mem_args'.
12708 (build_new_op): Likewise for `mem_arglist'. Add `return' from
12709 default case in enumeration switch.
12711 * class.c (build_vtable_entry): Add explicit braces to avoid
12713 (build_class_init_list): Likewise.
12714 (finish_struct_1): Initialize `width' to 0.
12715 (instantiate_type): Initialize `name' to NULL_TREE. Add
12716 explicit braces to avoid ambiguous `else'.
12718 * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous
12721 * decl.c (grok_reference_init): Eliminate unused parameter, all
12723 (record_builtin_type): Initialize `tdecl' to NULL_TREE.
12724 (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE.
12725 (cp_finish_decl): Initialize `ttype' to NULL_TREE.
12726 (grokdeclarator): Add parentheses around && within ||. Add
12727 explicit braces to avoid ambiguous `else'.
12728 (grokparms): Initialize `type' to NULL_TREE.
12729 (xref_tag): Remove unused label `just_return'.
12730 (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE.
12731 (finish_function): Initialize `cond' and `thenclause' to NULL_TREE.
12732 (hack_incomplete_structures): Add parentheses around assignment
12733 used as truth value.
12735 * decl2.c (coerce_delete_type): Hide definition of `e3'.
12737 * error.c: Include <stdlib.h>.
12738 (dump_expr): Change the type of `i' to size_t. Remove unused
12741 * except.c (init_exception_processing): Remove unused variable `d'.
12742 (expand_throw): Likewise for `label'.
12744 * friend.c (add_friends): Add explicit braces to avoid ambiguous
12747 * init.c (sort_member_init): Initialize `last_field' to NULL_TREE.
12748 (sort_base_init): Likewise for `binfo'.
12749 (expand_member_init): Likewise for `rval'.
12750 (build_member_call): Add parentheses around assignment used as
12752 (build_offset_ref): Add explicit braces to avoid ambiguous `else'.
12753 (build_new): Initialize `nelts' to NULL_TREE. Initialize
12754 `old_immediate_size_expand' to 0.
12755 (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE.
12756 (build_vec_delete_1): Remove unused variable `block'.
12757 (expand_vec_init): Initialize `itype' to NULL_TREE.
12759 * lex.c: Include <strings.h> if we don't have <string.h>. Protect
12760 declaration of `index' and `rindex' with autoconf macros.
12761 (reinit_parse_for_expr): Remove unused variables
12762 `look_for_semicolon' and `look_for_lbrac'.
12763 (cons_up_default_function): Initialize `args' to NULL_TREE.
12764 (readescape): Initialize `firstdig' to 0.
12765 (real_yylex): Add parentheses around assignment used as truth value.
12767 * method.c: Include <strings.h> if we don't have <string.h>.
12768 Protect declaration of `index' with autoconf macro.
12770 * parse.y (primary): Add explicit braces to avoid ambiguous `else'.
12771 Initialize `type' to NULL_TREE.
12772 (structsp): Remove unused variable `id'.
12774 * pt.c (coerce_template_parms): Add explicit braces to avoid
12776 (lookup_template_class): Initialize `template' to NULL_TREE.
12777 (instantiate_class_template): Remove unused variable `name' and `e'.
12778 (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE.
12779 (do_poplevel): Initialize `saved_warn_unused' to 0.
12780 (type_unification): Remove unused varable `parm'.
12781 (unify): Likewise for `j'.
12783 * repo.c (init_repo): Add parentheses around assignment used as
12785 (finish_repo): Remove unused varable `p'.
12787 * search.c (get_binfo): Initialize `type' to NULL_TREE.
12788 (get_base_distance): Likewise.
12789 (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path'
12790 and `new_v' to NULL_TREE.
12791 (lookup_fnfields): Likewise for `rval_binfo_h'.
12792 (breadth_first_search): Add parentheses around assignment used as
12794 (get_template_base): Initialize `type' to NULL_TREE.
12796 * sig.c (append_signature_fields): Initialize `last_mfptr' to
12798 (build_signature_table_constructor): Likewise for
12799 `last_rhs_field', `pfn' and `vt_off'.
12800 (build_sigtable): Likewise for `init'.
12802 * tree.c (break_out_calls): Initialize `t2' to NULL_TREE.
12803 (propagate_binfo_offsets): Likewise for `delta'.
12804 (hash_tree_cons): Initialize hashcode to 0.
12805 (can_free): Likewise for `size'.
12806 (cp_tree_equal): Add explicit braces to avoid ambiguous `else'.
12808 * typeck.c (convert_sequence): Hide prototype.
12809 (common_type): Add explicit braces to avoid ambiguous `else'.
12810 (comp_target_types): Likewise.
12811 (build_x_function_call): Initialize `ctypeptr' to NULL_TREE.
12812 (build_function_call_real): Add explicit braces to avoid ambiguous
12814 (convert_arguments): Initialize `called_thing' to 0.
12815 (convert_for_initialization): Initialize `savew' and `savee' to 0.
12817 * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0.
12818 (digest_init): Initialize `old_tail_contents' to NULL_TREE.
12819 (build_x_arrow): Likewise for `last_rval'.
12821 * xref.c (GNU_xref_decl): Initialize `cls' to 0.
12823 Sun Feb 1 12:45:34 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
12825 * decl.c (init_decl_processing): Use set_sizetype.
12826 * decl2.c (sizetype): Don't declare.
12827 * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype.
12828 (c_sizeof_nowarn, build_binary_op_nodefault): Likewise.
12829 (build_component_addr, unary_complex_lvalue): Likewise.
12830 * rtti.c (expand_class_desc): Likewise.
12831 * class.c (get_vfield_offset): Likewise.
12833 Thu Jan 29 10:39:30 1998 Mark Mitchell <mmitchell@usa.net>
12835 * pt.c (convert_nontype_argument): Move check for is_overloaded_fn
12836 early to avoid bogus error. Handle overloaded function
12837 names provided as template arguments correctly.
12838 (coerce_template_parms): Don't mishandle overloaded functions when
12839 dealing with template template parameters.
12840 (lookup_template_class): Issue an error message, rather than
12841 crashing, when the TYPE_DECL provided is not a template type.
12843 Wed Jan 28 23:14:44 1998 Jason Merrill <jason@yorick.cygnus.com>
12845 * class.c (instantiate_type): Don't just return a known type if
12848 Wed Jan 28 11:04:07 1998 Mark Mitchell <mmitchell@usa.net>
12850 * class.c (instantiate_type): Remove handling of FUNCTION_DECL
12851 since that code could never be reached.
12853 * error.c (dump_decl): Avoid aborting in the midst of printing an
12854 error message about an illegal template declaration.
12856 * parse.y (structsp): Print an error message, rather than crashing,
12857 when a class-head does not name a class.
12859 * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE
12860 template arguments as a g++ extension.
12862 * cp-tree.def (ALIGNOF_EXPR): New tree code.
12863 * decl2.c (grok_alignof): If processing_template_decl, just store
12865 * typeck.c (c_alignof): Likewise.
12866 * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR.
12867 * error.c (dump_expr): Likewise.
12868 * pt.c (tsubst_copy): Likewise.
12869 * tree.c (cp_tree_equal): Likewise.
12870 * pt.c (uses_template_parms): Correctly determine whether or not a
12871 SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant
12872 folding can be done.
12874 * cp-tree.h (grok_enum_decls): Remove type parameter.
12875 * decl.c (grok_enum_decls): Likewise.
12876 * decl2.c (grok_x_components): Call grok_enum_decls
12877 unconditionally, since it will do nothing if there is no
12878 current_local_enum. Use the new calling sequence.
12879 * pt.c (tsubst_enum): Use the new calling sequence for
12882 * decl.c (start_function): Make member functions of local classes
12883 in extern inline functions have comdat linkage here...
12884 (grokdeclarator): Rather than here.
12886 Wed Jan 28 10:55:47 1998 Jason Merrill <jason@yorick.cygnus.com>
12888 * pt.c (convert_nontype_argument): Use decl_constant_value.
12890 Tue Jan 27 16:42:21 1998 Mark Mitchell <mmitchell@usa.net>
12892 * call.c (add_template_candidate_real): New function.
12893 (add_template_candidate): Use it.
12894 (add_template_conv_candidate): Likewise.
12895 (joust): Pass extra argument to more_specialized.
12896 * class.c (instantiate_type): Handle a single FUNCTION_DECL.
12897 (is_local_class): Remove.
12898 (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
12899 * cp-tree.h (is_local_class): Remove.
12900 (perform_array_to_pointer_conversion): Likewise.
12901 (finish_member_template_decl): Add.
12902 (check_explicit_specialization): Return a tree, not an int.
12903 (more_specialized): Take additional argument.
12904 (get_bindings): Likewise.
12905 (TI_PENDING_SPECIALIZATION_FLAG): New macro.
12906 * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
12907 (perform_array_to_pointer_conversion): Remove.
12908 * decl.c (saved_scope): Add processing_specialization,
12909 processing_explicit_instantiation fields.
12910 (maybe_push_to_top_level): Save them.
12911 (pop_from_top_level): Restore them.
12912 (grokfndecl): Use new return value from
12913 check_explicit_specialization.
12914 (start_decl): Don't check flag_guiding_decls before pushing
12916 (cp_finish_decl): Remove previous (bogus) change.
12917 (grok_declarator): Use decl_function_context rather than
12919 * decl2.c (finish_file): Pass extra argument to get_bindings.
12920 (build_expr_from_tree): Let build_x_component_ref check
12921 validity of arguments rather than doing it here.
12922 * lex.c (cons_up_default_function): Remove code fooling with
12923 processing_specialization, processing_explicit_instantiation
12924 flags, as that is now done in {maybe_push_top,pop_from}_top_level.
12925 * method.c (build_overload_identifier): Mangle local classes in
12926 template functions correctly.
12927 * parse.y (finish_member_template_decl): Move to pt.c.
12928 * pt.c (finish_member_template_decl): Moved here from parse.y.
12929 (print_candidates): New function.
12930 (determine_specialization): Change interface. Properly look for
12931 most specialized versions of template candidates.
12932 (check_explicit_specialization): Fully process explicit
12934 (push_template_decl): Avoid looking at CLASSTYPE fields in
12936 (determine_overloaded_function): Remove.
12937 (convert_nontype_argument): Change name from
12938 convert_nontype_parameter. Use determine_overloaded_function
12939 instead of instantiate_type.
12940 (mangle_class_name_for_template): Handle type contexts as well as
12942 (classtype_mangled_name): Likewise.
12943 (lookup_template_class): Likewise.
12944 (tsubst): Likewise.
12945 (more_specialized): Take explict template arguments as a
12947 (most_specialized): Likewise.
12948 (get_bindings): Likewise. Check that return types match before
12949 proclaiming a function a match.
12950 (do_decl_instantiation): Remove code searching for function to
12951 instantiate; that is now done in check_explicit_specialization.
12952 (add_maybe_template): Pass extra argument to get_bindings.
12953 * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
12955 * typeck.c (build_component_ref): Check for invalid arguments.
12957 Tue Jan 27 01:44:02 1998 Jason Merrill <jason@yorick.cygnus.com>
12959 * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that
12960 return_target and call_target are equivalent.
12962 * pt.c (type_unification_real): Just accept function parms that
12963 don't use any template parms.
12965 Sun Jan 25 03:30:00 1998 Jason Merrill <jason@yorick.cygnus.com>
12967 * decl.c (cp_finish_decl): When bailing on a comdat variable, also
12968 unset DECL_NOT_REALLY_EXTERN.
12970 * parse.y (typename_sub*): Fix std::.
12972 Sat Jan 24 12:13:54 1998 Jason Merrill <jason@yorick.cygnus.com>
12974 * error.c (dump_decl): Fix type default template args.
12975 (dump_type): Hand TEMPLATE_DECL off to dump_decl.
12977 Fri Jan 23 18:34:37 1998 Mumit Khan <khan@xraylith.wisc.edu>
12979 * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined.
12980 (file_name_nondirectory): Use.
12982 Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
12984 * pt.c (coerce_template_parms): Don't access elements of ARGLIST
12985 that are not really present. Substitute default arguments in
12986 template template arguments. Correctly convert TEMPLATE_DECL to
12987 TEMPLATE_TEMPLATE_PARM.
12988 (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM
12989 are no longer treated specially here.
12990 * parse.y (template_template_parm): Fix copy error.
12991 * decl.c (grokdeclarator): Warn about missing `typename' for nested
12992 type created from template template parameters.
12993 * parse.y (bad_parm): Likewise
12995 * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM.
12996 (push_nested_class): Likewise.
12997 * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code.
12998 * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro.
12999 (copy_template_template_parm): Declare.
13000 * decl.c (arg_looking_for_template): New variable.
13001 (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM.
13002 Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM
13003 node if arg_looking_for_template is nonzero.
13004 (pushdecl): Handle TEMPLATE_TEMPLATE_PARM.
13005 (grok_op_properties, xref_tag, xref_basetypes): Likewise.
13006 (grokdeclarator): Handle TEMPLATE_DECL.
13007 * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM.
13008 * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM.
13009 (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM.
13010 (dump_decl): Handle unnamed template type parameters.
13011 Handle template template parameters.
13012 (dump_function_name): Handle template template parameters.
13013 * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef):
13014 Handle TEMPLATE_TEMPLATE_PARM.
13015 * method.c (build_template_template_parm_names): New function.
13016 (build_template_parm_names): Handle TEMPLATE_DECL.
13017 (build_overload_nested_name, build_overload_name):
13018 Handle TEMPLATE_TEMPLATE_PARM.
13019 * parse.y (maybe_identifier): New nonterminal.
13020 (template_type_parm): Use it.
13021 (template_template_parm, template_arg1): New nonterminal.
13022 (template_parm): Add template_template_parm rules.
13023 (template_arg): Set processing_template_arg.
13024 (template_arg1): Rules moved from template_arg.
13025 (primary, nonnested_type): Set arg_looking_for_template if we are
13026 processing template arguments.
13027 * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL.
13028 (process_template_parm): Handle template template parameters.
13029 (coerce_template_parms, comp_template_args): Likewise.
13030 (mangle_class_name_for_template, lookup_template_class): Likewise.
13031 (uses_template_parms): Handle TEMPLATE_DECL and
13032 TEMPLATE_TEMPLATE_PARM.
13033 (current_template_args): Handle TEMPLATE_DECL.
13034 (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM.
13035 * search.c (dfs_walk, dfs_record_inheritance):
13036 Handle TEMPLATE_TEMPLATE_PARM.
13037 * tree.c (copy_template_template_parm): New function.
13038 (mapcar): Handle TEMPLATE_TEMPLATE_PARM.
13039 * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM.
13041 Mon Jan 19 22:40:03 1998 Mark Mitchell <mmitchell@usa.net>
13043 * decl.c (start_decl): Don't allow duplicate definitions of static
13046 * call.c (build_user_type_conversion_1): Handle user-defined
13047 template conversion operators correctly.
13049 * decl2.c (build_expr_from_tree): Issue an error message if the
13050 object in a COMPONENT_REF is a TEMPLATE_DECL.
13052 * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs.
13054 * class.c (is_local_class): New function.
13055 * cp-tree.h (is_local_class): Declare it.
13056 (last_tree): Likewise.
13057 (begin_tree): Likewise.
13058 (end_tree): Likewise.
13059 (lookup_template_class): Change prototype.
13060 * decl.c (cp_finish_decl): Check for NULL where necessary.
13061 Consider FUNCTION_DECLS to declare objects with top-level binding,
13062 when calling make_decl_rtl.
13063 (grokdeclarator): Give members of local classes internal linkage.
13064 (start_function): Remove declaration of last_tree.
13065 (finish_function): Set flag_keep_inline_functions around call to
13066 rest_of_compilation if we are processing a member function in a
13068 (start_method): Call push_template_decl for member functions of
13069 local classes in template functions.
13070 * decl2.c (import_export_decl): Don't give external linkage to
13071 instantiations of templates with internal linkage.
13072 * parse.y (last_tree): Remove declaration.
13073 (template_type): Pass extra parameter to lookup_template_class.
13074 (self_template_type): Likewise.
13075 (structsp): Move call to reset_specialization into left_curly.
13076 (left_curly): Call reset_specialization, and begin_tree.
13077 * pt.c (saved_trees): New variable.
13078 (mangle_class_name_for_template): Change prototype. Use
13079 additional function context to name local classes in templates
13081 (classtype_mangled_name): Pass the context.
13082 (push_template_decl): Handle local classes and templates, and
13083 member functions for such classes.
13084 (convert_nontype_parameter): Fix handling of pointer-to-member
13086 (lookup_template_class): Handle local classes in templates.
13087 (tsubst): Likewise. Don't assume that template instantiations
13088 have external linkage; pay attention to the template declaration.
13089 (mark_decl_instantiated): Likewise.
13090 (begin_tree): New function.
13091 (end_tree): Likewise.
13093 * decl.c (xref_basetypes): Don't call complete_type for basetypes
13094 that involve template parameters; that can lead to infinite
13095 recursion unnecessarily.
13097 * pt.c (register_specialization): Do not register specializations
13098 that aren't ready to be registered yet.
13099 (check_explicit_specialization): Handle explicit specialization of
13100 constructors and destructors.
13101 (build_template_decl): New function.
13102 (push_template_delc): Handle out-of-class specializations of
13105 * pt.c (check_explicit_specialization): Set up the template
13106 information before registering the specialization.
13107 (coerce_template_parms): Fix thinko.
13108 (tsubst): Handle specializations of member templates correctly.
13110 * class.c (finish_struct_methods): Remove calls to
13111 check_explicit_specialization from here.
13112 (finish_struct): And insert them here.
13113 * cp-tree.h (perform_qualification_conversions): New function.
13114 (perform_array_to_pointer_conversion): Likewise.
13115 (begin_explicit_instantiation): Likewise.
13116 (end_explicit_instantiation): Likewise.
13117 (determine_specialization): Renamed from
13118 determine_explicit_specialization.
13119 (comp_template_parms): New function.
13120 (processing_explicit_instantiation): New variable.
13121 * cvt.c (perform_qualification_conversions): New function.
13122 (perform_array_to_pointer_conversion): Likewise.
13123 * decl.c (duplicate_decls): Don't consider template functions
13124 alike unless they have the same parameters. Refine handling of
13125 instantiation/specialization mismatches.
13126 (start_decl): Don't call pushdecl for template specializations,
13127 since they don't affect overloading.
13128 (start_function): Likewise.
13129 (grokfndecl): Call check_explicit_specialization a little later.
13130 Don't call duplicate_decls for memberm template specializations.
13131 (grokdeclarator): Don't update template_count for classes that are
13132 themselves specializations. Remove use of `2' as parameter to
13133 grokfndecl since that value isn't used.
13134 * lex.c (cons_up_default_function): Save and restore
13135 processing_explicit_instantiation around calls to grokfield.
13136 * parse.y (finish_member_template_decl): New function.
13137 (component_decl_1): Use it.
13138 (fn.def2): Likewise.
13139 (template_arg_list_opt): New nonterminal.
13140 (template_type): Use it.
13141 (self_template_type): Likewise.
13142 (template_id): Likewise.
13143 (object_template_id): Likewise.
13144 (notype_template_declarator): Likwise.
13145 (begin_explicit_instantiation): Likewise.
13146 (end_explicit_instantiation): Likewise.
13147 (explicit_instantiation): Use them.
13148 * pt.c (coerce_template_parms): Add parameters.
13149 (processing_explicit_instantiation): New variable.
13150 (convert_nontype_parameter): New function.
13151 (determine_overloaded_function): Likewise.
13152 (begin_explicit_instantiation): Likewise.
13153 (end_explicit_instantiation): Likewise.
13154 (retrieve_specialization): Likewise.
13155 (register_specialization): Likewise.
13156 (processing_explicit_specialization): Removed.
13157 (determine_specialization): Handle specializations of member
13158 functions of template class instantiations.
13159 (check_explicit_specialization): Refine to conform to standard.
13160 (comp_template_parms): New function.
13161 (coerce_template_parms): Call convert_nontype_parameter.
13162 (tsubst): Refine handling of member templates. Use
13163 register_specialization.
13164 (instantiate_template): Use retrieve_specialization.
13165 (do_decl_instantiation): Likewise.
13166 (instantiate_decl): Likewise.
13167 (type_unification): Improve handling of explict template
13169 * tree.c (mapcar): Return error_mark_node, rather than aborting,
13170 on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
13171 * typeck.c (build_unary_op): Call determine_specialization, rather
13172 than determine_explicit_specialization.
13174 Mon Jan 19 13:18:51 1998 Jason Merrill <jason@yorick.cygnus.com>
13176 * cvt.c (build_up_reference): A TARGET_EXPR has side effects.
13178 Fri Jan 16 11:40:50 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13180 * error.c (dump_decl): For enum tags, output the tag, not its value.
13182 1998-01-13 Brendan Kehoe <brendan@cygnus.com>
13184 * decl.c (init_decl_processing): Only call init_rtti_processing
13187 Mon Jan 12 01:35:18 1998 Jason Merrill <jason@yorick.cygnus.com>
13189 * init.c (build_new_1): Split out from build_new.
13190 (build_new): Just return a NEW_EXPR.
13191 * expr.c (cplus_expand_expr): Handle NEW_EXPR.
13193 * decl2.c (get_temp_regvar): Tweak.
13195 * cp-tree.h (TREE_CALLS_NEW): Comment out.
13196 * class.c (resolves_to_fixed_type_p): Remove use.
13197 * method.c (build_opfncall): Likewise.
13198 * call.c (build_new_op): Likewise.
13200 Wed Jan 7 23:47:13 1998 Jason Merrill <jason@yorick.cygnus.com>
13202 * exception.cc (__eh_alloc, __eh_free): New fns.
13203 (__cp_push_exception, __cp_pop_exception): Use them.
13204 (__uncatch_exception): Call terminate here if no exception.
13205 * except.c (build_terminate_handler): New fn.
13206 (expand_start_catch_block): Use it.
13207 (expand_exception_blocks): Likewise.
13208 (alloc_eh_object): New fn.
13209 (expand_throw): Use it. Protect exception init with terminate.
13210 * typeck.c (build_modify_expr): Remove code that ignores trivial
13213 Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
13215 * call.c (add_builtin_candidate): Add default case in enumeration
13217 (build_new_op): Likewise.
13218 (convert_like): Likewise.
13219 * cvt.c (build_expr_type_conversion): Likewise.
13220 * tree.c (real_lvalue_p): Likewise.
13221 (lvalue_p): Likewise.
13222 (cp_tree_equal): Likewise.
13223 * typeck.c (comptypes): Likewise.
13224 (build_component_ref): Likewise.
13225 (build_function_call_real): Likewise.
13226 (build_binary_op_nodefault): Likewise.
13227 (build_unary_op): Likewise.
13228 (build_modify_expr): Likewise.
13229 * typeck2.c (initializer_constant_valid_p): Likewise.
13231 Sun Dec 21 15:59:00 1997 Nick Clifton <nickc@cygnus.com>
13233 * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas.
13235 Thu Dec 18 14:51:50 1997 Mark Mitchell <mmitchell@usa.net>
13237 * pt.c (coerce_template_parms): Make sure to digest_init if
13240 * decl.c (duplicate_decls): Make the newdecl virtual if the
13241 olddecl was, just as is done with other attributes of olddecl.
13243 Thu Dec 18 14:43:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13245 * typeck.c (unary_complex_lvalue): Ignore op0 when taking the
13246 address of an OFFSET_REF.
13248 * cp-tree.def: Add AGGR_INIT_EXPR.
13249 * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with
13250 AGGR_INIT_EXPR where appropriate.
13251 * expr.c (cplus_expand_expr): Likewise. Simplify.
13253 * decl2.c (finish_file): Remove call to register_exception_table.
13255 Wed Dec 17 17:08:52 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13257 * pt.c (instantiate_class_template): Don't do injection when
13258 processing_template_decl is true, as pollutes current_binding_level
13261 Wed Dec 17 21:17:39 1997 Peter Schmid <schmid@ltoi.iap.physik.tu-darmstadt.de>
13263 * pt.c (maybe_fold_nontype_arg): Add prototype.
13265 Tue Dec 16 10:31:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13267 * tree.c (mapcar): Handle TRY_CATCH_EXPR et al.
13268 * error.c (dump_expr): Likewise.
13270 Mon Dec 15 12:22:04 1997 Jason Merrill <jason@yorick.cygnus.com>
13272 * typeck.c (build_function_call_real): Remove "inline called before
13273 definition" pedwarn.
13275 * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg.
13277 Sun Dec 14 22:34:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13279 * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's.
13281 * pt.c (type_unification_real): Change __null to type void* with
13284 Sun Dec 14 20:38:35 1997 Mark Mitchell <mmitchell@usa.net>
13286 * call.c (implicit_conversion): Don't call
13287 build_user_type_conversion_1 with a NULL expr, since it will
13290 * pt.c (unify): Don't try to unify array bounds if either array is
13293 Fri Dec 12 16:09:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13295 * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at):
13296 Replace extern decls with casts.
13298 * decl.c (expand_start_early_try_stmts): Don't mess with a sequence.
13299 Update last_parm_cleanup_insn.
13300 (store_after_parms): Remove.
13301 * cp-tree.h: Adjust.
13303 Thu Dec 11 22:18:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13305 * decl2.c (comdat_linkage): Also set DECL_COMDAT.
13306 (finish_file): Check DECL_COMDAT instead of weak|one_only.
13307 (import_export_vtable): Use make_decl_one_only instead of
13308 comdat_linkage for win32 tweak.
13309 (import_export_decl): Likewise.
13310 * pt.c (mark_decl_instantiated): Likewise.
13312 * decl2.c (finish_file): Lose handling of templates in pending_statics.
13314 Thu Dec 11 21:12:09 1997 Jason Merrill <jason@yorick.cygnus.com>
13316 * decl2.c (finish_file): Lose call to expand_builtin_throw.
13317 * except.c (expand_builtin_throw): Remove.
13318 * cp-tree.h: Remove ptr_ptr_type_node.
13319 * decl.c: Likewise.
13321 Thu Dec 11 20:43:33 1997 Teemu Torma <tot@trema.com>
13323 * decl.c (ptr_ptr_type_node): Define.
13324 (init_decl_processing): Initialize it.
13325 * cp-tree.h: Declare it.
13326 * exception.cc (__cp_exception_info): Use __get_eh_info.
13327 (__cp_push_exception): Likewise.
13328 (__cp_pop_exception): Likewise.
13330 From Scott Snyder <snyder@d0sgif.fnal.gov>:
13331 * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of
13333 (init_exception_processing): Removed saved_pc initialization.
13335 Wed Dec 10 11:04:45 1997 Jason Merrill <jason@yorick.cygnus.com>
13337 * pt.c (instantiate_decl): Defer all templates but inline functions.
13339 Mon Dec 8 23:17:13 1997 Jason Merrill <jason@yorick.cygnus.com>
13341 * init.c (expand_vec_init): Don't fold a list of parameters.
13343 * decl.c (copy_args_p): Handle copy elision for types with virtual
13345 * call.c (build_over_call): Likewise.
13347 Sun Dec 7 22:38:12 1997 Mark Mitchell <mmitchell@usa.net>
13349 * pt.c (lookup_template_function): Copy the template arguments,
13350 not just the list containing them, to the permanent obstack.
13352 Sun Dec 7 15:53:06 1997 Jason Merrill <jason@yorick.cygnus.com>
13354 * except.c (expand_start_catch_block): suspend_momentary for the
13357 * error.c (dump_decl): Handle LOOKUP_EXPR.
13359 Sun Dec 7 15:45:07 1997 Mark Mitchell <mmitchell@usa.net>
13361 * rtti.c (build_dynamic_cast): Copy the cast-to type to the
13362 permanent obstack if we are processing a template decl.
13363 * typeck.c (build_static_cast): Likewise.
13364 (build_const_cast): Likewise.
13365 (build_reinterpret_cast): Likewise.
13367 * pt.c (coerce_template_parms): Coerce some expressions, even
13368 when processing_template_decl.
13370 Sun Dec 7 01:46:33 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13372 * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric
13373 handling of pointer difference expressions.
13375 * typeck.c (comp_target_types): Comparison of function/method types
13376 is independent of nptrs.
13378 Sun Dec 7 01:40:27 1997 Mark Mitchell <mmitchell@usa.net>
13380 * pt.c (tsubst): Avoid creating pointer to reference and
13381 reference to reference types.
13383 Sat Dec 6 01:29:37 1997 Jason Merrill <jason@yorick.cygnus.com>
13385 * parse.y (do_id): New nonterminal.
13386 (template_id): Use it.
13388 Fri Dec 5 01:17:34 1997 Jason Merrill <jason@yorick.cygnus.com>
13390 * parse.y (template_id): do_identifier for PFUNCNAMEs, too.
13391 * spew.c (yylex): Don't do_identifier here.
13392 * decl2.c (build_expr_from_tree): Revert last change.
13394 * decl2.c (build_expr_from_tree): Expand the name for a method call.
13395 * parse.y (object_template_id): Don't try to take the DECL_NAME.
13397 Wed Dec 3 20:02:39 1997 Jason Merrill <jason@yorick.cygnus.com>
13399 * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for
13401 * call.c (build_op_delete_call): Adjust.
13403 * except.c (expand_end_catch_block): Lose rethrow region.
13404 (expand_start_catch_block): Likewise.
13405 (expand_end_catch_block): Don't expand_leftover_cleanups.
13407 Wed Dec 3 13:24:04 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13409 * pt.c (tsubst): Remove tree_cons call (places redundant info into
13410 DECL_TEMPLATE_INSTANTIATION).
13412 Wed Dec 3 11:44:52 1997 Jason Merrill <jason@yorick.cygnus.com>
13414 * tree.c (is_overloaded_fn): Handle getting a fn template.
13415 (really_overloaded_fn): Likewise.
13416 * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better.
13417 * pt.c (check_explicit_specialization): Tweak.
13418 (determine_explicit_specialization): Tweak.
13420 * tree.c, cp-tree.h (get_target_expr): New fn.
13422 Wed Dec 3 08:47:27 1997 Paul Eggert <eggert@twinsun.com>
13424 * pt.c (check_explicit_specialization): Fix misspelling in
13425 diagnostic: `preceeded'.
13426 * typeck.c (get_delta_difference): Fix misspelling in diagnostic:
13429 1997-12-02 Mark Mitchell <mmitchell@usa.net>
13431 * pt.c (determine_explicit_specialization): Avoid an internal
13432 error for bad specializations.
13434 * method.c (build_overload_value): Handle SCOPE_REF.
13436 Tue Dec 2 19:18:50 1997 Mike Stump <mrs@wrs.com>
13438 * class.c (prepare_fresh_vtable): Enable even more complex MI
13441 Tue Dec 2 01:37:19 1997 Jason Merrill <jason@yorick.cygnus.com>
13443 * exception.cc (__check_eh_spec): Optimize a bit.
13445 * exception.cc (__cp_pop_exception): Lose handler arg.
13446 * except.c (do_pop_exception): Likewise.
13447 (push_eh_cleanup): Let the cleanup mechanism supply the handler.
13448 (expand_end_catch_block): Likewise.
13450 Fri Nov 28 01:58:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13452 * pt.c (check_explicit_specialization): Complain about using a
13453 template-id for a non-specialization.
13455 Fri Nov 28 12:35:19 1997 Scott Christley <scottc@net-community.com>
13457 * repo.c: Prototype rindex only if needed.
13458 * xref.c: Likewise.
13460 Fri Nov 28 01:56:35 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13462 * error.c (dump_decl): Handle TEMPLATE_ID_EXPR.
13464 Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com>
13466 * typeck.c (build_const_cast): Handle references here instead of
13467 handing off to convert_to_reference.
13469 * except.c: Lose Unexpected, SetTerminate, SetUnexpected,
13470 TerminateFunctionCall.
13471 (init_exception_processing): Likewise. Terminate et al are now
13472 the fns, not ADDR_EXPRs.
13473 (various): Lose redundant assemble_external calls.
13474 (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/.
13476 * cp-tree.h (struct lang_decl_flags): Add comdat.
13477 (DECL_COMDAT): New macro.
13478 * decl.c (duplicate_decls): Propagate it.
13479 (cp_finish_decl): Handle it.
13480 * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs.
13482 * class.c: Remove static pending_hard_virtuals.
13483 (add_virtual_function): Take pointers to pending_virtuals
13484 and pending_hard_virtuals.
13485 (finish_struct_1): Pass them. Declare pending_hard_virtuals.
13487 Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com>
13489 * decl2.c (import_export_vtable): If we support one_only but not
13490 weak symbols, mark instantiated template vtables one_only.
13491 (import_export_decl): Likewise for tinfo functions.
13492 (finish_vtable_vardecl): Also write out vtables from explicitly
13493 instantiated template classes.
13494 * pt.c (mark_class_instantiated): Revert last change.
13496 * except.c (expand_throw): Call mark_used on the destructor.
13498 Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com)
13500 * lex.c (lang_init): Enable flag_exceptions by default if no
13501 command line switch was specified.
13503 1997-11-26 Mark Mitchell <mmitchell@usa.net>
13505 * pt.c (unify): Handle `void' template parameters in
13508 Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
13510 * rtti.c (build_dynamic_cast): Handle template case here.
13511 (build_dynamic_cast_1): Not here.
13513 * typeck2.c (digest_init): Make copies where appropriate.
13515 * decl2.c (delete_sanity): resolve_offset_ref.
13517 * except.c: Call terminate without caching so many bits.
13519 * except.c (expand_start_catch_block): Fix catching a reference
13522 Tue Nov 25 11:28:21 1997 Jason Merrill <jason@yorick.cygnus.com>
13524 * init.c (build_new): Copy size to the saveable obstack.
13526 * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the
13527 TRY_CATCH_EXPR for now.
13529 Mon Nov 24 12:15:55 1997 Jason Merrill <jason@yorick.cygnus.com>
13531 * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL
13532 has DECL_LANG_SPECIFIC.
13534 * exception.cc (struct cp_eh_info): Add handlers field.
13535 (__cp_push_exception): Initialize it.
13536 (__cp_pop_exception): Decrement it. Don't pop unless it's 0.
13537 (__throw_bad_exception): Remove.
13538 * except.c (call_eh_info): Add handlers field.
13539 (get_eh_handlers): New fn.
13540 (push_eh_cleanup): Increment handlers.
13542 Fri Nov 21 12:22:07 1997 Jason Merrill <jason@yorick.cygnus.com>
13544 * except.c (expand_start_eh_spec): Use the try/catch code.
13545 (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of
13546 doing everything inline.
13547 (init_exception_processing): throw_type_match now takes
13548 const void pointers.
13549 * exception.cc (__check_eh_spec): New fn.
13550 * inc/exception: Neither terminate nor unexpected return.
13551 * decl.c: Make const_ptr_type_node public.
13552 * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly.
13554 * except.c (expand_start_catch_block): We only need the rethrow
13555 region for non-sjlj exceptions.
13556 (expand_end_catch_block): Likewise. Use outer_context_label_stack.
13558 Thu Nov 20 14:40:17 1997 Jason Merrill <jason@yorick.cygnus.com>
13560 * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs.
13561 (various.o): Likewise.
13562 * inc/new: Add placement deletes. Add throw specs for default new.
13563 * new.cc (set_new_handler): Move here from libgcc2.
13564 * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler.
13565 (new): Move from libgcc2. Throw bad_alloc.
13566 * new2.cc: Move the rest of the op news and op deletes from libgcc2.
13567 * decl.c (init_decl_processing): Update exception specs on new and
13570 * method.c (build_decl_overload_real): Don't mess with global
13573 * init.c (build_new): Check for null throw spec, not nothrow_t.
13575 * decl.c (duplicate_decls): Don't complain about different exceptions
13576 from an internal declaration.
13578 * call.c (build_op_delete_call): Fix check for member fns again.
13580 * decl2.c (import_export_decl): Interface hackery affects
13581 virtual synthesized methods.
13583 Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13585 * decl.c (start_decl): Don't just complain about a mismatched
13588 * decl.c (make_implicit_typename): Handle case where t is not
13589 actually from context.
13590 * tree.c (get_type_decl): Lose identifier case.
13591 * spew.c (yylex): Lose useless call to identifier_typedecl_value.
13592 * parse.y (nonnested_type): Just use lookup_name.
13593 (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
13595 Wed Nov 19 11:45:07 1997 Michael Tiemann <tiemann@axon.cygnus.com>
13597 * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
13598 T was built in C language context (for example, by
13599 output_func_start_profiler).
13601 Wed Nov 19 10:39:27 1997 Jason Merrill <jason@yorick.cygnus.com>
13603 * decl.c (make_implicit_typename): New fn.
13604 (lookup_name_real): Use it. Use current_class_type as the context.
13606 Mon Nov 17 23:42:03 1997 Bruno Haible <haible@ilog.fr>
13608 * pt.c (do_poplevel): Don't prohibit jumps into this contour.
13610 Mon Nov 17 02:01:28 1997 Jason Merrill <jason@yorick.cygnus.com>
13612 * friend.c (do_friend): Warn about non-template friends in templates.
13614 * call.c (build_op_delete_call): Fix handling of inherited delete.
13616 * search.c (dfs_record_inheritance): Ignore template type parms.
13618 Sat Nov 15 00:30:51 1997 Jason Merrill <jason@yorick.cygnus.com>
13620 * call.c (build_new_op): Fix copy error.
13621 (build_op_new_call): New fn.
13622 (build_op_delete_call): New fn.
13623 * cp-tree.h: Declare them.
13624 * init.c (build_new): Use them. Support placement delete.
13625 (build_x_delete): Use build_op_delete_call.
13626 (build_delete): Likewise.
13627 * decl2.c (delete_sanity): Likewise.
13628 (coerce_delete_type): Don't complain about placement delete.
13630 Thu Nov 13 01:52:36 1997 Jason Merrill <jason@yorick.cygnus.com>
13632 * call.c (build_new_function_call): Remove unused 'obj' parm.
13633 * cp-tree.h, typeck.c: Adjust.
13635 * init.c (build_new): Make the cleanup last longer.
13636 (expand_vec_init): Call do_pending_stack_adjust.
13638 Wed Nov 12 11:04:33 1997 Jason Merrill <jason@yorick.cygnus.com>
13640 * pt.c (do_type_instantiation): Fix typo.
13641 (mark_class_instantiated): If we support one_only but not weak
13642 symbols, don't mark this as known.
13644 * init.c (build_new): Handle vec delete in EH cleanup.
13646 Wed Nov 12 08:11:55 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13648 * call.c (build_method_call): Call complete_type before checking
13651 Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com)
13653 * decl.c (add_block_current_level): Delete.
13654 * init.c (build_vec_delete_1): Delete build_block and
13655 add_block_current_level calls.
13657 Wed Nov 12 00:48:16 1997 Jason Merrill <jason@yorick.cygnus.com>
13659 * init.c (build_new): Handle freeing allocated memory when the
13660 constructor throws.
13662 * call.c (build_new_method_call): Fix flags arg.
13664 * pt.c (do_type_instantiation): Don't try to instantiate
13666 (mark_decl_instantiated): If we support one_only but not
13667 weak symbols, mark this one_only.
13668 * decl2.c (import_export_vtable): Don't defer handling of vtables
13669 if MULTIPLE_SYMBOL_SPACES.
13671 Tue Nov 11 12:02:12 1997 Jason Merrill <jason@yorick.cygnus.com>
13673 * except.c (expand_end_catch_block): Lose call to __sjpopnthrow.
13675 Tue Nov 11 02:53:44 1997 Jason Merrill <jason@lasher.cygnus.com>
13677 * except.c (do_pop_exception): Return a value.
13679 Mon Nov 10 20:25:31 1997 Jason Merrill <jason@yorick.cygnus.com>
13681 * call.c (build_new_method_call): Handle getting a
13682 TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field
13683 if we got template parms.
13684 * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR,
13686 * decl2.c (build_expr_from_tree): Tweak last change.
13687 * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE.
13688 (maybe_fold_nontype_arg): Split out from tsubst_copy.
13689 * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR.
13691 Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>
13693 * pt.c (tsubst_copy): Handle explicit template arguments in
13695 * typeck.c (build_x_function_call): Likewise.
13696 * decl2.c (build_expr_from_tree): Lookup function name if it
13699 * pt.c (tsubst): Instantiate template functions properly when
13700 template parameter does not appear in function arguments and return
13702 (comp_template_args): Handle member templates required by tsubst.
13704 Mon Nov 10 20:08:38 1997 Jason Merrill <jason@yorick.cygnus.com>
13706 * decl.c (grokdeclarator): Tweak conditions for pedwarn in
13709 Mon Nov 10 20:08:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13711 * pt.c (coerce_template_parms): Tweak error message.
13713 * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
13714 return type defaults to `int', even if there are storage-class
13717 Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com>
13719 Complete nested exception support.
13720 * except.c (do_pop_exception): Split out...
13721 (push_eh_cleanup): From here. Handle the EH region by hand.
13722 (expand_start_catch_block): Add a new level for the catch parm.
13723 Move the rethrow region outside the two cleanup regions.
13724 Protect the initializer for the catch parm with terminate.
13725 (expand_end_catch_block): Likewise. End the region for the eh_cleanup.
13726 * exception.cc (__cp_pop_exception): Now takes two parms. Handle
13727 popping off the middle of the stack.
13728 * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR,
13729 WITH_CLEANUP_EXPR, and UNSAVE_EXPR.
13730 (build_cplus_new): Only wrap CALL_EXPRs.
13731 * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around
13732 the constructor call.
13734 Sun Nov 9 18:00:26 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13736 * Make-lang.in (c++.distdir): Make inc subdirectory.
13738 Fri Nov 7 11:57:28 1997 Jason Merrill <jason@yorick.cygnus.com>
13740 * decl2.c (finish_file): Put back some code.
13742 Thu Nov 6 11:28:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13744 * decl2.c (finish_file): Remove redundant code.
13745 * method.c (emit_thunk): Don't let the backend defer generic thunks.
13747 Wed Nov 5 23:52:50 1997 Jason Merrill <jason@yorick.cygnus.com>
13749 * except.c (call_eh_info): Split out...
13750 (push_eh_info): From here.
13751 (expand_builtin_throw): Use it.
13752 (expand_start_catch_block): Move region start back.
13754 Tue Nov 4 13:45:10 1997 Doug Evans <devans@canuck.cygnus.com>
13756 * lex.c (MULTIBYTE_CHARS): #undef if cross compiling.
13757 (real_yylex): Record wide strings using target endianness, not host.
13759 1997-11-03 Brendan Kehoe <brendan@lisa.cygnus.com>
13761 * repo.c (rindex): Add decl unconditionally.
13762 (get_base_filename, open_repo_file): Don't cast rindex.
13763 * xref.c (rindex): Add decl unconditionally.
13764 (index): Remove unused decl.
13765 (open_xref_file): Don't cast rindex.
13767 Sun Nov 2 15:04:12 1997 Jason Merrill <jason@yorick.cygnus.com>
13769 * class.c (build_vbase_path): Propagate the result type properly.
13771 1997-11-01 Brendan Kehoe <brendan@lisa.cygnus.com>
13773 * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace
13774 remaining use of saved_throw_type with a call to get_eh_type.
13776 1997-10-31 Brendan Kehoe <brendan@lisa.cygnus.com>
13778 * lex.c (FILE_NAME_NONDIRECTORY): Delete macro.
13779 (file_name_nondirectory): New function, doing the same as the macro.
13780 (set_typedecl_interface_info): Use it instead of the macro.
13781 (check_newline): Likewise.
13782 (handle_cp_pragma): Likewise.
13784 * repo.c (get_base_filename): Cast result of rindex to char*.
13785 (open_repo_file): Likewise.
13786 * xref.c (open_xref_file): Likewise.
13787 * error.c (dump_char): Make its arg int, not char.
13789 * except.c (push_eh_info): Pass the number of fields - 1 down, not
13790 the exact number of fields.
13792 Fri Oct 31 01:47:57 1997 Jason Merrill <jason@yorick.cygnus.com>
13794 Support for nested exceptions.
13795 * tinfo2.cc (__is_pointer): New fn.
13796 * exception.cc (struct cp_eh_info): Define.
13797 (__cp_exception_info, __uncatch_exception): New fns.
13798 (__cp_push_exception, __cp_pop_exception): New fns.
13799 * except.c: Lose saved_throw_{type,value,cleanup,in_catch}.
13801 (init_exception_processing): Likewise. __eh_pc is now external.
13802 (push_eh_info): New fn.
13803 (get_eh_{info,value,type,caught}): New fns.
13804 (push_eh_cleanup): Just call __cp_pop_exception.
13805 (expand_start_catch_block): Use push_eh_info. Start the eh region
13807 (expand_end_eh_spec): Use push_eh_info.
13808 (expand_throw): Call __cp_push_exception to set up the exception info.
13809 Just pass the destructor or 0 as the cleanup. Call __uncatch_exception
13811 (expand_builtin_throw): Don't refer to empty_fndecl.
13813 Thu Oct 23 02:01:30 1997 Jason Merrill <jason@yorick.cygnus.com>
13815 * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl.
13817 1997-10-22 Brendan Kehoe <brendan@cygnus.com>
13819 * method.c (build_template_parm_names, build_decl_overload_real):
13820 Add static to definitions.
13821 * pt.c (add_to_template_args, note_template_header,
13822 processing_explicit_specialization, type_unification_real): Likewise.
13823 ({determine,check}_explicit_specialization): Use a single string for
13826 Mon Oct 20 12:06:34 1997 Jason Merrill <jason@yorick.cygnus.com>
13828 * except.c (expand_exception_blocks): Call do_pending_stack_adjust.
13829 (expand_end_catch_block): Likewise.
13830 (expand_end_eh_spec): Likewise.
13832 Mon Oct 20 11:44:20 1997 Mark Mitchell <mmitchell@usa.net>
13834 * decl.c (duplicate_decls): Handle template specializations
13836 * error.c (dump_function_name): Fix printing of specializations of
13837 member functions that are not member templates.
13838 * cp-tree.h (processing_specialization): Make global.
13839 * pt.c (processing_specialization): Likewise.
13840 * lex.c (cons_up_default_function): Save and restore
13841 processing_specialization to avoid confusion.
13843 Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
13845 * decl.c (init_decl_processing): Give null_node unknown* type.
13846 * typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
13847 (common_type): Likewise.
13848 * error.c (args_as_string): Recognize null_node.
13850 Sun Oct 19 09:13:01 1997 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
13852 * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR.
13853 (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR.
13855 * decl.c (init_decl_processing): Call using_eh_for_cleanups.
13857 * Make-lang.in (g++): Include prefix.o.
13859 Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
13861 * pt.c (determine_explicit_specialization): Initialize "dummy"
13862 to keep Purify quiet.
13864 Thu Oct 16 00:14:48 1997 Jason Merrill <jason@yorick.cygnus.com>
13866 * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here.
13867 (build_overload_int): Not here.
13869 Wed Oct 15 00:35:28 1997 Mike Stump <mrs@wrs.com>
13871 * class.c (build_type_pathname): Remove.
13872 (prepare_fresh_vtable): Fix problem with complex MI vtable names.
13874 1997-10-14 Brendan Kehoe <brendan@lisa.cygnus.com>
13876 * parse.y (unary_expr): Give a pedwarn if someone tries to use the
13877 &&label GNU extension.
13879 Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net>
13881 * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it,
13882 so as to avoid incorrect manglings.
13883 * method.c (build_decl_overload_real): Don't mangle return types
13886 Tue Oct 14 11:46:14 1997 Jason Merrill <jason@yorick.cygnus.com>
13888 * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec,
13889 scratch_tree_cons): Define as macros for now.
13890 * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c,
13891 lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c,
13892 typeck2.c: Use them and the expression_obstack variants.
13894 Mon Oct 13 17:41:26 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
13896 * decl.c (store_return_init): Allow classes with explicit ctors to
13897 be used with the named return values extension.
13899 Fri Oct 10 12:21:11 1997 Jason Merrill <jason@yorick.cygnus.com>
13901 * pt.c (instantiate_decl): Fix previous change.
13903 Thu Oct 9 12:08:21 1997 Jason Merrill <jason@yorick.cygnus.com>
13905 * pt.c (tsubst): Fix thinko.
13906 (instantiate_decl): Really use the original template.
13908 * call.c (build_new_method_call): Use simple constructor_name for
13911 Wed Oct 8 22:44:42 1997 Jeffrey A Law <law@cygnus.com>
13913 * method.c (build_underscore_int): Don't use ANSI specific
13916 Wed Oct 8 00:18:22 1997 Jason Merrill <jason@yorick.cygnus.com>
13918 * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN
13919 for our key method; it might have been inlined by -O3.
13921 Tue Oct 7 23:00:12 1997 Mark Mitchell <mmitchell@usa.net>
13923 * decl.c (make_typename_type): Do not try to call lookup_field for
13924 non-aggregate types.
13926 Tue Oct 7 22:52:10 1997 Jason Merrill <jason@yorick.cygnus.com>
13928 * typeck.c (build_reinterpret_cast): Tweak.
13930 Tue Oct 7 22:45:31 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
13932 * typeck.c (build_reinterpret_cast): Converting a void pointer
13933 to function pointer with a reinterpret_cast produces a warning
13934 if -pedantic is issued.
13936 Tue Oct 7 22:43:43 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
13938 * typeck.c (c_expand_return): Don't warn about returning a
13939 reference-type variable as a reference.
13941 Tue Oct 7 21:11:22 1997 Jason Merrill <jason@yorick.cygnus.com>
13943 * method.c (build_static_name): Fix typo.
13945 1997-10-07 Brendan Kehoe <brendan@lisa.cygnus.com>
13947 * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on
13948 OLDDECL before we try to do DECL_USE_TEMPLATE.
13950 Tue Oct 7 00:48:36 1997 Jason Merrill <jason@yorick.cygnus.com>
13952 * decl.c (duplicate_decls): Don't warn about template instances.
13954 * typeck.c (mark_addressable): Lose ancient code that unsets
13957 * pt.c (do_decl_instantiation): Lose support for instantiating
13960 * call.c (build_new_function_call): Fix handling of null explicit
13962 (build_new_method_call): Likewise.
13964 Mon Oct 6 23:44:34 1997 Mark Mitchell <mmitchell@usa.net>
13966 * method.c (build_underscore_int): Fix typo.
13968 1997-10-06 Brendan Kehoe <brendan@lisa.cygnus.com>
13970 * tree.c (print_lang_statistics): #if 0 call to
13971 print_inline_obstack_statistics until its definition is checked in.
13973 Mon Oct 6 09:27:29 1997 Jason Merrill <jason@yorick.cygnus.com>
13975 * decl2.c (finish_file): Move dump_tree_statistics to end.
13977 * pt.c (instantiate_decl): Look for the original template.
13978 (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations
13979 of member templates.
13981 Wed Oct 1 08:41:38 1997 Jason Merrill <jason@yorick.cygnus.com>
13983 * Makefile.in (g++FAQ.*): New rules.
13984 (CONFLICTS): Update.
13985 * g++FAQ.texi: Moved from libg++.
13987 * parse.y (PFUNCNAME): Only specify the type once.
13989 1997-10-01 Brendan Kehoe <brendan@lasher.cygnus.com>
13991 * lex.c (real_yylex): Clean up the code to fully behave the way
13992 the c-lex.c parser does for complex and real numbers.
13994 Tue Sep 30 08:51:36 1997 Jason Merrill <jason@yorick.cygnus.com>
13996 * method.c (build_decl_overload_real): Reformat.
13998 Tue Sep 30 00:18:26 1997 Jason Merrill <jason@yorick.cygnus.com>
14000 * method.c (synthesize_method): If at_eof, determine our linkage.
14002 1997-09-29 Paul Eggert <eggert@twinsun.com>
14004 * lex.c (real_yylex): Treat `$' just like `_', except issue a
14005 diagnostic if !dollars_in_ident or if pedantic.
14007 * lang-specs.h (@c++): -ansi no longer implies -$.
14009 * decl2.c (lang_decode_option):
14010 -traditional and -ansi now do not mess with
14013 Mon Sep 29 19:57:51 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
14015 * Makefile.in (parse.o, decl.o): Also depend on
14016 $(srcdir)/../except.h $(srcdir)/../output.h.
14017 (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h
14018 $(srcdir)/../except.h $(srcdir)/../output.h.
14019 (typeck.o, init.o): Also depend on $(srcdir)/../expr.h
14022 * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping.
14024 * expr.c (cplus_expand_expr): Make it static.
14026 * decl2.c, init.c, typeck.c: Include "expr.h".
14027 (expand_expr): Use proper values when calling the function.
14029 Mon Sep 29 11:05:54 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
14031 * lang-options.h: New -Wold-style-cast flag.
14032 * cp-tree.h (warn_old_style_cast): New variable.
14033 * decl2.c (warn_old_style_cast): Likewise.
14034 (lang_decode_option): Support -Wold-style-cast.
14035 (reparse_absdcl_as_casts): Produce old-style-cast warning.
14037 Mon Sep 29 09:20:53 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14039 * decl.c (cp_finish_decl): Allow expand_aggr_init to set
14040 TREE_USED, reset value based on already_used.
14042 * init.c (expand_member_init): Revert change.
14044 Mon Sep 29 08:57:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14046 * cp-tree.h, decl.c, decl2.c, pt.c:
14047 Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public.
14049 * decl2.c (lang_decode_option): Add missing ;.
14051 Sat Sep 27 16:22:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14053 * friend.c (do_friend): Disable injection for all template-derived
14055 * decl2.c (lang_decode_option): Handle -fguiding-decls.
14056 * parse.y (notype_template_declarator): New nonterminal.
14057 (direct_notype_declarator): Use it.
14058 (complex_direct_notype_declarator): Likewise.
14059 (object_template_id): Accept any kind of identifier after TEMPLATE.
14060 (notype_qualified_id): Don't add template declarators here.
14062 Sat Sep 27 16:21:58 1997 Mark Mitchell <mmitchell@usa.net>
14064 * call.c (add_template_candidate): Add explicit_targs parameter.
14065 (build_scoped_method_call): Use it.
14066 (build_overload_call_real): Likewise.
14067 (build_user_type_conversion_1): Likewise.
14068 (build_new_function_call): Likewise.
14069 (build_object_call): Likewise.
14070 (build_new_op): Likewise.
14071 (build_new_method_call): Likewise.
14072 (build_new_function_call): Handle TEMPLATE_ID_EXPR.
14073 (build_new_method_call): Likewise.
14075 * class.c (finish_struct_methods): Add specialization pass to
14076 determine which methods were specializing which other methods.
14077 (instantiate_type): Handle TEMPLATE_ID_EXPR.
14079 * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.
14081 * cp-tree.h (name_mangling_version): New variable.
14082 (flag_guiding_decls): Likewise.
14083 (build_template_decl_overload): New function.
14084 (begin_specialization): Likewise.
14085 (reset_specialization): Likewise.
14086 (end_specialization): Likewise.
14087 (determine_explicit_specialization): Likewise.
14088 (check_explicit_specialization): Likewise.
14089 (lookup_template_function): Likewise.
14090 (fn_type_unification): Add explicit_targs parameter.
14091 (type_unification): Likewise.
14093 * decl.c (duplicate_decls): Add smarts for explicit
14095 (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
14097 (grokfndecl): Call check_explicit_specialization.
14099 * decl2.c (lang_decode_option): Handle -fname-mangling-version.
14100 (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
14101 (check_classfn): Handle specializations.
14103 * error.c (dump_function_name): Print specialization arguments.
14105 * friend.c (do_friend): Don't call pushdecl for template
14108 * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.
14110 * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
14111 and -fno-guiding-decls.
14113 * lex.c (identifier_type): Return PFUNCNAME for template function
14116 * method.c (build_decl_overload_real): New function.
14117 (build_template_parm_names): New function.
14118 (build_overload_identifier): Use it.
14119 (build_underscore_int): New function.
14120 (build_overload_int): Use it. Add levels for template
14122 (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs.
14123 (build_overload_nested_names): Handle template type parameters.
14124 (build_template_decl_overload): New function.
14126 * parse.y (YYSTYPE): New ntype member.
14127 (nested_name_specifier): Use it.
14128 (nested_name_specifier_1): Likewise.
14129 (PFUNCNAME): New token.
14130 (template_id, object_template_id): New non-terminals.
14131 (template_parm_list): Note specializations.
14132 (template_def): Likewise.
14133 (structsp): Likewise.
14134 (fn.def2): Handle member template specializations.
14135 (component_decl_1): Likewise.
14136 (direct_notype_declarator): Handle template-ids.
14137 (component_decl_1): Likewise.
14138 (direct_notype_declarator): Handle template-ids.
14139 (primary): Handle TEMPLATE_ID_EXPR, and template-ids.
14141 * pt.c (processing_specializations): New variable.
14142 (template_header_count): Likewise.
14143 (type_unification_real): New function.
14144 (processing_explicit_specialization): Likewise.
14145 (note_template_header): Likewise.
14146 (is_member_template): Handle specializations.
14147 (end_template_decl): Call reset_specialization.
14148 (push_template_decl): Handle member template specializations.
14149 (tsubst): Likewise.
14150 (tsubst_copy): Handle TEMPLATE_ID_EXPR.
14151 (instantiate_template): Handle specializations.
14152 (instantiate_decl): Likewise.
14153 (fn_type_unification): Handle explicit_targs.
14154 (type_unification): Likewise. Allow incomplete unification
14155 without an error message, if allow_incomplete.
14156 (get_bindings): Use new calling sequence for fn_type_unification.
14158 * spew.c (yylex): Handle PFUNCNAME.
14160 * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
14161 (really_overloaded_fn): Likewise.
14162 (get_first_fn): Handle function templates.
14164 * typeck.c (build_x_function_call): Use really_overloaded_fn.
14165 Handle TEMPLATE_ID_EXPR.
14166 (build_x_unary_op): Likewise.
14167 (build_unary_op): Likewise.
14168 (mark_addressable): Templates whose address is taken are marked
14171 1997-09-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14173 * decl.c (init_decl_processing): Declare __builtin_constant_p as
14174 accepting any kind of type, not only int.
14176 Fri Sep 26 00:22:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14178 * search.c (get_matching_virtual): Notice virtual bases when sorrying
14179 about covariant returns.
14181 * parse.y (member_init): Also imply typename here. Remove ancient
14182 extension for initializing base members.
14184 Thu Sep 25 11:11:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14186 Handle multi-level typenames and implicit typename in base list.
14187 * parse.y (typename_sub{,[0-2]}): New rules.
14188 (structsp, rule TYPENAME_KEYWORD): Use typename_sub.
14189 (nonnested_type): New rule.
14190 (complete_type_name): Use it.
14191 (base_class.1): Use typename_sub and nonnested_type.
14192 (nested_name_specifier): Don't elide std:: here.
14193 * decl.c (make_typename_type): Handle getting a type for NAME.
14194 (lookup_name_real): Turn std:: into :: here.
14196 Rvalue conversions were removed in London.
14197 * call.c (is_subseq): Don't consider lvalue transformations.
14198 (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK.
14199 (joust): Re-enable ?: kludge.
14201 1997-09-22 Brendan Kehoe <brendan@lisa.cygnus.com>
14203 * decl.c (start_function): Up warning of no return type to be a
14206 Mon Sep 22 14:15:34 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14208 * init.c (expand_member_init): Don't set TREE_USED.
14209 * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED
14210 set,don't clear TREE_USED wholesale.
14212 Sat Sep 20 15:31:00 1997 Jason Merrill <jason@yorick.cygnus.com>
14214 * call.c (build_over_call): Do require_complete_type before
14217 Thu Sep 18 16:47:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14219 * search.c (lookup_field): Call complete_type in all cases.
14221 * decl.c (finish_function): Just warn about flowing off the end.
14223 Wed Sep 17 10:31:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14225 * decl.c (grokparms): Don't bash a permanent list node if we're
14228 1997-09-17 Brendan Kehoe <brendan@lisa.cygnus.com>
14230 * Makefile.in (CONFLICTS): Fix s/r conflict count to 18.
14232 Tue Sep 16 14:06:56 1997 Jason Merrill <jason@yorick.cygnus.com>
14234 * call.c (build_new_op): Give better error for syntactically
14235 correct, but semantically invalid, use of undeclared template.
14237 * call.c (compare_qual): Handle pmfs.
14239 * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
14240 after the exception spec.
14242 Mon Sep 15 11:52:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14244 * call.c (null_ptr_cst_p): Integer type, not integral type.
14246 * call.c (joust): Disable warnings until they can be moved to the
14249 Fri Sep 12 16:11:13 1997 Per Bothner <bothner@cygnus.com>
14251 * Makefile.in, config-lang.in: Convert to autoconf.
14253 Thu Sep 11 17:14:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14255 * decl.c (lookup_name_real): Add implicit 'typename' to types from
14258 * pt.c (most_specialized_class): Fix typo.
14259 (tsubst): Move constant folding to TREE_VEC case.
14261 Thu Sep 11 10:08:45 1997 Mark Mitchell <mmitchell@usa.net>
14263 * pt.c (do_poplevel): Don't warn about unused local variables
14264 while processing_template_decl since we don't always know whether
14265 or not they will need constructing/destructing.
14267 * pt.c (uses_template_parms): Check the values of an enumeration
14268 type to make sure they don't depend on template parms.
14270 * decl.c (make_typename_type): Don't lookup the field if the
14271 context uses template parms, even if we're not
14272 processing_template_decl at the moment.
14274 * pt.c (coerce_template_parms): Avoid looking at the
14275 TYPE_LANG_DECL portion of a typename type, since there won't be
14277 (tsubst): Do constant folding as necessary to make sure that
14278 arguments passed to lookup_template_class really are constants.
14280 Wed Sep 10 11:21:55 1997 Jason Merrill <jason@yorick.cygnus.com>
14282 * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO.
14283 * decl2.c (finish_file): Only register exception tables if we
14286 * decl.c (init_decl_processing): Add __builtin_[fs]p.
14288 Tue Sep 9 19:49:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14290 * pt.c (unify): Just return 0 for a TYPENAME_TYPE.
14292 Tue Sep 9 17:57:25 1997 Mark Mitchell <mmitchell@usa.net>
14294 * error.c (dump_decl): Avoid crashing when presented with a
14295 uninitialized constant, as can occur with a template parameter.
14296 (dump_expr): Make sure that there are enough levels of
14297 current_template_parms before we start diving through them.
14299 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
14301 * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to
14304 Tue Sep 9 09:36:39 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14306 * except.c (expand_throw): Call build_delete for all
14307 exception types, not just objects with destructors.
14309 Mon Sep 8 02:33:20 1997 Jody Goldberg <jodyg@idt.net>
14311 * decl.c (current_local_enum): Remove static.
14312 * pt.c (tsubst_enum): Save and restore value of current_local_enum
14313 in case template is expanded in enum decl.
14314 (instantiate_class_template): Use new tsubst_enum signature.
14315 (tsubst_expr): Likewise.
14317 Mon Sep 8 01:21:43 1997 Mark Mitchell <mmitchell@usa.net>
14319 * pt.c (begin_member_template_processing): Take a function as
14320 argument, not a set of template arguments. Use the template
14321 parameters, rather than the arguments. Handle non-type parameters
14322 correctly. Push a binding level for the parameters so that multiple
14323 member templates using the same parameter names can be declared.
14324 (end_member_template_processing): Pop the binding level.
14325 (push_template_decl): Mark member templates as static when
14328 * lex.c (do_pending_inlines): Pass the function, not its template
14329 arguments, to begin_member_template_processing.
14330 (process_next_inline): Likewise.
14331 (do_pending_defargs): Likewise.
14333 * error.c (dump_expr): Obtain the correct declaration for a
14334 TEMPLATE_CONST_PARM.
14336 * call.c (add_template_conv_candidate): New function.
14337 (build_object_call): Handle member templates, as done in the other
14340 Sat Sep 6 10:20:27 1997 Mark Mitchell <mmitchell@usa.net>
14342 * decl.c (replace_defag): Undo previous change.
14343 * lex.c (do_pending_defargs): Deal with member templates.
14345 * pt.c (is_member_template): Avoid crashing when passed a
14346 non-function argument.
14348 Fri Sep 5 17:27:38 1997 Jason Merrill <jason@yorick.cygnus.com>
14350 * class.c (grow_method): Remove check for redeclaration.
14352 Fri Sep 5 01:37:17 1997 Mark Mitchell <mmitchell@usa.net>
14354 * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
14355 (DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
14356 (PRIMARY_TEMPLATE_P): Use it.
14357 * call.c (build_overload_call_real): Use it.
14358 * class.c (instantiate_type): Likewise.
14359 * decl.c (decls_match): Likewise.
14360 * method.c (build_overload_identifier): Likewise.
14361 * pt.c (push_template_decl): Likewise.
14362 (classtype_mangled_name): Likewise.
14363 (lookup_template_class): Likewise.
14365 * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
14366 DECL_NTPARMS to conform to usage elsewhere.
14367 * call.c (add_template_candidate): Likewise.
14368 * class.c (instantiate_type): Likewise.
14369 * pt.c (instantiate_template): Likewise.
14370 (get_bindings): Likewise.
14372 * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
14373 is_member_template.
14375 * pt.c (unify): Undo changes to allow multiple levels of template
14377 (type_unification): Likewise.
14378 (fn_type_unification): Likewise.
14379 (get_class_bindings): Likewise.
14380 * cp-tree.h (Likewise).
14382 * decl.c (replace_defarg): Check that the type of the default
14383 parameter does not invlove a template type before complaining
14384 about the initialization.
14386 * error.c (dump_expr): Deal with template constant parameters in
14387 member templates correctly.
14389 * pt.c (is_member_template): Deal with class specializations
14391 (tsubst): Handle "partial instantiation" of member templates
14394 Wed Sep 3 12:30:24 1997 Mark Mitchell <mmitchell@usa.net>
14396 * pt.c (type_unification): Change calling sequence to allow for
14397 multiple levels of template parameters.
14398 (tsubst_expr): Likewise.
14399 (tsubst): Likewise.
14400 (tsubst_copy): Likewise.
14401 (instantiate_template): Likewise.
14403 * call.c (build_overload_call_real): Use it.
14404 (add_builtin_candidate): Use it.
14405 (build_new_method_call): Use it.
14406 * class.c (instantiate_type): Use it.
14407 * decl.c (grokdeclarator): Use it.
14408 * decl2.c (finish_file): Use it.
14409 * method.c (build_overload_identifier): Use it.
14411 * call.c (add_template_candidate): Add additional parameter for
14412 the function return type. Call fn_type_unification istead of
14414 (build_user_type_conversion_1): Handle member templates.
14415 (build_new_function_call): Likewise.
14416 (build_new_op): Likewise.
14417 (build_new_method_call): Likewise.
14419 * class.c (grow_method): Don't give an error message indicating
14420 that two member templates with the same name are ambiguous.
14421 (finish_struct): Treat member template functions just like member
14424 * cp-tree.h (check_member_template): Add declaration.
14425 (begin_member_template_processing): Likewise.
14426 (end_member_template_processing): Likewise.
14427 (fn_type_unification): Likewise.
14428 (is_member_template): Likewise.
14429 (tsubst): Change prototype.
14430 (tsubst_expr): Likewise.
14431 (tsubst_copy): Likewise.
14432 (instantiate_template): Likewise.
14433 (get_bindings): Likewise.
14435 * decl.c (decls_match): Handle multiple levels of template
14437 (pushdecl): Handle template type params just like other type
14439 (push_class_level_binding): Return immediately if the
14440 class_binding_level is NULL.
14441 (grokfndecl): If check_classfn() returns a member_template, use
14442 the result of the template, not the template itself.
14444 * decl2.c (check_member_template): New function. Check to see
14445 that the entity declared to be a member template can be one.
14446 (check_classfn): Allow redeclaration of member template functions
14447 with different types; the new functions can be specializations or
14448 explicit instantiations.
14450 * error.c (dump_decl): Handle multiple levels of template
14452 (dump_function_decl): Update to handle function templates.
14454 * lex.c (do_pending_inlines): Set up template parameter context
14455 for member templates.
14456 (process_next_inline): Likewise.
14458 * method.c (build_overload_identifier): Adjust for multiple levels
14459 of template parameters.
14461 * parse.y (fn.def2): Add member templates.
14462 (component_decl_1): Likewise.
14464 * pt.c (begin_member_template_processing): New function.
14465 (end_member_template_processing): Likewise.
14466 (is_member_template): Likewise.
14467 (fn_type_unification): Likewise.
14468 (current_template_parms): Return a vector of all the template
14469 parms, not just the innermost level of parms.
14470 (push_template_decl): Deal with the possibility of member
14472 (lookup_template_class): Likewise.
14473 (uses_template_parms): Likewise.
14474 (tsubst): Modify processing to TEMPLATE_TYPE_PARM and
14475 TEMPLATE_CONST_PARM to deal with multiple levels of template
14476 arguments. Add processing of TEMPLATE_DECL to produce new
14477 TEMPLATE_DECLs from old ones.
14478 (do_decl_instantiation): Handle member templates.
14480 * search.c (lookup_fnfields_1): Handle member template conversion
14483 * tree.c (cp_tree_equal): Check the levels, as well as the
14484 indices, of TEMPLATE_CONST_PARMs.
14486 * typeck.c (comptypes): Check the levels, as well as the indices,
14487 fo TEMPLATE_TYPE_PARMs.
14488 (build_x_function_call): Treat member templates like member
14491 Wed Sep 3 11:09:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14493 * typeck.c (c_expand_return): Always convert_for_initialization
14494 before checking for returning a pointer to local.
14496 * pt.c (type_unification): If strict and the function parm doesn't
14497 use template parms, just compare types.
14499 Wed Sep 3 10:35:49 1997 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de>
14501 * method.c (build_overloaded_value): Replace direct call
14502 to the floating point emulator with REAL_VALUE_TO_DECIMAL macro.
14504 Wed Sep 3 00:02:53 1997 Jason Merrill <jason@yorick.cygnus.com>
14506 * typeck.c (convert_arguments): Don't arbitrarily choose the first
14507 of a set of overloaded functions.
14509 Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
14511 * lex.c (real_yylex): Don't elide __FUNCTION__.
14513 * method.c (build_overload_value): Add in_template parm.
14514 (build_overload_int): Likewise.
14515 (build_overload_identifier): Pass it.
14517 * decl.c (duplicate_decls): Don't bash a previous template
14518 definition with a redeclaration.
14520 * pt.c (unify): float doesn't match double.
14522 * pt.c (do_type_instantiation): Handle getting a _TYPE or a
14523 TYPE_DECL. Handle getting non-template types.
14524 * parse.y (explicit_instantiation): Use typespec instead of
14525 aggr template_type.
14527 Tue Sep 2 10:27:08 1997 Richard Henderson <rth@cygnus.com>
14529 * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings.
14531 Mon Sep 1 13:19:04 1997 Eugene Mamchits <eugin@ips.ras.ru>
14533 * call.c (add_builtin_candidate): Add missing TREE_TYPE.
14534 (compare_ics): Likewise.
14536 Mon Sep 1 13:19:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14538 * call.c (joust): Warn about choosing one conversion op over
14539 another because of 'this' argument when the other return type is
14541 (source_type): New fn.
14543 * call.c (build_new_op): Strip leading REF_BIND from first operand
14544 to builtin operator.
14546 * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
14549 Thu Aug 28 09:45:23 1997 Jason Merrill <jason@yorick.cygnus.com>
14551 * call.c (null_ptr_cst_p): Remove support for (void*)0.
14553 Wed Aug 27 02:03:34 1997 Jeffrey A Law <law@cygnus.com>
14555 * typeck.c (expand_target_expr): Make definition match declaration.
14557 * class.c (get_basefndecls): Make definition match declaration.
14559 Mon Aug 25 14:30:02 1997 Jason Merrill <jason@yorick.cygnus.com>
14561 * input.c (sub_getch): Eventually give up and release the input file.
14563 * decl.c (cp_finish_decl): If #p i/i, put inline statics in the
14566 * call.c (joust): Tweak message.
14568 Sat Aug 23 18:02:59 1997 Mark Mitchell <mmitchell@usa.net>
14570 * error.c (type_as_string): Put const/volatile on template type
14571 parameters where appropriate.
14573 Sat Aug 23 17:47:22 1997 Jeffrey A Law <law@cygnus.com>
14575 * call.c (strictly_better): Make arguments unsigned ints.
14577 Thu Aug 21 18:48:44 1997 Jason Merrill <jason@yorick.cygnus.com>
14579 * lex.c (real_yylex): Refer to __complex instead of complex.
14581 Thu Aug 21 22:25:46 1997 J"orn Rennecke <amylaar@cygnus.co.uk>
14583 * lex.c (real_yylex): Don't use getc directly.
14585 Wed Aug 20 17:25:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14587 * call.c (is_subseq): Don't try to be clever.
14589 Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
14591 * parse.y, pt.c: Include "except.h".
14592 * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
14593 error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
14594 lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
14595 sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
14598 Wed Aug 20 01:34:40 1997 Jason Merrill <jason@yorick.cygnus.com>
14600 * decl2.c (mark_vtable_entries): Instead of replacing pure
14601 virtuals with a reference to __pure_virtual, copy the decl and
14604 Tue Aug 19 02:26:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14606 * pt.c (lookup_nested_type_by_name): Handle typedef wierdness.
14608 * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com.
14610 * pt.c (instantiate_class_template): Call repo_template_used
14611 before finish_prevtable_vardecl.
14613 * call.c (is_subseq): New fn.
14614 (compare_ics): Use it.
14616 * repo.c (finish_repo): Don't crash on no args.
14618 * parse.y (named_complex_class_head_sans_basetype): Handle
14619 explicit global scope.
14620 * decl2.c (handle_class_head): New fn.
14622 * pt.c (unify): Add CONST_DECL case.
14624 Thu Aug 14 10:05:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14626 * rtti.c (permanent_obstack): Fix decl to not be a pointer.
14628 * cp-tree.h (report_type_mismatch): Add prototype.
14629 * call.c (build_overload_call_real): Remove erroneous fourth
14630 argument to report_type_mismatch.
14631 (build_user_type_conversion_1): Remove erroneous second arg to
14633 (build_new_function_call): Likewise.
14634 (build_object_call): Likewise.
14635 (build_new_op): Likewise.
14636 (build_new_method_call): Likewise.
14638 Wed Aug 13 19:19:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14640 * error.c (dump_decl): Don't bother processing a function with no
14641 DECL_LANG_SPECIFIC.
14643 * method.c (emit_thunk): Call init_function_start in the macro case.
14645 Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
14647 * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
14648 defined and used to set flag_vtable_thunks.
14650 Tue Aug 12 20:13:57 1997 Jason Merrill <jason@yorick.cygnus.com>
14652 * parse.y: Don't clear the inlines from their obstack until they've
14653 all been processed.
14655 * decl.c (duplicate_decls): Don't complain about exception
14656 specification mismatch if flag_exceptions is off.
14658 Mon Aug 11 15:01:56 1997 Marc Lehmann <pcg@goof.com>
14660 * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
14662 Sun Aug 10 12:06:09 1997 Paul Eggert <eggert@twinsun.com>
14664 * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
14665 * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
14666 Include <stdio.h> before include files that formerly used STDIO_PROTO.
14668 * decl.c, g++spec.c, lex.c, method.c, repo.c:
14669 Include "config.h" first, as per autoconf manual.
14671 Fri Aug 8 11:47:48 1997 Jason Merrill <jason@yorick.cygnus.com>
14673 * decl.c (duplicate_decls): Tweak wording.
14674 * lex.c (do_pending_defargs): Don't die if we see a default arg
14675 that isn't a DEFAULT_ARG.
14676 * error.c (dump_expr): Handle DEFAULT_ARG.
14678 * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
14679 * lang-options.h: Add -fhandle-exceptions.
14681 * class.c (build_vtable): Vtables are artificial.
14682 (prepare_fresh_vtable): Likewise.
14684 Wed Aug 6 11:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14686 * cvt.c (ocp_convert): After converting to the target type, set
14687 LOOKUP_NO_CONVERSION.
14689 * call.c (joust): Warn about potentially confusing promotion rules
14691 * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
14693 Tue Aug 5 15:15:07 1997 Michael Meissner <meissner@cygnus.com>
14695 * exception.cc: Declare __terminate_func with noreturn attribute.
14697 Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
14699 * parse.y: Break out eat_saved_input, handle errors.
14700 (function_try_block): Use compstmt instead of compstmt_or_error.
14702 Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
14704 * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE.
14706 Fri Jul 4 01:45:16 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14708 * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for
14709 existence of cc1plus check whether $(LANGUAGES) contains C++.
14711 Wed Jul 30 13:04:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
14713 * method.c (do_build_copy_constructor): When copying an anonymous
14714 union member loop around to handle nested anonymous unions. Use
14715 the offset of the member relative to the outer structure, not the
14718 Tue Jul 29 21:17:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14720 * call.c (resolve_args): New fn.
14721 (build_new_function_call): Use it.
14722 (build_object_call): Likewise.
14723 (build_new_method_call): Likewise.
14725 Mon Jul 28 16:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
14727 * call.c (build_over_call): tsubst all default parms from templates.
14729 Wed Jul 23 13:36:25 1997 Jason Merrill <jason@yorick.cygnus.com>
14731 * decl.c (struct cp_function): Add static_labelno.
14732 (push_cp_function_context): Save it.
14733 (pop_cp_function_context): Restore it.
14735 Tue Jul 22 14:43:29 1997 Jason Merrill <jason@yorick.cygnus.com>
14737 * typeck.c (build_component_ref_1): Convert from reference.
14739 Tue Jul 22 11:06:23 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14741 * parse.y (current_declspecs, prefix_attributes): Initialize to
14744 * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil
14745 before we try to force it to be a TREE_LIST.
14746 (decl): Make sure $1.t is non-nil.
14748 Sun Jul 20 11:53:07 1997 Jason Merrill <jason@yorick.cygnus.com>
14750 * pt.c (uses_template_parms): Handle template first-parse codes.
14752 * decl.c (cp_finish_decl): Only warn about user-defined statics.
14754 Fri Jul 18 17:56:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14756 * pt.c (unify): Handle BOOLEAN_TYPE.
14758 * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE.
14759 * pt.c (tsubst): Don't set it.
14760 * call.c (build_over_call): Use uses_template_parms.
14762 Thu Jul 17 18:06:30 1997 Jason Merrill <jason@yorick.cygnus.com>
14764 * method.c (build_overload_nested_name): Use static_labelno
14765 instead of var_labelno.
14766 (build_qualified_name): New fn.
14767 (build_overload_name): Split out from here.
14768 (build_static_name): Use build_qualified_name.
14769 * decl.c (cp_finish_decl): Statics in extern inline functions
14770 have comdat linkage.
14771 (start_function): Initialize static_labelno.
14773 Thu Jul 17 11:20:17 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
14775 * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy
14776 before "all member functions in class [] are private".
14778 Wed Jul 16 23:47:08 1997 Jason Merrill <jason@yorick.cygnus.com>
14780 * lex.c (do_scoped_id): convert_from_reference.
14781 * init.c (build_offset_ref): Likewise.
14783 Wed Jul 16 12:34:29 1997 Benjamin Kosnik <bkoz@lisa.cygnus.com>
14785 * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list.
14787 Mon Jul 14 03:23:46 1997 Jason Merrill <jason@yorick.cygnus.com>
14789 * typeck.c (get_member_function_from_ptrfunc): Promote index
14792 Sun Jul 13 00:11:52 1997 Jason Merrill <jason@yorick.cygnus.com>
14794 * tree.c (layout_basetypes): Move non-virtual destructor warning.
14795 * decl.c (xref_basetypes): Remove non-virtual destructor warning.
14797 Sat Jul 12 12:47:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14799 * decl.c (grokdeclarator): Call add_defarg_fn for the function
14801 * lex.c (add_defarg_fn): Adjust.
14802 (do_pending_defargs): Adjust. Don't skip the first parm.
14804 Fri Jul 11 01:39:50 1997 Jason Merrill <jason@yorick.cygnus.com>
14806 * decl.c (build_enumerator): Global enumerators are also readonly.
14808 * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast.
14809 (build_dynamic_cast): Call it and convert_from_reference.
14811 * lex.c (add_defarg_fn): New fn.
14812 (snarf_defarg): Don't add to defarg_types.
14813 (do_pending_defargs): Lose defarg_types. All fns we process now
14815 * decl.c (grokfndecl): Call add_defarg_fn.
14817 * Makefile.in (CONFLICTS): Expect 18 s/r conflicts.
14818 * cp-tree.def: Add DEFAULT_ARG.
14819 * spew.c (yylex): Call snarf_defarg as appropriate.
14820 * parse.y: New tokens DEFARG and DEFARG_MARKER.
14821 (defarg_again, pending_defargs, defarg, defarg1): New rules.
14822 (structsp): Use pending_defargs.
14823 (parms, full_parm): Use defarg.
14824 * lex.c (init_lex): Initialize inline_text_firstobj.
14825 (do_pending_inlines): Never pass the obstack to feed_input.
14826 (process_next_inline): Call end_input instead of restore_pending_input.
14827 (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs,
14828 finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns.
14829 * input.c (end_input): New fn.
14830 (sub_getch): At the end of some fed input, just keep returning EOF
14831 until someone calls end_input.
14832 Remove 'obstack' field from struct input_source.
14833 * decl.c (grokparms): Handle DEFAULT_ARG.
14834 (replace_defarg): New fn.
14835 * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros.
14837 Wed Jul 9 13:44:12 1997 Jason Merrill <jason@yorick.cygnus.com>
14839 * call.c (implicit_conversion): If nothing else works, try binding
14840 an rvalue to a reference.
14842 Wed Jul 9 13:04:38 1997 Geoffrey Noer <noer@cygnus.com>
14844 * decl.c (init_decl_processing): Fix Jun 30 patch -- move
14845 ifndef for Cygwin32 to include SIGSEGV.
14847 Thu Jul 3 01:44:05 1997 Jason Merrill <jason@yorick.cygnus.com>
14849 * class.c (finish_struct_1): Only complain about pointers without
14850 copy stuff if there are any constructors.
14852 * rtti.c (build_dynamic_cast): Call complete_type on the types.
14854 * decl.c (grokfndecl): If the function we chose doesn't actually
14857 * decl2.c (grokclassfn): Don't specify 'const int' for the
14858 artificial destructor parm.
14860 * pt.c (type_unification): If we are called recursively, nothing
14863 Mon Jun 30 17:53:21 1997 Geoffrey Noer <noer@cygnus.com>
14865 * decl.c (init_decl_processing): Stop trying to catch signals
14866 other than SIGABRT since the Cygwin32 library doesn't support
14867 them correctly yet. This fixes a situation in which g++ causes
14868 a hang on SIGSEGVs and other such signals in our Win32-hosted
14871 Mon Jun 30 14:50:01 1997 Jason Merrill <jason@yorick.cygnus.com>
14873 * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data.
14875 Fri Jun 27 15:18:49 1997 Jason Merrill <jason@yorick.cygnus.com>
14877 * typeck2.c (store_init_value): Always return the value if our
14878 type needs constructing.
14880 * method.c (hack_identifier): Convert class statics from
14883 Thu Jun 26 11:44:46 1997 Jason Merrill <jason@yorick.cygnus.com>
14885 * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency.
14887 Thu Jun 19 16:49:28 1997 Mike Stump <mrs@cygnus.com>
14889 * typeck.c (c_expand_return): Make sure we clean up temporaries at
14890 the end of return x;
14892 Thu Jun 19 12:28:43 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14894 * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER.
14896 Tue Jun 17 18:35:57 1997 Mike Stump <mrs@cygnus.com>
14898 * except.c (expand_builtin_throw): Add support
14899 -fno-sjlj-exceptions -fPIC exception handling on the SPARC.
14901 Mon Jun 16 01:24:37 1997 Jason Merrill <jason@yorick.cygnus.com>
14903 * repo.c (extract_string): Null-terminate.
14905 * cp-tree.h (TI_SPEC_INFO): New macro.
14906 (CLASSTYPE_TI_SPEC_INFO): New macro.
14907 * pt.c (push_template_decl): Correctly determine # of template parms
14910 * call.c (compare_ics): Really fix 'this' conversions.
14912 * pt.c (do_decl_instantiation): Don't crash on explicit inst of
14915 * pt.c (push_template_decl): Complain about mismatch in # of
14916 template parms between a class template and a member template.
14918 Sun Jun 15 02:38:20 1997 Jason Merrill <jason@yorick.cygnus.com>
14920 * method.c (synthesize_method): You can't call
14921 function_cannot_inline_p after finish_function.
14922 * decl.c (finish_function): Turn on flag_inline_functions and turn
14923 off DECL_INLINE before handing a synthesized method to the
14926 Thu Jun 12 17:35:28 1997 Jason Merrill <jason@yorick.cygnus.com>
14928 * method.c (synthesize_method): Remove July 30 change to never set
14929 DECL_INLINE if at_eof.
14931 Thu Jun 12 15:25:08 1997 Mike Stump <mrs@cygnus.com>
14933 * xref.c (GNU_xref_member): Ensure that the node has a
14934 decl_lang_specific part before checking DECL_FRIEND_P.
14936 Thu Jun 12 12:36:05 1997 Jason Merrill <jason@yorick.cygnus.com>
14938 * pt.c (instantiate_class_template): Diagnose non-class types used
14941 Wed Jun 11 17:33:40 1997 Jason Merrill <jason@yorick.cygnus.com>
14943 * typeck.c (build_conditional_expr): Use convert_for_initialization
14944 instead of convert_and_check.
14946 Wed Jun 11 12:31:33 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14948 * parse.y (typespec): Don't pedwarn for typeof.
14950 Tue Jun 10 00:22:09 1997 Jason Merrill <jason@yorick.cygnus.com>
14952 * repo.c (finish_repo): Only check changes if we would write a
14955 * call.c (compare_ics): Fix handling of 'this' conversions.
14957 * pt.c (do_decl_instantiation): Support static data too. Rename
14958 from do_function_instantiation.
14959 * cp-tree.h: Adjust.
14962 * repo.c (extract_string): New fn.
14963 (get_base_filename): Use it.
14964 (init_repo): Compare old args with current args.
14966 Mon Jun 9 14:25:30 1997 Mike Stump <mrs@cygnus.com>
14968 * Makefile.in, Make-lang.in: Protect C-ls with a comment
14969 character, idea from Paul Eggert <eggert@twinsun.com>.
14971 Mon Jun 9 01:52:03 1997 Jason Merrill <jason@yorick.cygnus.com>
14973 * typeck.c (c_expand_return): Be more persistent in looking for
14976 * cvt.c (build_up_reference): Use NOP_EXPR for switching from
14977 pointer to reference.
14979 * class.c (build_vbase_path): Don't do anything if PATH has no steps.
14981 Sun Jun 8 03:07:05 1997 Jason Merrill <jason@yorick.cygnus.com>
14983 * init.c (build_member_call, build_offset_ref):
14984 Use do_scoped_id instead of do_identifier.
14986 * cvt.c (convert): Remove bogosity.
14988 Sat Jun 7 20:50:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
14990 * cvt.c (build_up_reference): Do checks of ARGTYPE and
14991 TARGET_TYPE before trying to use get_binfo.
14993 Fri Jun 6 17:36:39 1997 Jason Merrill <jason@yorick.cygnus.com>
14995 * cvt.c (build_up_reference): Call get_binfo to get access control.
14997 * decl2.c (import_export_decl): If we don't support weaks, leave
15000 Fri Jun 6 15:55:49 1997 Mike Stump <mrs@cygnus.com>
15002 * except.c (expand_builtin_throw): Add support for machines that
15003 cannot access globals after throw's epilogue when
15004 -fno-sjlj-exceptions is used.
15006 Thu Jun 5 16:28:43 1997 Jason Merrill <jason@yorick.cygnus.com>
15008 * parse.y: 'std::' becomes '::'.
15009 * lex.c (real_yylex): Remove 'namespace' warning.
15010 * init.c (build_member_call): Ignore 'std::'.
15011 (build_offset_ref): Likewise.
15012 * decl2.c (do_using_directive): Ignore 'using namespace std;'.
15013 (do_toplevel_using_decl): Ignore 'using std::whatever'.
15014 * decl.c (push_namespace): Just sorry.
15015 (pop_namespace): Nop.
15016 (init_decl_processing): Declare std namespace.
15018 Tue Jun 3 18:08:23 1997 Jason Merrill <jason@yorick.cygnus.com>
15020 * search.c (push_class_decls): A name which ambiguously refers to
15021 several instantiations of the same template just refers to the
15024 Tue Jun 3 12:30:40 1997 Benjamin Kosnik <bkoz@cirdan.cygnus.com>
15026 * decl.c (build_enumerator): Fix problem with unsigned long
15027 enumerated values being smashed to ints, causing overflow
15028 when computing next enumerated value (for enum values around
15031 Mon Jun 2 17:40:56 1997 Jason Merrill <jason@yorick.cygnus.com>
15033 * typeck.c (build_component_ref): Only call mark_used on a decl.
15035 Thu May 29 15:54:17 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15037 * typeck.c (build_c_cast): Make the check for a ptr to function
15038 more specific before possible default_conversion call.
15040 Thu May 29 13:02:06 1997 Mike Stump <mrs@cygnus.com>
15042 * except.c (expand_exception_blocks): Simplify and fix and make
15043 sure we don't end a region in a sequence, as expand_end_bindings
15046 Wed May 28 17:08:03 1997 Mike Stump <mrs@cygnus.com>
15048 * except.c (init_exception_processing): Mark terminate as not
15049 returning so that the optimizer can optimize better.
15051 Tue May 27 19:49:19 1997 Mike Stump <mrs@cygnus.com>
15053 * cvt.c (convert): Don't do any extra work, if we can avoid it
15056 Tue May 27 18:21:47 1997 Mike Stump <mrs@cygnus.com>
15058 * *.[chy]: Change cp_convert to ocp_convert, change convert to
15059 cp_convert. convert is now reserved for the backend, and doesn't
15060 have the semantics a frontend person should ever want.
15062 Fri May 23 10:58:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15064 * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled.
15065 Lose -traditional support.
15067 Thu May 22 15:41:28 1997 Jason Merrill <jason@yorick.cygnus.com>
15069 * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype).
15071 * parse.y (self_reference): Do it for templates, too.
15072 * class.c (pushclass): Don't overload_template_name; the alias
15073 generated by build_self_reference serves the same purpose.
15075 * tree.c (list_hash): Make static, take more args.
15076 (list_hash_lookup): Likewise.
15077 (list_hash_add): Make static.
15078 (list_hash_canon): Lose.
15079 (hash_tree_cons): Only build a new node if one isn't already in the
15081 (hash_tree_chain): Use hash_tree_cons.
15082 * cp-tree.h: Adjust.
15083 * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead
15084 of calling lookup_name.
15086 Wed May 21 18:24:19 1997 Jason Merrill <jason@yorick.cygnus.com>
15088 * pt.c (instantiate_class_template): TYPE_VALUES for an enum
15089 doesn't refer to the CONST_DECLs.
15091 Tue May 20 21:09:32 1997 Bob Manson <manson@charmed.cygnus.com>
15093 * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever
15095 (expand_class_desc): Convert the last argument to a sizetype.
15097 Tue May 20 13:55:57 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
15099 * gxx.gperf (__complex, __complex__, __imag, __imag__, __real,
15100 __real__): Add reswords.
15101 * hash.h: Regenerate.
15102 * lex.h (rid): Add RID_COMPLEX.
15103 (RID_LAST_MODIFIER): Set to RID_COMPLEX.
15104 * lex.c (init_lex): Add building of RID_COMPLEX.
15105 (real_yylex): General cleanup in line with what c-lex.c also has,
15106 sans the cruft for traditional; add handling of SPEC_IMAG, complex
15107 types, and imaginary numeric constants.
15108 * parse.y (REALPART, IMAGPART): Add tokens.
15109 (unary_expr): Add REALPART and IMAGPART rules.
15110 * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare.
15111 * decl.c (complex_{integer,float,double,long}_type_node): Define
15113 (init_decl_processing): Set up the types.
15114 (grokdeclarator): Add handling of RID_COMPLEX. Set and use
15115 DEFAULTED_INT instead of EXPLICIT_INT when we default to int type.
15116 * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15117 * cvt.c (cp_convert): Handle COMPLEX_TYPE.
15118 * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add
15120 * method.c (build_overload_name): Add handling of the different
15121 COMPLEX_TYPEs, prefixing them with `J'.
15122 * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE
15123 as a template parm.
15124 (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case.
15125 * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases.
15126 (mapcar): Handle COMPLEX_CST.
15127 * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE.
15128 (common_type): Add code for complex types.
15129 (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases.
15130 (convert_for_assignment): Likewise.
15131 (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases.
15133 Mon May 19 12:26:27 1997 Jason Merrill <jason@yorick.cygnus.com>
15135 * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to
15136 tsubst_expr, as it might try to do overload resolution.
15138 Sat May 17 10:48:31 1997 Jason Merrill <jason@yorick.cygnus.com>
15140 * pt.c (instantiate_class_template): Oops.
15142 Fri May 16 14:23:57 1997 Jason Merrill <jason@yorick.cygnus.com>
15144 * cp-tree.def: Add TAG_DEFN.
15145 * pt.c (tsubst_enum): New fn.
15146 (instantiate_class_template): Use it.
15147 (tsubst_expr): Support TAG_DEFN.
15148 (tsubst): Support local enums.
15149 (tsubst_copy): Likewise.
15150 * decl.c (finish_enum): Likewise.
15151 (start_enum): If this is a local enum, switch to permanent_obstack.
15153 Wed May 14 19:08:28 1997 Mike Stump <mrs@cygnus.com>
15155 * decl.c (store_parm_decls): Set last_parm_cleanup_insn here.
15156 (finish_function): Put the base init code for constructors just
15157 after the parm cleanup insns.
15158 (struct cp_function): Add last_parm_cleanup_insn.