1 2003-03-10 Devang Patel <dpatel@apple.com>
4 * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG.
5 2003-03-10 Jason Merrill <jason@redhat.com>
8 * decl.c (push_using_directive): Push before recursing.
11 * call.c (resolve_scoped_fn_name): Handle the case of a function
14 * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this'
15 argument in the pointer-to-member case.
17 2003-03-09 Mark Mitchell <mark@codesourcery.com>
20 * cp-lang.c (cxx_get_alias_set): Use alias set zero for
21 pointers to member functions.
24 * decl.c (build_ptrmemfunc_type): Do not allow default arugments
25 in pointer-to-member-function types.
27 2003-03-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
29 * expr.c (cplus_expand_constant): Use C90 prototype style.
30 (cxx_expand_expr): Likewise.
32 2003-03-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
35 * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual
38 2003-03-08 Geoffrey Keating <geoffk@apple.com>
40 * lang-specs.h (c++-header): Change .pch to .gch.
42 2003-03-08 Neil Booth <neil@daikokuya.co.uk>
44 * cp-tree.h (cxx_init): Update prototype.
45 * lex.c (cxx_init): Similarly.
47 2003-03-08 Mark Mitchell <mark@codesourcery.com>
50 * cp-tree.h (begin_mem_initializers): Remove.
51 * parser.c (cp_parser_mem_initializer_list): Inline it here.
52 Do not call finish_mem_initializers if not in a constructor.
53 (cp_parser_class_head): Fix typo in error message.
54 * semantics.c (begin_mem_initializers): Remove.
55 * testsuite/g++.dg/parser/constructor1.C: New test.
58 * call.c (add_function_candidate): Skip builtin fuctions that have
59 not yet been declared.
62 * init.c (build_new_1): Correct logic for determining whether or
63 not to use an array cookie.
66 * parser.c (cp_parser_postfix_expression): Call
67 finish_non_static_data_member, even when processing_template_decl.
70 * cp-tree.h (is_ancestor): New function.
71 (handle_class_head): Change prototype.
72 * decl2.c (is_namespace_ancestor): Rename to ...
73 (namespace_anecestor): ... this.
74 (set_decl_namespace): Adjust accordingly.
75 (handle_class_head): Remove unncessary parameters.
76 * parser.c (cp_parser_class_head): Check that
77 nested-name-specifiers are used appropriately.
79 2003-03-07 Mark Mitchell <mark@codesourcery.com>
81 * call.c (reference_binding): Remove REF_IS_VAR parameter.
82 (implicit_conversion): Adjust call to reference_binding.
83 (make_temporary_var_for_ref_to_type): Add TYPE parameter.
84 (initialize_reference): Adjust handling for references bound to
86 * cp-tree.h (make_temporary_var_for_ref_to_temp): Change
88 (real_non_cast_lvalue_p): New method.
89 * cvt.c (build_up_reference): Adjust use of
90 make_temporary_var_for_ref_to_temp.
91 * tree.c (real_non_cast_lvalue_p): New method.
93 2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
95 * except.c (init_exception_processing): Use C90 prototype style.
96 (cp_protect_cleanup_actions): Likewise.
97 (prepare_eh_type): Likewise.
98 (build_eh_type_type): Likewise.
99 (build_exc_ptr): Likewise.
100 (do_begin_catch): Likewise.
101 (dtor_nothrow): Likewise.
102 (do_end_catch): Likewise.
103 (push_eh_cleanup): Likewise.
104 (decl_is_java_type): Likewise.
105 (choose_personality_routine): Likewise.
106 (initialize_handler_parm): Likewise.
107 (expand_start_catch_block): Likewise.
108 (expand_end_catch_block): Likewise.
109 (begin_eh_spec_block): Likewise.
110 (finish_eh_spec_block): Likewise.
111 (do_allocate_exception): Likewise.
112 (do_free_exception): Likewise.
113 (wrap_cleanups_r): Likewise.
114 (stabilize_throw_expr): Likewise.
115 (build_throw): Likewise.
116 (complete_ptr_ref_or_void_ptr_p): Likewise.
117 (is_admissible_throw_operand): Likewise.
118 (nothrow_libfn_p): Likewise.
119 (can_convert_eh): Likewise.
120 (check_handlers_1): Likewise.
121 (check_handlers): Likewise.
123 2003-03-06 Mark Mitchell <mark@codesourcery.com>
125 * call.c (merge_conversion_sequences): New function.
126 (build_conv): Set ICS_USER_FLAG for USER_CONVs.
127 (convert_class_to_reference): Correct handling of second
128 standard conversion sequence in a user-defined conversion
130 (build_user_type_conversion_1): Use merge_conversion_sequences.
131 * cp-tree.def: Add comments for CONV nodes.
132 * rtti.c (get_tinfo_decl): Use build_address/build_nop.
134 2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
136 * error.c (init_error): Use C90 prototype style.
137 (dump_scope): Likewise.
138 (dump_qualifiers): Likewise.
139 (dump_template_argument): Likewise.
140 (dump_template_argument_list): Likewise.
141 (dump_template_parameter): Likewise.
142 (dump_template_bindings): Likewise.
143 (dump_type): Likewise.
144 (dump_typename): Likewise.
145 (class_key_or_enum): Likewise.
146 (dump_aggr_type): Likewise.
147 (dump_type_prefix): Likewise.
148 (dump_type_suffix): Likewise.
149 (dump_global_iord): Likewise.
150 (dump_simple_decl): Likewise.
151 (dump_decl): Likewise.
152 (dump_template_decl): Likewise.
153 (dump_function_decl): Likewise.
154 (dump_parameters): Likewise.
155 (dump_exception_spec): Likewise.
156 (dump_function_name): Likewise.
157 (dump_template_parms): Likewise.
158 (dump_char): Likewise.
159 (dump_expr_list): Likewise.
160 (dump_expr): Likewise.
161 (dump_binary_op): Likewise.
162 (dump_unary_op): Likewise.
163 (type_as_string): Likewise.
164 (expr_as_string): Likewise.
165 (decl_as_string): Likewise.
166 (context_as_string): Likewise.
167 (lang_decl_name): Likewise.
168 (cp_file_of): Likewise.
169 (cp_line_of): Likewise.
170 (decl_to_string): Likewise.
171 (expr_to_string): Likewise.
172 (fndecl_to_string): Likewise.
173 (code_to_string): Likewise.
174 (language_to_string): Likewise.
175 (parm_to_string): Likewise.
176 (op_to_string): Likewise.
177 (type_to_string): Likewise.
178 (assop_to_string): Likewise.
179 (args_to_string): Likewise.
180 (cv_to_string): Likewise.
181 (cxx_print_error_function): Likewise.
182 (cp_diagnostic_starter): Likewise.
183 (cp_diagnostic_finalizer): Likewise.
184 (cp_print_error_function): Likewise.
185 (function_category): Likewise.
186 (print_instantiation_full_context): Likewise.
187 (print_instantiation_partial_context): Likewise.
188 (maybe_print_instantiation_context): Likewise.
189 (print_instantiation_context): Likewise.
190 (cp_printer): Likewise.
191 (print_integer): Likewise.
192 (print_non_consecutive_character): Likewise.
193 (locate_error): Likewise.
195 2003-03-06 Mark Mitchell <mark@codesourcery.com>
198 * call.c (reference_binding): Add ref_is_var parameter.
199 (implicit_conversion): Adjust call to reference_binding.
200 (initialize_reference): Likewise.
203 * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
207 * class.c (get_basefndecls): Use lookup_fnfields_1.
209 2003-03-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
212 * parser.c (cp_parser_type_parameter): Remove redundant `expect'
214 (cp_parser_single_declaration): Likewise.
216 2003-03-05 Jason Merrill <jason@redhat.com>
219 * call.c (build_conditional_expr): Use convert rather than an
222 2003-03-02 Matt Austern <austern@apple.com>
224 * decl.c (cp_binding_level): Add static_decls varray member.
225 (add_decl_to_level): Add static/inline namespace scope
226 declarations to static_decls array.
227 (wrapup_global_for_namespace): Pass static_decls only, instead of
228 all decls, to wrapup_global_declarations/check_global_declarations.
229 (push_namespace): Initialize static_decls for ordinary namespaces.
230 (cxx_init_decl_processing): Initialize static_decls for global
233 2003-03-05 Mark Mitchell <mark@codesourcery.com>
235 * class.c (end_of_class): Correct thinko.
237 2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
239 * config-lang.in: Replace ${libstdcxx_version} by its value.
241 2003-03-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
243 * cp-tree.h (cxx_saved_binding): Declare.
244 (struct saved_scope): Adjust type of field 'old_binding'.
245 * decl.c (cxx_saved_binding_make): New macro.
246 (struct cxx_saved_binding): Define.
247 (store_bindings): Adjust prototype. Use cxx_saved_binding to save
249 (maybe_push_to_top_level): Adjust local variable type.
250 (pop_from_top_level): Likewise.
252 2003-03-04 Tom Tromey <tromey@redhat.com>
254 * Make-lang.in (c++.tags): New target.
256 2003-03-04 Neil Booth <neil@daikokuya.co.uk>
258 * Make-lang.in: Update.
260 2003-03-03 Jason Merrill <jason@redhat.com>
262 * decl.c (finish_enum): Do set the type in a template. Simplify.
263 * pt.c (tsubst_enum, tsubst_copy): Revert last patch.
265 2003-03-03 Mark Mitchell <mark@codesourcery.com>
268 * call.c (convert_class_to_reference): Correct conversion
270 (reference_binding): Add ref_bound_directly_to_rvalue_p parameter.
271 (implicit_conversion): Adjust call to reference_binding.
272 (add_candidate): Change type of candidates parameter.
273 (add_function_candidate): Likewise.
274 (add_conv_candidate): Likewise.
275 (build_builtin_candidate): Likewise.
276 (add_builtin_candidate): Likewise.
277 (add_builtin_candidates): Likewise.
278 (add_template_candidate_real): Likewise.
279 (add_template_candidate): Likewise.
280 (add_template_conv_candidate): Likewise.
281 (build_user_type_conversion_1): Adjust accordingly.
282 (build_object_call): Likewise.
283 (build_conditional_expr): Likewise.
284 (add_candidates): Likewise.
285 (build_new_op): Likewise.
286 (convert_like_real): Use USER_CONV_CAND. Use build_nop.
287 (build_new_method_call): Adjust calls to add_function_candidate.
288 (make_temporary_var_for_ref_to_temp): New function.
289 (initialize_reference): Add decl parameter.
290 * class.c (build_rtti_vtbl_entries): Use build_address and
292 * cp-tree.h (initialize_reference): Change prototype.
293 (make_temporary_var_for_ref_to_temp): New function.
294 (build_type_conversion): Change prototype.
295 (build_address): New function.
296 (build_nop): Likewise.
297 * cvt.c (cp_convert_to_pointer): Adjust call to
298 build_type_conversion. Avoid indicating redundant NOP_EXPRs.
300 (convert_to_pointer_force): Use build_nop.
301 (build_up_reference): Use make_temporary_var_for_ref_to_temp.
302 (convert_to_reference): Adjust call to build_type_conversion.
303 (ocp_convert): Likewise.
304 (build_type_conversion): Remove for_sure parameter.
305 * decl.c (grok_reference_init): Use initialize_reference.
306 * typeck.c (build_address): New function.
307 (build_nop): Likewise.
308 (build_unary_op): Use them.
309 (build_ptrmemfunc): Tidy slightly.
310 (convert_for_initialization): Adjust call to
311 initialize_reference.
312 * typeck2.c (store_init_value): Remove #if 0'd code.
314 2003-03-03 Jason Merrill <jason@redhat.com>
316 * decl.c (start_function): Clear DECL_NUM_STMTS.
318 * class.c (get_vtable_decl): Use vtbl_type_node.
319 (build_primary_vtable): Check for it.
321 2003-03-02 Aldy Hernandez <aldyh@redhat.com>
323 * decl.c (check_initializer): Check for vector_opaque_p.
325 2003-03-02 Ashif Harji <asharji@uwaterloo.ca>
327 * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to
328 invoke an external cpp during compilation.
330 2003-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
332 * decl.c (duplicate_decls): Convert use of warning_with_decl() to
334 (start_decl): Likewise.
335 (start_function): Likewise.
337 2003-03-01 Neil Booth <neil@daikokuya.co.uk>
339 * Make-lang.in (CXX_C_OBJS): Update.
341 2003-02-28 Mark Mitchell <mark@codesourcery.com>
344 * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when
347 2003-02-28 Aldy Hernandez <aldyh@redhat.com>
349 * parser.c (cp_parser_init_declarator): Revert opaque
350 vector_opaque_p change.
351 Do not include target.h.
353 2003-02-28 Mark Mitchell <mark@codesourcery.com>
356 * cp-tree.h (build_zero_init): Add parameter.
357 * decl.c (cp_finish_decl): Adjust call.
358 * init.c (build_zero_init): Add nelts parameter. Adjust recursive
360 (build_default_init): Add nelts parameter. Adjust calls to
362 (build_new_1): Adjust call to build_default_init.
363 * typeck2.c (process_init_constructor): Adjust call to build_zero_init.
365 2003-02-26 Devang Patel <dpatel@apple.com>
367 * decl.c (finish_enum): Merge two 'for' loops. Copy value node if required.
368 Postpone enum setting for template decls.
369 (build_enumerator): Delay copying value node until finish_enum (). Remove
371 * pt.c (tsubst_enum): Set TREE_TYPE and copy value node.
372 (tsubst_copy): Add check for enum type.
374 2003-02-25 Mark Mitchell <mark@codesourcery.com>
377 * decl2.c (prune_vars_needing_no_initialization): Do not throw
378 away initializations for DECL_EXTERNAL VAR_DECLs.
379 (finish_file): Adjust accordingly.
380 * pt.c (instantiate_decl): Do not defer VAR_DECLs.
382 2003-02-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
384 * decl.c (add_binding): Time TV_NAME_LOOKUP.
385 (push_class_binding): Likewise.
386 (set_namespace_binding): Likewise.
388 2003-02-24 Mark Mitchell <mark@codesourcery.com>
391 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from
392 specializations back to the main template.
393 * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use.
394 * pt.c (resolve_typename_type): Likewise.
396 2003-02-24 Jeffrey D. Oldham <oldham@codesourcery.com>
399 * pt.c (tsubst_copy_and_build): For a templated function inside a
400 scope, process template arguments.
402 2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
405 * typeck2.c (abstract_virtuals_error): Don't check when
406 TYPE is still template parameter dependent.
408 2003-02-23 Mark Mitchell <mark@codesourcery.com>
411 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro.
412 * parser.c (cp_parser_diagnose_invalid_type_name): Use it.
413 * pt.c (instantiate_class_template): Don't try to instantiate
415 (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE.
417 2003-02-21 Mark Mitchell <mark@codesourcery.com>
420 * decl.c (grokdeclarator): Do not allow parameters with variably
423 2003-02-21 Nathan Sidwell <nathan@codesourcery.com>
425 * search.c (bfs_walk_grow): Remove. Fold into ...
426 (bfs_walk): ... here, fix fencepost error. Fix merge lossage
429 2003-02-20 Mark Mitchell <mark@codesourcery.com>
432 * mangle.c (mangle_conv_op_name_for_type): Issue an error message
433 when the G++ 3.2 ABI prevents correct compilation.
435 2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
437 Change base class access representation. Share virtual base
439 * cp/call.c (build_special_member_call): Remove binfo_for_vbase
441 * cp/class.c (build_base_path): Likewise.
442 (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
443 (build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
444 (make_new_vtable): Adjust.
445 (force_canonical_binfo_r): Delete.
446 (force_canonical_binfo): Delete.
447 (mark_primary_virtual_base): Delete.
448 (dfs_unshared_virtual_bases): Delete.
449 (mark_primary_bases): Adjust.
450 (maybe_warn_about_overly_private_class): Adjust.
451 (dfs_base_derived_from): Delete.
452 (base_derived_from): Follow the inheritance chain.
453 (struct find_final_overrider_data): Add vpath member.
454 (dfs_find_final_overrider): Adjust.
455 (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
456 (find_final_overrider): Adjust.
457 (update_vtable_entry_for_fn): Adjust.
458 (modify_all_vtables): Adjust.
459 (walk_subobject_offsets): Adjust.
460 (layout_nonempty_base_or_field): Adjust.
461 (layout_empty_base): Remove last parameter. Adjust.
462 (build_base_field): Adjust.
463 (build_base_fields): Adjust.
464 (propagate_binfo_offsets): Remove last parameter. Adjust.
465 (dfs_set_offset_for_unshared_vbases): Delete.
466 (layout_virtual_bases): Adjust.
467 (finish_struct_1): Adjust.
468 (init_class_processing): Don't init access nodes.
469 (dfs_get_primary_binfo): Delete.
470 (get_primary_binfo): Adjust.
471 (dump_class_hierarchy_r): Remove most derived arg, add IGO
473 (dump_class_hierarchy): Adjust.
474 (finish_vtbls): Adjust.
475 (get_original_base): Delete.
476 (build_vtt_inits): Adjust.
477 (dfs_build_secondary_vptr_vtt_inits): Adjust.
478 (dfs_ctor_vtable_bases_queue_p): Adjust.
479 (build_ctor_vtbl_group): Adjust.
480 (dfs_accumulate_vtbl_inits): Adjust.
481 (build_vtbl_initializer): Adjust.
482 (build_vbase_offset_vtbl_entries): Adjust.
483 (add_vcall_offset_vtbl_entries_1): Adjust.
484 * cp/cp-tree.h (CPTI_ACCESS_*): Remove.
485 (access_*_node): Remove.
486 (CANONICAL_BINFO): Delete.
487 (BINFO_UNSHARED_MARKED): Remove.
488 (BINFO_MARKED): Set LANG_FLAG_0 directly.
489 (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
490 (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
491 (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
493 (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
494 (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
495 (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
497 (BINFO_DEPENDENT_BASE_P): New.
498 (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
500 (markedp, unmarkedp): Adjust.
501 (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
502 dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
503 find_vbase_instance, binfo_for_vbase): Delete.
504 (copied_binfo, original_binfo): Declare.
505 (finish_base_specifier): Add virtual_p arg.
506 (unshare_base_binfos): Delete.
507 (copy_base_binfos): Declare.
508 (reverse_path): Delete.
509 * cp/decl.c (xref_basetypes): Access and virtuality passed
510 differently. Don't copy direct base binfos here. Call
512 * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
513 (initialize_vtbl_ptrs): Adjust.
514 (expand_member_init): Adjust.
515 * cp/parser.c (cp_parser_base_specifier): Adjust.
516 * cp/pt.c (instantiate_class_template): Adjust.
517 (get_template_base_recursive): Adjust.
518 * cp/rtti.c (get_pseudo_ti_init): Adjust.
519 (get_pseudo_ti_desc): Adjust.
520 * cp/tree.c (unshare_base_binfos): Rename to ...
521 (copy_base_binfos): ... here, reimplement.
522 (make_binfo): Set BINFO_DEPENDENT_BASE_P.
523 (reverse_path): Remove.
524 * cp/typeck.c (get_delta_difference): Adjust error messages.
525 * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
526 * cp/search.c (lookup_base_r): Adjust.
527 (dynamic_cast_base_recurse): Adjust.
528 (canonical_binfo): Remove.
529 (dfs_canonical_queue): Remove.
530 (dfs_assert_unmarked_p): Remove.
531 (assert_canonical_unmarked): Remove.
532 (shared_marked_p, shared_unmarked_p): Remove.
533 (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
534 (dfs_access_in_type): Adjust.
535 (access_in_type): Adjust.
536 (dfs_accessible_queue_p): Adjust.
537 (dfs_accessible_p): Adjust.
538 (is_subobject_of_p_1, is_subobject_of_p): Remove.
539 (struct lookup_field_info): Remove from_dep_base_p field.
540 (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
541 (lookup_field_r): Remove dependent base code.
542 (lookup_member): Likewise.
543 (dfs_walk, dfs_walk_real): Add access arg to queue fn.
544 (dfs_unmarked_real_bases_queue_p): Remove.
545 (dfs_marked_real_bases_queue_p): Remove.
546 (dfs_skip_vbases): Remove.
547 (dfs_get_pure_virtuals): Adjust.
548 (markedp, unmarkedp): Adjust.
549 (marked_vtable_pathp, unmarked_vtable_pathp): Remove.
550 (marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
551 (dfs_unmark): Adjust.
552 (dfs_get_vbase_types):Remove.
553 (dfs_build_inheritance_graph_order): Remove.
554 (get_vbase_types): Remove
555 (dfs_find_vbase_instance): Remove.
556 (find_vbase_instance): Remove.
557 (dfs_debug_unmarkedp): Adjust.
558 (dependent_base_p): Remove.
559 (dfs_push_type_decls): Adjust.
560 (dfs_push_decls): Adjust.
561 (dfs_no_overlap_yet): Adjust.
562 (copied_binfo): New function.
563 (original_binfo): New function.
564 (binfo_for_vbase): Remove.
566 2003-02-18 Zack Weinberg <zack@codesourcery.com>
568 * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk.
569 (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES
572 2003-02-18 Mark Mitchell <mark@codesourcery.com>
575 * class.c (layout_class_type): In the 3.2 ABI, take into account
576 trailing bit fields when computing CLASSTYPE_SIZE_UNIT.
578 2003-02-18 Matt Austern <austern@apple.com>
580 * cp/cp-lang.c: Change lang hooks so that final_write_globals does
582 * cp/decl.c (wrapup_globals_for_namespace): Remove special
583 handling of global namespace.
585 2003-02-18 Geoffrey Keating <geoffk@apple.com>
587 * cp-tree.h (rid_to_yy): Delete.
588 (C_RID_YYCODE): Delete.
589 (finish_file): Delete redundant declaration.
591 2003-02-18 Jason Merrill <jason@redhat.com>
594 * decl.c (reshape_init): Don't mess with initializer labels.
597 * parser.c (cp_parser_postfix_expression): Set idk properly for
598 object->scope::member.
600 2003-02-18 Ben Elliston <bje@redhat.com>
603 * decl.c (duplicate_decls): Fix typo in comment.
605 2003-02-17 Michael Elizabeth Chastain <mec@shout.net>
608 * class.c (build_base_field): Mark fields for base classes with
611 2003-02-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
614 * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
615 CONSTRUCTOR_ELTS only once.
617 2003-02-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
620 * error.c (dump_type_prefix): Handle TYPEOF_TYPE.
621 (dump_type_suffix): Likewise.
623 2003-02-14 Nathan Sidwell <nathan@codesourcery.com>
625 * search.c: ANSIfy function declarations and definitions.
626 * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool.
627 * call.c (build_method_call, resolve_scoped_fn_name,
628 build_java_interface_fn_ref): Adjust lookup_field, lookup_member
630 * class.c (handle_using_decl): Likewise.
631 * decl.c (make_typename_type, make_unmound_class_template,
632 start_decl, compute_array_index_type): Likewise.
633 * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise.
634 * init.c (expand_member_init, build_member_call): Likewise.
635 * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation,
636 resolve_typename_type): Likewise.
637 * typeck.c (lookup_destructor, finish_class_member_access_exprm
638 build_prememfunc_access_expr): Likewise.
640 2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
642 * decl2.c: Include "timevar.h".
643 (namespace_ancestor): Time name lookup.
644 (add_using_namespace): Likewise.
645 (lookup_using_namespace): Likewise.
646 (qualified_lookup_using_namespace): Likewise.
647 (decl_namespace): Likewise.
648 (lookup_arg_dependent): Likewise.
649 * lex.c (do_identifier): Likewise.
650 (do_scoped_id): Likewise.
651 * pt.c (lookup_template_class): Likewise.
653 2003-02-14 Andrew Pinski <pinskia@physics.uc.edu>
655 * decl.c: (define_label): Fix warning for return 0 instead of NULL.
657 2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
659 * decl.c: Include "timevar.h".
660 (poplevel): Time name lookup.
661 (find_binding): Likewise.
662 (push_namespace): Likewise.
663 (pop_nested_namespace): Likewise.
664 (store_bindings): Likewise.
665 (maybe_push_to_top_level): Likewise.
666 (pop_from_top_level): Likewise.
667 (push_local_name): Likewise.
669 (pushdecl): Likewise.
670 (pushdecl_with_scope): Likewise.
671 (pushdecl_namespace_level): Likewise.
672 (pushdecl_top_level): Likewise.
673 (pushdecl_class_level): Likewise.
674 (push_class_level_binding): Likewise.
675 (push_using_decl): Likewise.
676 (push_using_directive): Likewise.
677 (push_overloaded_decl): Likewise.
678 (lookup_label): Likewise.
679 (define_label): Likewise.
680 (lookup_tag): Likewise.
681 (lookup_tag_reverse): Likewise.
682 (lookup_namespace_name): Likewise.
683 (select_decl): Likewise.
684 (unqualified_namespace_lookup): Likewise.
685 (lookup_name_real): Likewise.
686 (lookup_name_current_level): Likewise.
687 (lookup_type_current_level): Likewise.
688 (maybe_inject_for_scope_var): Likewise.
689 (xref_tag): Likewise.
691 * Make-lang.in (cp/decl.o): Add dependency on timevar.h
693 2003-02-12 Phil Edwards <pme@gcc.gnu.org>
695 * decl.c (build_enumerator): Remove unneeded test.
697 2003-02-09 Dan Nicolaescu <dann@ics.uci.edu>
699 * cp-tree.h (struct lang_type_header): Make all fields unsigned
702 2003-02-03 Mark Mitchell <mark@codesourcery.com>
705 * call.c (z_candidate): Add args.
706 (convert_class_to_reference): Set it.
707 (implicit_conversion): Tidy.
708 (add_candidate): Add args parameter.
709 (add_function_candidate): Adjust call to add_candidate.
710 (add_conv_candidate): Likewise.
711 (build_builtin_candidate): Likewise.
712 (build_user_type_conversion_1): Eliminate wasteful tree_cons
714 (build_new_function_call): Likewise.
715 (build_object_call): Likewise.
716 (add_candidates): New function.
717 (build_new_op): Use it.
718 (covert_like_real): Adjust call to build_over_call.
719 (build_over_call): Remove args parameter.
720 * operators.def: Add <?= and >?=.
722 2003-02-01 Richard Sandiford <rsandifo@redhat.com>
724 * typeck.c (build_indirect_ref): Don't check flag_volatile.
726 2003-01-31 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
729 * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL.
731 2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
733 * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
734 BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
735 (BINFO_LANG_ELTS): New #define.
736 * tree.c (make_binfo): Use BINFO_LANG_ELTS.
738 2003-01-30 Geoffrey Keating <geoffk@apple.com>
740 * cp/Make-lang.in: Remove -Wno-error from cp/decl.o.
742 2003-01-30 Mark Mitchell <mark@codesourcery.com>
744 * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY
746 * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit
747 rather than TYPE_LANG_FLAG_0.
748 (TYPE_BUILT_IN): Remove.
749 (TYPE_DEPENDENT_P): New macro.
750 (TYPE_DEPENDENT_P_VALID): Likewise.
751 (lang_type_class): Add fields_readonly.
752 * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN.
753 * pt.c (dependent_type_p_r): New function, split out from ...
754 (dependent_type_p): ... here. Memoize results.
755 * search.c (dependent_base_p): Use dependent_type_p, not
757 * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY
760 2003-01-29 Mark Mitchell <mark@codesourcery.com>
762 * call.c (build_field_call): Use build_new_op, not build_opfncall.
763 (prep_operand): New function.
764 (build_new_op): Use it. Remove dead code.
765 * class.c (pushclass): Change "modify" parameter type from int to
767 (currently_open_class): Use same_type_p, not pointer equality.
768 (push_nested_class): Adjust calls to pushclass, remove modify
770 * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
771 (pushclass): Change prototype.
772 (push_nested_class): Likewise.
773 (grokoptypename): Remove.
774 (build_opfncall): Remove.
775 (value_dependent_expression_p): Declare.
776 (resolve_typename_type): Likewise.
777 (resolve_typename_type_in_current_instantiation): Likewise.
778 (enter_scope_of): Remove.
780 (tsubst_expr): Likewise.
781 (tsubst_copy): Likewise.
782 (tsubst_copy_and_build): Likewise.
783 * decl.c (warn_about_implicit_typename_lookup): Remove.
784 (finish_case_label): Return error_mark_node for erroneous labels.
785 (start_decl): Adjust calls to push_nested_class.
786 (grokfndecl): Call push_scope/pop_scope around call to
788 (grokdeclarator): Do not call tsubst.
789 (start_function): Adjust calls to push_nested_class.
790 * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
791 (check_classfn): Use push_scope/pop_scope around type comparisions.
792 (grokoptypename): Remove.
793 (push_sscope): Adjust call to push_nested_class.
794 * error.c (dump_type): Show cv-qualification of typename types.
795 * init.c (build_member_call): Use build_new_op, not
797 * method.c (build_opfncall): Remove.
798 * parser.c (cp_parser): Add allow_non_constant_expression_p and
799 non_constant_expression_p.
800 (cp_parser_constant_expression): Adjust prototype.
801 (cp_parser_resolve_typename_type): Remove.
802 (cp_parser_non_constant_expression): New function.
803 (cp_parser_non_constant_id_expression): Likewise.
804 (cp_parser_new): Set allow_non_constant_expression_p and
805 non_constant_expression_p.
806 (cp_parser_primary_expression): Reject `this' and `va_arg' in
807 constant-expressions. Note that dependent names aren't really
809 (cp_parser_postfix_expression): Reject conversions to non-integral
810 types in constant-expressions. Neither are increments or
812 (cp_parser_unary_expression): Reject increments and decrements in
813 constant-expressions.
814 (cp_parser_direct_new_declarator): Adjust call to
815 cp_parser_constant_expression.
816 (cp_parser_cast_expression): Reject conversions to non-integral
817 types in constant-expressions.
818 (cp_parser_assignment_expression): Rejects assignments in
819 constant-expressions.
820 (cp_parser_expression): Reject commas in constant-expressions.
821 (cp_parser_labeled_statement): Adjust call to
822 cp_parser_constant_expression.
823 (cp_parser_direct_declarator): Simplify array bounds, even in
824 templates, when they are non-dependent. Use
825 resolve_typename_type, not cp_parser_resolve_typename_type.
826 (cp_parser_class_head): Use resolve_typename_type, not
827 cp_parser_resolve_typename_type.
828 (cp_parser_member_declaration): Adjust call to
829 cp_parser_constant_expression.
830 (cp_parser_constant_initializer): Likewise.
831 (cp_parser_constructor_declarator): Use resolve_typename_type, not
832 cp_parser_resolve_typename_type.
833 (cp_parser_late_parsing_default_args): Adjust call to
835 * pt.c (tsubst): Give it internal linkage.
836 (tsubst_expr): Likewise.
837 (tsubst_copy): Likewise.
838 (tsubst_copy_and_build): Likewise.
839 (push_access_scope_real): Likewise.
840 (tsubst_friend_class): Likewise.
841 (instantiate_class_template): Adjust call to pushclass.
842 (value_dependent_expression_p): Give it external linkage.
844 (resolve_typename_type): New function.
845 * semantics.c (finish_call_expr): Use build_new_op, not
847 (begin_constructor_declarator): Remove.
848 (begin_class_definition): Adjust call to pushclass.
849 (enter_scope_of): Remove.
850 * typeck.c (comptypes): Resolve typename types as appropriate.
851 (build_x_indirect_ref): Use build_new_op, not build_opfncall.
852 (build_x_compound_expr): Likewise.
853 (build_modify_expr): Likewise.
854 (build_x_modify_expr): Likewise.
855 * typeck2.c (build_x_arrow): Likewise.
857 2003-01-29 Fariborz Jahanian <fjahanian@apple.com>
859 * pt.c (last_pending_template) Declare GTY().
861 2003-01-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
864 * parser.c (cp_parser_elaborated_type_specifier): Convert
865 TEMPLATE_DECL to TYPE_DECL only when processing template friends.
866 (cp_parser_maybe_treat_template_as_class): Remove redundant tests.
868 2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
871 * pt.c (unify): Don't unify '*T' with 'U C::*'.
874 * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
877 2003-01-27 Nathan Sidwell <nathan@codesourcery.com>
879 * class.c (update_vtable_entry_for_fn): Add index parameter.
880 Generate vcall thunk for covariant overriding from a virtual
882 (dfs_modify_vtables): Adjust.
884 2003-01-25 Nathan Sidwell <nathan@codesourcery.com>
887 * parser.c (cp_parser_class_or_namespace_name): Reject duplicate
889 (cp_parser_base_specifier): Look for and consume a
890 TEMPLATE keyword. Replace switch with array index.
893 * semantics.c (finish_non_static_data_member): Remember the
894 field's type even in a template.
897 * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are
901 * parser.c (cp_parser_cast_expression): Be more tentative.
903 2003-01-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
905 * cp-tree.h (flagged_type_tree_s): Remove.
906 (check_for_new_type): Likewise.
907 * typeck2.c (check_for_new_type): Likewise.
909 2003-01-23 Nathanael Nerode <neroden@gcc.gnu.org>
911 * dump.c: ANSIfy function declarations and definitions.
913 * cp-tree.h, decl.h: Get rid of PARAMS. Again.
915 2003-01-22 Mark Mitchell <mark@codesourcery.com>
918 * init.c (build_new): Set the type of the new-expression, even
919 when processing_templte_decl.
922 * parser.c (cp_parser_primary_expression): Improve error message
923 for templates used in an expression context.
926 * parser.c (cp_parser_decl_specifier_seq): Commit to tentative
927 parse when encountering "typedef".
929 2003-01-22 Nathanael Nerode <neroden@gcc.gnu.org>
931 * class.c, parser.c: ANSIfy function definitions and declarations.
933 2003-01-22 Mark Mitchell <mark@codesourcery.com>
936 * error.c (dump_decl): For an OVERLOAD, just print the name of the
937 function; it doesn't make sense to try to print its type.
938 * semantics.c (finish_typeof): Issue errors about invalid uses.
941 * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New
943 (cp_parser_expression_statement): Use it.
944 (cp_parser_explicit_instantiation): Likewise.
945 * pt.c (do_decl_instantiation): Improve error handling logic.
947 2003-01-22 Mark Mitchell <mark@codesourcery.com>
950 * parser.c (cp_parser_using_declaration): Issue error messages
951 about name resolution failures here.
954 * class.c (currently_open_derived_class): Use dependent_type_p.
955 * cp-tree.h (dependent_type_p): New function.
956 (dependent_template_arg_p): Likewise.
957 (dependent_template_p): Likewise.
958 (type_dependent_expression_p): Likewise.
959 * parser.c (cp_parser_dependent_type_p): Remove.
960 (cp_parser_value_dependent_type_p): Likewise.
961 (cp_parser_type_dependent_expression_p): Likewise.
962 (cp_parser_dependent_template_arg_p): Likewise.
963 (cp_parser_dependent_template_id_p): Likewise.
964 (cp_parser_dependent_template_p): Likewise.
965 (cp_parser_diagnose_invalid_type_name): Replace
966 cp_parser_dependent_type_p with dependent_type_p, etc.
967 (cp_parser_primary_expresion): Likewise.
968 (cp_parser_nested_name_specifier_opt): Likewise.
969 (cp_parser_postfix_expression): Likewise.
970 (cp_parser_unary_expression): Likewise.
971 (cp_parser_template_name): Likewise.
972 (cp_parser_class_name): Likewise.
973 (cp_parser_lookup_name): Likewise.
974 * pt.c (dependent_type_p): New function.
975 (value_dependent_expression_p): Likewise.
976 (type_dependent_expression_p): Likewise.
977 (dependent_template_arg_p): Likewise.
978 (dependent_template_id_p): Likewise.
979 (dependent_template_p): Likewise.
983 * parser.c (cp_parser_simple_declaration): Return quickly when
986 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
988 Make-lang.in (cp/decl.o-warn): Add -Wno-error.
990 2003-01-17 Jason Merrill <jason@redhat.com>
992 PR c++/9167, c++/9358
993 * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
995 2003-01-17 Jason Merrill <jason@redhat.com>
998 * call.c (build_conditional_expr): Always do lvalue-rvalue
1001 2003-01-17 Mark Mitchell <mark@codesourcery.com>
1004 * cp-tree.def (BASELINK): Make it class 'x', not class 'e'.
1005 * cp-tree.h (BASELINK_BINFO): Adjust.
1006 (BASELINK_FUNCTIONS): Likewise.
1007 (BASELINK_ACCESS_BINFO): Likewise.
1008 (tree_baselink): New structure.
1009 (cp_tree_node_structure_enum): Add TS_CP_BASELINK.
1010 (lang_tree_node): Add baselink.
1011 * decl.c (cp_tree_node_structure): Add BASELINK case.
1012 * search.c (build_baselink): Adjust.
1013 * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P
1014 test from TREE_LIST case.
1017 * parser.c (cp_parser_constructor_declarator_p): Do not assume
1018 that a constructor cannot be declared outside of its own class.
1020 * parser.c (cp_parser_resolve_typename_type): If the scope cannot
1021 be resolved, neither can the qualified name.
1023 * rtti.c (get_pseudo_ti_desc): Fix thinko.
1025 2003-01-16 Jason Merrill <jason@redhat.com>
1028 * init.c (build_vec_init): Re-add maxindex parm.
1029 (perform_member_init, build_aggr_init): Pass it.
1030 (build_new_1): Pass it. Use an incomplete array type for full_type.
1031 * typeck.c (build_modify_expr): Pass it.
1032 * cp-tree.h: Adjust.
1034 2003-01-16 Jeffrey D. Oldham <oldham@codesourcery.com>
1036 * cp-tree.h (tsubst_copy_and_build): New declaration.
1037 * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment.
1038 (tsubst_expr): Use 'tsubst_copy_and_build'. Update initial comment.
1039 (tsubst_copy_and_build): New function.
1041 2003-01-16 Mark Mitchell <mark@codesourcery.com>
1043 * cp-tree.h (lang_type_class): Remove is_partial_instantiation.
1044 (PARTIAL_INSTANTIATION_P): Remove.
1045 (IMPLICIT_TYPENAME_P): Likewise.
1046 (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise.
1047 (build_typename_type): Remove declaration.
1048 (parmlist_is_exprlist): Likewise.
1049 * decl.c (build_typename_type): Make it static, remove third
1051 (push_class_binding): Don't do implicit typename stuff.
1052 (make_typename_type): Likewise.
1053 (lookup_name_real): Likewise.
1054 (grokdeclarator): Don't try to convert declarations into
1055 initializations. Don't do implicit typename stuff.
1056 (parmlist_is_exprlist): Remove.
1057 (xref_basetypes): Simplify.
1058 * decl2.c (grokfield): Don't try to convert declarations into
1060 (build_anon_union_vars): Do this while processing templates, too.
1061 (finish_anon_union): Likewise.
1062 * error.c (dump_type): Remove implicit typename handling.
1063 * parser.c (cp_parser_diagnose_invalid_type_name): New method.
1064 (cp_parser_primary_expression): Correct handling of names not
1065 found by unqualified name lookup in templates.
1066 (cp_parser_nested_name_specifier_opt): Avoid checking dependency
1067 of types when possible.
1068 (cp_parser_simple_declaration): Complain intelligently about some
1069 invalid declarations.
1070 (cp_parser_member_declaration): Likewise.
1071 (cp_parser_constructor_declarator_p): Don't check when we're in a
1073 * pt.c (instantiate_class_template): Remove
1074 PARTIAL_INSTANTIATION_P gunk.
1075 * search.c (lookup_field_r): Don't build implicit typenames.
1076 (marked_pushdecls_p): Don't enter dependent base types.
1077 (unmarked_pushdecls_p): Likewise.
1078 * semantics.c (begin_class_definition): Remove implicit typename
1081 2003-01-16 Nathan Sidwell <nathan@codesourcery.com>
1084 * parser.c (cp_parser_direct_declarator): If accepting either
1085 abstract or named, the name must be an unqualified-id.
1087 2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1089 * class.c (layout_virtual_bases): Avoid signed/unsigned warning.
1091 2003-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1093 * decl2.c (check_classfn): Fix uninitialized warning.
1094 (build_anon_union_vars): Likewise.
1095 * pt.c (tsubst_copy): Likewise.
1097 2003-01-14 Jeffrey D. Oldham <oldham@codesourcery.com>
1099 Further conform g++'s __vmi_class_type_info to the C++ ABI
1101 * rtti.c (dfs_class_hint_mark): Do not set hints not specified by
1103 (class_hint_flags): Likewise.
1105 2003-01-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1107 * config-lang.in: Add semantics.c to gtfiles.
1108 * cp-tree.h (flagged_type_tree_s): Remove lookups field.
1109 (saved_scope): Likewise.
1110 (type_lookups): Remove.
1111 (deferred_access): New structure.
1112 (type_access_control): Remove.
1113 (save_type_access_control): Likewise.
1114 (reset_type_access_control): Likewise.
1115 (decl_type_access_control): Likewise.
1116 (push_deferring_access_checks): Declare.
1117 (resume_deferring_access_checks): Likewise.
1118 (stop_deferring_access_checks): Likewise.
1119 (pop_deferring_access_checks): Likewise.
1120 (get_deferred_access_checks): Likewise.
1121 (pop_to_parent_deferring_access_checks): Likewise.
1122 (perform_deferred_access_checks): Likewise.
1123 (perform_or_defer_access_check): Likewise.
1124 * decl.c (make_typename_type): Use perform_or_defer_access_check.
1125 (make_unbound_class_template): Likewise.
1126 (grokdeclarator): Don't call decl_type_access_control.
1127 * parser.c (cp_parser_context): Remove deferred_access_checks
1128 and deferring_access_checks_p fields.
1129 (cp_parser_context_new): Adjust.
1130 (cp_parser): Remove access_checks_lists.
1131 (cp_parser_defer_access_check): Remove.
1132 (cp_parser_start_deferring_access_checks): Remove.
1133 (cp_parser_stop_deferring_access_checks): Remove.
1134 (cp_parser_perform_deferred_access_checks): Remove.
1135 (cp_parser_nested_name_specifier_opt): Use new deferred access
1137 (cp_parser_simple_declaration): Likewise.
1138 (cp_parser_template_id): Likewise.
1139 (cp_parser_function_definition): Likewise.
1140 (cp_parser_class_specifier): Likewise.
1141 (cp_parser_lookup_name): Likewise.
1142 (cp_parser_single_declaration): Likewise.
1143 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
1144 (cp_parser_parse_tentatively): Likewise.
1145 (cp_parser_parse_definitely): Likewise.
1146 (yyparse): Likewise.
1147 (cp_parser_init_declarator): Remove access_checks parameter.
1148 Use new deferred access functions.
1149 (cp_parser_function_definition_from_specifiers_and_declarator):
1151 (cp_parser_class_head): Remove deferring_access_checks_p and
1152 saved_access_checks parameters. Use new deferred access functions.
1153 (cp_parser_member_specification_opt): Don't call
1154 reset_type_access_control.
1155 * search.c (type_access_control): Remove.
1156 * semantics.c: Include "gt-cp-semantics.h".
1157 (deferred_type_access_control): Remove.
1158 (deferred_access_stack): New variable.
1159 (deferred_access_free_list): Likewise.
1160 (push_deferring_access_checks): New function.
1161 (resume_deferring_access_checks): Likewise.
1162 (stop_deferring_access_checks): Likewise.
1163 (pop_deferring_access_checks): Likewise.
1164 (get_deferred_access_checks): Likewise.
1165 (pop_to_parent_deferring_access_checks): Likewise.
1166 (perform_deferred_access_checks): New function, adapted from
1167 cp_parser_perform_deferred_access_checks.
1168 (perform_or_defer_access_check): New function, adapted from
1169 cp_parser_defer_access_check.
1170 (current_type_lookups): Remove.
1171 (deferred_type_access_control): Likewise.
1172 (decl_type_access_control): Likewise.
1173 (save_type_access_control): Likewise.
1174 (reset_type_access_control): Likewise.
1175 (begin_function_definition): Adjust.
1176 (begin_class_definiton): Likewise.
1178 2003-01-13 Jason Merrill <jason@redhat.com>
1181 * class.c (build_base_path): Take the address before calling save_expr.
1183 * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
1184 all the ambiguous conversions are bad.
1186 * class.c (maybe_warn_about_overly_private_class): Don't stop
1187 searching when we find a nonprivate method.
1189 * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue.
1191 2003-01-12 Mark Mitchell <mark@codesourcery.com>
1193 * cp-tree.h (get_arglist_len_in_bytes): Remove.
1196 * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
1197 typeame types more robustly.
1199 2003-01-11 Phil Edwards <pme@gcc.gnu.org>
1201 * parser.c: Fix comment typos.
1203 2003-01-10 Mark Mitchell <mark@codesourcery.com>
1206 * parser.c (cp_parser_scope_through_which_access_occurs): Handle
1207 an object_type which is not a class type.
1209 2003-01-10 Geoffrey Keating <geoffk@apple.com>
1211 * parser.c (cp_parser_late_parsing_for_member): Don't cast to void.
1212 (cp_parser_late_parsing_default_args): Likewise.
1214 2003-01-10 Nathanael Nerode <neroden@gcc.gnu.org>
1216 * cfns.gperf: ANSIfy function declarations.
1217 * cfns.h: Regenerate.
1218 * cp-tree.h: ANSIfy function declarations.
1220 2003-01-10 Mark Mitchell <mark@codesourcery.com>
1222 * cp-tree.h (reparse_absdcl_as_expr): Remove.
1223 (reparse_absdcl_as_casts): Likewise.
1224 (reparse_decl_as_expr): Likewise.
1225 (finish_decl_parsing): Likewise.
1226 * decl2.c (reparse_absdcl_as_expr): Remove.
1227 (reparse_absdcl_as_casts): Likewise.
1228 (repase_decl_as_expr): Likewise.
1229 (finish_decl_parsing): Likewise.
1234 * parser.c (cp_parser_pre_parsed_nested_name_specifier): New
1236 (cp_parser_nested_name_specifier_opt): Correct the
1237 check_dependency_p false.
1238 (cp_parser_postfix_expression): Fix formatting.
1239 (cp_parser_decl_specifier_seq): Avoid looking for constructor
1240 declarators when possible.
1241 (cp_parser_template_id): Avoid performing name-lookup when
1243 (cp_parser_class_head): Do not count specializations when counting
1244 levels of templates.
1245 (cp_parser_constructor_declarator_p): Return immediately if
1246 there's no chance that the tokens form a constructor declarator.
1247 * rtti.c (throw_bad_typeid): Add comment. Do not return an
1248 expression with reference type.
1249 (get_tinfo_decl_dynamic): Do not return an expression with
1251 (build_typeid): Add comment. Do not return an expression with
1253 * typeck.c (build_class_member_access_expr): Improve handling of
1254 conditionals and comma-expressions as objects.
1256 2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
1258 * cfns.gperf: ANSIfy function declarations.
1259 * cfns.h: Regenerate.
1260 * cp-tree.h: ANSIfy function declarations.
1261 * parser.c: ANSIfy function declarations & definitions.
1263 * decl.c (bad_specifiers): Fix parameter order error I introduced.
1265 2003-01-09 Geoffrey Keating <geoffk@apple.com>
1267 Merge from pch-branch:
1269 2003-01-09 Geoffrey Keating <geoffk@apple.com>
1271 Merge to tag pch-merge-20030102:
1273 * semantics.c (finish_translation_unit): Don't call finish_file.
1274 * parser.c: Don't include ggc.h.
1275 (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer,
1276 read first token here. Don't allow PCH files after the first
1278 (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new.
1279 (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL.
1280 (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory.
1281 (cp_parser_late_parsing_for_member): Don't duplicate call to
1282 cp_lexer_set_source_position_from_token.
1283 (cp_parser_late_parsing_default_args): Likewise.
1284 (yyparse): Call finish_file after clearing the_parser.
1286 2002-12-11 Geoffrey Keating <geoffk@apple.com>
1288 * Make-lang.in: Remove $(GGC_H) from all dependencies.
1289 (CXX_TREE_H): Add $(GGC_H).
1290 * class.c: Don't include ggc.h.
1291 (field_decl_cmp): Make parameters be 'const void *' to match qsort.
1292 (method_name_cmp): Likewise.
1293 (resort_data): New variable.
1294 (resort_field_decl_cmp): New.
1295 (resort_method_name_cmp): New.
1296 (resort_sorted_fields): New.
1297 (resort_type_method_vec): New.
1298 (finish_struct_methods): Delete cast.
1299 (finish_struct_1): Delete cast.
1300 * cp-tree.h: Include ggc.h.
1301 (struct lang_type_class): Add reorder attribute to field `methods'.
1302 (union lang_decl_u3): Add reorder attribute to field `sorted_fields'.
1303 (resort_sorted_fields): New prototype.
1304 (resort_type_method_vec): New prototype.
1305 * call.c: Don't include ggc.h.
1307 * decl2.c: Likewise.
1310 * method.c: Likewise.
1311 * optimize.c: Likewise.
1312 * parse.y: Likewise.
1315 * search.c: Likewise.
1316 * semantics.c: Likewise.
1320 * lang-specs.h: Remove comment.
1322 2002-12-03 Geoffrey Keating <geoffk@apple.com>
1324 * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery.
1325 (operator_name_info): Mark to be saved for PCH, specify size.
1326 (assignment_operator_name_info): Likewise.
1328 2002-11-19 Geoffrey Keating <geoffk@apple.com>
1330 * decl.c (anon_cnt): Mark to be saved for PCH.
1332 2002-10-25 Geoffrey Keating <geoffk@apple.com>
1334 * lex.c (init_reswords): Delete now-untrue comment.
1335 Allocate ridpointers using GGC.
1337 2002-10-04 Geoffrey Keating <geoffk@apple.com>
1339 * cp-tree.h (union lang_decl_u2): Add tags to all fields.
1341 * g++spec.c (lang_specific_driver): Don't include standard
1342 libraries in `added'.
1344 2002-08-27 Geoffrey Keating <geoffk@redhat.com>
1346 * decl2.c (finish_file): Call c_common_write_pch.
1347 * Make-lang.in (CXX_C_OBJS): Add c-pch.o.
1349 2002-08-17 Geoffrey Keating <geoffk@redhat.com>
1351 * g++spec.c (lang_specific_driver): Treat .h files as C++ header
1352 files when using g++.
1353 * lang-specs.h: Handle compiling C++ header files.
1355 2003-01-09 Jakub Jelinek <jakub@redhat.com>
1357 * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs.
1359 2003-01-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1361 * pt.c (push_access_scope_real): Call push_to_top_level for
1362 function in namespace scope.
1363 (pop_access_scope): Call pop_from_top_level for function in
1366 2003-01-09 Jakub Jelinek <jakub@redhat.com>
1368 * decl.c (start_decl): Don't set DECL_COMMON for __thread variables.
1370 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
1372 * Make-lang.in (c++.install-common, c++.install-man,
1373 c++.uninstall): Prepend $(DESTDIR) to destination paths in
1374 all (un)installation commands.
1375 (c++.install-common): Rewrite $(LN) commands to support
1376 DESTDIR with "ln" as well as with "ln -s".
1378 2003-01-08 Jason Merrill <jason@redhat.com>
1380 * parser.c (cp_parser_primary_expression): See through explicitly
1381 scoped ALIAS_DECLs, too.
1383 2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
1385 * decl.c: Remove some #if 0 code.
1387 * decl.c: ANSIfy function declarations.
1389 2003-01-07 Mark Mitchell <mark@codesourcery.com>
1391 * parser.c (cp_parser_asm_definition): Correct handling of omitted
1394 2003-01-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1397 * decl.c (make_typename_type): Check access only when tf_error.
1398 (make_unbound_class_template): Likewise.
1399 * pt.c (saved_access_scope): New variable.
1400 (push_access_scope_real): New function.
1401 (push_access_scope): Likewise.
1402 (pop_access_scope): Likewise.
1403 (tsubst_default_argument): Use them.
1404 (instantiate_template): Likewise.
1405 (regenerate_decl_from_template): Likewise.
1406 (instantiate_decl): Likewise.
1407 (get_mostly_instantiated_function_type): Likewise.
1409 2003-01-07 Nathanael Nerode <neroden@gcc.gnu.org>
1411 * tree.c: Delete bogus #if 0 code.
1413 2003-01-07 Andreas Schwab <schwab@suse.de>
1415 * class.c (layout_class_type): Don't use
1416 PCC_BITFIELD_TYPE_MATTERS if not defined.
1418 2003-01-06 Mark Mitchell <mark@codesourcery.com>
1421 * decl2.c (build_cleanup): Mark the object as used.
1423 * pt.c (retrieve_local_specialization): Revert 2003-01-05 change.
1424 (hash_local_specialization): New function.
1425 (register_local_specialization): Revert 2003-01-05 change.
1426 (instantiate_decl): Use hash_local_specialization when creating
1427 the local_specializations table.
1429 * decl2.c (mark_used): Do not synthesize thunks.
1431 * class.c (layout_class_type): Correct handling of unnamed
1432 bitfields wider than their types.
1435 * parser.c (cp_parser): Remove default_arg_types. Update
1436 documentation for unparsed_functions_queues.
1437 (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the
1439 (cp_parser_new): Don't set parser->default_arg_types.
1440 (cp_parser_function_definition): Adjust usage of
1441 unparsed_funtions_queues.
1442 (cp_parser_class_specifier): Don't mess with
1443 parser->default_arg_types. Handle default argument processing in
1444 a separate phase from function body processing.
1445 (cp_parser_template_declaration_after_export): Adjust usage of
1446 unparsed_functions_queues.
1447 (cp_parser_late_parsing_for_member): Do not handle default
1450 2003-01-06 Nathan Sidwell <nathan@codesourcery.com>
1453 * parser.c (cp_parser_declarator_kind): New enum.
1454 (cp_parser_declarator): Adjust.
1455 (cp_parser_direct_declarator): Adjust. Allow for either named or
1456 abstract declarator. Prefer abstract, if possible. Allow
1457 parenthesized function name.
1458 (cp_parser_condition): Adjust cp_parser_declarator call.
1459 (cp_parser_explicit_instantiation): Likewise.
1460 (cp_parser_init_declarator): Likewise.
1461 (cp_parser_type_id): Likewise.
1462 (cp_parser_function_definition): Likewise.
1463 (cp_parser_member_declaration): Likewise.
1464 (cp_parser_parameter_declaration): Use cp_parser_declarator to do
1465 the tentative parsing.
1466 (cp_parser_exception_declaration): Likewise.
1468 2003-01-05 Mark Mitchell <mark@codesourcery.com>
1470 * parser.c (cp_parser_template_parameter): Adjust call to
1471 cp_parser_parameter_declaration.
1472 (cp_parser_parameter_declaration_list): Likewise.
1473 (cp_parser_parameter_declaration): Replace
1474 greater_than_is_operator_p with template_parm_p parameter. Do not
1475 cache tokens for template default arguments.
1477 * pt.c (retrieve_local_specialization): Use htab_find, not
1478 htab_find_with_hash.
1479 (register_local_specialization): Use htab_find_slot, not
1480 htab_find_slot_with_hash.
1481 (instantiate_decl): Pass a hash function to htab_create.
1483 2003-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1485 * parser.c (cp_parser_binary_expression,
1486 cp_parser_multiplicative_expression,
1487 cp_parser_additive_expression, cp_parser_shift_expression,
1488 cp_parser_relational_expression, cp_parser_equality_expression,
1489 cp_parser_and_expression, cp_parser_exclusive_or_expression,
1490 cp_parser_inclusive_or_expression,
1491 cp_parser_logical_and_expression, cp_parser_logical_or_expression,
1492 cp_parser_binary_expression): Const-ify.
1494 2003-01-04 Mark Mitchell <mark@codesourcery.com>
1496 * method.c (use_thunk): Disable access control while building the
1499 2003-01-03 Nathanael Nerode <neroden@gcc.gnu.org>
1501 * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C
1504 2003-01-03 Matt Austern <austern@apple.com>
1506 * cp-tree.h (struct lang_type_class): add field for key method
1507 (cp_global_trees): rename dynamic_classes to keyed_classes
1508 (key_method): add definition
1509 * class.c (finish_struct_1): compute class's key method, and add
1510 the class to keyed_classes list if there is no key method.
1511 * decl.c (finish_function): add class to keyed_classes list if we
1512 see a definition of the class's key method.
1513 * pt.c (instantiate_class_template): add template specialization
1514 of a dynamic class to keyed_classes list.
1515 * decl2.c (key_method): remove
1516 (finish_file): iterate only through keyed_classes list when
1517 deciding whether to emit vtables, remove class from its list after
1520 2003-01-02 Jason Merrill <jason@redhat.com>
1522 * call.c (build_conditional_expr): Stabilize lvalues properly.
1523 * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type.
1524 * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues.
1525 Don't allow CALL_EXPR or VA_ARG_EXPR, either.
1527 * call.c (convert_like_real): Call decl_constant_value for an
1528 IDENTITY_CONV even if there are no more conversions.
1530 * cvt.c (build_up_reference): Don't push unnamed temps.
1532 * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL.
1534 * dump.c (cp_dump_tree): Don't try to dump class-specific fields
1535 for a backend struct.
1537 * except.c (wrap_cleanups_r, build_throw): Make
1538 MUST_NOT_THROW_EXPRs void.
1539 * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR.
1541 * init.c (build_vec_delete_1): Pre-evaluate the base address.
1543 * init.c (get_temp_regvar): Simplify logic.
1545 * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if
1546 our replacement is a decl.
1548 * decl.c (cp_make_fname_decl): Push the decls inside the
1551 2003-01-03 Nathan Sidwell <nathan@codesourcery.com>
1554 * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be
1557 2003-01-03 Graham Stott <graham.stott@btinternet.com>
1559 * parser.c (struct cp_parser): Add access_checks_lists field
1560 (cp_parser_simple_declaration): Use.
1561 (cp_parser_init_declarator): Likewise.
1563 2003-01-02 Mark Mitchell <mark@codesourcery.com>
1565 * parser.c (cp_parser_declaration): Accept the __extension__
1566 keyword before the declaration.
1569 * parser.c (cp_parser_parameter_declaration): Allow attributes to
1570 appear after the declarator.
1572 * call.c (build_new_method_call): Fix typo in message format
1575 2003-01-02 Mark Mitchell <mark@codesourcery.com>
1577 * parser.c (cp_lexer_next_token_is): Declare it inline.
1578 (cp_lexer_set_source_position_from_token): Likewise.
1579 (cp_lexer_debugging_p): Likewise.
1580 (cp_parser_parsing_tentatively): Likewise.
1581 (cp_parser_nested_name_specifier_opt): Reduce the number of calls
1582 to the cp_lexer_peek_token.
1584 * parser.c (cp_parser_sizeof_operand): Do not evaluate the
1587 2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
1589 * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c,
1590 cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c,
1591 cp/repo.c: Fix copyright years.
1593 2003-01-01 Neil Booth <neil@daikokuya.co.uk>
1595 * lex.c: Remove superfluous include of cpplib.h.
1596 (CONSTRAINT): Define without conditions.
1597 (init_cp_pragma): Use c_register_pragma.
1599 2002-12-31 Neil Booth <neil@daikokuya.co.uk>
1601 * .cvsignore: Remove.
1603 2002-12-31 Steven Bosscher <s.bosscher@student.tudelft.nl>
1605 * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
1606 except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
1607 lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
1608 pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
1609 typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
1611 * lex.h: parse.y is dead, so don't mention it. Also replace the
1612 copyright header with the default GNU copyright header.
1614 2002-12-31 Mark Mitchell <mark@codesourcery.com>
1616 * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove.
1617 (lookup_name_namespace_only): Likewise.
1618 (begin_only_namespace_names): Likewise.
1619 (end_only_namespace_names): Likewise.
1620 * decl.c (only_namespace_names): Remove.
1621 (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED.
1622 (lookup_name_real): Do not check only_namespace_names.
1623 (lookup_name_namespace_only): Remove.
1624 (begin_only_namespace_names): Likewise.
1625 (end_only_namespace_names): Likewise.
1626 * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous
1627 nested-name-specifiers more gracefully.
1628 (cp_parser_class_or_namespace_name): Avoid looking up namespace
1629 names when they cannot possibly appear.
1630 (cp_parser_template_name): Adjust call to cp_parser_lookup_name.
1631 (cp_parser_elaborated_type_specifier): Likewise.
1632 (cp_parser_namespace_name): Only look for namespace names.
1633 (cp_parser_lookup_name): Add is_namespace parameter.
1634 (cp_parser_lookup_name_simple): Adjust call to
1635 cp_parser_lookup_name.
1637 * parser.c (cp_parser_dependent_type_p): Fix thinko.
1639 2002-12-31 Neil Booth <neil@daikokuya.co.uk>
1641 * .cvsignore: Update.
1643 2002-12-31 Nathan Sidwell <nathan@codesourcery.com>
1645 * class.c (modify_vtable_entry): Remove unused variable.
1646 (get_vcall_index): Always expect a non-thunk.
1647 (update_vtable_entry_for_fn): Combine covariant adjustments, when
1648 overriding a thunk. Pass get_vcall_index a non-thunk.
1650 * decl2.c (finish_file): Mark undefined inlines as extern.
1652 2002-12-31 Mark Mitchell <mark@codesourcery.com>
1654 * cp-tree.def (RETURN_INIT): Remove.
1655 * cp-tree.h (DECL_IN_MEMORY_P): Remove.
1656 (scope_kind): Add sk_block, sk_try, sk_catch, sk_for.
1657 (note_level_for_for): Remove.
1658 (note_level_for_try): Likewise.
1659 (note_level_for_catch): Likewise.
1660 (finish_named_return_value): Likewise.
1661 (do_pushlevel): Change prototype.
1662 (pending_lang_change): Remove.
1663 * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch,
1665 (note_level_for_for): Remove.
1666 (note_level_for_try): Likewise.
1667 (note_level_for_catch): Likewise.
1668 (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P.
1669 * parser.c (cp_parser_context_free_list): Make it "deletable".
1670 (cp_parser_template_argument): Remove misleading comment.
1671 * pt.c (tsubst_expr): Remove RETURN_INIT code.
1672 * semantics.c (genrtl_named_return_value): Remove.
1673 (do_pushlevel): Take a scope kind as an argument.
1674 (begin_if_stmt): Adjust.
1675 (begin_while_stmt): Likewise.
1676 (begin_for_stmt): Likewise.
1677 (finish_for_init_stmt): Likewise.
1678 (begin_switch_stmt): Likewise.
1679 (begin_handler): Likewise.
1680 (begin_compound_stmt): Likewise.
1681 (finish_named_return_value): Remove.
1682 (cp_expand_stmt): Remove RETURN_INIT case.
1683 * tree.c (cp_statement_code_p): Remove RETURN_INIT case.
1685 2002-12-31 Mark Mitchell <mark@codesourcery.com>
1688 * parser.c (cp_parser_direct_declarator): Handle erroneous
1689 parenthesized declarators correctly.
1691 2002-12-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
1693 * cp-tree.h (pending_lang_change): Declare.
1695 2002-12-30 Mark Mitchell <mark@codesourcery.com>
1697 * parser.c (cp_parser_context_free_list): New variable.
1698 (cp_parser_context_new): Use it.
1699 (cp_parser_error): Check return code from
1700 cp_parser_simulate_error.
1701 (cp_parser_simulate_error): Return a value.
1702 (cp_parser_id_expression): Optimize common case.
1703 (cp_parser_class_name): Likewise.
1704 (cp_parser_class_specifier): Adjust call to
1705 cp_parser_late_parsing_default_args.
1706 (cp_parser_lookup_name): Optimize common case.
1707 (cp_parser_late_parsing_for_member): Adjust call to
1708 cp_parser_late_parsing_default_args.
1709 (cp_parser_late_parsing_default_args): Add scope parameter.
1710 (cp_parser_require): Avoid creating the error message unless it's
1712 (cp_parser_parse_definitely): Place free'd contexts on the free
1715 * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change.
1717 2002-12-30 David Edelsohn <edelsohn@gnu.org>
1719 * parser.c (cp_parser_parameter_declaration_clause): Treat system
1720 header as extern "C" if NO_IMPLICIT_EXTERN_C undefined.
1722 2002-12-30 Nathanael Nerode <neroden@gcc.gnu.org>
1724 * config-lang.in, Make-lang.in, operators.def, cp-tree.def:
1727 2002-12-30 Mark Mitchell <mark@codesourcery.com>
1731 * Make-lang.in (gt-cp-spew.h): Remove.
1732 * cp-tree.h (do_pending_lang_change): Remove.
1733 (do_identifier): Change prototype.
1734 (finish_id_expr): Remove.
1735 * decl.c (lookup_name_real): Remove yylex variable.
1736 * decl2.c (build_expr_from_tree): Adjust call to do_identifier.
1737 * lex.c (init_cpp_parse): Remove.
1738 (reduce_cmp): Likewise.
1739 (token_cmp): Likewise.
1741 (lastiddecl): Likewise.
1742 (token_count): Likewise.
1743 (reduce_count): Likewise.
1745 (print_parse_statistics): Likewise.
1746 (do_pending_lang_change): Likewise.
1747 (do_identifier): Remove parsing parameter.
1748 * lex.h (lastiddecl): Remove.
1749 (looking_for_typename): Remove.
1750 (looking_for_template): Likewise.
1751 (pending_lang_change): Likewise.
1753 * semantics.c (finish_id_expr): Remove.
1755 * decl.c (grokdeclarator): Diagnost "extern thread" and "static
1758 2002-12-30 Nathanael Nerode <neroden@gcc.gnu.org>
1760 * decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front
1761 end, not the C front end.
1763 2002-12-30 Nathan Sidwell <nathan@codesourcery.com>
1765 * cp-tree.h (THUNK_TARGET): New macro.
1766 (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo.
1767 (finish_thunk): Remove offset parms.
1768 * class.c (find_final_overrider): Look through thunks.
1769 (get_vcall_index): Use THUNK_TARGET.
1770 (update_vtable_entry_for_fn): Look through thunks. Set covariant
1771 fixed offset here. Adjust finish_thunk call.
1772 (build_vtbl_initializer): Adjust finish_thunk calls.
1773 * mangle.c (mangle_call_offset): Remove superfluous if.
1774 (mangle_thunk): Adjust.
1775 * method.c (make_thunk): Adjust.
1776 (finish_thunk): Adjust.
1777 (thunk_adjust): Remove assert.
1778 (use_thunk): Use THUNK_TARGET
1779 * dump1.c (cp_dump_tree): Adjust thunk dumping.
1782 * class.c (layout_class_type): Set TYPE_CONTEXT of type for base.
1783 * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types.
1785 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1787 Remove traditional C constructs 4/n.
1788 * decl2.c (grok_method_quals, warn_if_unknown_interface,
1789 grok_x_components, cp_build_parm_decl, build_artificial_parm,
1790 maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
1791 delete_sanity, check_member_template, check_java_method,
1792 check_classfn, finish_static_data_member_decl, grokfield,
1793 grokbitfield, grokoptypename, grok_function_init,
1794 cplus_decl_attributes, constructor_name, defer_fn,
1795 build_anon_union_vars, finish_anon_union, coerce_new_type,
1796 coerce_delete_type, comdat_linkage, maybe_make_one_only,
1797 key_method, import_export_vtable, import_export_class,
1798 output_vtable_inherit, import_export_decl, import_export_tinfo,
1799 build_cleanup, get_guard, get_guard_bits, get_guard_cond,
1800 set_guard, start_objects, finish_objects,
1801 start_static_storage_duration_function,
1802 finish_static_storage_duration_function, get_priority_info,
1803 start_static_initialization_or_destruction,
1804 finish_static_initialization_or_destruction,
1805 do_static_initialization, do_static_destruction,
1806 prune_vars_needing_no_initialization, write_out_vars,
1807 reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
1808 add_using_namespace, merge_functions, ambiguous_decl,
1809 lookup_using_namespace, lookup_using_namespace,
1810 qualified_lookup_using_namespace, set_decl_namespace,
1811 decl_namespace, current_decl_namespace, push_decl_namespace,
1812 pop_decl_namespace, push_scope, pop_scope, add_function,
1813 arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
1814 lookup_arg_dependent, do_namespace_alias,
1815 validate_nonmember_using_decl, do_nonmember_using_decl,
1816 do_toplevel_using_decl, do_local_using_decl,
1817 do_class_using_decl, do_using_directive, check_default_args,
1818 mark_used, handle_class_head): Use C90 prototypings. Use booleans.
1819 * parser.c (cp_parser_class_head): Use booleanss.
1820 * decl.c (walk_globals, walk_vtables): Likewise.
1821 * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
1822 walk_globals): Change return type from 'int' to 'bool'.
1823 * rtti.c (init_rtti_processing, build_headof, throw_bad_cast
1824 throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
1825 build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
1826 get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
1827 qualifier_flags, tinfo_base_init, generic_initializer,
1828 ptr_initializer, dfs_class_hint_mark, ptm_initializer,
1829 dfs_class_hint_unmark, class_hint_flags, class_initializer,
1830 typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
1831 get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
1832 unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
1833 * repo.c (repo_compile_flags, repo_template_declared,
1834 repo_template_defined, repo_class_defined, repo_get_id,
1835 repo_template_used, repo_vtable_used, repo_inline_used,
1836 repo_tinfo_used, repo_template_instantiated, extract_string,
1837 open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
1838 finish_repo): Likewise.
1839 * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
1840 cxx_print_xnode): Likewise..
1841 * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
1842 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1843 * cxxfilt.c (demangle_it, print_demangler_list, usage,
1844 standard_symbol_characters, hp_symbol_characters, main, fatal):
1846 (strip_underscore): Change type from 'int' to 'bool'.
1847 (main): Use boolean constants.
1849 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1851 Remove traditional C constructs 3/n.
1852 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1853 build_up_reference, warn_ref_binding, convert_to_reference,
1854 convert_from_reference, convert_lvalue, cp_convert, ocp_convert,
1855 convert_to_void, convert, convert_force, build_type_conversion,
1856 build_expr_type_conversion, type_promotes_to,
1857 perform_qualification_conversions): Use C90 prototyping style.
1858 * decl2.c (grok_array_decl): Use boolean constant.
1859 (delete_sanity): Likewise.
1860 * typeck.c (build_unary_op): Likewise.
1861 * semantics.c (finish_switch_cond): Likewise.
1862 * parser.c (cp_parser_direct_new_declarator): Likewise.
1863 * init.c (build_new): Likewise.
1865 2002-12-27 Mark Mitchell <mark@codesourcery.com>
1867 * Make-lang.in (po-generated): Remove parse.c.
1868 (CXX_OBJS): Remove parse.o and spew.o. Add parser.o.
1869 ($(srcdir)/cp/parse.h): Remove target.
1870 ($(srcdir)/cp/parse.c): Likewise.
1871 (gt-cp-parse.h): Likewise.
1872 (gt-cp-parser.h): New target.
1873 (c++.distclean): Do not remove parse.output.
1874 (c++.maintainer-clean): Do not remove parse.c or parse.h.
1875 (cp/spew.o): Remove target.
1876 (cp/lex.o): Adjust dependencies.
1877 (cp/pt.o): Likewise.
1878 (cp/parse.o): Likewise.
1879 (cp/TAGS): Do not mention parse.c.
1880 (cp/parser.o): New target.
1881 * NEWS: Mention the new parser.
1882 * call.c (build_scoped_method_call): Simplify.
1883 (build_method_call): Likewise.
1884 (build_new_function_call): Adjust calls to add_function_candidate
1885 and add_template_candidate.
1886 (build_new_op): Improve handling of erroroneous operands.
1887 (convert_default_arg): Remove circular argument processing.
1888 (name_as_c_string): New function.
1889 (build_new_method_call): Use it.
1890 (perform_implicit_conversion): Use error_operand_p.
1891 * class.c (finish_struct_anon): Use constructor_name_p.
1892 (check_field_decls): Likewise.
1893 (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN.
1894 (resolve_address_of_overloaded_function): Likewise.
1895 (instantiate_type): Tweak pointer-to-member handling.
1896 (get_primary_binfo): Remove incorrect assertion.
1897 * config-lang.in (gtfiles): Add parser.c, remove parse.c.
1898 * cp-tree.h (DEFARG_TOKENS): New macro.
1899 (default_arg): New structure.
1900 (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG.
1901 (lang_tree_node): Add default_arg.
1902 (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE.
1903 (type_info_ref_type): New macro.
1904 (saved_scope): Make processing_explicit_instantiation a boolean.
1905 (check_access): New field.
1906 (unparsed_text): Remove.
1907 (language_function): Remove unparsed_inlines.
1908 (error_operand_p): New macro.
1909 (lang_decl): Adjust pending_inline_info.
1910 (DEFARG_POINTER): Remove.
1911 (tag_types): Add typenames.
1912 (lookup_ualified_name): Declare.
1913 (lookup_name_real): Likewise.
1914 (shadow_tag): Adjust prototype.
1915 (get_scope_of_declarator): Declare it.
1916 (process_next_inline): Remove it.
1917 (check_for_missing_semicolon): Likewise.
1918 (maybe_get_template_decl_from_type_decl): Declare it.
1919 (finish_label_stmt): Adjust prototype.
1920 (finish_non_static_data_meber): Declare it.
1921 (finish_pseudo_destructor_call_expr): Rename to ...
1922 (finish_pseudo_destructor_expr): ... this.
1923 (finish_compound_literal): Declare it.
1924 (begin_inline_definitions): Remove it.
1925 (init_spew): Remove.
1926 (peekyylex): Likewise.
1927 (arbitrate_lookup): Likewise.
1928 (frob_opname): Likewise.
1929 (maybe_snarf_defarg): Likewise.
1930 (add_defarg_fn): Likewise.
1931 (do_pending_defargs): Likewise.
1932 (done_pending_defargs): Likewise.
1933 (unprocessed_defarg_fn): Likewise.
1934 (replace_defarg): Likewise.
1935 (end_input): Likewise.
1936 (get_overloaded_fn): Likewise.
1937 * cvt.c (convert_to_reference): Improve error handling.
1938 * decl.c (lookup_name_real): Do not declare it static.
1939 (maybe_push_to_top_level): Set check_access.
1940 (identifier_type_value): Adjust call to lookup_name_real.
1941 (lookup_qualified_name): New method.
1942 (lookup_name_real): Remove special-case parsing code.
1943 (lookup_name-nonclass): Adjust call to lookup_name_real.
1944 (lookup_name_namespace_only): Likewise.
1945 (lookup_name): Likewise.
1946 (check_tag_decl): Return the type declared.
1947 (shadow_tag): Likewise.
1948 (register_dtor_fn): Tweak check_access.
1949 (grokfndecl): Use constructor_name_p.
1950 (get_scope_of_declarator): New function.
1951 (grokdeclarator): Obscure tweaks for slightly different declarator
1953 (start_method): Return error_mark_node to indicate failure.
1954 (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs.
1955 * decl2.c (constructor_name_full): Simplify.
1956 (constructor_name): Use it.
1957 (build_expr_from_tree): Adjust for changes to do new parser.
1958 (push_scope): Improve robustness.
1959 (validate_nonmember_using_decl): Process declarations, not names.
1960 (do_class_using_decl): Likewise.
1961 (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS
1963 * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs.
1964 * expr.c (cxx_expand_expr): Handle BASELINKs.
1965 * init.c (member_init_ok_or_else): Issue more errors.
1966 (build_offset_ref): Tweak handling of FUNCTION_DECLs.
1967 * lex.c: Do not include parse.h.
1968 (yypring): Do not declare.
1970 (make_reference_declarator): Remove error-generating code.
1971 (rid_to_yy): Remove.
1972 (cxx_init): Do not call init_spew.
1974 (check_for_missing_semicolon): Remove.
1975 * lex.h (got_scope): Remove.
1976 (got_object): Remove.
1977 * method.c (hack_identifier): Use finish_non_static_data_member.
1978 (implicitly_declare_fn): Adjust use of constructor_name.
1979 * parser.c: New file.
1980 * pt.c (parse.h): Do not include it.
1981 (maybe_get_template_decl_from_template): Do not declare it.
1982 (finish_member_template_decl): Tweak.
1983 (begin_explicit_instantiation): Adjust for
1984 processing_explicit_instantiation being boolean.
1985 (end_explicit_instantiation): Likewise.
1986 (maybe_process_partial_specialization): Tighten specialization
1988 (retrieve_local_specialization): Adjust ue of hash table.
1989 (eq_local_specializations): New function.
1990 (register_local_specialization): Likewise.
1991 (push_template_decl_real): Remove unnecessary test.
1992 (maybe_get_template_decl_from_type_decl): Don't make it static.
1993 (for_each_template_parm_r): Handle TYPEOF_TYPE.
1994 (tsubst_copy): Use retrieive_local_specialization to handle
1995 PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs.
1996 Handle COMPONENT_REFs with pseudo-destructor-expressions.
1997 Simplify handling of CALL_EXPR and METHOD_CALL_EXPR.
1998 (tsubst_expr): Pass decls, not names, to do_local_using_decl.
1999 (unify): Tweak handling of CONST_DECLs.
2000 (regenerate_decl_from_template): Use push_nested_class.
2001 (template_for_substitution): New funciton.
2002 (instantiate_decl): Use it. Register parameters as local
2004 * rtti.c (init_rtti_processing): Set type_info_ref_type.
2005 (build_typeid): Use it.
2006 (get_typeid): Likeise.
2007 * search.c (accessible_p): Use check_access, not
2008 flag_access_control.
2009 (adjust_result_of_qualified_name_lookup): Pay attention to the
2011 * semantics.c (finish_asm_stmt): Adjust error handling.
2012 (finish_label_stmt): Return the statement.
2013 (finish_non_static_data_member): New function.
2014 (finish_class_expr): Handle BASELINKs.
2015 (finish_call_expr): Handle PSEUDO_DTOR_EXPR.
2016 (finish_object_call_expr): Simplify handling during templates.
2017 (finish_pseudo_destructor_call_expr): Rename to ...
2018 (finish_pseudo_dtor_expr): ... this.
2019 (finish_compound_literal): New function.
2020 (begin_inline_definitions): Remove.
2021 (finish_sizeof): Remove special template handling.
2022 * spew.c: Do not include parse.h.
2023 * tree.c (get_overloaded_fn): Remove.
2024 * typeck.c (build_class_member_access_expr): Handle
2025 PSEUDO_DTOR_EXPR. Adjust handling of static member functions.
2026 (lookup_destructor): New function.
2027 (finish_class_member_access_expr): Use it.
2028 (convert_arguments): Simplify.
2029 (build_unary_op): Handle BASELINKs.
2031 2002-12-26 Nathan Sidwell <nathan@codesourcery.com>
2034 * decl2.c (mark_used): Defer inline functions.
2035 (finish_file): Merge deferred_fns loops. Check all used
2036 inline functions have a definition.
2037 * method.c (make_thunk): Thunks are not inline.
2039 PR c++/5116, c++/764
2040 * call.c (build_new_op): Make sure template class operands are
2043 2002-12-24 Nathan Sidwell <nathan@codesourcery.com>
2046 * cp-tree.h (resolve_scoped_fn_name): Prototype.
2047 * call.c (resolve_scoped_fn_name): New function. Deal with
2048 more template expansion. Broken out of ...
2049 * parse.y (parse_finish_call_expr): ... here. Call it.
2050 * decl2.c (build_expr_from_tree, CALL_EXPR): Use
2051 resolve_scoped_fn_name and build_call_from_tree.
2054 * decl.c (duplicate_decls): Templates may be disambiguated by
2058 * decl2.c (check_classfn): Use lookup_fnfield_1. List all
2059 conversion operators on failure.
2061 2002-12-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
2063 Remove traditional C constructs 2/n.
2064 * call.c (tourney, build_field_call, equal_functions, joust,
2065 compare_ics, build_over_call, build_java_interface_fn_ref,
2066 convert_like_real, op_error, build_object_call, resolve_args,
2067 build_vfield_ref, check_dtor_name, build_scoped_method_call,
2068 build_addr_func, build_call, build_method_call, null_ptr_cst_p,
2069 sufficient_parms_p, build_conv, non_reference, strip_top_quals,
2070 standard_conversion, reference_related_p,
2071 reference_compatible_p, convert_class_to_reference,
2072 direct_reference_binding, reference_binding,
2073 ,implicit_conversion, is_complete, promoted_arithmetic_type_p,
2074 add_template_conv_candidate, any_viable, any_strictly_viable,
2075 build_this, splice_viable, print_z_candidates,
2076 build_user_type_conversion, build_new_function_call,
2077 conditional_conversion, build_conditional_expr, build_new_op,
2078 build_op_delete_call, enforce_access, call_builtin_trap,
2079 convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to,
2080 convert_default_arg, type_passed_as, convert_for_arg_passing,
2081 in_charge_arg_for_name, is_properly_derived_from,
2082 maybe_handle_implicit_object, maybe_handle_ref_bind,
2083 source_type, add_warning, can_convert, can_convert_arg,
2084 perform_implicit_conversion, can_convert_arg_bad,
2085 initialize_reference, add_conv_candidate,
2086 add_template_candidate_real, add_template_candidate): Ansify.
2088 2002-12-22 Nathan Sidwell <nathan@codesourcery.com>
2091 * cp-tree.h (grokoptypename): Add SCOPE parameter.
2092 * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type
2093 if in a template scope.
2094 * parse.y (unoperator): Return the scope.
2095 (operator_name): Adjust grokoptypename call.
2097 2002-12-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2099 * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t.
2100 * decl.c (make_unbound_class_template): Adjust. Check for tf_error.
2101 * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error.
2103 2002-12-20 Kazu Hirata <kazu@cs.umass.edu>
2105 * ChangeLog: Fix a typo.
2106 * class.c: Fix comment typos.
2107 * cp-tree.h: Likewise.
2109 2002-12-18 Jason Merrill <jason@redhat.com>
2111 Handle anonymous unions at the tree level.
2112 C++ ABI change: Mangle anonymous unions using the name of their
2113 first named field (by depth-first search). Should not cause
2114 binary compatibility problems, though, as the compiler previously
2115 didn't emit anything for affected unions.
2116 * cp-tree.def (ALIAS_DECL): New tree code.
2117 * decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the
2118 first field, not the largest.
2119 (finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME,
2120 push the decl, and write it out at namespace scope.
2121 * decl.c (lookup_name_real): See through an ALIAS_DECL.
2122 (pushdecl): Add namespace bindings for ALIAS_DECLs.
2123 * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
2124 of a decl which doesn't have one.
2125 * typeck.c (build_class_member_access_expr): Don't recurse if
2126 we already have the type we want.
2128 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2131 * friend.c (make_friend_class): Allow partial specialization
2132 when declaration is not a template friend.
2134 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2137 * pt.c (lookup_template_class): Copy TREE_PRIVATE and
2138 TREE_PROTECTED to created decl nodes.
2140 2002-12-18 Mark Mitchell <mark@codesourcery.com>
2142 * class.c (build_base_field): Do not set DECL_PACKED on the
2145 2002-12-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
2147 * cp-tree.h (struct tree_srcloc): Use location_t.
2148 (SOURCE_LOCUS): New.
2149 (SRCLOC_FILE, SRCLOC_LINE): Adjust.
2151 2002-12-17 Jason Merrill <jason@redhat.com>
2153 * decl.c (finish_function): Also complain about no return in
2155 * semantics.c (finish_return_stmt): Also call check_return_expr in
2157 * typeck.c (check_return_expr): In a template, just remember that we
2160 2002-12-16 Jason Merrill <jason@redhat.com>
2162 * semantics.c (simplify_aggr_init_exprs_r): Don't change the type
2165 * semantics.c (do_pushlevel): Call pushlevel after adding the
2167 (do_poplevel): Call poplevel before adding the SCOPE_STMT.
2168 * parse.y (function_body): Go back to using compstmt.
2169 * decl.c (pushdecl): Skip another level to get to the parms level.
2171 * call.c (build_new_method_call): Use is_dummy_object to determine
2172 whether or not to evaluate the object parameter to a static member
2175 2002-12-14 Jason Merrill <jason@redhat.com>
2177 * semantics.c (simplify_aggr_init_exprs_r): Also prepend the
2178 return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR.
2179 * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE,
2180 don't bother with an AGGR_INIT_EXPR.
2181 (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE,
2182 just generate a new decl normally. Take return slot parm.
2183 * cp-tree.h: Adjust prototype.
2185 2002-12-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
2188 * cvt.c (convert_to_pointer_force): Don't try comparing against
2191 2002-12-13 Geoffrey Keating <geoffk@apple.com>
2193 * cp-tree.h: Have the multiple-include guards around
2196 2002-12-10 David Edelsohn <edelsohn@gnu.org>
2198 * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos
2200 (snarf_method): Same.
2201 (snarf_defarg): Same.
2203 2002-12-10 Mark Mitchell <mark@codesourcery.com>
2206 * pt.c (tsubst_copy): Handle destructor names more correctly.
2208 2002-12-10 Matt Austern <austern@apple.com>
2210 * cp-tree.h: get rid of needs_virtual_reinit bit.
2212 2002-12-09 Mark Mitchell <mark@codesourcery.com>
2214 * NEWS: Document removal of in-class initialization extension for
2215 static data members of non-arithmetic, non-enumeration type.
2216 * decl.c (check_static_variable_definition): Do not allow that
2218 * decl2.c (grokfield): Do not call digest_init when processing
2221 2002-12-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2223 * error.c (dump_expr): Fix format specifier warning.
2225 2002-12-04 Geoffrey Keating <geoffk@apple.com>
2227 * class.c (finish_struct_1): Correct comment.
2228 * cp-tree.c (DECL_SORTED_FIELDS): Likewise.
2230 2002-12-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
2233 * error.c (dump_expr): Don't ever try to dump a non-existent
2236 2002-12-03 Nathan Sidwell <nathan@codesourcery.com>
2238 Implement covariant returns.
2239 * cp-tree.h (IS_AGGR_TYPE_2): Remove.
2240 (struct lang_decl_flags): Add this_thunk_p flag.
2241 Rename vcall_offset to virtual_offset.
2242 (struct lang_decl): Rename delta to fixed_offset.
2243 (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines.
2244 (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg.
2245 (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ...
2246 (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here.
2247 (make_thunk): Add this_adjusting arg.
2248 (finish_thunk): Declare.
2249 (mangle_thunk): Add this_adjusting arg.
2250 * class.c (get_vcall_index): Use base function for lookup.
2251 (update_vtable_entry_for_fn): Generate covariant thunk.
2252 (finish_struct_1): Set DECL_VINDEX to NULL for thunks.
2253 (build_vtbl_initializer): Use base function for lookup.
2254 Finish covariant thunk here. Adjust thunk generation.
2255 * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling.
2256 Adjust thunk dumping.
2257 * mangle.c (mangle_call_offset): New function.
2258 (mangle_thunk): Adjust for covariant thunks.
2259 * method.c (make_thunk): Adjust. Do not set name here.
2260 (finish_thunk): New function. Set name here.
2261 (use_thunk): Generate covariant thunks too.
2262 (thunk_adjust): New function.
2263 * search.c (covariant_return_p): Remove. Fold into ...
2264 (check_final_overrider): ... here. Simplify.
2265 * semantics.c (emit_associated_thunks): Walk covariant thunk lists.
2267 2002-12-03 Jason Merrill <jason@redhat.com>
2270 * call.c (build_over_call): Check specifically for TARGET_EXPR
2273 PR c++/8461, c++/8625
2274 * call.c (convert_for_arg_passing): Don't mess with error_mark_node.
2275 (cp_convert_parm_for_inlining): Remove.
2276 * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
2278 * cp-tree.h (ADDR_IS_INVISIREF): Remove.
2279 * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code.
2281 * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on
2282 an ambiguous conversion.
2284 2002-12-03 Mark Mitchell <mark@codesourcery.com>
2287 * decl.c (reshape_init): Handle erroneous initializers.
2289 2002-12-02 Mark Mitchell <mark@codesourcery.com>
2292 * spew.c (remove_last_token): Make sure that last_chunk is set
2296 * error.c (dump_expr): Handle character constants with
2299 2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2302 * decl.c (grokdeclarator): Require class-key for all friend class.
2303 Output the correct type and context in the error message.
2305 2002-12-01 Mark Mitchell <mark@codesourcery.com>
2308 * pt.c (unify): Use variably_modified_type_p to test validity of
2309 template argument types.
2312 * cp-tree.h (lang_type_class): Add typeinfo_var.
2313 (CLASSTYPE_TYPEINFO_VAR): New macro.
2314 * rtti.c (get_tinfo_decl): Use it.
2317 * init.c (expand_member_init): Always get the main variant of a
2320 2002-12-01 Mark Mitchell <mark@codesourcery.com>
2324 * decl.c (cxx_init_decl_processing): Use size_type_node, not
2326 * decl2.c (coerce_new_type): Likewise.
2327 * except.c (do_allocate_exception): Likewise.
2329 2002-11-30 Zack Weinberg <zack@codesourcery.com>
2331 * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c,
2332 dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c,
2333 lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c,
2334 repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
2335 typeck2.c: Include coretypes.h and tm.h.
2336 * Make-lang.in: Update dependencies.
2338 2002-11-30 Mark Mitchell <mark@codesourcery.com>
2341 * decl.c (layout_var_decl): Deal gracefully with erroneous types.
2342 (check_initializer): Validate the type of the initialized
2343 variable, even if the initializer is absent.
2344 * typeck.c (cp_type_quals): Deal gracefully with erroneous types.
2347 * typeck.c (convert_for_assignment): Do not use
2348 decl_constant_value on the operand.
2351 * pt.c (instantiate_decl): Handle template friends defined outside
2352 of the class correctly.
2354 2002-11-29 Joe Buck <jbuck@synopsys.com>
2356 * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
2359 2002-11-29 Mark Mitchell <mark@codesourcery.com>
2361 * class.c (walk_subobject_offsets): Recur on binfos as well as on
2363 (layout_nonempty_base_or_field): Pass it a binfo when processing a
2365 (layout_empty_base): Likewise.
2366 (build_base_field): Likewise.
2368 2002-11-27 Mark Mitchell <mark@codesourcery.com>
2370 * class.c (build_base_field): Make sure we get the canonical base
2371 when descending through primary bases.
2373 2002-11-26 Geoffrey Keating <geoffk@apple.com>
2375 * decl.c (check_initializer): Don't error on initialisation of
2376 a scalar with a brace-enclosed expression.
2378 2002-11-26 Nathan Sidwell <nathan@codesourcery.com>
2380 * cp-tree.h (DECL_LANG_FLAG_4): Document more uses.
2381 (template_parms_equal): Remove prototype.
2382 * typeck.c (buuld_indirect_ref): Reformat.
2384 2002-11-25 Jason Merrill <jason@redhat.com>
2386 * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT
2389 2002-11-25 Mark Mitchell <mark@codesourcery.com>
2391 * tree.c (cp_build_qualified_type_real): Correct handling of
2393 * class.c (walk_subobject_offsets): Fix thinko.
2394 (build_base_field): Record offsets of empty bases in primary
2396 (layout_class_type): Record offsets of empty bases in fields.
2398 * search.c (is_subobject_of_p_1): Fix thinko.
2399 (lookup_field_queue_p): Likewise.
2401 2002-11-24 Mark Mitchell <mark@codesourcery.com>
2403 * class.c (layout_class_type): Reuse tail padding when laying out
2406 2002-11-22 Mark Mitchell <mark@codesourcery.com>
2408 * rtti.c (qualifier_flags): Fix thinko.
2410 2002-11-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
2412 Remove traditional C constructs 1/n.
2413 * cp-tree.h (init_method, set_mangled_name_for_decl,
2414 build_opfncall, hack_identifier, make_thunk, use_thunk,
2415 synthesize_method, implicitly_declare_fn,
2416 skip_artificial_parms_for, optimize_function, calls_setjmp_p,
2417 maybe_clone_body): Remove use of PARAMS.
2419 * method.c (do_build_assign_ref, do_build_copy_constructor,
2420 synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy):
2422 (synthesize_method): Use 'bool' type and constants instead of
2424 (locate_copy): Likewise.
2425 (implicitly_declare_fn): Likewise.
2427 * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function):
2428 Remove old-style declaration.
2429 (maybe_clone_body): Use 'bool' type and constants.
2431 2002-11-21 Glen Nakamura <glen@imodulo.com>
2434 * typeck.c (get_member_function_from_ptrfunc): Make sure that a
2435 SAVE_EXPR for instance_ptr doesn't get evaluated first inside one
2436 of the branches of a COND_EXPR.
2438 2002-11-19 Mark Mitchell <mark@codesourcery.com>
2440 * pt.c (for_each_template_parm): Free allocated memory.
2441 * search.c (is_subobject_of_p_1): New function.
2442 (is_subobject_of_p): Avoid walking virtual bases multiple times.
2444 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
2446 * g++spec.c (lang_specific_spec_functions): New.
2448 2002-11-15 Kazu Hirata <kazu@cs.umass.edu>
2450 * ChangeLog: Follow spelling conventions.
2451 * class.c: Likewise.
2452 * decl2.c: Likewise.
2454 2002-11-14 Zack Weinberg <zack@codesourcery.com>
2456 * search.c (dfs_push_decls): Do not try to reorder elements
2457 3..n of method_vec if method_vec has only two elements.
2458 Reverse order of two tests to avoid accessing unallocated
2461 2002-11-14 Mark Mitchell <mark@codesourcery.com>
2463 * class.c (dfs_find_final_overrider): Adjust so that the most
2464 derived object is a binfo, rather than a class type.
2465 (find_final_overrider): Likewise.
2466 (add_vcall_offset_vtbl_entries_1): Simplify accordingly.
2467 (add_vcall_offset): Likewise.
2469 2002-11-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2472 * pt.c (instantiate_template): Push class scope for member
2474 (get_mostly_instantiated_function_type): Likewise. Don't call
2475 tsubst on context. Remove CONTEXTP and TPARMSP parameters.
2476 * cp-tree.h (get_mostly_instantiated_function_type): Adjust.
2477 * mangle.c (write_encoding, write_unqualified_name): Adjust.
2479 2002-11-07 Mark Mitchell <mark@codesourcery.com>
2481 * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of
2482 vcall offfsets. Split out ...
2483 (add_vcall_offset): ... new function.
2486 * pt.c (for_each_template_parm): Add htab parameter.
2487 (process_partial_specialization): Adjust call.
2488 (push_template_decl_real): Likewise.
2489 (pair_fn_data): Add visited.
2490 (for_each_template_parm_r): Avoid walking duplicates more than
2492 (uses_template_parms): Adjust call to for_each_template_parm.
2494 2002-11-07 Mark Mitchell <mark@codesourcery.com>
2496 * class.c (add_implicitly_declared_members): Put implicitly
2497 declared functions at the end of TYPE_METHODs when -fabi-version
2500 2002-11-05 Geoffrey Keating <geoffk@apple.com>
2502 * decl2.c (finish_file): Correct spelling.
2504 2002-11-03 Mark Mitchell <mark@codesourcery.com>
2506 * call.c (build_special_member_call): Do not try to lookup VTTs by
2508 * class.c (vtbl_init_data): Add generate_vcall_entries.
2509 (get_vtable_decl): Do not look up virtual tables by name.
2510 (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P.
2511 (set_primary_base): Do not set CLASSTYPE_RTTI.
2512 (determine_primary_base): Likewise.
2513 (get_matching_virtual): Remove.
2514 (get_vcall_index): New function.
2515 (update_vtable_entry_for_fn): Do not try to use virtual thunks
2516 when they are not required. Assign vcall indices at this point.
2517 (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT.
2518 Do update dynamic_classes.
2519 (build_vtt): Do not add VTTs to the symbol table.
2520 (build_ctor_vtbl_group): Likewise.
2521 (build_vtbl_initializer): Simplify handling of vcall indices.
2522 (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets
2523 for the most derived class.
2524 (add_vcall_offset_vtbl_entries_1): But do not actually add them to
2526 * cp-tree.h (dynamic_classes): New macro.
2527 (lang_type_class): Remove rtti. Add vtables. Add vcall_indices.
2528 (CLASSTYPE_RTTI): Remove.
2529 (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove.
2530 (CLASSTYPE_VCALL_INDICES): New macro.
2531 (CLASSTYPE_VTABLES): Likewise.
2532 (BV_USE_VCALL_INDEX_P): Remove.
2533 (build_vtable_path): Remove.
2534 * decl2.c (finish_vtable_vardecl): Remove.
2535 (key_method): Remove #if 0'd code.
2536 (finish_vtable_vardecl): Rename to ...
2537 (maybe_emit_vtables): ... this.
2538 (finish_file): Use it.
2539 * search.c (look_for_overrides_here): Update comment.
2541 2002-11-01 Zack Weinberg <zack@codesourcery.com>
2544 * decl2.c (grokfield): Reject TYPE_DECLs with initializers.
2546 2002-10-30 Jason Merrill <jason@redhat.com>
2549 * cp-tree.h (ADDR_IS_INVISIREF): New macro.
2550 * call.c (convert_for_arg_passing): Set it.
2551 * except.c (stabilize_throw_expr): Recurse for such an arg.
2553 2002-10-31 Mark Mitchell <mark@codesourcery.com>
2555 * cp-tree.h (lang_decl_flags): Remove init_priority.
2556 (lang_decl): Add delta.
2557 (GLOBAL_INIT_PRIORITY): Remove.
2558 (THUNK_DELTA): Revise definition.
2559 * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY.
2560 * dump.c (cp_dump_tree): Don't dump it.
2562 2002-10-30 Mark Mitchell <mark@codesourcery.com>
2565 * typeck2.c (process_init_constructor): Call complete_array_type.
2568 * decl.c (make_typename_type): Issue errors about invalid results.
2570 2002-10-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2572 Core issue 287, PR c++/7639
2573 * cp-tree.h (lang_type_class): Add decl_list field.
2574 (CLASSTYPE_DECL_LIST): New macro.
2575 (maybe_add_class_template_decl_list): Add declaration.
2576 * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST.
2577 (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST.
2578 (maybe_add_class_template_decl_list): New function.
2579 (add_implicitly_declared_members): Use it.
2580 * decl.c (maybe_process_template_type_declaration): Likewise.
2581 (pushtag): Likewise.
2582 * friend.c (add_friend): Likewise.
2583 (make_friend_class): Likewise.
2584 * semantics.c (finish_member_declaration): Likewise.
2585 (begin_class_definition): Initialize CLASSTYPE_DECL_LIST.
2586 * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST
2587 to process members and friends in the order of declaration.
2589 2002-10-29 Mark Mitchell <mark@codesourcery.com>
2592 * decl.c (finish_destructor_body): Create the label to jump to
2593 when returning from a destructor here.
2594 (finish_function_body): Rather than here.
2596 2002-10-25 Zack Weinberg <zack@codesourcery.com>
2599 * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a
2600 SCOPE_REF is not null before dereferencing it.
2602 2002-10-25 Mark Mitchell <mark@codesourcery.com>
2604 * call.c (build_over_call): Use DECL_CONTEXT, not
2605 DECL_VIRTUAL_CONTEXT.
2606 * class.c (modify_vtable_entry): Don't mess with
2607 DECL_VIRTUAL_CONTEXT.
2608 (set_vindex): Remove.
2609 (set_primary_base): Remove vfuns_p parameter.
2610 (determine_primary_base): Likewise.
2611 (modify_all_vtables): Likewise.
2612 (layout_class_type): Likewise. Adjust calls to other functions
2614 (finish_struct_1): Adjust calls to modified functions. Set
2616 * cp-tree.h (lang_type_class): Remove vsize.
2617 (CLASSTYPE_VSIZE): Remove.
2618 (lang_decl): Remove thunks.
2619 (DECL_THUNKS): Adjust.
2620 (DECL_VIRTUAL_CONTEXT): Remove.
2621 (duplicate_decls): Don't copy it.
2622 * pt.c (build_template_decl): Don't set it.
2623 (tsubst_decl): Likewise.
2624 * typeck.c (expand_ptrmemfunc_cst): Don't use it.
2626 * class.c (build_vtbl_initializer): Don't use build_vtable_entry.
2627 (build_vtable_entry): Remove.
2628 * cp-tree.h (BINFO_VIRTUALS): Expand documentation.
2629 (lang_decl): Add thunks.
2630 (DECL_THUNKS): New macro.
2631 * decl.c (duplicate_decls): Copy it.
2632 * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS.
2633 * semantics.c (emit_associated_thunks): Simplify.
2635 2002-10-24 David Edelsohn <edelsohn@gnu.org>
2638 * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that
2639 lang_type structure exists before accessing field.
2640 (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro.
2641 (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar.
2642 (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro.
2643 * class.c (check_field_decls): Use new macros.
2644 * typeck2.c (process_init_constructor): Remove redundant check for
2645 existence of lang_type structure.
2647 2002-10-24 Mark Mitchell <mark@codesourcery.com>
2649 * class.c (end_of_base): New method.
2650 (end_of_class): Use it. Check indirect virtual bases.
2652 * class.c (check_field_decls): Fix typo.
2654 2002-10-23 Mark Mitchell <mark@codesourcery.com>
2657 * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
2661 * spew.c (next_token): Do not return an endless stream of
2662 END_OF_SAVED_INPUT tokens.
2663 (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of
2664 the cached token stream.
2665 (snarf_defarg): Likewise.
2667 2002-10-23 Zack Weinberg <zack@codesourcery.com>
2669 * cp-lang.c (cp_var_mod_type_p): New: C++ hook for
2670 variably_modified_type_p.
2671 * cp-tree.h: Remove prototype of variably_modified_type_p.
2672 * tree.c (variably_modified_type_p): Remove; now implemented
2673 in language-independent code.
2675 2002-10-22 Mark Mitchell <mark@codesourcery.com>
2678 * spew.c (snarf_parenthesized_expression): New function.
2679 (snarf_block): Use it.
2681 2002-10-22 Richard Henderson <rth@redhat.com>
2683 * method.c (use_thunk): Always compute vcall_value; assert that
2684 it is not zero. Use can_output_mi_thunk; use output_mi_thunk
2685 for vcall thunks as well.
2687 2002-10-21 Mark Mitchell <mark@codesourcery.com>
2689 * class.c (empty_base_at_nonzero_offset_p): New function.
2690 (layout_nonempty_base_or_field): Do not check for conflicts when
2691 laying out a virtual base using the GCC 3.2 ABI.
2692 (build_base_field): Correct checking for presence of empty classes
2693 at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P.
2695 * class.c (include_empty_classes): Use normalize_rli.
2696 (layout_class_type): Likewise.
2698 * decl.c (reshape_init): Tweak handling of character arrays.
2701 * cp-tree.h (lang_type_class): Add contains_empty_class_p.
2702 (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro.
2703 * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P.
2704 (check_field_decls): Likewise.
2705 (layout_class_type): Likewise.
2706 (finish_struct_1): Initialize it.
2707 (walk_subobject_offsets): Use it to prune searches.
2709 2002-10-20 Mark Mitchell <mark@codesourcery.com>
2711 * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT.
2712 * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with
2713 TARGET_ASM_OUTPUT_MI_THUNK in comments.
2715 2002-10-18 Zack Weinberg <zack@codesourcery.com>
2717 * decl.c (start_decl): Point users of the old initialized-
2718 typedef extension at __typeof__.
2720 2002-10-18 Mark Mitchell <mark@codesourcery.com>
2722 * Make-lang.in (method.o): Depend on TARGET_H.
2723 * method.c (target.h): Include it.
2724 (use_thunk): Use target hooks. Use vcall thunks, if available.
2726 2002-10-18 Mark Mitchell <mark@codesourcery.com>
2728 * class.c (base_derived_from): Make sure return value is a bool.
2730 2002-10-18 Mark Mitchell <mark@codesourcery.com>
2732 * class.c (find_final_overrider_data_s): Remove overriding_fn and
2734 (dfs_base_derived_from): New function.
2735 (base_derived_from): Likewise.
2736 (dfs_find_final_overrider): Use base_derived_from.
2737 (find_final_overrider): Adjust.
2739 2002-10-18 Jason Merrill <jason@redhat.com>
2742 * semantics.c (finish_for_cond, finish_while_cond): Don't mess
2743 with condition decls in a template.
2745 2002-10-17 Nathan Sidwell <nathan@codesourcery.com>
2747 * class.c (add_method): Compare template parms too.
2749 2002-10-17 Mark Mitchell <mark@codesourcery.com>
2752 * class.c (handle_using_decl): Allow the declaration used to be
2753 from an ambiguous base.
2755 * pt.c (convert_template_argument): Revert this change:
2756 2002-10-16 Mark Mitchell <mark@codesourcery.com>
2757 * pt.c (convert_template_argument): Do not fold non-type
2758 template rguments when inside a template.
2760 * init.c (expand_default_init): Handle brace-enclosed initializers
2763 2002-10-16 Mark Mitchell <mark@codesourcery.com>
2765 * mangle.c (write_expression): Correct handling of enumeration
2767 (write_template_arg): Likewise.
2768 * pt.c (convert_template_argument): Do not fold non-type template
2769 arguments when inside a template.
2772 * cvt.c (convert_to_reference): Allow references as the incoming
2775 2002-10-16 Mark Mitchell <mark@codesourcery.com>
2778 * method.c (do_build_assign_ref): Use cp_build_qualified_type, not
2779 build_qualified_type.
2781 2002-10-15 Richard Henderson <rth@redhat.com>
2783 * error.c (dump_expr): Use real_to_decimal directly, and with
2786 2002-10-15 Mark Mitchell <mark@codesourcery.com>
2788 * decl.c (reshape_init): Fix typo.
2790 * cp-tree.h (operator_name_info_t): Add arity.
2791 * lex.c (init_operators): Initialize it.
2792 * mangle.c (write_conversion_operator_name): New function.
2793 (write_unqualified_name): Use it.
2794 (write_template_args): Accept template arguments as a TREE_LIST.
2795 (write_expression): Adjust handling of qualified names to match
2798 2002-10-15 Jason Merrill <jason@redhat.com>
2800 * call.c (call_builtin_trap): New fn.
2801 (convert_arg_to_ellipsis): Use it. Downgrade error to warning.
2802 (build_call): Don't set current_function_returns_abnormally outside
2805 2002-10-14 Mark Mitchell <mark@codesourcery.com>
2807 * class.c (check_field_decls): Remove empty_p parameter. Instead,
2808 clear CLASSTYPE_EMPTY_P.
2809 (build_base_field): Likewise.
2810 (build_base_fields): Likewise.
2811 (check_bases_and_members): Likewise.
2812 (create_vtbl_ptr): Likewise.
2813 (layout_class_type): Likewise. Ensure that empty classes have
2814 size zero when used as base classes in the 3.2 ABI.
2815 (finish_struct_1): Initialize CLASSTYPE_EMPTY_P and
2816 CLASSTYPE_NEARLY_EMPTY_P. Adjust calls to avoid passing empty_p
2818 (is_empty_class): Correct definition when using post-3.2 ABI.
2819 * cp-tree.h (lang_type_class): Add empty_p.
2820 (CLASSTYPE_EMPTY_P): New macro.
2822 2002-10-12 Nathan Sidwell <nathan@codesourcery.com>
2824 * init.c (build_delete): Do not apply save_expr for arrays.
2825 (build_vec_delete): Likewise.
2827 2002-10-14 Mark Mitchell <mark@codesourcery.com>
2829 * decl.c (layout_var_decl): Call layout_decl even for variables
2830 whose type is an array with unspecified bounds.
2833 * lex.c (do_identifier): Add another option for the parsing
2835 * parse.y (do_id): Use it.
2837 2002-10-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
2839 PRs C++/6803, C++/7721 and C++/7803
2840 * decl.c (grokdeclarator): Gracefully handle template-name as
2843 2002-10-11 Jason Molenda <jmolenda@apple.com>
2845 * init.c (build_field_list): Provide uses_unions_p with a default
2848 2002-10-11 Mark Mitchell <mark@codesourcery.com>
2851 * cp-tree.h (variably_modified_type_p): New function.
2852 (grokdeclarator) Tighten check for variably modified types as
2854 * pt.c (convert_template_argument): Do not allow variably modified
2855 types as template arguments.
2856 * tree.c (variably_modified_type_p): New function.
2858 * NEWS: Document removal of "new X = ..." extension.
2859 * class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on
2860 brace-enclosed initializers.
2861 * cp-tree.h (CP_AGGREGATE_TYPE_P): New macro.
2862 (initialize_local_var): Remove declaration.
2863 (expand_static_init): Likewise.
2864 * decl.c (next_initializable_field): New function.
2865 (reshape_init): Likewise.
2866 (check_initializer): Use them. Build dynamic initializer for
2867 aggregates here too.
2868 (initialize_local_var): Simplify, and incorporate cleanup
2869 insertion code as well.
2870 (destroy_local_var): Remove.
2871 (cp_finish_decl): Tidy.
2872 (expand_static_init): Fold checks for whether or not a variable
2873 needs initialization into this function. Simplify.
2874 * decl2.c (do_static_initialization): Simplify.
2875 * init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will
2876 be done for us automatically.
2877 (expand_default_init): Handle brace-enclosed initializers
2879 (expand_aggr_init_1): Remove RTL-generation code.
2880 (build_vec_init): Remove "new X = ..." support.
2881 * parse.y (new_initializer): Likewise.
2882 * rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on
2883 brace-enclosed initializer.
2884 (create_pseudo_type_info): Likewise.
2885 * typeck2.c (store_init_value): Don't try to handle digest_init
2886 being called more than once.
2887 (digest_init): Tidy handling of brace-enclosed initializers.
2889 2002-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2891 * decl.c (typename_hash): Use htab_hash_pointer.
2893 2002-10-10 Jim Wilson <wilson@redhat.com>
2895 * decl.c (duplicate_decls): Don't call decl_attributes.
2897 2002-10-09 Zack Weinberg <zack@codesourcery.com>
2900 * decl.c (start_decl): Unconditionally issue error for
2901 'typedef foo = bar'.
2902 (cp_finish_decl): Remove special case for TYPE_DECL with initializer.
2903 (grokdeclarator): Remove redundant error for 'typedef foo = bar'.
2905 2002-10-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2907 * decl2.c (prune_vtable_vardecl): Delete unused function.
2909 2002-10-03 Mark Mitchell <mark@codesourcery.com>
2912 * decl2.c (finish_anon_union): Do not expand anonymous unions when
2913 procesing template functions.
2914 * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
2915 type. Call layout_decl.
2916 (tsubst_expr, case DECL_STMT): Handle anonymous unions.
2918 2002-10-07 Richard Henderson <rth@redhat.com>
2920 * decl2.c, pt.c: Revert c++/7754 fix.
2922 2002-10-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2925 * error.c (dump_expr) [REAL_CST]: Output in decimal format.
2927 2002-10-03 Mark Mitchell <mark@codesourcery.com>
2930 * pt.c (for_each_template_parm_r): Handle BASELINKs.
2933 * decl2.c (finish_anon_union): Do not expand anonymous unions when
2934 procesing template functions.
2935 * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
2936 type. Call layout_decl.
2937 (tsubst_expr, case DECL_STMT): Handle anonymous unions.
2939 2002-10-03 Mark Mitchell <mark@codesourcery.com>
2942 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template
2943 template parameters.
2944 (globals): Add entity and need_abi_warning.
2945 (decl_is_template_id): Use TYPE_TEMPLATE_INFO, not
2946 CLASSTYPE_TEMPLATE_INFO.
2947 (is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not
2949 (write_prefix): Handle typename types correctly.
2950 (write_template_prefix): Handle template template parameters
2952 (start_mangling): Add entity parameter.
2953 (finish_mangling): Warn about names whose mangling will change.
2954 (mangle_decl_string): Adjust.
2955 (mangle_type_string): Likewise.
2956 (mangle_special_for_type): Likewise.
2957 (mangle_ctor_vtbl_for_type): Likewise.
2958 (mangle_thunk): Likewise.
2959 (mangle_guard_variable): Likewise.
2960 (mangle_ref_init_variable): Likewise.
2962 2002-10-02 Mark Mitchell <mark@codesourcery.com>
2965 * cp-tree.def (CTOR_INITIALIZER): Use one slot, not two.
2966 * cp-tree.h (emit_base_init): Rename to ....
2967 (emit_mem_initializers): ... this.
2968 (expand_member_init): Change prototype.
2969 * init.c (perform_member_init): Compute explicit, rather than
2970 requiring it as a parameter.
2971 (sort_member_init): Rename to ...
2972 (sort_mem_initializers): ... this. Process bases and data members
2974 (sort_base_init): Remove.
2975 (emit_base_init): Rename to ...
2976 (emit_mem_initializers): ... this.
2977 (expand_aggr_vbase_init_1): Remove.
2978 (construct_virtual_bases): Rename to ...
2979 (construct_virtual_base): ... this.
2980 (expand_member_init): Rework handling of base initializers.
2981 * method.c (do_build_copy_constructor): Use
2982 finish_mem_initializers.
2983 * parse.y (member_init): Adjust calls to expand_member_init.
2984 * pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case.
2985 (tsubst_initializer_list): Use expand_member_init.
2986 * semantics.c (finish_mem_intiailizers): Simplify.
2988 2002-10-02 Matt Austern <austern@apple.com>
2989 * decl.c (walk_vtables_r): Fixed typo that caused result to
2990 never get a nonzero value.
2992 2002-10-02 Roger Sayle <roger@eyesopen.com>
2994 PR optimization/6627
2995 * cp-tree.h (enum ptrmemfunc_vbit_where_t): Delete definition
2996 from here, and move it to tree.h.
2997 * decl.c (cxx_init_decl_processing): If storing the vbit
2998 in function pointers, ensure that force_align_functions_log
3001 2002-10-02 Matt Austern <austern@apple.com>
3003 * class.c (check_field_decls): Changed warning about const member
3004 variables so that it doesn't get issued for a class aggregate.
3006 2002-10-01 Mark Mitchell <mark@codesourcery.com>
3008 * decl.c (cp_finish_decl): Make sure array types are laid out,
3009 even if the array bounds are unknown.
3011 2002-10-01 Steve Ellcey <sje@cup.hp.com>
3013 * class.c (build_vtbl_initializer): Change build_c_cast
3016 2002-10-01 Mark Mitchell <mark@codesourcery.com>
3018 * decl.c (cp_finish_decl): Make sure array types are laid out,
3019 even if the array bounds are unknown.
3021 * decl.c (cp_finish_decl): Correct check for dynamic
3022 initialization of thread-local storage.
3024 2002-09-30 Nathan Sidwell <nathan@codesourcery.com>
3026 * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
3029 2002-09-30 Steve Ellcey <sje@cup.hp.com>
3031 * class.c (build_vtbl_initializer): Add cast.
3032 (add_vcall_offset_vtbl_entries_1):
3033 Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.
3035 2002-09-30 Mark Mitchell <mark@codesourcery.com>
3037 * class.c (walk_subobject_offsets): Correct the calculation of
3038 offsets for virtual bases. Correct the counting of array
3040 (layout_nonempty_base_or_field): Simplify. Correct the
3041 calculation of offsets to be propagated through the binfo
3043 (build_base_field): Avoid creating a FIELD_DECL for empty bases.
3044 Add the FIELD_DECL to TYPE_FIELDS.
3045 (build_base_fields): Adjust accordingly.
3046 (layout_virtual_bases): Use build_base_field.
3047 (end_of_class): Return a tree, not an integer.
3048 (warn_about_ambiguous_direct_bases): Rename to ...
3049 (warn_about_ambiguous_bases): ... this.
3050 (include_empty_classes): New function.
3051 (layout_class_type): Create an alternative version of the type to
3052 be used when as a base class type. Do not call
3053 finish_record_layout until we are done laying out the class.
3054 * cp-tree.h (lang_type_class): Remove size, size_unit. Add
3056 (CLASSTYPE_SIZE): Reimplement.
3057 (CLASSTYPE_SIZE_UNIT): Likewise.
3058 (CLASSTYPE_ALIGN): Likweise.
3059 (CLASSTYPE_USER_ALIGN): Likewise.
3060 (CLASSTYPE_AS_BASE): New macro.
3061 (DECL_INITIALIZED_P): Likewise.
3062 (extract_init): Remove prototype.
3063 (build_forced_zero_init): Rename to ...
3064 (build_zero_init): ... this.
3065 (force_store_init_value): Remove.
3066 * decl.c (obscure_complex_init): Remove.
3067 (duplicate_decls): Copy DECL_INITIALIZED_P.
3068 (check_initializer): Do not leave junk in DECL_INITIAL.
3069 (cp_finish_decl): Handle zero-initialization of entities with
3070 static storage duration.
3071 * expr.c (extract_init): Remove.
3072 * init.c (build_forced_zero_init): Remove.
3073 (build_zero_init): New function.
3074 (build_default_init): Use it.
3075 (build_field_list): Skip FIELD_DECLs for base subobjects.
3076 (push_base_cleanups): Likewise.
3077 * method.c (do_build_assign_ref): Likewise.
3078 (synthesize_exception_spec): Likewise.
3079 * pt.c (tsubst_decl): Clear DECL_INITIALIZED_P.
3080 (regenerate_decl_from_template): To not set DECL_INITIAL for a
3081 static data member whose initialization took place in its class.
3082 (instantiate_decl): Do not pass an initializer to cp_finish_decl
3084 * search.c (dfs_push_decls): Skip FIELD_DECLs for base subobjects.
3085 (dfs_unuse_fields): Likewise.
3086 * tree.c (pod_type_p): Handle error_mark_node.
3087 (zero_init_p): Likewise.
3088 * typeck.c (lookup_anon_field): Skip FIELD_DECLs for base
3090 * typeck2.c (store_init_value): Remove #if 0'd code.
3091 (force_store_init_value): Remove.
3092 (process_init_constructor): Use build_zero_init.
3094 2002-09-29 Nathan Sidwell <nathan@codesourcery.com>
3097 * rtti.c (unemitted_tinfo_decl_p): Check it has a field.
3099 2002-09-29 Kazu Hirata <kazu@cs.umass.edu>
3101 * cp-tree.h: Fix comment typos.
3105 2002-09-25 Mark Mitchell <mark@codesourcery.com>
3107 * cp/class.c (contains_empty_class_p): New method.
3108 (walk_subobject_offsets): Correct computation of field offset.
3109 (layout_empty_base): Correct placement of emtpy base classes.
3110 (layout_class_type): Warn about ABI changes.
3112 2002-09-23 Mark Mitchell <mark@codesourcery.com>
3114 * cp/class.c (layout_virtual_bases): Do not round the size of the
3115 type to a multiple of the alignment before laying out virtual bases.
3116 (layout_class_type): Correct handling of bit-fields that are wider
3117 than their type inside unions. Round the size of the type to a
3118 even number of bytes when computing the size without virtual
3120 * cp/cp-tree.h (abi_version_at_least): New macro.
3122 2002-09-21 Kazu Hirata <kazu@cs.umass.edu>
3124 * ChangeLog: Follow spelling conventions.
3125 * ChangeLog.2: Likewise.
3127 * class.c: Likewise.
3128 * cp-tree.h: Likewise.
3131 * decl2.c: Likewise.
3132 * except.c: Likewise.
3133 * friend.c: Likewise.
3134 * g++spec.c: Likewise.
3137 * mangle.c: Likewise.
3138 * method.c: Likewise.
3139 * operators.def: Likewise.
3140 * optimize.c: Likewise.
3143 * search.c: Likewise.
3144 * semantics.c: Likewise.
3147 * typeck.c: Likewise.
3149 2002-09-18 Devang Patel <dpatel@apple.com>
3151 * cp/cp-tree.h: New prototype for walk_vtabls().
3152 * cp/decl.c (walk_vtables_r): New function.
3153 (struct cp_binding_level): Add new members, namespaces,
3154 names_size and vtables.
3155 (add_decl_to_level): Add decl in namespaces or vtables
3156 chain, if conditions match.
3157 (walk_vtables): New function.
3158 (walk_namespaces_r): Travers separate namespace chain
3159 for namespace decls.
3160 (wrapup_globals_for_namespace): Use names_size instead
3162 * cp/decl2.c (finish_file): Use walk_vtables() instead of
3163 walk_globals() to walk vtable decls.
3165 2002-09-18 Nathan Sidwell <nathan@codesourcery.com>
3167 * decl.c (grokdeclarator): Use assert, not internal_error. Don't
3168 ICE with invalid pointers & references.
3170 2002-09-17 Zack Weinberg <zack@codesourcery.com>
3172 * Make-lang.in: Remove all references to the demangler.
3173 * cxxfilt.c: Moved to binutils.
3175 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
3178 * pt.c (tsubst_decl): Remove assert.
3180 Remove DR 295 implementation.
3181 * pt.c (check_cv_quals_for_unify): Disable function & method cases.
3182 * tree.c (cp_build_qualified_type_real): Likewise. Don't warn
3183 about ignoring volatile qualifiers.
3185 * search.c (lookup_member): Correct documentation.
3187 2002-09-16 Geoffrey Keating <geoffk@apple.com>
3189 * cp-tree.h (union lang_tree_node): Add chain_next option.
3191 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
3193 * parse.y (parse_finish_call_expr): Check lookup_member result.
3196 * semantic.c (finish_asm_stmt): Fix operand/output_operands
3198 * typeck.c (c_expand_asm_operands): Protect from error_mark_node.
3200 2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
3203 * call.c (build_over_call): Convert this pointer for fns found by
3206 2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
3208 * ChangeLog: Follow spelling conventions.
3209 * ChangeLog.1: Likewise.
3211 2002-09-14 Nathan Sidwell <nathan@codesourcery.com>
3214 * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
3216 2002-09-14 Kazu Hirata <kazu@cs.umass.edu>
3218 * error.c: Fix comment formatting.
3219 * except.c: Likewise.
3221 * friend.c: Likewise.
3222 * g++spec.c: Likewise.
3225 * mangle.c: Likewise.
3226 * method.c: Likewise.
3227 * optimize.c: Likewise.
3230 * search.c: Likewise.
3231 * semantics.c: Likewise.
3234 * typeck.c: Likewise.
3235 * typeck2.c: Likewise.
3237 2002-09-13 Matt Austern <austern@apple.com>
3240 * cp/cp-tree.h, cp/tree.c: New function non_cast_lvalue_p.
3241 * cp/call.c: Change call-by-const-reference mechanism to use
3242 non_cast_lvalue_p when deciding whether the create a temporary.
3243 We need a temporary when passing, e.g. (long) x by const ref.
3245 2002-09-13 Nathan Sidwell <nathan@codesourcery.com>
3247 * pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
3249 2002-09-13 Kazu Hirata <kazu@cs.umass.edu>
3251 * decl.c: Fix comment formatting.
3252 * decl2.c: Likewise.
3254 2002-09-12 Kazu Hirata <kazu@cs.umass.edu>
3256 * call.c: Fix comment formatting.
3257 * class.c: Likewise.
3258 * cp-lang.c: Likewise.
3259 * cp-tree.h: Likewise.
3262 2002-09-11 Zack Weinberg <zack@codesourcery.com>
3264 * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c,
3265 and c++filt from cxxfilt.o + version.o + $(LIBDEPS).
3266 * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with
3267 minor adjustments (use version_string, eliminate yet another
3268 duplicate of xmalloc)
3270 2002-09-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3272 * cp-tree.h (require_complete_eh_spec_types): Add prototype.
3274 2002-09-05 Jason Merrill <jason@redhat.com>
3276 * typeck2.c (add_exception_specifier): Only pedwarn for an
3278 (require_complete_eh_spec_types): New fn.
3279 (cxx_incomplete_type_diagnostic): Also support pedwarning.
3280 * typeck.c (complete_type_or_diagnostic): Likewise.
3281 * call.c (build_call): Call require_complete_eh_spec_types.
3282 * rtti.c (get_pseudo_ti_desc): Give an error rather than aborting
3283 on an incomplete type.
3285 2002-09-04 Jakub Jelinek <jakub@redhat.com>
3287 * decl.c (start_cleanup_fn): Clear interface_only before
3288 start_function, restore it afterwards.
3290 2002-09-02 Nathan Sidwell <nathan@codesourcery.com>
3292 * cp-tree.h (finish_builtin_type): Remove.
3293 * decl2.c (finish_builtin_type): Move to common code.
3294 * decl.c (build_ptrmemfunc_type): Adjust.
3295 * rtti.c (create_pseudo_type_info): Adjust.
3296 (create_tinfo_types): Adjust.
3298 2002-08-31 Jason Merrill <jason@redhat.com>
3300 * cp-lang.c (cp_expr_size): Allow initialization from a
3303 2002-08-30 Richard Henderson <rth@redhat.com>
3306 * tree.c: Include target.h.
3307 (cp_cannot_inline_tree_fn): Don't auto-inline functions that
3309 * Makefile.in (tree.o): Update.
3311 2002-08-27 Mark Mitchell <mark@codesourcery.com>
3313 * class.c (layout_virtual_bases): Warn about bugs in G++ that
3314 result in incorrect object layouts.
3315 (layout_class_type): Likewise.
3317 2002-08-24 Matt Austern <austern@apple.com>
3319 * tree.c (lvalue_p_1): Add argument for whether casts of lvalues
3321 (real_lvalue_p): Update caller.
3323 (non_cast_lvalue_or_else): New.
3324 * tree.h: Declare it.
3325 * typeck.c (build_unary_op): Use non_cast_lvalue_or_else.
3327 2002-08-22 Mark Mitchell <mark@codesourcery.com>
3329 * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR
3330 and COND_EXPR specially; fix error message output.
3332 2002-08-22 Jason Merrill <jason@redhat.com>
3334 * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR.
3335 * semantics.c (nullify_returns_r): Likewise.
3337 2002-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
3340 * typeck.c (finish_class_member_access_expr): Diagnose cases where
3341 name lookup finds nothing.
3343 2002-08-15 Jason Merrill <jason@redhat.com>
3345 * semantics.c (finish_then_clause): Remove redundant assignment.
3346 (finish_if_stmt, begin_switch_stmt, finish_switch_stmt): Move the
3347 extra binding level outside the if/switch statement.
3348 (finish_while_cond, finish_for_cond): Rewrite complex condition
3351 2002-08-15 Alexandre Oliva <aoliva@redhat.com>
3353 * parse.y (sizeof, alignof, typeof): New non-terminals to
3354 increment skip_evaluation. Replace terminals with them and
3355 decrement skip_evaluation at the end of rules using them.
3356 * decl2.c (mark_used): Don't assemble_external if
3357 skipping evaluation.
3359 2002-08-15 Gabriel Dos Reis <gdr@nerim.net>
3362 * parse.y (parse_finish_call_expr): Handle incomplete
3363 type used to name a scope.
3365 2002-08-15 Nathan Sidwell <nathan@codesourcery.com>
3368 * typeck.c (build_unary_op): Fold offsetof idiom. Fixes
3369 regression caused by my 2002-08-08 patch.
3371 2002-08-13 Mark Mitchell <mark@codesourcery.com>
3373 * decl.c (pushdecl_class_level): Honor requests to bind names to
3376 2002-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3378 * decl2.c (build_call_from_tree): Fix uninitialized variable.
3379 * parse.y (parse_finish_call_expr): Likewise.
3380 * repo.c (old_args, old_dir, old_main): Const-ify.
3382 2002-08-11 Gabriel Dos Reis <gdr@nerim.net>
3384 * decl.c (duplicate_decls): Replace DECL_SOURCE_FILE +
3385 DECL_SOURCE_LINE with DECL_SOURCE_LOCATION.
3386 * optimize.c (maybe_clone_body): Likewise.
3387 * pt.c (tsubst_enum): Likewise.
3388 (lookup_template_class): Likewise.
3389 * tree.c (cp_copy_res_decl_for_inlining): Likewise.
3391 2002-08-10 Neil Booth <neil@daikokuya.co.uk>
3393 * lang-specs.h: Remove -ansi.
3395 2002-08-10 Nathan Sidwell <nathan@codesourcery.com>
3397 * tree.c (maybe_dummy_object): Replace // with /* */
3399 2002-08-09 Mark Mitchell <mark@codesourcery.com>
3401 * call.c (standard_conversion): Use build_ptrmem_type.
3402 * cp-tree.h (build_ptrmem_type): New function.
3403 (adjust_result_of_qualified_name_lookup): Likewise.
3404 * decl.c (grokvardecl): Do not look for OFFSET_TYPEs to indicate
3405 static data members.
3406 (build_ptrmem_type): New function.
3407 (grokdeclarator): Do not use build_offset_type when encountering a
3409 * parse.y (parse_finish_call_expr): Use
3410 adjust_result_of_qualified_name_lookup.
3411 * search.c (adjust_result_of_qualified_name_lookup): New function.
3412 * typeck.c (qualify_type_recursive): Use TYPE_PTRMEM_* rather than
3413 accessing OFFSET_TYPEs directly.
3415 2002-08-08 Mike Stump <mrs@apple.com>
3417 * call.c (add_builtin_candidate): legal -> valid, illegal -> invalid.
3418 (type_decays_to): Likewise.
3419 * class.c (find_final_overrider): Likewise.
3420 (maybe_note_name_used_in_class): Likewise.
3421 * decl.c (current_tmpl_spec_kind): Likewise.
3422 (add_binding): Likewise.
3423 (push_class_binding): Likewise.
3424 (duplicate_decls): Likewise.
3425 (layout_var_decl): Likewise.
3426 (grokfndecl): Likewise.
3427 (grokdeclarator): Likewise.
3428 (check_default_argument): Likewise.
3429 * decl2.c (handle_class_head): Likewise.
3430 * error.c (dump_template_decl): Likewise.
3431 * init.c (build_offset_ref): Likewise.
3432 * pt.c (check_specialization_scope): Likewise.
3433 (determine_specialization): Likewise.
3434 (check_explicit_specialization): Likewise.
3435 (maybe_check_template_type): Likewise.
3436 (process_partial_specialization): Likewise.