1 2003-03-10 Mark Mitchell <mark@codesourcery.com>
3 * call.c (perform_overload_resolution): New function.
4 (build_new_function_call): Use it.
5 (build_operator_new_call): Likewise.
6 (add_candidates): Add explicit_targs and template_only parameters.
7 (build_new_op): Adjust accordingly.
8 * cp-tree.h (build_operator_new_call): New function.
9 (build_function_call_real): Remove.
10 (build_function_call_maybe): Likewise.
11 * init.c (build_new_1): Use build_operator_new_call.
12 * typeck.c (build_function_call_real): Rename to ...
13 (build_function_call): ... this.
15 2003-03-10 Devang Patel <dpatel@apple.com>
18 * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG.
20 2003-03-10 Jason Merrill <jason@redhat.com>
23 * decl.c (push_using_directive): Push before recursing.
26 * call.c (resolve_scoped_fn_name): Handle the case of a function
29 * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this'
30 argument in the pointer-to-member case.
32 2003-03-09 Mark Mitchell <mark@codesourcery.com>
35 * cp-lang.c (cxx_get_alias_set): Use alias set zero for
36 pointers to member functions.
39 * decl.c (build_ptrmemfunc_type): Do not allow default arugments
40 in pointer-to-member-function types.
42 2003-03-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
44 * expr.c (cplus_expand_constant): Use C90 prototype style.
45 (cxx_expand_expr): Likewise.
47 2003-03-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
50 * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual
53 2003-03-08 Geoffrey Keating <geoffk@apple.com>
55 * lang-specs.h (c++-header): Change .pch to .gch.
57 2003-03-08 Neil Booth <neil@daikokuya.co.uk>
59 * cp-tree.h (cxx_init): Update prototype.
60 * lex.c (cxx_init): Similarly.
62 2003-03-08 Mark Mitchell <mark@codesourcery.com>
65 * cp-tree.h (begin_mem_initializers): Remove.
66 * parser.c (cp_parser_mem_initializer_list): Inline it here.
67 Do not call finish_mem_initializers if not in a constructor.
68 (cp_parser_class_head): Fix typo in error message.
69 * semantics.c (begin_mem_initializers): Remove.
70 * testsuite/g++.dg/parser/constructor1.C: New test.
73 * call.c (add_function_candidate): Skip builtin fuctions that have
74 not yet been declared.
77 * init.c (build_new_1): Correct logic for determining whether or
78 not to use an array cookie.
81 * parser.c (cp_parser_postfix_expression): Call
82 finish_non_static_data_member, even when processing_template_decl.
85 * cp-tree.h (is_ancestor): New function.
86 (handle_class_head): Change prototype.
87 * decl2.c (is_namespace_ancestor): Rename to ...
88 (namespace_anecestor): ... this.
89 (set_decl_namespace): Adjust accordingly.
90 (handle_class_head): Remove unncessary parameters.
91 * parser.c (cp_parser_class_head): Check that
92 nested-name-specifiers are used appropriately.
94 2003-03-07 Mark Mitchell <mark@codesourcery.com>
96 * call.c (reference_binding): Remove REF_IS_VAR parameter.
97 (implicit_conversion): Adjust call to reference_binding.
98 (make_temporary_var_for_ref_to_type): Add TYPE parameter.
99 (initialize_reference): Adjust handling for references bound to
101 * cp-tree.h (make_temporary_var_for_ref_to_temp): Change
103 (real_non_cast_lvalue_p): New method.
104 * cvt.c (build_up_reference): Adjust use of
105 make_temporary_var_for_ref_to_temp.
106 * tree.c (real_non_cast_lvalue_p): New method.
108 2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
110 * except.c (init_exception_processing): Use C90 prototype style.
111 (cp_protect_cleanup_actions): Likewise.
112 (prepare_eh_type): Likewise.
113 (build_eh_type_type): Likewise.
114 (build_exc_ptr): Likewise.
115 (do_begin_catch): Likewise.
116 (dtor_nothrow): Likewise.
117 (do_end_catch): Likewise.
118 (push_eh_cleanup): Likewise.
119 (decl_is_java_type): Likewise.
120 (choose_personality_routine): Likewise.
121 (initialize_handler_parm): Likewise.
122 (expand_start_catch_block): Likewise.
123 (expand_end_catch_block): Likewise.
124 (begin_eh_spec_block): Likewise.
125 (finish_eh_spec_block): Likewise.
126 (do_allocate_exception): Likewise.
127 (do_free_exception): Likewise.
128 (wrap_cleanups_r): Likewise.
129 (stabilize_throw_expr): Likewise.
130 (build_throw): Likewise.
131 (complete_ptr_ref_or_void_ptr_p): Likewise.
132 (is_admissible_throw_operand): Likewise.
133 (nothrow_libfn_p): Likewise.
134 (can_convert_eh): Likewise.
135 (check_handlers_1): Likewise.
136 (check_handlers): Likewise.
138 2003-03-06 Mark Mitchell <mark@codesourcery.com>
140 * call.c (merge_conversion_sequences): New function.
141 (build_conv): Set ICS_USER_FLAG for USER_CONVs.
142 (convert_class_to_reference): Correct handling of second
143 standard conversion sequence in a user-defined conversion
145 (build_user_type_conversion_1): Use merge_conversion_sequences.
146 * cp-tree.def: Add comments for CONV nodes.
147 * rtti.c (get_tinfo_decl): Use build_address/build_nop.
149 2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
151 * error.c (init_error): Use C90 prototype style.
152 (dump_scope): Likewise.
153 (dump_qualifiers): Likewise.
154 (dump_template_argument): Likewise.
155 (dump_template_argument_list): Likewise.
156 (dump_template_parameter): Likewise.
157 (dump_template_bindings): Likewise.
158 (dump_type): Likewise.
159 (dump_typename): Likewise.
160 (class_key_or_enum): Likewise.
161 (dump_aggr_type): Likewise.
162 (dump_type_prefix): Likewise.
163 (dump_type_suffix): Likewise.
164 (dump_global_iord): Likewise.
165 (dump_simple_decl): Likewise.
166 (dump_decl): Likewise.
167 (dump_template_decl): Likewise.
168 (dump_function_decl): Likewise.
169 (dump_parameters): Likewise.
170 (dump_exception_spec): Likewise.
171 (dump_function_name): Likewise.
172 (dump_template_parms): Likewise.
173 (dump_char): Likewise.
174 (dump_expr_list): Likewise.
175 (dump_expr): Likewise.
176 (dump_binary_op): Likewise.
177 (dump_unary_op): Likewise.
178 (type_as_string): Likewise.
179 (expr_as_string): Likewise.
180 (decl_as_string): Likewise.
181 (context_as_string): Likewise.
182 (lang_decl_name): Likewise.
183 (cp_file_of): Likewise.
184 (cp_line_of): Likewise.
185 (decl_to_string): Likewise.
186 (expr_to_string): Likewise.
187 (fndecl_to_string): Likewise.
188 (code_to_string): Likewise.
189 (language_to_string): Likewise.
190 (parm_to_string): Likewise.
191 (op_to_string): Likewise.
192 (type_to_string): Likewise.
193 (assop_to_string): Likewise.
194 (args_to_string): Likewise.
195 (cv_to_string): Likewise.
196 (cxx_print_error_function): Likewise.
197 (cp_diagnostic_starter): Likewise.
198 (cp_diagnostic_finalizer): Likewise.
199 (cp_print_error_function): Likewise.
200 (function_category): Likewise.
201 (print_instantiation_full_context): Likewise.
202 (print_instantiation_partial_context): Likewise.
203 (maybe_print_instantiation_context): Likewise.
204 (print_instantiation_context): Likewise.
205 (cp_printer): Likewise.
206 (print_integer): Likewise.
207 (print_non_consecutive_character): Likewise.
208 (locate_error): Likewise.
210 2003-03-06 Mark Mitchell <mark@codesourcery.com>
213 * call.c (reference_binding): Add ref_is_var parameter.
214 (implicit_conversion): Adjust call to reference_binding.
215 (initialize_reference): Likewise.
218 * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
222 * class.c (get_basefndecls): Use lookup_fnfields_1.
224 2003-03-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
227 * parser.c (cp_parser_type_parameter): Remove redundant `expect'
229 (cp_parser_single_declaration): Likewise.
231 2003-03-05 Jason Merrill <jason@redhat.com>
234 * call.c (build_conditional_expr): Use convert rather than an
237 2003-03-02 Matt Austern <austern@apple.com>
239 * decl.c (cp_binding_level): Add static_decls varray member.
240 (add_decl_to_level): Add static/inline namespace scope
241 declarations to static_decls array.
242 (wrapup_global_for_namespace): Pass static_decls only, instead of
243 all decls, to wrapup_global_declarations/check_global_declarations.
244 (push_namespace): Initialize static_decls for ordinary namespaces.
245 (cxx_init_decl_processing): Initialize static_decls for global
248 2003-03-05 Mark Mitchell <mark@codesourcery.com>
250 * class.c (end_of_class): Correct thinko.
252 2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
254 * config-lang.in: Replace ${libstdcxx_version} by its value.
256 2003-03-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
258 * cp-tree.h (cxx_saved_binding): Declare.
259 (struct saved_scope): Adjust type of field 'old_binding'.
260 * decl.c (cxx_saved_binding_make): New macro.
261 (struct cxx_saved_binding): Define.
262 (store_bindings): Adjust prototype. Use cxx_saved_binding to save
264 (maybe_push_to_top_level): Adjust local variable type.
265 (pop_from_top_level): Likewise.
267 2003-03-04 Tom Tromey <tromey@redhat.com>
269 * Make-lang.in (c++.tags): New target.
271 2003-03-04 Neil Booth <neil@daikokuya.co.uk>
273 * Make-lang.in: Update.
275 2003-03-03 Jason Merrill <jason@redhat.com>
277 * decl.c (finish_enum): Do set the type in a template. Simplify.
278 * pt.c (tsubst_enum, tsubst_copy): Revert last patch.
280 2003-03-03 Mark Mitchell <mark@codesourcery.com>
283 * call.c (convert_class_to_reference): Correct conversion
285 (reference_binding): Add ref_bound_directly_to_rvalue_p parameter.
286 (implicit_conversion): Adjust call to reference_binding.
287 (add_candidate): Change type of candidates parameter.
288 (add_function_candidate): Likewise.
289 (add_conv_candidate): Likewise.
290 (build_builtin_candidate): Likewise.
291 (add_builtin_candidate): Likewise.
292 (add_builtin_candidates): Likewise.
293 (add_template_candidate_real): Likewise.
294 (add_template_candidate): Likewise.
295 (add_template_conv_candidate): Likewise.
296 (build_user_type_conversion_1): Adjust accordingly.
297 (build_object_call): Likewise.
298 (build_conditional_expr): Likewise.
299 (add_candidates): Likewise.
300 (build_new_op): Likewise.
301 (convert_like_real): Use USER_CONV_CAND. Use build_nop.
302 (build_new_method_call): Adjust calls to add_function_candidate.
303 (make_temporary_var_for_ref_to_temp): New function.
304 (initialize_reference): Add decl parameter.
305 * class.c (build_rtti_vtbl_entries): Use build_address and
307 * cp-tree.h (initialize_reference): Change prototype.
308 (make_temporary_var_for_ref_to_temp): New function.
309 (build_type_conversion): Change prototype.
310 (build_address): New function.
311 (build_nop): Likewise.
312 * cvt.c (cp_convert_to_pointer): Adjust call to
313 build_type_conversion. Avoid indicating redundant NOP_EXPRs.
315 (convert_to_pointer_force): Use build_nop.
316 (build_up_reference): Use make_temporary_var_for_ref_to_temp.
317 (convert_to_reference): Adjust call to build_type_conversion.
318 (ocp_convert): Likewise.
319 (build_type_conversion): Remove for_sure parameter.
320 * decl.c (grok_reference_init): Use initialize_reference.
321 * typeck.c (build_address): New function.
322 (build_nop): Likewise.
323 (build_unary_op): Use them.
324 (build_ptrmemfunc): Tidy slightly.
325 (convert_for_initialization): Adjust call to
326 initialize_reference.
327 * typeck2.c (store_init_value): Remove #if 0'd code.
329 2003-03-03 Jason Merrill <jason@redhat.com>
331 * decl.c (start_function): Clear DECL_NUM_STMTS.
333 * class.c (get_vtable_decl): Use vtbl_type_node.
334 (build_primary_vtable): Check for it.
336 2003-03-02 Aldy Hernandez <aldyh@redhat.com>
338 * decl.c (check_initializer): Check for vector_opaque_p.
340 2003-03-02 Ashif Harji <asharji@uwaterloo.ca>
342 * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to
343 invoke an external cpp during compilation.
345 2003-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
347 * decl.c (duplicate_decls): Convert use of warning_with_decl() to
349 (start_decl): Likewise.
350 (start_function): Likewise.
352 2003-03-01 Neil Booth <neil@daikokuya.co.uk>
354 * Make-lang.in (CXX_C_OBJS): Update.
356 2003-02-28 Mark Mitchell <mark@codesourcery.com>
359 * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when
362 2003-02-28 Aldy Hernandez <aldyh@redhat.com>
364 * parser.c (cp_parser_init_declarator): Revert opaque
365 vector_opaque_p change.
366 Do not include target.h.
368 2003-02-28 Mark Mitchell <mark@codesourcery.com>
371 * cp-tree.h (build_zero_init): Add parameter.
372 * decl.c (cp_finish_decl): Adjust call.
373 * init.c (build_zero_init): Add nelts parameter. Adjust recursive
375 (build_default_init): Add nelts parameter. Adjust calls to
377 (build_new_1): Adjust call to build_default_init.
378 * typeck2.c (process_init_constructor): Adjust call to build_zero_init.
380 2003-02-26 Devang Patel <dpatel@apple.com>
382 * decl.c (finish_enum): Merge two 'for' loops. Copy value node if required.
383 Postpone enum setting for template decls.
384 (build_enumerator): Delay copying value node until finish_enum (). Remove
386 * pt.c (tsubst_enum): Set TREE_TYPE and copy value node.
387 (tsubst_copy): Add check for enum type.
389 2003-02-25 Mark Mitchell <mark@codesourcery.com>
392 * decl2.c (prune_vars_needing_no_initialization): Do not throw
393 away initializations for DECL_EXTERNAL VAR_DECLs.
394 (finish_file): Adjust accordingly.
395 * pt.c (instantiate_decl): Do not defer VAR_DECLs.
397 2003-02-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
399 * decl.c (add_binding): Time TV_NAME_LOOKUP.
400 (push_class_binding): Likewise.
401 (set_namespace_binding): Likewise.
403 2003-02-24 Mark Mitchell <mark@codesourcery.com>
406 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from
407 specializations back to the main template.
408 * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use.
409 * pt.c (resolve_typename_type): Likewise.
411 2003-02-24 Jeffrey D. Oldham <oldham@codesourcery.com>
414 * pt.c (tsubst_copy_and_build): For a templated function inside a
415 scope, process template arguments.
417 2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
420 * typeck2.c (abstract_virtuals_error): Don't check when
421 TYPE is still template parameter dependent.
423 2003-02-23 Mark Mitchell <mark@codesourcery.com>
426 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro.
427 * parser.c (cp_parser_diagnose_invalid_type_name): Use it.
428 * pt.c (instantiate_class_template): Don't try to instantiate
430 (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE.
432 2003-02-21 Mark Mitchell <mark@codesourcery.com>
435 * decl.c (grokdeclarator): Do not allow parameters with variably
438 2003-02-21 Nathan Sidwell <nathan@codesourcery.com>
440 * search.c (bfs_walk_grow): Remove. Fold into ...
441 (bfs_walk): ... here, fix fencepost error. Fix merge lossage
444 2003-02-20 Mark Mitchell <mark@codesourcery.com>
447 * mangle.c (mangle_conv_op_name_for_type): Issue an error message
448 when the G++ 3.2 ABI prevents correct compilation.
450 2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
452 Change base class access representation. Share virtual base
454 * cp/call.c (build_special_member_call): Remove binfo_for_vbase
456 * cp/class.c (build_base_path): Likewise.
457 (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
458 (build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
459 (make_new_vtable): Adjust.
460 (force_canonical_binfo_r): Delete.
461 (force_canonical_binfo): Delete.
462 (mark_primary_virtual_base): Delete.
463 (dfs_unshared_virtual_bases): Delete.
464 (mark_primary_bases): Adjust.
465 (maybe_warn_about_overly_private_class): Adjust.
466 (dfs_base_derived_from): Delete.
467 (base_derived_from): Follow the inheritance chain.
468 (struct find_final_overrider_data): Add vpath member.
469 (dfs_find_final_overrider): Adjust.
470 (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
471 (find_final_overrider): Adjust.
472 (update_vtable_entry_for_fn): Adjust.
473 (modify_all_vtables): Adjust.
474 (walk_subobject_offsets): Adjust.
475 (layout_nonempty_base_or_field): Adjust.
476 (layout_empty_base): Remove last parameter. Adjust.
477 (build_base_field): Adjust.
478 (build_base_fields): Adjust.
479 (propagate_binfo_offsets): Remove last parameter. Adjust.
480 (dfs_set_offset_for_unshared_vbases): Delete.
481 (layout_virtual_bases): Adjust.
482 (finish_struct_1): Adjust.
483 (init_class_processing): Don't init access nodes.
484 (dfs_get_primary_binfo): Delete.
485 (get_primary_binfo): Adjust.
486 (dump_class_hierarchy_r): Remove most derived arg, add IGO
488 (dump_class_hierarchy): Adjust.
489 (finish_vtbls): Adjust.
490 (get_original_base): Delete.
491 (build_vtt_inits): Adjust.
492 (dfs_build_secondary_vptr_vtt_inits): Adjust.
493 (dfs_ctor_vtable_bases_queue_p): Adjust.
494 (build_ctor_vtbl_group): Adjust.
495 (dfs_accumulate_vtbl_inits): Adjust.
496 (build_vtbl_initializer): Adjust.
497 (build_vbase_offset_vtbl_entries): Adjust.
498 (add_vcall_offset_vtbl_entries_1): Adjust.
499 * cp/cp-tree.h (CPTI_ACCESS_*): Remove.
500 (access_*_node): Remove.
501 (CANONICAL_BINFO): Delete.
502 (BINFO_UNSHARED_MARKED): Remove.
503 (BINFO_MARKED): Set LANG_FLAG_0 directly.
504 (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
505 (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
506 (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
508 (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
509 (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
510 (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
512 (BINFO_DEPENDENT_BASE_P): New.
513 (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
515 (markedp, unmarkedp): Adjust.
516 (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
517 dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
518 find_vbase_instance, binfo_for_vbase): Delete.
519 (copied_binfo, original_binfo): Declare.
520 (finish_base_specifier): Add virtual_p arg.
521 (unshare_base_binfos): Delete.
522 (copy_base_binfos): Declare.
523 (reverse_path): Delete.
524 * cp/decl.c (xref_basetypes): Access and virtuality passed
525 differently. Don't copy direct base binfos here. Call
527 * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
528 (initialize_vtbl_ptrs): Adjust.
529 (expand_member_init): Adjust.
530 * cp/parser.c (cp_parser_base_specifier): Adjust.
531 * cp/pt.c (instantiate_class_template): Adjust.
532 (get_template_base_recursive): Adjust.
533 * cp/rtti.c (get_pseudo_ti_init): Adjust.
534 (get_pseudo_ti_desc): Adjust.
535 * cp/tree.c (unshare_base_binfos): Rename to ...
536 (copy_base_binfos): ... here, reimplement.
537 (make_binfo): Set BINFO_DEPENDENT_BASE_P.
538 (reverse_path): Remove.
539 * cp/typeck.c (get_delta_difference): Adjust error messages.
540 * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
541 * cp/search.c (lookup_base_r): Adjust.
542 (dynamic_cast_base_recurse): Adjust.
543 (canonical_binfo): Remove.
544 (dfs_canonical_queue): Remove.
545 (dfs_assert_unmarked_p): Remove.
546 (assert_canonical_unmarked): Remove.
547 (shared_marked_p, shared_unmarked_p): Remove.
548 (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
549 (dfs_access_in_type): Adjust.
550 (access_in_type): Adjust.
551 (dfs_accessible_queue_p): Adjust.
552 (dfs_accessible_p): Adjust.
553 (is_subobject_of_p_1, is_subobject_of_p): Remove.
554 (struct lookup_field_info): Remove from_dep_base_p field.
555 (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
556 (lookup_field_r): Remove dependent base code.
557 (lookup_member): Likewise.
558 (dfs_walk, dfs_walk_real): Add access arg to queue fn.
559 (dfs_unmarked_real_bases_queue_p): Remove.
560 (dfs_marked_real_bases_queue_p): Remove.
561 (dfs_skip_vbases): Remove.
562 (dfs_get_pure_virtuals): Adjust.
563 (markedp, unmarkedp): Adjust.
564 (marked_vtable_pathp, unmarked_vtable_pathp): Remove.
565 (marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
566 (dfs_unmark): Adjust.
567 (dfs_get_vbase_types):Remove.
568 (dfs_build_inheritance_graph_order): Remove.
569 (get_vbase_types): Remove
570 (dfs_find_vbase_instance): Remove.
571 (find_vbase_instance): Remove.
572 (dfs_debug_unmarkedp): Adjust.
573 (dependent_base_p): Remove.
574 (dfs_push_type_decls): Adjust.
575 (dfs_push_decls): Adjust.
576 (dfs_no_overlap_yet): Adjust.
577 (copied_binfo): New function.
578 (original_binfo): New function.
579 (binfo_for_vbase): Remove.
581 2003-02-18 Zack Weinberg <zack@codesourcery.com>
583 * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk.
584 (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES
587 2003-02-18 Mark Mitchell <mark@codesourcery.com>
590 * class.c (layout_class_type): In the 3.2 ABI, take into account
591 trailing bit fields when computing CLASSTYPE_SIZE_UNIT.
593 2003-02-18 Matt Austern <austern@apple.com>
595 * cp/cp-lang.c: Change lang hooks so that final_write_globals does
597 * cp/decl.c (wrapup_globals_for_namespace): Remove special
598 handling of global namespace.
600 2003-02-18 Geoffrey Keating <geoffk@apple.com>
602 * cp-tree.h (rid_to_yy): Delete.
603 (C_RID_YYCODE): Delete.
604 (finish_file): Delete redundant declaration.
606 2003-02-18 Jason Merrill <jason@redhat.com>
609 * decl.c (reshape_init): Don't mess with initializer labels.
612 * parser.c (cp_parser_postfix_expression): Set idk properly for
613 object->scope::member.
615 2003-02-18 Ben Elliston <bje@redhat.com>
618 * decl.c (duplicate_decls): Fix typo in comment.
620 2003-02-17 Michael Elizabeth Chastain <mec@shout.net>
623 * class.c (build_base_field): Mark fields for base classes with
626 2003-02-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
629 * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
630 CONSTRUCTOR_ELTS only once.
632 2003-02-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
635 * error.c (dump_type_prefix): Handle TYPEOF_TYPE.
636 (dump_type_suffix): Likewise.
638 2003-02-14 Nathan Sidwell <nathan@codesourcery.com>
640 * search.c: ANSIfy function declarations and definitions.
641 * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool.
642 * call.c (build_method_call, resolve_scoped_fn_name,
643 build_java_interface_fn_ref): Adjust lookup_field, lookup_member
645 * class.c (handle_using_decl): Likewise.
646 * decl.c (make_typename_type, make_unmound_class_template,
647 start_decl, compute_array_index_type): Likewise.
648 * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise.
649 * init.c (expand_member_init, build_member_call): Likewise.
650 * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation,
651 resolve_typename_type): Likewise.
652 * typeck.c (lookup_destructor, finish_class_member_access_exprm
653 build_prememfunc_access_expr): Likewise.
655 2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
657 * decl2.c: Include "timevar.h".
658 (namespace_ancestor): Time name lookup.
659 (add_using_namespace): Likewise.
660 (lookup_using_namespace): Likewise.
661 (qualified_lookup_using_namespace): Likewise.
662 (decl_namespace): Likewise.
663 (lookup_arg_dependent): Likewise.
664 * lex.c (do_identifier): Likewise.
665 (do_scoped_id): Likewise.
666 * pt.c (lookup_template_class): Likewise.
668 2003-02-14 Andrew Pinski <pinskia@physics.uc.edu>
670 * decl.c: (define_label): Fix warning for return 0 instead of NULL.
672 2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
674 * decl.c: Include "timevar.h".
675 (poplevel): Time name lookup.
676 (find_binding): Likewise.
677 (push_namespace): Likewise.
678 (pop_nested_namespace): Likewise.
679 (store_bindings): Likewise.
680 (maybe_push_to_top_level): Likewise.
681 (pop_from_top_level): Likewise.
682 (push_local_name): Likewise.
684 (pushdecl): Likewise.
685 (pushdecl_with_scope): Likewise.
686 (pushdecl_namespace_level): Likewise.
687 (pushdecl_top_level): Likewise.
688 (pushdecl_class_level): Likewise.
689 (push_class_level_binding): Likewise.
690 (push_using_decl): Likewise.
691 (push_using_directive): Likewise.
692 (push_overloaded_decl): Likewise.
693 (lookup_label): Likewise.
694 (define_label): Likewise.
695 (lookup_tag): Likewise.
696 (lookup_tag_reverse): Likewise.
697 (lookup_namespace_name): Likewise.
698 (select_decl): Likewise.
699 (unqualified_namespace_lookup): Likewise.
700 (lookup_name_real): Likewise.
701 (lookup_name_current_level): Likewise.
702 (lookup_type_current_level): Likewise.
703 (maybe_inject_for_scope_var): Likewise.
704 (xref_tag): Likewise.
706 * Make-lang.in (cp/decl.o): Add dependency on timevar.h
708 2003-02-12 Phil Edwards <pme@gcc.gnu.org>
710 * decl.c (build_enumerator): Remove unneeded test.
712 2003-02-09 Dan Nicolaescu <dann@ics.uci.edu>
714 * cp-tree.h (struct lang_type_header): Make all fields unsigned
717 2003-02-03 Mark Mitchell <mark@codesourcery.com>
720 * call.c (z_candidate): Add args.
721 (convert_class_to_reference): Set it.
722 (implicit_conversion): Tidy.
723 (add_candidate): Add args parameter.
724 (add_function_candidate): Adjust call to add_candidate.
725 (add_conv_candidate): Likewise.
726 (build_builtin_candidate): Likewise.
727 (build_user_type_conversion_1): Eliminate wasteful tree_cons
729 (build_new_function_call): Likewise.
730 (build_object_call): Likewise.
731 (add_candidates): New function.
732 (build_new_op): Use it.
733 (covert_like_real): Adjust call to build_over_call.
734 (build_over_call): Remove args parameter.
735 * operators.def: Add <?= and >?=.
737 2003-02-01 Richard Sandiford <rsandifo@redhat.com>
739 * typeck.c (build_indirect_ref): Don't check flag_volatile.
741 2003-01-31 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
744 * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL.
746 2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
748 * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
749 BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
750 (BINFO_LANG_ELTS): New #define.
751 * tree.c (make_binfo): Use BINFO_LANG_ELTS.
753 2003-01-30 Geoffrey Keating <geoffk@apple.com>
755 * cp/Make-lang.in: Remove -Wno-error from cp/decl.o.
757 2003-01-30 Mark Mitchell <mark@codesourcery.com>
759 * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY
761 * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit
762 rather than TYPE_LANG_FLAG_0.
763 (TYPE_BUILT_IN): Remove.
764 (TYPE_DEPENDENT_P): New macro.
765 (TYPE_DEPENDENT_P_VALID): Likewise.
766 (lang_type_class): Add fields_readonly.
767 * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN.
768 * pt.c (dependent_type_p_r): New function, split out from ...
769 (dependent_type_p): ... here. Memoize results.
770 * search.c (dependent_base_p): Use dependent_type_p, not
772 * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY
775 2003-01-29 Mark Mitchell <mark@codesourcery.com>
777 * call.c (build_field_call): Use build_new_op, not build_opfncall.
778 (prep_operand): New function.
779 (build_new_op): Use it. Remove dead code.
780 * class.c (pushclass): Change "modify" parameter type from int to
782 (currently_open_class): Use same_type_p, not pointer equality.
783 (push_nested_class): Adjust calls to pushclass, remove modify
785 * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
786 (pushclass): Change prototype.
787 (push_nested_class): Likewise.
788 (grokoptypename): Remove.
789 (build_opfncall): Remove.
790 (value_dependent_expression_p): Declare.
791 (resolve_typename_type): Likewise.
792 (resolve_typename_type_in_current_instantiation): Likewise.
793 (enter_scope_of): Remove.
795 (tsubst_expr): Likewise.
796 (tsubst_copy): Likewise.
797 (tsubst_copy_and_build): Likewise.
798 * decl.c (warn_about_implicit_typename_lookup): Remove.
799 (finish_case_label): Return error_mark_node for erroneous labels.
800 (start_decl): Adjust calls to push_nested_class.
801 (grokfndecl): Call push_scope/pop_scope around call to
803 (grokdeclarator): Do not call tsubst.
804 (start_function): Adjust calls to push_nested_class.
805 * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
806 (check_classfn): Use push_scope/pop_scope around type comparisions.
807 (grokoptypename): Remove.
808 (push_sscope): Adjust call to push_nested_class.
809 * error.c (dump_type): Show cv-qualification of typename types.
810 * init.c (build_member_call): Use build_new_op, not
812 * method.c (build_opfncall): Remove.
813 * parser.c (cp_parser): Add allow_non_constant_expression_p and
814 non_constant_expression_p.
815 (cp_parser_constant_expression): Adjust prototype.
816 (cp_parser_resolve_typename_type): Remove.
817 (cp_parser_non_constant_expression): New function.
818 (cp_parser_non_constant_id_expression): Likewise.
819 (cp_parser_new): Set allow_non_constant_expression_p and
820 non_constant_expression_p.
821 (cp_parser_primary_expression): Reject `this' and `va_arg' in
822 constant-expressions. Note that dependent names aren't really
824 (cp_parser_postfix_expression): Reject conversions to non-integral
825 types in constant-expressions. Neither are increments or
827 (cp_parser_unary_expression): Reject increments and decrements in
828 constant-expressions.
829 (cp_parser_direct_new_declarator): Adjust call to
830 cp_parser_constant_expression.
831 (cp_parser_cast_expression): Reject conversions to non-integral
832 types in constant-expressions.
833 (cp_parser_assignment_expression): Rejects assignments in
834 constant-expressions.
835 (cp_parser_expression): Reject commas in constant-expressions.
836 (cp_parser_labeled_statement): Adjust call to
837 cp_parser_constant_expression.
838 (cp_parser_direct_declarator): Simplify array bounds, even in
839 templates, when they are non-dependent. Use
840 resolve_typename_type, not cp_parser_resolve_typename_type.
841 (cp_parser_class_head): Use resolve_typename_type, not
842 cp_parser_resolve_typename_type.
843 (cp_parser_member_declaration): Adjust call to
844 cp_parser_constant_expression.
845 (cp_parser_constant_initializer): Likewise.
846 (cp_parser_constructor_declarator): Use resolve_typename_type, not
847 cp_parser_resolve_typename_type.
848 (cp_parser_late_parsing_default_args): Adjust call to
850 * pt.c (tsubst): Give it internal linkage.
851 (tsubst_expr): Likewise.
852 (tsubst_copy): Likewise.
853 (tsubst_copy_and_build): Likewise.
854 (push_access_scope_real): Likewise.
855 (tsubst_friend_class): Likewise.
856 (instantiate_class_template): Adjust call to pushclass.
857 (value_dependent_expression_p): Give it external linkage.
859 (resolve_typename_type): New function.
860 * semantics.c (finish_call_expr): Use build_new_op, not
862 (begin_constructor_declarator): Remove.
863 (begin_class_definition): Adjust call to pushclass.
864 (enter_scope_of): Remove.
865 * typeck.c (comptypes): Resolve typename types as appropriate.
866 (build_x_indirect_ref): Use build_new_op, not build_opfncall.
867 (build_x_compound_expr): Likewise.
868 (build_modify_expr): Likewise.
869 (build_x_modify_expr): Likewise.
870 * typeck2.c (build_x_arrow): Likewise.
872 2003-01-29 Fariborz Jahanian <fjahanian@apple.com>
874 * pt.c (last_pending_template) Declare GTY().
876 2003-01-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
879 * parser.c (cp_parser_elaborated_type_specifier): Convert
880 TEMPLATE_DECL to TYPE_DECL only when processing template friends.
881 (cp_parser_maybe_treat_template_as_class): Remove redundant tests.
883 2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
886 * pt.c (unify): Don't unify '*T' with 'U C::*'.
889 * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
892 2003-01-27 Nathan Sidwell <nathan@codesourcery.com>
894 * class.c (update_vtable_entry_for_fn): Add index parameter.
895 Generate vcall thunk for covariant overriding from a virtual
897 (dfs_modify_vtables): Adjust.
899 2003-01-25 Nathan Sidwell <nathan@codesourcery.com>
902 * parser.c (cp_parser_class_or_namespace_name): Reject duplicate
904 (cp_parser_base_specifier): Look for and consume a
905 TEMPLATE keyword. Replace switch with array index.
908 * semantics.c (finish_non_static_data_member): Remember the
909 field's type even in a template.
912 * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are
916 * parser.c (cp_parser_cast_expression): Be more tentative.
918 2003-01-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
920 * cp-tree.h (flagged_type_tree_s): Remove.
921 (check_for_new_type): Likewise.
922 * typeck2.c (check_for_new_type): Likewise.
924 2003-01-23 Nathanael Nerode <neroden@gcc.gnu.org>
926 * dump.c: ANSIfy function declarations and definitions.
928 * cp-tree.h, decl.h: Get rid of PARAMS. Again.
930 2003-01-22 Mark Mitchell <mark@codesourcery.com>
933 * init.c (build_new): Set the type of the new-expression, even
934 when processing_templte_decl.
937 * parser.c (cp_parser_primary_expression): Improve error message
938 for templates used in an expression context.
941 * parser.c (cp_parser_decl_specifier_seq): Commit to tentative
942 parse when encountering "typedef".
944 2003-01-22 Nathanael Nerode <neroden@gcc.gnu.org>
946 * class.c, parser.c: ANSIfy function definitions and declarations.
948 2003-01-22 Mark Mitchell <mark@codesourcery.com>
951 * error.c (dump_decl): For an OVERLOAD, just print the name of the
952 function; it doesn't make sense to try to print its type.
953 * semantics.c (finish_typeof): Issue errors about invalid uses.
956 * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New
958 (cp_parser_expression_statement): Use it.
959 (cp_parser_explicit_instantiation): Likewise.
960 * pt.c (do_decl_instantiation): Improve error handling logic.
962 2003-01-22 Mark Mitchell <mark@codesourcery.com>
965 * parser.c (cp_parser_using_declaration): Issue error messages
966 about name resolution failures here.
969 * class.c (currently_open_derived_class): Use dependent_type_p.
970 * cp-tree.h (dependent_type_p): New function.
971 (dependent_template_arg_p): Likewise.
972 (dependent_template_p): Likewise.
973 (type_dependent_expression_p): Likewise.
974 * parser.c (cp_parser_dependent_type_p): Remove.
975 (cp_parser_value_dependent_type_p): Likewise.
976 (cp_parser_type_dependent_expression_p): Likewise.
977 (cp_parser_dependent_template_arg_p): Likewise.
978 (cp_parser_dependent_template_id_p): Likewise.
979 (cp_parser_dependent_template_p): Likewise.
980 (cp_parser_diagnose_invalid_type_name): Replace
981 cp_parser_dependent_type_p with dependent_type_p, etc.
982 (cp_parser_primary_expresion): Likewise.
983 (cp_parser_nested_name_specifier_opt): Likewise.
984 (cp_parser_postfix_expression): Likewise.
985 (cp_parser_unary_expression): Likewise.
986 (cp_parser_template_name): Likewise.
987 (cp_parser_class_name): Likewise.
988 (cp_parser_lookup_name): Likewise.
989 * pt.c (dependent_type_p): New function.
990 (value_dependent_expression_p): Likewise.
991 (type_dependent_expression_p): Likewise.
992 (dependent_template_arg_p): Likewise.
993 (dependent_template_id_p): Likewise.
994 (dependent_template_p): Likewise.
998 * parser.c (cp_parser_simple_declaration): Return quickly when
1001 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1003 Make-lang.in (cp/decl.o-warn): Add -Wno-error.
1005 2003-01-17 Jason Merrill <jason@redhat.com>
1007 PR c++/9167, c++/9358
1008 * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
1010 2003-01-17 Jason Merrill <jason@redhat.com>
1013 * call.c (build_conditional_expr): Always do lvalue-rvalue
1016 2003-01-17 Mark Mitchell <mark@codesourcery.com>
1019 * cp-tree.def (BASELINK): Make it class 'x', not class 'e'.
1020 * cp-tree.h (BASELINK_BINFO): Adjust.
1021 (BASELINK_FUNCTIONS): Likewise.
1022 (BASELINK_ACCESS_BINFO): Likewise.
1023 (tree_baselink): New structure.
1024 (cp_tree_node_structure_enum): Add TS_CP_BASELINK.
1025 (lang_tree_node): Add baselink.
1026 * decl.c (cp_tree_node_structure): Add BASELINK case.
1027 * search.c (build_baselink): Adjust.
1028 * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P
1029 test from TREE_LIST case.
1032 * parser.c (cp_parser_constructor_declarator_p): Do not assume
1033 that a constructor cannot be declared outside of its own class.
1035 * parser.c (cp_parser_resolve_typename_type): If the scope cannot
1036 be resolved, neither can the qualified name.
1038 * rtti.c (get_pseudo_ti_desc): Fix thinko.
1040 2003-01-16 Jason Merrill <jason@redhat.com>
1043 * init.c (build_vec_init): Re-add maxindex parm.
1044 (perform_member_init, build_aggr_init): Pass it.
1045 (build_new_1): Pass it. Use an incomplete array type for full_type.
1046 * typeck.c (build_modify_expr): Pass it.
1047 * cp-tree.h: Adjust.
1049 2003-01-16 Jeffrey D. Oldham <oldham@codesourcery.com>
1051 * cp-tree.h (tsubst_copy_and_build): New declaration.
1052 * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment.
1053 (tsubst_expr): Use 'tsubst_copy_and_build'. Update initial comment.
1054 (tsubst_copy_and_build): New function.
1056 2003-01-16 Mark Mitchell <mark@codesourcery.com>
1058 * cp-tree.h (lang_type_class): Remove is_partial_instantiation.
1059 (PARTIAL_INSTANTIATION_P): Remove.
1060 (IMPLICIT_TYPENAME_P): Likewise.
1061 (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise.
1062 (build_typename_type): Remove declaration.
1063 (parmlist_is_exprlist): Likewise.
1064 * decl.c (build_typename_type): Make it static, remove third
1066 (push_class_binding): Don't do implicit typename stuff.
1067 (make_typename_type): Likewise.
1068 (lookup_name_real): Likewise.
1069 (grokdeclarator): Don't try to convert declarations into
1070 initializations. Don't do implicit typename stuff.
1071 (parmlist_is_exprlist): Remove.
1072 (xref_basetypes): Simplify.
1073 * decl2.c (grokfield): Don't try to convert declarations into
1075 (build_anon_union_vars): Do this while processing templates, too.
1076 (finish_anon_union): Likewise.
1077 * error.c (dump_type): Remove implicit typename handling.
1078 * parser.c (cp_parser_diagnose_invalid_type_name): New method.
1079 (cp_parser_primary_expression): Correct handling of names not
1080 found by unqualified name lookup in templates.
1081 (cp_parser_nested_name_specifier_opt): Avoid checking dependency
1082 of types when possible.
1083 (cp_parser_simple_declaration): Complain intelligently about some
1084 invalid declarations.
1085 (cp_parser_member_declaration): Likewise.
1086 (cp_parser_constructor_declarator_p): Don't check when we're in a
1088 * pt.c (instantiate_class_template): Remove
1089 PARTIAL_INSTANTIATION_P gunk.
1090 * search.c (lookup_field_r): Don't build implicit typenames.
1091 (marked_pushdecls_p): Don't enter dependent base types.
1092 (unmarked_pushdecls_p): Likewise.
1093 * semantics.c (begin_class_definition): Remove implicit typename
1096 2003-01-16 Nathan Sidwell <nathan@codesourcery.com>
1099 * parser.c (cp_parser_direct_declarator): If accepting either
1100 abstract or named, the name must be an unqualified-id.
1102 2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1104 * class.c (layout_virtual_bases): Avoid signed/unsigned warning.
1106 2003-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1108 * decl2.c (check_classfn): Fix uninitialized warning.
1109 (build_anon_union_vars): Likewise.
1110 * pt.c (tsubst_copy): Likewise.
1112 2003-01-14 Jeffrey D. Oldham <oldham@codesourcery.com>
1114 Further conform g++'s __vmi_class_type_info to the C++ ABI
1116 * rtti.c (dfs_class_hint_mark): Do not set hints not specified by
1118 (class_hint_flags): Likewise.
1120 2003-01-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1122 * config-lang.in: Add semantics.c to gtfiles.
1123 * cp-tree.h (flagged_type_tree_s): Remove lookups field.
1124 (saved_scope): Likewise.
1125 (type_lookups): Remove.
1126 (deferred_access): New structure.
1127 (type_access_control): Remove.
1128 (save_type_access_control): Likewise.
1129 (reset_type_access_control): Likewise.
1130 (decl_type_access_control): Likewise.
1131 (push_deferring_access_checks): Declare.
1132 (resume_deferring_access_checks): Likewise.
1133 (stop_deferring_access_checks): Likewise.
1134 (pop_deferring_access_checks): Likewise.
1135 (get_deferred_access_checks): Likewise.
1136 (pop_to_parent_deferring_access_checks): Likewise.
1137 (perform_deferred_access_checks): Likewise.
1138 (perform_or_defer_access_check): Likewise.
1139 * decl.c (make_typename_type): Use perform_or_defer_access_check.
1140 (make_unbound_class_template): Likewise.
1141 (grokdeclarator): Don't call decl_type_access_control.
1142 * parser.c (cp_parser_context): Remove deferred_access_checks
1143 and deferring_access_checks_p fields.
1144 (cp_parser_context_new): Adjust.
1145 (cp_parser): Remove access_checks_lists.
1146 (cp_parser_defer_access_check): Remove.
1147 (cp_parser_start_deferring_access_checks): Remove.
1148 (cp_parser_stop_deferring_access_checks): Remove.
1149 (cp_parser_perform_deferred_access_checks): Remove.
1150 (cp_parser_nested_name_specifier_opt): Use new deferred access
1152 (cp_parser_simple_declaration): Likewise.
1153 (cp_parser_template_id): Likewise.
1154 (cp_parser_function_definition): Likewise.
1155 (cp_parser_class_specifier): Likewise.
1156 (cp_parser_lookup_name): Likewise.
1157 (cp_parser_single_declaration): Likewise.
1158 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
1159 (cp_parser_parse_tentatively): Likewise.
1160 (cp_parser_parse_definitely): Likewise.
1161 (yyparse): Likewise.
1162 (cp_parser_init_declarator): Remove access_checks parameter.
1163 Use new deferred access functions.
1164 (cp_parser_function_definition_from_specifiers_and_declarator):
1166 (cp_parser_class_head): Remove deferring_access_checks_p and
1167 saved_access_checks parameters. Use new deferred access functions.
1168 (cp_parser_member_specification_opt): Don't call
1169 reset_type_access_control.
1170 * search.c (type_access_control): Remove.
1171 * semantics.c: Include "gt-cp-semantics.h".
1172 (deferred_type_access_control): Remove.
1173 (deferred_access_stack): New variable.
1174 (deferred_access_free_list): Likewise.
1175 (push_deferring_access_checks): New function.
1176 (resume_deferring_access_checks): Likewise.
1177 (stop_deferring_access_checks): Likewise.
1178 (pop_deferring_access_checks): Likewise.
1179 (get_deferred_access_checks): Likewise.
1180 (pop_to_parent_deferring_access_checks): Likewise.
1181 (perform_deferred_access_checks): New function, adapted from
1182 cp_parser_perform_deferred_access_checks.
1183 (perform_or_defer_access_check): New function, adapted from
1184 cp_parser_defer_access_check.
1185 (current_type_lookups): Remove.
1186 (deferred_type_access_control): Likewise.
1187 (decl_type_access_control): Likewise.
1188 (save_type_access_control): Likewise.
1189 (reset_type_access_control): Likewise.
1190 (begin_function_definition): Adjust.
1191 (begin_class_definiton): Likewise.
1193 2003-01-13 Jason Merrill <jason@redhat.com>
1196 * class.c (build_base_path): Take the address before calling save_expr.
1198 * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
1199 all the ambiguous conversions are bad.
1201 * class.c (maybe_warn_about_overly_private_class): Don't stop
1202 searching when we find a nonprivate method.
1204 * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue.
1206 2003-01-12 Mark Mitchell <mark@codesourcery.com>
1208 * cp-tree.h (get_arglist_len_in_bytes): Remove.
1211 * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
1212 typeame types more robustly.
1214 2003-01-11 Phil Edwards <pme@gcc.gnu.org>
1216 * parser.c: Fix comment typos.
1218 2003-01-10 Mark Mitchell <mark@codesourcery.com>
1221 * parser.c (cp_parser_scope_through_which_access_occurs): Handle
1222 an object_type which is not a class type.
1224 2003-01-10 Geoffrey Keating <geoffk@apple.com>
1226 * parser.c (cp_parser_late_parsing_for_member): Don't cast to void.
1227 (cp_parser_late_parsing_default_args): Likewise.
1229 2003-01-10 Nathanael Nerode <neroden@gcc.gnu.org>
1231 * cfns.gperf: ANSIfy function declarations.
1232 * cfns.h: Regenerate.
1233 * cp-tree.h: ANSIfy function declarations.
1235 2003-01-10 Mark Mitchell <mark@codesourcery.com>
1237 * cp-tree.h (reparse_absdcl_as_expr): Remove.
1238 (reparse_absdcl_as_casts): Likewise.
1239 (reparse_decl_as_expr): Likewise.
1240 (finish_decl_parsing): Likewise.
1241 * decl2.c (reparse_absdcl_as_expr): Remove.
1242 (reparse_absdcl_as_casts): Likewise.
1243 (repase_decl_as_expr): Likewise.
1244 (finish_decl_parsing): Likewise.
1249 * parser.c (cp_parser_pre_parsed_nested_name_specifier): New
1251 (cp_parser_nested_name_specifier_opt): Correct the
1252 check_dependency_p false.
1253 (cp_parser_postfix_expression): Fix formatting.
1254 (cp_parser_decl_specifier_seq): Avoid looking for constructor
1255 declarators when possible.
1256 (cp_parser_template_id): Avoid performing name-lookup when
1258 (cp_parser_class_head): Do not count specializations when counting
1259 levels of templates.
1260 (cp_parser_constructor_declarator_p): Return immediately if
1261 there's no chance that the tokens form a constructor declarator.
1262 * rtti.c (throw_bad_typeid): Add comment. Do not return an
1263 expression with reference type.
1264 (get_tinfo_decl_dynamic): Do not return an expression with
1266 (build_typeid): Add comment. Do not return an expression with
1268 * typeck.c (build_class_member_access_expr): Improve handling of
1269 conditionals and comma-expressions as objects.
1271 2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
1273 * cfns.gperf: ANSIfy function declarations.
1274 * cfns.h: Regenerate.
1275 * cp-tree.h: ANSIfy function declarations.
1276 * parser.c: ANSIfy function declarations & definitions.
1278 * decl.c (bad_specifiers): Fix parameter order error I introduced.
1280 2003-01-09 Geoffrey Keating <geoffk@apple.com>
1282 Merge from pch-branch:
1284 2003-01-09 Geoffrey Keating <geoffk@apple.com>
1286 Merge to tag pch-merge-20030102:
1288 * semantics.c (finish_translation_unit): Don't call finish_file.
1289 * parser.c: Don't include ggc.h.
1290 (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer,
1291 read first token here. Don't allow PCH files after the first
1293 (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new.
1294 (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL.
1295 (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory.
1296 (cp_parser_late_parsing_for_member): Don't duplicate call to
1297 cp_lexer_set_source_position_from_token.
1298 (cp_parser_late_parsing_default_args): Likewise.
1299 (yyparse): Call finish_file after clearing the_parser.
1301 2002-12-11 Geoffrey Keating <geoffk@apple.com>
1303 * Make-lang.in: Remove $(GGC_H) from all dependencies.
1304 (CXX_TREE_H): Add $(GGC_H).
1305 * class.c: Don't include ggc.h.
1306 (field_decl_cmp): Make parameters be 'const void *' to match qsort.
1307 (method_name_cmp): Likewise.
1308 (resort_data): New variable.
1309 (resort_field_decl_cmp): New.
1310 (resort_method_name_cmp): New.
1311 (resort_sorted_fields): New.
1312 (resort_type_method_vec): New.
1313 (finish_struct_methods): Delete cast.
1314 (finish_struct_1): Delete cast.
1315 * cp-tree.h: Include ggc.h.
1316 (struct lang_type_class): Add reorder attribute to field `methods'.
1317 (union lang_decl_u3): Add reorder attribute to field `sorted_fields'.
1318 (resort_sorted_fields): New prototype.
1319 (resort_type_method_vec): New prototype.
1320 * call.c: Don't include ggc.h.
1322 * decl2.c: Likewise.
1325 * method.c: Likewise.
1326 * optimize.c: Likewise.
1327 * parse.y: Likewise.
1330 * search.c: Likewise.
1331 * semantics.c: Likewise.
1335 * lang-specs.h: Remove comment.
1337 2002-12-03 Geoffrey Keating <geoffk@apple.com>
1339 * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery.
1340 (operator_name_info): Mark to be saved for PCH, specify size.
1341 (assignment_operator_name_info): Likewise.
1343 2002-11-19 Geoffrey Keating <geoffk@apple.com>
1345 * decl.c (anon_cnt): Mark to be saved for PCH.
1347 2002-10-25 Geoffrey Keating <geoffk@apple.com>
1349 * lex.c (init_reswords): Delete now-untrue comment.
1350 Allocate ridpointers using GGC.
1352 2002-10-04 Geoffrey Keating <geoffk@apple.com>
1354 * cp-tree.h (union lang_decl_u2): Add tags to all fields.
1356 * g++spec.c (lang_specific_driver): Don't include standard
1357 libraries in `added'.
1359 2002-08-27 Geoffrey Keating <geoffk@redhat.com>
1361 * decl2.c (finish_file): Call c_common_write_pch.
1362 * Make-lang.in (CXX_C_OBJS): Add c-pch.o.
1364 2002-08-17 Geoffrey Keating <geoffk@redhat.com>
1366 * g++spec.c (lang_specific_driver): Treat .h files as C++ header
1367 files when using g++.
1368 * lang-specs.h: Handle compiling C++ header files.
1370 2003-01-09 Jakub Jelinek <jakub@redhat.com>
1372 * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs.
1374 2003-01-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1376 * pt.c (push_access_scope_real): Call push_to_top_level for
1377 function in namespace scope.
1378 (pop_access_scope): Call pop_from_top_level for function in
1381 2003-01-09 Jakub Jelinek <jakub@redhat.com>
1383 * decl.c (start_decl): Don't set DECL_COMMON for __thread variables.
1385 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
1387 * Make-lang.in (c++.install-common, c++.install-man,
1388 c++.uninstall): Prepend $(DESTDIR) to destination paths in
1389 all (un)installation commands.
1390 (c++.install-common): Rewrite $(LN) commands to support
1391 DESTDIR with "ln" as well as with "ln -s".
1393 2003-01-08 Jason Merrill <jason@redhat.com>
1395 * parser.c (cp_parser_primary_expression): See through explicitly
1396 scoped ALIAS_DECLs, too.
1398 2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
1400 * decl.c: Remove some #if 0 code.
1402 * decl.c: ANSIfy function declarations.
1404 2003-01-07 Mark Mitchell <mark@codesourcery.com>
1406 * parser.c (cp_parser_asm_definition): Correct handling of omitted
1409 2003-01-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1412 * decl.c (make_typename_type): Check access only when tf_error.
1413 (make_unbound_class_template): Likewise.
1414 * pt.c (saved_access_scope): New variable.
1415 (push_access_scope_real): New function.
1416 (push_access_scope): Likewise.
1417 (pop_access_scope): Likewise.
1418 (tsubst_default_argument): Use them.
1419 (instantiate_template): Likewise.
1420 (regenerate_decl_from_template): Likewise.
1421 (instantiate_decl): Likewise.
1422 (get_mostly_instantiated_function_type): Likewise.
1424 2003-01-07 Nathanael Nerode <neroden@gcc.gnu.org>
1426 * tree.c: Delete bogus #if 0 code.
1428 2003-01-07 Andreas Schwab <schwab@suse.de>
1430 * class.c (layout_class_type): Don't use
1431 PCC_BITFIELD_TYPE_MATTERS if not defined.
1433 2003-01-06 Mark Mitchell <mark@codesourcery.com>
1436 * decl2.c (build_cleanup): Mark the object as used.
1438 * pt.c (retrieve_local_specialization): Revert 2003-01-05 change.
1439 (hash_local_specialization): New function.
1440 (register_local_specialization): Revert 2003-01-05 change.
1441 (instantiate_decl): Use hash_local_specialization when creating
1442 the local_specializations table.
1444 * decl2.c (mark_used): Do not synthesize thunks.
1446 * class.c (layout_class_type): Correct handling of unnamed
1447 bitfields wider than their types.
1450 * parser.c (cp_parser): Remove default_arg_types. Update
1451 documentation for unparsed_functions_queues.
1452 (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the
1454 (cp_parser_new): Don't set parser->default_arg_types.
1455 (cp_parser_function_definition): Adjust usage of
1456 unparsed_funtions_queues.
1457 (cp_parser_class_specifier): Don't mess with
1458 parser->default_arg_types. Handle default argument processing in
1459 a separate phase from function body processing.
1460 (cp_parser_template_declaration_after_export): Adjust usage of
1461 unparsed_functions_queues.
1462 (cp_parser_late_parsing_for_member): Do not handle default
1465 2003-01-06 Nathan Sidwell <nathan@codesourcery.com>
1468 * parser.c (cp_parser_declarator_kind): New enum.
1469 (cp_parser_declarator): Adjust.
1470 (cp_parser_direct_declarator): Adjust. Allow for either named or
1471 abstract declarator. Prefer abstract, if possible. Allow
1472 parenthesized function name.
1473 (cp_parser_condition): Adjust cp_parser_declarator call.
1474 (cp_parser_explicit_instantiation): Likewise.
1475 (cp_parser_init_declarator): Likewise.
1476 (cp_parser_type_id): Likewise.
1477 (cp_parser_function_definition): Likewise.
1478 (cp_parser_member_declaration): Likewise.
1479 (cp_parser_parameter_declaration): Use cp_parser_declarator to do
1480 the tentative parsing.
1481 (cp_parser_exception_declaration): Likewise.
1483 2003-01-05 Mark Mitchell <mark@codesourcery.com>
1485 * parser.c (cp_parser_template_parameter): Adjust call to
1486 cp_parser_parameter_declaration.
1487 (cp_parser_parameter_declaration_list): Likewise.
1488 (cp_parser_parameter_declaration): Replace
1489 greater_than_is_operator_p with template_parm_p parameter. Do not
1490 cache tokens for template default arguments.
1492 * pt.c (retrieve_local_specialization): Use htab_find, not
1493 htab_find_with_hash.
1494 (register_local_specialization): Use htab_find_slot, not
1495 htab_find_slot_with_hash.
1496 (instantiate_decl): Pass a hash function to htab_create.
1498 2003-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1500 * parser.c (cp_parser_binary_expression,
1501 cp_parser_multiplicative_expression,
1502 cp_parser_additive_expression, cp_parser_shift_expression,
1503 cp_parser_relational_expression, cp_parser_equality_expression,
1504 cp_parser_and_expression, cp_parser_exclusive_or_expression,
1505 cp_parser_inclusive_or_expression,
1506 cp_parser_logical_and_expression, cp_parser_logical_or_expression,
1507 cp_parser_binary_expression): Const-ify.
1509 2003-01-04 Mark Mitchell <mark@codesourcery.com>
1511 * method.c (use_thunk): Disable access control while building the
1514 2003-01-03 Nathanael Nerode <neroden@gcc.gnu.org>
1516 * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C
1519 2003-01-03 Matt Austern <austern@apple.com>
1521 * cp-tree.h (struct lang_type_class): add field for key method
1522 (cp_global_trees): rename dynamic_classes to keyed_classes
1523 (key_method): add definition
1524 * class.c (finish_struct_1): compute class's key method, and add
1525 the class to keyed_classes list if there is no key method.
1526 * decl.c (finish_function): add class to keyed_classes list if we
1527 see a definition of the class's key method.
1528 * pt.c (instantiate_class_template): add template specialization
1529 of a dynamic class to keyed_classes list.
1530 * decl2.c (key_method): remove
1531 (finish_file): iterate only through keyed_classes list when
1532 deciding whether to emit vtables, remove class from its list after
1535 2003-01-02 Jason Merrill <jason@redhat.com>
1537 * call.c (build_conditional_expr): Stabilize lvalues properly.
1538 * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type.
1539 * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues.
1540 Don't allow CALL_EXPR or VA_ARG_EXPR, either.
1542 * call.c (convert_like_real): Call decl_constant_value for an
1543 IDENTITY_CONV even if there are no more conversions.
1545 * cvt.c (build_up_reference): Don't push unnamed temps.
1547 * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL.
1549 * dump.c (cp_dump_tree): Don't try to dump class-specific fields
1550 for a backend struct.
1552 * except.c (wrap_cleanups_r, build_throw): Make
1553 MUST_NOT_THROW_EXPRs void.
1554 * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR.
1556 * init.c (build_vec_delete_1): Pre-evaluate the base address.
1558 * init.c (get_temp_regvar): Simplify logic.
1560 * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if
1561 our replacement is a decl.
1563 * decl.c (cp_make_fname_decl): Push the decls inside the
1566 2003-01-03 Nathan Sidwell <nathan@codesourcery.com>
1569 * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be
1572 2003-01-03 Graham Stott <graham.stott@btinternet.com>
1574 * parser.c (struct cp_parser): Add access_checks_lists field
1575 (cp_parser_simple_declaration): Use.
1576 (cp_parser_init_declarator): Likewise.
1578 2003-01-02 Mark Mitchell <mark@codesourcery.com>
1580 * parser.c (cp_parser_declaration): Accept the __extension__
1581 keyword before the declaration.
1584 * parser.c (cp_parser_parameter_declaration): Allow attributes to
1585 appear after the declarator.
1587 * call.c (build_new_method_call): Fix typo in message format
1590 2003-01-02 Mark Mitchell <mark@codesourcery.com>
1592 * parser.c (cp_lexer_next_token_is): Declare it inline.
1593 (cp_lexer_set_source_position_from_token): Likewise.
1594 (cp_lexer_debugging_p): Likewise.
1595 (cp_parser_parsing_tentatively): Likewise.
1596 (cp_parser_nested_name_specifier_opt): Reduce the number of calls
1597 to the cp_lexer_peek_token.
1599 * parser.c (cp_parser_sizeof_operand): Do not evaluate the
1602 2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
1604 * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c,
1605 cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c,
1606 cp/repo.c: Fix copyright years.
1608 2003-01-01 Neil Booth <neil@daikokuya.co.uk>
1610 * lex.c: Remove superfluous include of cpplib.h.
1611 (CONSTRAINT): Define without conditions.
1612 (init_cp_pragma): Use c_register_pragma.
1614 2002-12-31 Neil Booth <neil@daikokuya.co.uk>
1616 * .cvsignore: Remove.
1618 2002-12-31 Steven Bosscher <s.bosscher@student.tudelft.nl>
1620 * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
1621 except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
1622 lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
1623 pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
1624 typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
1626 * lex.h: parse.y is dead, so don't mention it. Also replace the
1627 copyright header with the default GNU copyright header.
1629 2002-12-31 Mark Mitchell <mark@codesourcery.com>
1631 * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove.
1632 (lookup_name_namespace_only): Likewise.
1633 (begin_only_namespace_names): Likewise.
1634 (end_only_namespace_names): Likewise.
1635 * decl.c (only_namespace_names): Remove.
1636 (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED.
1637 (lookup_name_real): Do not check only_namespace_names.
1638 (lookup_name_namespace_only): Remove.
1639 (begin_only_namespace_names): Likewise.
1640 (end_only_namespace_names): Likewise.
1641 * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous
1642 nested-name-specifiers more gracefully.
1643 (cp_parser_class_or_namespace_name): Avoid looking up namespace
1644 names when they cannot possibly appear.
1645 (cp_parser_template_name): Adjust call to cp_parser_lookup_name.
1646 (cp_parser_elaborated_type_specifier): Likewise.
1647 (cp_parser_namespace_name): Only look for namespace names.
1648 (cp_parser_lookup_name): Add is_namespace parameter.
1649 (cp_parser_lookup_name_simple): Adjust call to
1650 cp_parser_lookup_name.
1652 * parser.c (cp_parser_dependent_type_p): Fix thinko.
1654 2002-12-31 Neil Booth <neil@daikokuya.co.uk>
1656 * .cvsignore: Update.
1658 2002-12-31 Nathan Sidwell <nathan@codesourcery.com>
1660 * class.c (modify_vtable_entry): Remove unused variable.
1661 (get_vcall_index): Always expect a non-thunk.
1662 (update_vtable_entry_for_fn): Combine covariant adjustments, when
1663 overriding a thunk. Pass get_vcall_index a non-thunk.
1665 * decl2.c (finish_file): Mark undefined inlines as extern.
1667 2002-12-31 Mark Mitchell <mark@codesourcery.com>
1669 * cp-tree.def (RETURN_INIT): Remove.
1670 * cp-tree.h (DECL_IN_MEMORY_P): Remove.
1671 (scope_kind): Add sk_block, sk_try, sk_catch, sk_for.
1672 (note_level_for_for): Remove.
1673 (note_level_for_try): Likewise.
1674 (note_level_for_catch): Likewise.
1675 (finish_named_return_value): Likewise.
1676 (do_pushlevel): Change prototype.
1677 (pending_lang_change): Remove.
1678 * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch,
1680 (note_level_for_for): Remove.
1681 (note_level_for_try): Likewise.
1682 (note_level_for_catch): Likewise.
1683 (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P.
1684 * parser.c (cp_parser_context_free_list): Make it "deletable".
1685 (cp_parser_template_argument): Remove misleading comment.
1686 * pt.c (tsubst_expr): Remove RETURN_INIT code.
1687 * semantics.c (genrtl_named_return_value): Remove.
1688 (do_pushlevel): Take a scope kind as an argument.
1689 (begin_if_stmt): Adjust.
1690 (begin_while_stmt): Likewise.
1691 (begin_for_stmt): Likewise.
1692 (finish_for_init_stmt): Likewise.
1693 (begin_switch_stmt): Likewise.
1694 (begin_handler): Likewise.
1695 (begin_compound_stmt): Likewise.
1696 (finish_named_return_value): Remove.
1697 (cp_expand_stmt): Remove RETURN_INIT case.
1698 * tree.c (cp_statement_code_p): Remove RETURN_INIT case.
1700 2002-12-31 Mark Mitchell <mark@codesourcery.com>
1703 * parser.c (cp_parser_direct_declarator): Handle erroneous
1704 parenthesized declarators correctly.
1706 2002-12-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
1708 * cp-tree.h (pending_lang_change): Declare.
1710 2002-12-30 Mark Mitchell <mark@codesourcery.com>
1712 * parser.c (cp_parser_context_free_list): New variable.
1713 (cp_parser_context_new): Use it.
1714 (cp_parser_error): Check return code from
1715 cp_parser_simulate_error.
1716 (cp_parser_simulate_error): Return a value.
1717 (cp_parser_id_expression): Optimize common case.
1718 (cp_parser_class_name): Likewise.
1719 (cp_parser_class_specifier): Adjust call to
1720 cp_parser_late_parsing_default_args.
1721 (cp_parser_lookup_name): Optimize common case.
1722 (cp_parser_late_parsing_for_member): Adjust call to
1723 cp_parser_late_parsing_default_args.
1724 (cp_parser_late_parsing_default_args): Add scope parameter.
1725 (cp_parser_require): Avoid creating the error message unless it's
1727 (cp_parser_parse_definitely): Place free'd contexts on the free
1730 * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change.
1732 2002-12-30 David Edelsohn <edelsohn@gnu.org>
1734 * parser.c (cp_parser_parameter_declaration_clause): Treat system
1735 header as extern "C" if NO_IMPLICIT_EXTERN_C undefined.
1737 2002-12-30 Nathanael Nerode <neroden@gcc.gnu.org>
1739 * config-lang.in, Make-lang.in, operators.def, cp-tree.def:
1742 2002-12-30 Mark Mitchell <mark@codesourcery.com>
1746 * Make-lang.in (gt-cp-spew.h): Remove.
1747 * cp-tree.h (do_pending_lang_change): Remove.
1748 (do_identifier): Change prototype.
1749 (finish_id_expr): Remove.
1750 * decl.c (lookup_name_real): Remove yylex variable.
1751 * decl2.c (build_expr_from_tree): Adjust call to do_identifier.
1752 * lex.c (init_cpp_parse): Remove.
1753 (reduce_cmp): Likewise.
1754 (token_cmp): Likewise.
1756 (lastiddecl): Likewise.
1757 (token_count): Likewise.
1758 (reduce_count): Likewise.
1760 (print_parse_statistics): Likewise.
1761 (do_pending_lang_change): Likewise.
1762 (do_identifier): Remove parsing parameter.
1763 * lex.h (lastiddecl): Remove.
1764 (looking_for_typename): Remove.
1765 (looking_for_template): Likewise.
1766 (pending_lang_change): Likewise.
1768 * semantics.c (finish_id_expr): Remove.
1770 * decl.c (grokdeclarator): Diagnost "extern thread" and "static
1773 2002-12-30 Nathanael Nerode <neroden@gcc.gnu.org>
1775 * decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front
1776 end, not the C front end.
1778 2002-12-30 Nathan Sidwell <nathan@codesourcery.com>
1780 * cp-tree.h (THUNK_TARGET): New macro.
1781 (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo.
1782 (finish_thunk): Remove offset parms.
1783 * class.c (find_final_overrider): Look through thunks.
1784 (get_vcall_index): Use THUNK_TARGET.
1785 (update_vtable_entry_for_fn): Look through thunks. Set covariant
1786 fixed offset here. Adjust finish_thunk call.
1787 (build_vtbl_initializer): Adjust finish_thunk calls.
1788 * mangle.c (mangle_call_offset): Remove superfluous if.
1789 (mangle_thunk): Adjust.
1790 * method.c (make_thunk): Adjust.
1791 (finish_thunk): Adjust.
1792 (thunk_adjust): Remove assert.
1793 (use_thunk): Use THUNK_TARGET
1794 * dump1.c (cp_dump_tree): Adjust thunk dumping.
1797 * class.c (layout_class_type): Set TYPE_CONTEXT of type for base.
1798 * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types.
1800 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1802 Remove traditional C constructs 4/n.
1803 * decl2.c (grok_method_quals, warn_if_unknown_interface,
1804 grok_x_components, cp_build_parm_decl, build_artificial_parm,
1805 maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
1806 delete_sanity, check_member_template, check_java_method,
1807 check_classfn, finish_static_data_member_decl, grokfield,
1808 grokbitfield, grokoptypename, grok_function_init,
1809 cplus_decl_attributes, constructor_name, defer_fn,
1810 build_anon_union_vars, finish_anon_union, coerce_new_type,
1811 coerce_delete_type, comdat_linkage, maybe_make_one_only,
1812 key_method, import_export_vtable, import_export_class,
1813 output_vtable_inherit, import_export_decl, import_export_tinfo,
1814 build_cleanup, get_guard, get_guard_bits, get_guard_cond,
1815 set_guard, start_objects, finish_objects,
1816 start_static_storage_duration_function,
1817 finish_static_storage_duration_function, get_priority_info,
1818 start_static_initialization_or_destruction,
1819 finish_static_initialization_or_destruction,
1820 do_static_initialization, do_static_destruction,
1821 prune_vars_needing_no_initialization, write_out_vars,
1822 reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
1823 add_using_namespace, merge_functions, ambiguous_decl,
1824 lookup_using_namespace, lookup_using_namespace,
1825 qualified_lookup_using_namespace, set_decl_namespace,
1826 decl_namespace, current_decl_namespace, push_decl_namespace,
1827 pop_decl_namespace, push_scope, pop_scope, add_function,
1828 arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
1829 lookup_arg_dependent, do_namespace_alias,
1830 validate_nonmember_using_decl, do_nonmember_using_decl,
1831 do_toplevel_using_decl, do_local_using_decl,
1832 do_class_using_decl, do_using_directive, check_default_args,
1833 mark_used, handle_class_head): Use C90 prototypings. Use booleans.
1834 * parser.c (cp_parser_class_head): Use booleanss.
1835 * decl.c (walk_globals, walk_vtables): Likewise.
1836 * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
1837 walk_globals): Change return type from 'int' to 'bool'.
1838 * rtti.c (init_rtti_processing, build_headof, throw_bad_cast
1839 throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
1840 build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
1841 get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
1842 qualifier_flags, tinfo_base_init, generic_initializer,
1843 ptr_initializer, dfs_class_hint_mark, ptm_initializer,
1844 dfs_class_hint_unmark, class_hint_flags, class_initializer,
1845 typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
1846 get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
1847 unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
1848 * repo.c (repo_compile_flags, repo_template_declared,
1849 repo_template_defined, repo_class_defined, repo_get_id,
1850 repo_template_used, repo_vtable_used, repo_inline_used,
1851 repo_tinfo_used, repo_template_instantiated, extract_string,
1852 open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
1853 finish_repo): Likewise.
1854 * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
1855 cxx_print_xnode): Likewise..
1856 * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
1857 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
1858 * cxxfilt.c (demangle_it, print_demangler_list, usage,
1859 standard_symbol_characters, hp_symbol_characters, main, fatal):
1861 (strip_underscore): Change type from 'int' to 'bool'.
1862 (main): Use boolean constants.
1864 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1866 Remove traditional C constructs 3/n.
1867 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1868 build_up_reference, warn_ref_binding, convert_to_reference,
1869 convert_from_reference, convert_lvalue, cp_convert, ocp_convert,
1870 convert_to_void, convert, convert_force, build_type_conversion,
1871 build_expr_type_conversion, type_promotes_to,
1872 perform_qualification_conversions): Use C90 prototyping style.
1873 * decl2.c (grok_array_decl): Use boolean constant.
1874 (delete_sanity): Likewise.
1875 * typeck.c (build_unary_op): Likewise.
1876 * semantics.c (finish_switch_cond): Likewise.
1877 * parser.c (cp_parser_direct_new_declarator): Likewise.
1878 * init.c (build_new): Likewise.
1880 2002-12-27 Mark Mitchell <mark@codesourcery.com>
1882 * Make-lang.in (po-generated): Remove parse.c.
1883 (CXX_OBJS): Remove parse.o and spew.o. Add parser.o.
1884 ($(srcdir)/cp/parse.h): Remove target.
1885 ($(srcdir)/cp/parse.c): Likewise.
1886 (gt-cp-parse.h): Likewise.
1887 (gt-cp-parser.h): New target.
1888 (c++.distclean): Do not remove parse.output.
1889 (c++.maintainer-clean): Do not remove parse.c or parse.h.
1890 (cp/spew.o): Remove target.
1891 (cp/lex.o): Adjust dependencies.
1892 (cp/pt.o): Likewise.
1893 (cp/parse.o): Likewise.
1894 (cp/TAGS): Do not mention parse.c.
1895 (cp/parser.o): New target.
1896 * NEWS: Mention the new parser.
1897 * call.c (build_scoped_method_call): Simplify.
1898 (build_method_call): Likewise.
1899 (build_new_function_call): Adjust calls to add_function_candidate
1900 and add_template_candidate.
1901 (build_new_op): Improve handling of erroroneous operands.
1902 (convert_default_arg): Remove circular argument processing.
1903 (name_as_c_string): New function.
1904 (build_new_method_call): Use it.
1905 (perform_implicit_conversion): Use error_operand_p.
1906 * class.c (finish_struct_anon): Use constructor_name_p.
1907 (check_field_decls): Likewise.
1908 (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN.
1909 (resolve_address_of_overloaded_function): Likewise.
1910 (instantiate_type): Tweak pointer-to-member handling.
1911 (get_primary_binfo): Remove incorrect assertion.
1912 * config-lang.in (gtfiles): Add parser.c, remove parse.c.
1913 * cp-tree.h (DEFARG_TOKENS): New macro.
1914 (default_arg): New structure.
1915 (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG.
1916 (lang_tree_node): Add default_arg.
1917 (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE.
1918 (type_info_ref_type): New macro.
1919 (saved_scope): Make processing_explicit_instantiation a boolean.
1920 (check_access): New field.
1921 (unparsed_text): Remove.
1922 (language_function): Remove unparsed_inlines.
1923 (error_operand_p): New macro.
1924 (lang_decl): Adjust pending_inline_info.
1925 (DEFARG_POINTER): Remove.
1926 (tag_types): Add typenames.
1927 (lookup_ualified_name): Declare.
1928 (lookup_name_real): Likewise.
1929 (shadow_tag): Adjust prototype.
1930 (get_scope_of_declarator): Declare it.
1931 (process_next_inline): Remove it.
1932 (check_for_missing_semicolon): Likewise.
1933 (maybe_get_template_decl_from_type_decl): Declare it.
1934 (finish_label_stmt): Adjust prototype.
1935 (finish_non_static_data_meber): Declare it.
1936 (finish_pseudo_destructor_call_expr): Rename to ...
1937 (finish_pseudo_destructor_expr): ... this.
1938 (finish_compound_literal): Declare it.
1939 (begin_inline_definitions): Remove it.
1940 (init_spew): Remove.
1941 (peekyylex): Likewise.
1942 (arbitrate_lookup): Likewise.
1943 (frob_opname): Likewise.
1944 (maybe_snarf_defarg): Likewise.
1945 (add_defarg_fn): Likewise.
1946 (do_pending_defargs): Likewise.
1947 (done_pending_defargs): Likewise.
1948 (unprocessed_defarg_fn): Likewise.
1949 (replace_defarg): Likewise.
1950 (end_input): Likewise.
1951 (get_overloaded_fn): Likewise.
1952 * cvt.c (convert_to_reference): Improve error handling.
1953 * decl.c (lookup_name_real): Do not declare it static.
1954 (maybe_push_to_top_level): Set check_access.
1955 (identifier_type_value): Adjust call to lookup_name_real.
1956 (lookup_qualified_name): New method.
1957 (lookup_name_real): Remove special-case parsing code.
1958 (lookup_name-nonclass): Adjust call to lookup_name_real.
1959 (lookup_name_namespace_only): Likewise.
1960 (lookup_name): Likewise.
1961 (check_tag_decl): Return the type declared.
1962 (shadow_tag): Likewise.
1963 (register_dtor_fn): Tweak check_access.
1964 (grokfndecl): Use constructor_name_p.
1965 (get_scope_of_declarator): New function.
1966 (grokdeclarator): Obscure tweaks for slightly different declarator
1968 (start_method): Return error_mark_node to indicate failure.
1969 (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs.
1970 * decl2.c (constructor_name_full): Simplify.
1971 (constructor_name): Use it.
1972 (build_expr_from_tree): Adjust for changes to do new parser.
1973 (push_scope): Improve robustness.
1974 (validate_nonmember_using_decl): Process declarations, not names.
1975 (do_class_using_decl): Likewise.
1976 (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS
1978 * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs.
1979 * expr.c (cxx_expand_expr): Handle BASELINKs.
1980 * init.c (member_init_ok_or_else): Issue more errors.
1981 (build_offset_ref): Tweak handling of FUNCTION_DECLs.
1982 * lex.c: Do not include parse.h.
1983 (yypring): Do not declare.
1985 (make_reference_declarator): Remove error-generating code.
1986 (rid_to_yy): Remove.
1987 (cxx_init): Do not call init_spew.
1989 (check_for_missing_semicolon): Remove.
1990 * lex.h (got_scope): Remove.
1991 (got_object): Remove.
1992 * method.c (hack_identifier): Use finish_non_static_data_member.
1993 (implicitly_declare_fn): Adjust use of constructor_name.
1994 * parser.c: New file.
1995 * pt.c (parse.h): Do not include it.
1996 (maybe_get_template_decl_from_template): Do not declare it.
1997 (finish_member_template_decl): Tweak.
1998 (begin_explicit_instantiation): Adjust for
1999 processing_explicit_instantiation being boolean.
2000 (end_explicit_instantiation): Likewise.
2001 (maybe_process_partial_specialization): Tighten specialization
2003 (retrieve_local_specialization): Adjust ue of hash table.
2004 (eq_local_specializations): New function.
2005 (register_local_specialization): Likewise.
2006 (push_template_decl_real): Remove unnecessary test.
2007 (maybe_get_template_decl_from_type_decl): Don't make it static.
2008 (for_each_template_parm_r): Handle TYPEOF_TYPE.
2009 (tsubst_copy): Use retrieive_local_specialization to handle
2010 PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs.
2011 Handle COMPONENT_REFs with pseudo-destructor-expressions.
2012 Simplify handling of CALL_EXPR and METHOD_CALL_EXPR.
2013 (tsubst_expr): Pass decls, not names, to do_local_using_decl.
2014 (unify): Tweak handling of CONST_DECLs.
2015 (regenerate_decl_from_template): Use push_nested_class.
2016 (template_for_substitution): New funciton.
2017 (instantiate_decl): Use it. Register parameters as local
2019 * rtti.c (init_rtti_processing): Set type_info_ref_type.
2020 (build_typeid): Use it.
2021 (get_typeid): Likeise.
2022 * search.c (accessible_p): Use check_access, not
2023 flag_access_control.
2024 (adjust_result_of_qualified_name_lookup): Pay attention to the
2026 * semantics.c (finish_asm_stmt): Adjust error handling.
2027 (finish_label_stmt): Return the statement.
2028 (finish_non_static_data_member): New function.
2029 (finish_class_expr): Handle BASELINKs.
2030 (finish_call_expr): Handle PSEUDO_DTOR_EXPR.
2031 (finish_object_call_expr): Simplify handling during templates.
2032 (finish_pseudo_destructor_call_expr): Rename to ...
2033 (finish_pseudo_dtor_expr): ... this.
2034 (finish_compound_literal): New function.
2035 (begin_inline_definitions): Remove.
2036 (finish_sizeof): Remove special template handling.
2037 * spew.c: Do not include parse.h.
2038 * tree.c (get_overloaded_fn): Remove.
2039 * typeck.c (build_class_member_access_expr): Handle
2040 PSEUDO_DTOR_EXPR. Adjust handling of static member functions.
2041 (lookup_destructor): New function.
2042 (finish_class_member_access_expr): Use it.
2043 (convert_arguments): Simplify.
2044 (build_unary_op): Handle BASELINKs.
2046 2002-12-26 Nathan Sidwell <nathan@codesourcery.com>
2049 * decl2.c (mark_used): Defer inline functions.
2050 (finish_file): Merge deferred_fns loops. Check all used
2051 inline functions have a definition.
2052 * method.c (make_thunk): Thunks are not inline.
2054 PR c++/5116, c++/764
2055 * call.c (build_new_op): Make sure template class operands are
2058 2002-12-24 Nathan Sidwell <nathan@codesourcery.com>
2061 * cp-tree.h (resolve_scoped_fn_name): Prototype.
2062 * call.c (resolve_scoped_fn_name): New function. Deal with
2063 more template expansion. Broken out of ...
2064 * parse.y (parse_finish_call_expr): ... here. Call it.
2065 * decl2.c (build_expr_from_tree, CALL_EXPR): Use
2066 resolve_scoped_fn_name and build_call_from_tree.
2069 * decl.c (duplicate_decls): Templates may be disambiguated by
2073 * decl2.c (check_classfn): Use lookup_fnfield_1. List all
2074 conversion operators on failure.
2076 2002-12-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
2078 Remove traditional C constructs 2/n.
2079 * call.c (tourney, build_field_call, equal_functions, joust,
2080 compare_ics, build_over_call, build_java_interface_fn_ref,
2081 convert_like_real, op_error, build_object_call, resolve_args,
2082 build_vfield_ref, check_dtor_name, build_scoped_method_call,
2083 build_addr_func, build_call, build_method_call, null_ptr_cst_p,
2084 sufficient_parms_p, build_conv, non_reference, strip_top_quals,
2085 standard_conversion, reference_related_p,
2086 reference_compatible_p, convert_class_to_reference,
2087 direct_reference_binding, reference_binding,
2088 ,implicit_conversion, is_complete, promoted_arithmetic_type_p,
2089 add_template_conv_candidate, any_viable, any_strictly_viable,
2090 build_this, splice_viable, print_z_candidates,
2091 build_user_type_conversion, build_new_function_call,
2092 conditional_conversion, build_conditional_expr, build_new_op,
2093 build_op_delete_call, enforce_access, call_builtin_trap,
2094 convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to,
2095 convert_default_arg, type_passed_as, convert_for_arg_passing,
2096 in_charge_arg_for_name, is_properly_derived_from,
2097 maybe_handle_implicit_object, maybe_handle_ref_bind,
2098 source_type, add_warning, can_convert, can_convert_arg,
2099 perform_implicit_conversion, can_convert_arg_bad,
2100 initialize_reference, add_conv_candidate,
2101 add_template_candidate_real, add_template_candidate): Ansify.
2103 2002-12-22 Nathan Sidwell <nathan@codesourcery.com>
2106 * cp-tree.h (grokoptypename): Add SCOPE parameter.
2107 * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type
2108 if in a template scope.
2109 * parse.y (unoperator): Return the scope.
2110 (operator_name): Adjust grokoptypename call.
2112 2002-12-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2114 * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t.
2115 * decl.c (make_unbound_class_template): Adjust. Check for tf_error.
2116 * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error.
2118 2002-12-20 Kazu Hirata <kazu@cs.umass.edu>
2120 * ChangeLog: Fix a typo.
2121 * class.c: Fix comment typos.
2122 * cp-tree.h: Likewise.
2124 2002-12-18 Jason Merrill <jason@redhat.com>
2126 Handle anonymous unions at the tree level.
2127 C++ ABI change: Mangle anonymous unions using the name of their
2128 first named field (by depth-first search). Should not cause
2129 binary compatibility problems, though, as the compiler previously
2130 didn't emit anything for affected unions.
2131 * cp-tree.def (ALIAS_DECL): New tree code.
2132 * decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the
2133 first field, not the largest.
2134 (finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME,
2135 push the decl, and write it out at namespace scope.
2136 * decl.c (lookup_name_real): See through an ALIAS_DECL.
2137 (pushdecl): Add namespace bindings for ALIAS_DECLs.
2138 * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
2139 of a decl which doesn't have one.
2140 * typeck.c (build_class_member_access_expr): Don't recurse if
2141 we already have the type we want.
2143 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2146 * friend.c (make_friend_class): Allow partial specialization
2147 when declaration is not a template friend.
2149 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2152 * pt.c (lookup_template_class): Copy TREE_PRIVATE and
2153 TREE_PROTECTED to created decl nodes.
2155 2002-12-18 Mark Mitchell <mark@codesourcery.com>
2157 * class.c (build_base_field): Do not set DECL_PACKED on the
2160 2002-12-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
2162 * cp-tree.h (struct tree_srcloc): Use location_t.
2163 (SOURCE_LOCUS): New.
2164 (SRCLOC_FILE, SRCLOC_LINE): Adjust.
2166 2002-12-17 Jason Merrill <jason@redhat.com>
2168 * decl.c (finish_function): Also complain about no return in
2170 * semantics.c (finish_return_stmt): Also call check_return_expr in
2172 * typeck.c (check_return_expr): In a template, just remember that we
2175 2002-12-16 Jason Merrill <jason@redhat.com>
2177 * semantics.c (simplify_aggr_init_exprs_r): Don't change the type
2180 * semantics.c (do_pushlevel): Call pushlevel after adding the
2182 (do_poplevel): Call poplevel before adding the SCOPE_STMT.
2183 * parse.y (function_body): Go back to using compstmt.
2184 * decl.c (pushdecl): Skip another level to get to the parms level.
2186 * call.c (build_new_method_call): Use is_dummy_object to determine
2187 whether or not to evaluate the object parameter to a static member
2190 2002-12-14 Jason Merrill <jason@redhat.com>
2192 * semantics.c (simplify_aggr_init_exprs_r): Also prepend the
2193 return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR.
2194 * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE,
2195 don't bother with an AGGR_INIT_EXPR.
2196 (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE,
2197 just generate a new decl normally. Take return slot parm.
2198 * cp-tree.h: Adjust prototype.
2200 2002-12-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
2203 * cvt.c (convert_to_pointer_force): Don't try comparing against
2206 2002-12-13 Geoffrey Keating <geoffk@apple.com>
2208 * cp-tree.h: Have the multiple-include guards around
2211 2002-12-10 David Edelsohn <edelsohn@gnu.org>
2213 * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos
2215 (snarf_method): Same.
2216 (snarf_defarg): Same.
2218 2002-12-10 Mark Mitchell <mark@codesourcery.com>
2221 * pt.c (tsubst_copy): Handle destructor names more correctly.
2223 2002-12-10 Matt Austern <austern@apple.com>
2225 * cp-tree.h: get rid of needs_virtual_reinit bit.
2227 2002-12-09 Mark Mitchell <mark@codesourcery.com>
2229 * NEWS: Document removal of in-class initialization extension for
2230 static data members of non-arithmetic, non-enumeration type.
2231 * decl.c (check_static_variable_definition): Do not allow that
2233 * decl2.c (grokfield): Do not call digest_init when processing
2236 2002-12-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2238 * error.c (dump_expr): Fix format specifier warning.
2240 2002-12-04 Geoffrey Keating <geoffk@apple.com>
2242 * class.c (finish_struct_1): Correct comment.
2243 * cp-tree.c (DECL_SORTED_FIELDS): Likewise.
2245 2002-12-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
2248 * error.c (dump_expr): Don't ever try to dump a non-existent
2251 2002-12-03 Nathan Sidwell <nathan@codesourcery.com>
2253 Implement covariant returns.
2254 * cp-tree.h (IS_AGGR_TYPE_2): Remove.
2255 (struct lang_decl_flags): Add this_thunk_p flag.
2256 Rename vcall_offset to virtual_offset.
2257 (struct lang_decl): Rename delta to fixed_offset.
2258 (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines.
2259 (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg.
2260 (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ...
2261 (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here.
2262 (make_thunk): Add this_adjusting arg.
2263 (finish_thunk): Declare.
2264 (mangle_thunk): Add this_adjusting arg.
2265 * class.c (get_vcall_index): Use base function for lookup.
2266 (update_vtable_entry_for_fn): Generate covariant thunk.
2267 (finish_struct_1): Set DECL_VINDEX to NULL for thunks.
2268 (build_vtbl_initializer): Use base function for lookup.
2269 Finish covariant thunk here. Adjust thunk generation.
2270 * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling.
2271 Adjust thunk dumping.
2272 * mangle.c (mangle_call_offset): New function.
2273 (mangle_thunk): Adjust for covariant thunks.
2274 * method.c (make_thunk): Adjust. Do not set name here.
2275 (finish_thunk): New function. Set name here.
2276 (use_thunk): Generate covariant thunks too.
2277 (thunk_adjust): New function.
2278 * search.c (covariant_return_p): Remove. Fold into ...
2279 (check_final_overrider): ... here. Simplify.
2280 * semantics.c (emit_associated_thunks): Walk covariant thunk lists.
2282 2002-12-03 Jason Merrill <jason@redhat.com>
2285 * call.c (build_over_call): Check specifically for TARGET_EXPR
2288 PR c++/8461, c++/8625
2289 * call.c (convert_for_arg_passing): Don't mess with error_mark_node.
2290 (cp_convert_parm_for_inlining): Remove.
2291 * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
2293 * cp-tree.h (ADDR_IS_INVISIREF): Remove.
2294 * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code.
2296 * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on
2297 an ambiguous conversion.
2299 2002-12-03 Mark Mitchell <mark@codesourcery.com>
2302 * decl.c (reshape_init): Handle erroneous initializers.
2304 2002-12-02 Mark Mitchell <mark@codesourcery.com>
2307 * spew.c (remove_last_token): Make sure that last_chunk is set
2311 * error.c (dump_expr): Handle character constants with
2314 2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2317 * decl.c (grokdeclarator): Require class-key for all friend class.
2318 Output the correct type and context in the error message.
2320 2002-12-01 Mark Mitchell <mark@codesourcery.com>
2323 * pt.c (unify): Use variably_modified_type_p to test validity of
2324 template argument types.
2327 * cp-tree.h (lang_type_class): Add typeinfo_var.
2328 (CLASSTYPE_TYPEINFO_VAR): New macro.
2329 * rtti.c (get_tinfo_decl): Use it.
2332 * init.c (expand_member_init): Always get the main variant of a
2335 2002-12-01 Mark Mitchell <mark@codesourcery.com>
2339 * decl.c (cxx_init_decl_processing): Use size_type_node, not
2341 * decl2.c (coerce_new_type): Likewise.
2342 * except.c (do_allocate_exception): Likewise.
2344 2002-11-30 Zack Weinberg <zack@codesourcery.com>
2346 * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c,
2347 dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c,
2348 lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c,
2349 repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
2350 typeck2.c: Include coretypes.h and tm.h.
2351 * Make-lang.in: Update dependencies.
2353 2002-11-30 Mark Mitchell <mark@codesourcery.com>
2356 * decl.c (layout_var_decl): Deal gracefully with erroneous types.
2357 (check_initializer): Validate the type of the initialized
2358 variable, even if the initializer is absent.
2359 * typeck.c (cp_type_quals): Deal gracefully with erroneous types.
2362 * typeck.c (convert_for_assignment): Do not use
2363 decl_constant_value on the operand.
2366 * pt.c (instantiate_decl): Handle template friends defined outside
2367 of the class correctly.
2369 2002-11-29 Joe Buck <jbuck@synopsys.com>
2371 * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
2374 2002-11-29 Mark Mitchell <mark@codesourcery.com>
2376 * class.c (walk_subobject_offsets): Recur on binfos as well as on
2378 (layout_nonempty_base_or_field): Pass it a binfo when processing a
2380 (layout_empty_base): Likewise.
2381 (build_base_field): Likewise.
2383 2002-11-27 Mark Mitchell <mark@codesourcery.com>
2385 * class.c (build_base_field): Make sure we get the canonical base
2386 when descending through primary bases.
2388 2002-11-26 Geoffrey Keating <geoffk@apple.com>
2390 * decl.c (check_initializer): Don't error on initialisation of
2391 a scalar with a brace-enclosed expression.
2393 2002-11-26 Nathan Sidwell <nathan@codesourcery.com>
2395 * cp-tree.h (DECL_LANG_FLAG_4): Document more uses.
2396 (template_parms_equal): Remove prototype.
2397 * typeck.c (buuld_indirect_ref): Reformat.
2399 2002-11-25 Jason Merrill <jason@redhat.com>
2401 * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT
2404 2002-11-25 Mark Mitchell <mark@codesourcery.com>
2406 * tree.c (cp_build_qualified_type_real): Correct handling of
2408 * class.c (walk_subobject_offsets): Fix thinko.
2409 (build_base_field): Record offsets of empty bases in primary
2411 (layout_class_type): Record offsets of empty bases in fields.
2413 * search.c (is_subobject_of_p_1): Fix thinko.
2414 (lookup_field_queue_p): Likewise.
2416 2002-11-24 Mark Mitchell <mark@codesourcery.com>
2418 * class.c (layout_class_type): Reuse tail padding when laying out
2421 2002-11-22 Mark Mitchell <mark@codesourcery.com>
2423 * rtti.c (qualifier_flags): Fix thinko.
2425 2002-11-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
2427 Remove traditional C constructs 1/n.
2428 * cp-tree.h (init_method, set_mangled_name_for_decl,
2429 build_opfncall, hack_identifier, make_thunk, use_thunk,
2430 synthesize_method, implicitly_declare_fn,
2431 skip_artificial_parms_for, optimize_function, calls_setjmp_p,
2432 maybe_clone_body): Remove use of PARAMS.
2434 * method.c (do_build_assign_ref, do_build_copy_constructor,
2435 synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy):
2437 (synthesize_method): Use 'bool' type and constants instead of
2439 (locate_copy): Likewise.
2440 (implicitly_declare_fn): Likewise.
2442 * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function):
2443 Remove old-style declaration.
2444 (maybe_clone_body): Use 'bool' type and constants.
2446 2002-11-21 Glen Nakamura <glen@imodulo.com>
2449 * typeck.c (get_member_function_from_ptrfunc): Make sure that a
2450 SAVE_EXPR for instance_ptr doesn't get evaluated first inside one
2451 of the branches of a COND_EXPR.
2453 2002-11-19 Mark Mitchell <mark@codesourcery.com>
2455 * pt.c (for_each_template_parm): Free allocated memory.
2456 * search.c (is_subobject_of_p_1): New function.
2457 (is_subobject_of_p): Avoid walking virtual bases multiple times.
2459 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
2461 * g++spec.c (lang_specific_spec_functions): New.
2463 2002-11-15 Kazu Hirata <kazu@cs.umass.edu>
2465 * ChangeLog: Follow spelling conventions.
2466 * class.c: Likewise.
2467 * decl2.c: Likewise.
2469 2002-11-14 Zack Weinberg <zack@codesourcery.com>
2471 * search.c (dfs_push_decls): Do not try to reorder elements
2472 3..n of method_vec if method_vec has only two elements.
2473 Reverse order of two tests to avoid accessing unallocated
2476 2002-11-14 Mark Mitchell <mark@codesourcery.com>
2478 * class.c (dfs_find_final_overrider): Adjust so that the most
2479 derived object is a binfo, rather than a class type.
2480 (find_final_overrider): Likewise.
2481 (add_vcall_offset_vtbl_entries_1): Simplify accordingly.
2482 (add_vcall_offset): Likewise.
2484 2002-11-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2487 * pt.c (instantiate_template): Push class scope for member
2489 (get_mostly_instantiated_function_type): Likewise. Don't call
2490 tsubst on context. Remove CONTEXTP and TPARMSP parameters.
2491 * cp-tree.h (get_mostly_instantiated_function_type): Adjust.
2492 * mangle.c (write_encoding, write_unqualified_name): Adjust.
2494 2002-11-07 Mark Mitchell <mark@codesourcery.com>
2496 * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of
2497 vcall offfsets. Split out ...
2498 (add_vcall_offset): ... new function.
2501 * pt.c (for_each_template_parm): Add htab parameter.
2502 (process_partial_specialization): Adjust call.
2503 (push_template_decl_real): Likewise.
2504 (pair_fn_data): Add visited.
2505 (for_each_template_parm_r): Avoid walking duplicates more than
2507 (uses_template_parms): Adjust call to for_each_template_parm.
2509 2002-11-07 Mark Mitchell <mark@codesourcery.com>
2511 * class.c (add_implicitly_declared_members): Put implicitly
2512 declared functions at the end of TYPE_METHODs when -fabi-version
2515 2002-11-05 Geoffrey Keating <geoffk@apple.com>
2517 * decl2.c (finish_file): Correct spelling.
2519 2002-11-03 Mark Mitchell <mark@codesourcery.com>
2521 * call.c (build_special_member_call): Do not try to lookup VTTs by
2523 * class.c (vtbl_init_data): Add generate_vcall_entries.
2524 (get_vtable_decl): Do not look up virtual tables by name.
2525 (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P.
2526 (set_primary_base): Do not set CLASSTYPE_RTTI.
2527 (determine_primary_base): Likewise.
2528 (get_matching_virtual): Remove.
2529 (get_vcall_index): New function.
2530 (update_vtable_entry_for_fn): Do not try to use virtual thunks
2531 when they are not required. Assign vcall indices at this point.
2532 (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT.
2533 Do update dynamic_classes.
2534 (build_vtt): Do not add VTTs to the symbol table.
2535 (build_ctor_vtbl_group): Likewise.
2536 (build_vtbl_initializer): Simplify handling of vcall indices.
2537 (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets
2538 for the most derived class.
2539 (add_vcall_offset_vtbl_entries_1): But do not actually add them to
2541 * cp-tree.h (dynamic_classes): New macro.
2542 (lang_type_class): Remove rtti. Add vtables. Add vcall_indices.
2543 (CLASSTYPE_RTTI): Remove.
2544 (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove.
2545 (CLASSTYPE_VCALL_INDICES): New macro.
2546 (CLASSTYPE_VTABLES): Likewise.
2547 (BV_USE_VCALL_INDEX_P): Remove.
2548 (build_vtable_path): Remove.
2549 * decl2.c (finish_vtable_vardecl): Remove.
2550 (key_method): Remove #if 0'd code.
2551 (finish_vtable_vardecl): Rename to ...
2552 (maybe_emit_vtables): ... this.
2553 (finish_file): Use it.
2554 * search.c (look_for_overrides_here): Update comment.
2556 2002-11-01 Zack Weinberg <zack@codesourcery.com>
2559 * decl2.c (grokfield): Reject TYPE_DECLs with initializers.
2561 2002-10-30 Jason Merrill <jason@redhat.com>
2564 * cp-tree.h (ADDR_IS_INVISIREF): New macro.
2565 * call.c (convert_for_arg_passing): Set it.
2566 * except.c (stabilize_throw_expr): Recurse for such an arg.
2568 2002-10-31 Mark Mitchell <mark@codesourcery.com>
2570 * cp-tree.h (lang_decl_flags): Remove init_priority.
2571 (lang_decl): Add delta.
2572 (GLOBAL_INIT_PRIORITY): Remove.
2573 (THUNK_DELTA): Revise definition.
2574 * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY.
2575 * dump.c (cp_dump_tree): Don't dump it.
2577 2002-10-30 Mark Mitchell <mark@codesourcery.com>
2580 * typeck2.c (process_init_constructor): Call complete_array_type.
2583 * decl.c (make_typename_type): Issue errors about invalid results.
2585 2002-10-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2587 Core issue 287, PR c++/7639
2588 * cp-tree.h (lang_type_class): Add decl_list field.
2589 (CLASSTYPE_DECL_LIST): New macro.
2590 (maybe_add_class_template_decl_list): Add declaration.
2591 * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST.
2592 (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST.
2593 (maybe_add_class_template_decl_list): New function.
2594 (add_implicitly_declared_members): Use it.
2595 * decl.c (maybe_process_template_type_declaration): Likewise.
2596 (pushtag): Likewise.
2597 * friend.c (add_friend): Likewise.
2598 (make_friend_class): Likewise.
2599 * semantics.c (finish_member_declaration): Likewise.
2600 (begin_class_definition): Initialize CLASSTYPE_DECL_LIST.
2601 * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST
2602 to process members and friends in the order of declaration.
2604 2002-10-29 Mark Mitchell <mark@codesourcery.com>
2607 * decl.c (finish_destructor_body): Create the label to jump to
2608 when returning from a destructor here.
2609 (finish_function_body): Rather than here.
2611 2002-10-25 Zack Weinberg <zack@codesourcery.com>
2614 * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a
2615 SCOPE_REF is not null before dereferencing it.
2617 2002-10-25 Mark Mitchell <mark@codesourcery.com>
2619 * call.c (build_over_call): Use DECL_CONTEXT, not
2620 DECL_VIRTUAL_CONTEXT.
2621 * class.c (modify_vtable_entry): Don't mess with
2622 DECL_VIRTUAL_CONTEXT.
2623 (set_vindex): Remove.
2624 (set_primary_base): Remove vfuns_p parameter.
2625 (determine_primary_base): Likewise.
2626 (modify_all_vtables): Likewise.
2627 (layout_class_type): Likewise. Adjust calls to other functions
2629 (finish_struct_1): Adjust calls to modified functions. Set
2631 * cp-tree.h (lang_type_class): Remove vsize.
2632 (CLASSTYPE_VSIZE): Remove.
2633 (lang_decl): Remove thunks.
2634 (DECL_THUNKS): Adjust.
2635 (DECL_VIRTUAL_CONTEXT): Remove.
2636 (duplicate_decls): Don't copy it.
2637 * pt.c (build_template_decl): Don't set it.
2638 (tsubst_decl): Likewise.
2639 * typeck.c (expand_ptrmemfunc_cst): Don't use it.
2641 * class.c (build_vtbl_initializer): Don't use build_vtable_entry.
2642 (build_vtable_entry): Remove.
2643 * cp-tree.h (BINFO_VIRTUALS): Expand documentation.
2644 (lang_decl): Add thunks.
2645 (DECL_THUNKS): New macro.
2646 * decl.c (duplicate_decls): Copy it.
2647 * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS.
2648 * semantics.c (emit_associated_thunks): Simplify.
2650 2002-10-24 David Edelsohn <edelsohn@gnu.org>
2653 * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that
2654 lang_type structure exists before accessing field.
2655 (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro.
2656 (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar.
2657 (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro.
2658 * class.c (check_field_decls): Use new macros.
2659 * typeck2.c (process_init_constructor): Remove redundant check for
2660 existence of lang_type structure.
2662 2002-10-24 Mark Mitchell <mark@codesourcery.com>
2664 * class.c (end_of_base): New method.
2665 (end_of_class): Use it. Check indirect virtual bases.
2667 * class.c (check_field_decls): Fix typo.
2669 2002-10-23 Mark Mitchell <mark@codesourcery.com>
2672 * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
2676 * spew.c (next_token): Do not return an endless stream of
2677 END_OF_SAVED_INPUT tokens.
2678 (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of
2679 the cached token stream.
2680 (snarf_defarg): Likewise.
2682 2002-10-23 Zack Weinberg <zack@codesourcery.com>
2684 * cp-lang.c (cp_var_mod_type_p): New: C++ hook for
2685 variably_modified_type_p.
2686 * cp-tree.h: Remove prototype of variably_modified_type_p.
2687 * tree.c (variably_modified_type_p): Remove; now implemented
2688 in language-independent code.
2690 2002-10-22 Mark Mitchell <mark@codesourcery.com>
2693 * spew.c (snarf_parenthesized_expression): New function.
2694 (snarf_block): Use it.
2696 2002-10-22 Richard Henderson <rth@redhat.com>
2698 * method.c (use_thunk): Always compute vcall_value; assert that
2699 it is not zero. Use can_output_mi_thunk; use output_mi_thunk
2700 for vcall thunks as well.
2702 2002-10-21 Mark Mitchell <mark@codesourcery.com>
2704 * class.c (empty_base_at_nonzero_offset_p): New function.
2705 (layout_nonempty_base_or_field): Do not check for conflicts when
2706 laying out a virtual base using the GCC 3.2 ABI.
2707 (build_base_field): Correct checking for presence of empty classes
2708 at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P.
2710 * class.c (include_empty_classes): Use normalize_rli.
2711 (layout_class_type): Likewise.
2713 * decl.c (reshape_init): Tweak handling of character arrays.
2716 * cp-tree.h (lang_type_class): Add contains_empty_class_p.
2717 (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro.
2718 * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P.
2719 (check_field_decls): Likewise.
2720 (layout_class_type): Likewise.
2721 (finish_struct_1): Initialize it.
2722 (walk_subobject_offsets): Use it to prune searches.
2724 2002-10-20 Mark Mitchell <mark@codesourcery.com>
2726 * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT.
2727 * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with
2728 TARGET_ASM_OUTPUT_MI_THUNK in comments.
2730 2002-10-18 Zack Weinberg <zack@codesourcery.com>
2732 * decl.c (start_decl): Point users of the old initialized-
2733 typedef extension at __typeof__.
2735 2002-10-18 Mark Mitchell <mark@codesourcery.com>
2737 * Make-lang.in (method.o): Depend on TARGET_H.
2738 * method.c (target.h): Include it.
2739 (use_thunk): Use target hooks. Use vcall thunks, if available.
2741 2002-10-18 Mark Mitchell <mark@codesourcery.com>
2743 * class.c (base_derived_from): Make sure return value is a bool.
2745 2002-10-18 Mark Mitchell <mark@codesourcery.com>
2747 * class.c (find_final_overrider_data_s): Remove overriding_fn and
2749 (dfs_base_derived_from): New function.
2750 (base_derived_from): Likewise.
2751 (dfs_find_final_overrider): Use base_derived_from.
2752 (find_final_overrider): Adjust.
2754 2002-10-18 Jason Merrill <jason@redhat.com>
2757 * semantics.c (finish_for_cond, finish_while_cond): Don't mess
2758 with condition decls in a template.
2760 2002-10-17 Nathan Sidwell <nathan@codesourcery.com>
2762 * class.c (add_method): Compare template parms too.
2764 2002-10-17 Mark Mitchell <mark@codesourcery.com>
2767 * class.c (handle_using_decl): Allow the declaration used to be
2768 from an ambiguous base.
2770 * pt.c (convert_template_argument): Revert this change:
2771 2002-10-16 Mark Mitchell <mark@codesourcery.com>
2772 * pt.c (convert_template_argument): Do not fold non-type
2773 template rguments when inside a template.
2775 * init.c (expand_default_init): Handle brace-enclosed initializers
2778 2002-10-16 Mark Mitchell <mark@codesourcery.com>
2780 * mangle.c (write_expression): Correct handling of enumeration
2782 (write_template_arg): Likewise.
2783 * pt.c (convert_template_argument): Do not fold non-type template
2784 arguments when inside a template.
2787 * cvt.c (convert_to_reference): Allow references as the incoming
2790 2002-10-16 Mark Mitchell <mark@codesourcery.com>
2793 * method.c (do_build_assign_ref): Use cp_build_qualified_type, not
2794 build_qualified_type.
2796 2002-10-15 Richard Henderson <rth@redhat.com>
2798 * error.c (dump_expr): Use real_to_decimal directly, and with
2801 2002-10-15 Mark Mitchell <mark@codesourcery.com>
2803 * decl.c (reshape_init): Fix typo.
2805 * cp-tree.h (operator_name_info_t): Add arity.
2806 * lex.c (init_operators): Initialize it.
2807 * mangle.c (write_conversion_operator_name): New function.
2808 (write_unqualified_name): Use it.
2809 (write_template_args): Accept template arguments as a TREE_LIST.
2810 (write_expression): Adjust handling of qualified names to match
2813 2002-10-15 Jason Merrill <jason@redhat.com>
2815 * call.c (call_builtin_trap): New fn.
2816 (convert_arg_to_ellipsis): Use it. Downgrade error to warning.
2817 (build_call): Don't set current_function_returns_abnormally outside
2820 2002-10-14 Mark Mitchell <mark@codesourcery.com>
2822 * class.c (check_field_decls): Remove empty_p parameter. Instead,
2823 clear CLASSTYPE_EMPTY_P.
2824 (build_base_field): Likewise.
2825 (build_base_fields): Likewise.
2826 (check_bases_and_members): Likewise.
2827 (create_vtbl_ptr): Likewise.
2828 (layout_class_type): Likewise. Ensure that empty classes have
2829 size zero when used as base classes in the 3.2 ABI.
2830 (finish_struct_1): Initialize CLASSTYPE_EMPTY_P and
2831 CLASSTYPE_NEARLY_EMPTY_P. Adjust calls to avoid passing empty_p
2833 (is_empty_class): Correct definition when using post-3.2 ABI.
2834 * cp-tree.h (lang_type_class): Add empty_p.
2835 (CLASSTYPE_EMPTY_P): New macro.
2837 2002-10-12 Nathan Sidwell <nathan@codesourcery.com>
2839 * init.c (build_delete): Do not apply save_expr for arrays.
2840 (build_vec_delete): Likewise.
2842 2002-10-14 Mark Mitchell <mark@codesourcery.com>
2844 * decl.c (layout_var_decl): Call layout_decl even for variables
2845 whose type is an array with unspecified bounds.
2848 * lex.c (do_identifier): Add another option for the parsing
2850 * parse.y (do_id): Use it.
2852 2002-10-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
2854 PRs C++/6803, C++/7721 and C++/7803
2855 * decl.c (grokdeclarator): Gracefully handle template-name as
2858 2002-10-11 Jason Molenda <jmolenda@apple.com>
2860 * init.c (build_field_list): Provide uses_unions_p with a default
2863 2002-10-11 Mark Mitchell <mark@codesourcery.com>
2866 * cp-tree.h (variably_modified_type_p): New function.
2867 (grokdeclarator) Tighten check for variably modified types as
2869 * pt.c (convert_template_argument): Do not allow variably modified
2870 types as template arguments.
2871 * tree.c (variably_modified_type_p): New function.
2873 * NEWS: Document removal of "new X = ..." extension.
2874 * class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on
2875 brace-enclosed initializers.
2876 * cp-tree.h (CP_AGGREGATE_TYPE_P): New macro.
2877 (initialize_local_var): Remove declaration.
2878 (expand_static_init): Likewise.
2879 * decl.c (next_initializable_field): New function.
2880 (reshape_init): Likewise.
2881 (check_initializer): Use them. Build dynamic initializer for
2882 aggregates here too.
2883 (initialize_local_var): Simplify, and incorporate cleanup
2884 insertion code as well.
2885 (destroy_local_var): Remove.
2886 (cp_finish_decl): Tidy.
2887 (expand_static_init): Fold checks for whether or not a variable
2888 needs initialization into this function. Simplify.
2889 * decl2.c (do_static_initialization): Simplify.
2890 * init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will
2891 be done for us automatically.
2892 (expand_default_init): Handle brace-enclosed initializers
2894 (expand_aggr_init_1): Remove RTL-generation code.
2895 (build_vec_init): Remove "new X = ..." support.
2896 * parse.y (new_initializer): Likewise.
2897 * rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on
2898 brace-enclosed initializer.
2899 (create_pseudo_type_info): Likewise.
2900 * typeck2.c (store_init_value): Don't try to handle digest_init
2901 being called more than once.
2902 (digest_init): Tidy handling of brace-enclosed initializers.
2904 2002-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2906 * decl.c (typename_hash): Use htab_hash_pointer.
2908 2002-10-10 Jim Wilson <wilson@redhat.com>
2910 * decl.c (duplicate_decls): Don't call decl_attributes.
2912 2002-10-09 Zack Weinberg <zack@codesourcery.com>
2915 * decl.c (start_decl): Unconditionally issue error for
2916 'typedef foo = bar'.
2917 (cp_finish_decl): Remove special case for TYPE_DECL with initializer.
2918 (grokdeclarator): Remove redundant error for 'typedef foo = bar'.
2920 2002-10-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2922 * decl2.c (prune_vtable_vardecl): Delete unused function.
2924 2002-10-03 Mark Mitchell <mark@codesourcery.com>
2927 * decl2.c (finish_anon_union): Do not expand anonymous unions when
2928 procesing template functions.
2929 * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
2930 type. Call layout_decl.
2931 (tsubst_expr, case DECL_STMT): Handle anonymous unions.
2933 2002-10-07 Richard Henderson <rth@redhat.com>
2935 * decl2.c, pt.c: Revert c++/7754 fix.
2937 2002-10-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2940 * error.c (dump_expr) [REAL_CST]: Output in decimal format.
2942 2002-10-03 Mark Mitchell <mark@codesourcery.com>
2945 * pt.c (for_each_template_parm_r): Handle BASELINKs.
2948 * decl2.c (finish_anon_union): Do not expand anonymous unions when
2949 procesing template functions.
2950 * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
2951 type. Call layout_decl.
2952 (tsubst_expr, case DECL_STMT): Handle anonymous unions.
2954 2002-10-03 Mark Mitchell <mark@codesourcery.com>
2957 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template
2958 template parameters.
2959 (globals): Add entity and need_abi_warning.
2960 (decl_is_template_id): Use TYPE_TEMPLATE_INFO, not
2961 CLASSTYPE_TEMPLATE_INFO.
2962 (is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not
2964 (write_prefix): Handle typename types correctly.
2965 (write_template_prefix): Handle template template parameters
2967 (start_mangling): Add entity parameter.
2968 (finish_mangling): Warn about names whose mangling will change.
2969 (mangle_decl_string): Adjust.
2970 (mangle_type_string): Likewise.
2971 (mangle_special_for_type): Likewise.
2972 (mangle_ctor_vtbl_for_type): Likewise.
2973 (mangle_thunk): Likewise.
2974 (mangle_guard_variable): Likewise.
2975 (mangle_ref_init_variable): Likewise.
2977 2002-10-02 Mark Mitchell <mark@codesourcery.com>
2980 * cp-tree.def (CTOR_INITIALIZER): Use one slot, not two.
2981 * cp-tree.h (emit_base_init): Rename to ....
2982 (emit_mem_initializers): ... this.
2983 (expand_member_init): Change prototype.
2984 * init.c (perform_member_init): Compute explicit, rather than
2985 requiring it as a parameter.
2986 (sort_member_init): Rename to ...
2987 (sort_mem_initializers): ... this. Process bases and data members
2989 (sort_base_init): Remove.
2990 (emit_base_init): Rename to ...
2991 (emit_mem_initializers): ... this.
2992 (expand_aggr_vbase_init_1): Remove.
2993 (construct_virtual_bases): Rename to ...
2994 (construct_virtual_base): ... this.
2995 (expand_member_init): Rework handling of base initializers.
2996 * method.c (do_build_copy_constructor): Use
2997 finish_mem_initializers.
2998 * parse.y (member_init): Adjust calls to expand_member_init.
2999 * pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case.
3000 (tsubst_initializer_list): Use expand_member_init.
3001 * semantics.c (finish_mem_intiailizers): Simplify.
3003 2002-10-02 Matt Austern <austern@apple.com>
3004 * decl.c (walk_vtables_r): Fixed typo that caused result to
3005 never get a nonzero value.
3007 2002-10-02 Roger Sayle <roger@eyesopen.com>
3009 PR optimization/6627
3010 * cp-tree.h (enum ptrmemfunc_vbit_where_t): Delete definition
3011 from here, and move it to tree.h.
3012 * decl.c (cxx_init_decl_processing): If storing the vbit
3013 in function pointers, ensure that force_align_functions_log
3016 2002-10-02 Matt Austern <austern@apple.com>
3018 * class.c (check_field_decls): Changed warning about const member
3019 variables so that it doesn't get issued for a class aggregate.
3021 2002-10-01 Mark Mitchell <mark@codesourcery.com>
3023 * decl.c (cp_finish_decl): Make sure array types are laid out,
3024 even if the array bounds are unknown.
3026 2002-10-01 Steve Ellcey <sje@cup.hp.com>
3028 * class.c (build_vtbl_initializer): Change build_c_cast
3031 2002-10-01 Mark Mitchell <mark@codesourcery.com>
3033 * decl.c (cp_finish_decl): Make sure array types are laid out,
3034 even if the array bounds are unknown.
3036 * decl.c (cp_finish_decl): Correct check for dynamic
3037 initialization of thread-local storage.
3039 2002-09-30 Nathan Sidwell <nathan@codesourcery.com>
3041 * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
3044 2002-09-30 Steve Ellcey <sje@cup.hp.com>
3046 * class.c (build_vtbl_initializer): Add cast.
3047 (add_vcall_offset_vtbl_entries_1):
3048 Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.
3050 2002-09-30 Mark Mitchell <mark@codesourcery.com>
3052 * class.c (walk_subobject_offsets): Correct the calculation of
3053 offsets for virtual bases. Correct the counting of array
3055 (layout_nonempty_base_or_field): Simplify. Correct the
3056 calculation of offsets to be propagated through the binfo
3058 (build_base_field): Avoid creating a FIELD_DECL for empty bases.
3059 Add the FIELD_DECL to TYPE_FIELDS.
3060 (build_base_fields): Adjust accordingly.
3061 (layout_virtual_bases): Use build_base_field.
3062 (end_of_class): Return a tree, not an integer.
3063 (warn_about_ambiguous_direct_bases): Rename to ...
3064 (warn_about_ambiguous_bases): ... this.
3065 (include_empty_classes): New function.
3066 (layout_class_type): Create an alternative version of the type to
3067 be used when as a base class type. Do not call
3068 finish_record_layout until we are done laying out the class.
3069 * cp-tree.h (lang_type_class): Remove size, size_unit. Add
3071 (CLASSTYPE_SIZE): Reimplement.
3072 (CLASSTYPE_SIZE_UNIT): Likewise.
3073 (CLASSTYPE_ALIGN): Likweise.
3074 (CLASSTYPE_USER_ALIGN): Likewise.
3075 (CLASSTYPE_AS_BASE): New macro.
3076 (DECL_INITIALIZED_P): Likewise.
3077 (extract_init): Remove prototype.
3078 (build_forced_zero_init): Rename to ...
3079 (build_zero_init): ... this.
3080 (force_store_init_value): Remove.
3081 * decl.c (obscure_complex_init): Remove.
3082 (duplicate_decls): Copy DECL_INITIALIZED_P.
3083 (check_initializer): Do not leave junk in DECL_INITIAL.
3084 (cp_finish_decl): Handle zero-initialization of entities with
3085 static storage duration.
3086 * expr.c (extract_init): Remove.
3087 * init.c (build_forced_zero_init): Remove.
3088 (build_zero_init): New function.
3089 (build_default_init): Use it.
3090 (build_field_list): Skip FIELD_DECLs for base subobjects.
3091 (push_base_cleanups): Likewise.
3092 * method.c (do_build_assign_ref): Likewise.
3093 (synthesize_exception_spec): Likewise.
3094 * pt.c (tsubst_decl): Clear DECL_INITIALIZED_P.
3095 (regenerate_decl_from_template): To not set DECL_INITIAL for a
3096 static data member whose initialization took place in its class.
3097 (instantiate_decl): Do not pass an initializer to cp_finish_decl
3099 * search.c (dfs_push_decls): Skip FIELD_DECLs for base subobjects.
3100 (dfs_unuse_fields): Likewise.
3101 * tree.c (pod_type_p): Handle error_mark_node.
3102 (zero_init_p): Likewise.
3103 * typeck.c (lookup_anon_field): Skip FIELD_DECLs for base
3105 * typeck2.c (store_init_value): Remove #if 0'd code.
3106 (force_store_init_value): Remove.
3107 (process_init_constructor): Use build_zero_init.
3109 2002-09-29 Nathan Sidwell <nathan@codesourcery.com>
3112 * rtti.c (unemitted_tinfo_decl_p): Check it has a field.
3114 2002-09-29 Kazu Hirata <kazu@cs.umass.edu>
3116 * cp-tree.h: Fix comment typos.
3120 2002-09-25 Mark Mitchell <mark@codesourcery.com>
3122 * cp/class.c (contains_empty_class_p): New method.
3123 (walk_subobject_offsets): Correct computation of field offset.
3124 (layout_empty_base): Correct placement of emtpy base classes.
3125 (layout_class_type): Warn about ABI changes.
3127 2002-09-23 Mark Mitchell <mark@codesourcery.com>
3129 * cp/class.c (layout_virtual_bases): Do not round the size of the
3130 type to a multiple of the alignment before laying out virtual bases.
3131 (layout_class_type): Correct handling of bit-fields that are wider
3132 than their type inside unions. Round the size of the type to a
3133 even number of bytes when computing the size without virtual
3135 * cp/cp-tree.h (abi_version_at_least): New macro.
3137 2002-09-21 Kazu Hirata <kazu@cs.umass.edu>
3139 * ChangeLog: Follow spelling conventions.
3140 * ChangeLog.2: Likewise.
3142 * class.c: Likewise.
3143 * cp-tree.h: Likewise.
3146 * decl2.c: Likewise.
3147 * except.c: Likewise.
3148 * friend.c: Likewise.
3149 * g++spec.c: Likewise.
3152 * mangle.c: Likewise.
3153 * method.c: Likewise.
3154 * operators.def: Likewise.
3155 * optimize.c: Likewise.
3158 * search.c: Likewise.
3159 * semantics.c: Likewise.
3162 * typeck.c: Likewise.
3164 2002-09-18 Devang Patel <dpatel@apple.com>
3166 * cp/cp-tree.h: New prototype for walk_vtabls().
3167 * cp/decl.c (walk_vtables_r): New function.
3168 (struct cp_binding_level): Add new members, namespaces,
3169 names_size and vtables.
3170 (add_decl_to_level): Add decl in namespaces or vtables
3171 chain, if conditions match.
3172 (walk_vtables): New function.
3173 (walk_namespaces_r): Travers separate namespace chain
3174 for namespace decls.
3175 (wrapup_globals_for_namespace): Use names_size instead
3177 * cp/decl2.c (finish_file): Use walk_vtables() instead of
3178 walk_globals() to walk vtable decls.
3180 2002-09-18 Nathan Sidwell <nathan@codesourcery.com>
3182 * decl.c (grokdeclarator): Use assert, not internal_error. Don't
3183 ICE with invalid pointers & references.
3185 2002-09-17 Zack Weinberg <zack@codesourcery.com>
3187 * Make-lang.in: Remove all references to the demangler.
3188 * cxxfilt.c: Moved to binutils.
3190 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
3193 * pt.c (tsubst_decl): Remove assert.
3195 Remove DR 295 implementation.
3196 * pt.c (check_cv_quals_for_unify): Disable function & method cases.
3197 * tree.c (cp_build_qualified_type_real): Likewise. Don't warn
3198 about ignoring volatile qualifiers.
3200 * search.c (lookup_member): Correct documentation.
3202 2002-09-16 Geoffrey Keating <geoffk@apple.com>
3204 * cp-tree.h (union lang_tree_node): Add chain_next option.
3206 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
3208 * parse.y (parse_finish_call_expr): Check lookup_member result.
3211 * semantic.c (finish_asm_stmt): Fix operand/output_operands
3213 * typeck.c (c_expand_asm_operands): Protect from error_mark_node.
3215 2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
3218 * call.c (build_over_call): Convert this pointer for fns found by
3221 2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
3223 * ChangeLog: Follow spelling conventions.
3224 * ChangeLog.1: Likewise.
3226 2002-09-14 Nathan Sidwell <nathan@codesourcery.com>
3229 * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
3231 2002-09-14 Kazu Hirata <kazu@cs.umass.edu>
3233 * error.c: Fix comment formatting.
3234 * except.c: Likewise.
3236 * friend.c: Likewise.
3237 * g++spec.c: Likewise.
3240 * mangle.c: Likewise.
3241 * method.c: Likewise.
3242 * optimize.c: Likewise.
3245 * search.c: Likewise.
3246 * semantics.c: Likewise.
3249 * typeck.c: Likewise.
3250 * typeck2.c: Likewise.
3252 2002-09-13 Matt Austern <austern@apple.com>
3255 * cp/cp-tree.h, cp/tree.c: New function non_cast_lvalue_p.
3256 * cp/call.c: Change call-by-const-reference mechanism to use
3257 non_cast_lvalue_p when deciding whether the create a temporary.
3258 We need a temporary when passing, e.g. (long) x by const ref.
3260 2002-09-13 Nathan Sidwell <nathan@codesourcery.com>
3262 * pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
3264 2002-09-13 Kazu Hirata <kazu@cs.umass.edu>
3266 * decl.c: Fix comment formatting.
3267 * decl2.c: Likewise.
3269 2002-09-12 Kazu Hirata <kazu@cs.umass.edu>
3271 * call.c: Fix comment formatting.
3272 * class.c: Likewise.
3273 * cp-lang.c: Likewise.
3274 * cp-tree.h: Likewise.
3277 2002-09-11 Zack Weinberg <zack@codesourcery.com>
3279 * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c,
3280 and c++filt from cxxfilt.o + version.o + $(LIBDEPS).
3281 * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with
3282 minor adjustments (use version_string, eliminate yet another
3283 duplicate of xmalloc)
3285 2002-09-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3287 * cp-tree.h (require_complete_eh_spec_types): Add prototype.
3289 2002-09-05 Jason Merrill <jason@redhat.com>
3291 * typeck2.c (add_exception_specifier): Only pedwarn for an
3293 (require_complete_eh_spec_types): New fn.
3294 (cxx_incomplete_type_diagnostic): Also support pedwarning.
3295 * typeck.c (complete_type_or_diagnostic): Likewise.
3296 * call.c (build_call): Call require_complete_eh_spec_types.
3297 * rtti.c (get_pseudo_ti_desc): Give an error rather than aborting
3298 on an incomplete type.
3300 2002-09-04 Jakub Jelinek <jakub@redhat.com>
3302 * decl.c (start_cleanup_fn): Clear interface_only before
3303 start_function, restore it afterwards.
3305 2002-09-02 Nathan Sidwell <nathan@codesourcery.com>
3307 * cp-tree.h (finish_builtin_type): Remove.
3308 * decl2.c (finish_builtin_type): Move to common code.
3309 * decl.c (build_ptrmemfunc_type): Adjust.
3310 * rtti.c (create_pseudo_type_info): Adjust.
3311 (create_tinfo_types): Adjust.
3313 2002-08-31 Jason Merrill <jason@redhat.com>
3315 * cp-lang.c (cp_expr_size): Allow initialization from a
3318 2002-08-30 Richard Henderson <rth@redhat.com>
3321 * tree.c: Include target.h.
3322 (cp_cannot_inline_tree_fn): Don't auto-inline functions that
3324 * Makefile.in (tree.o): Update.
3326 2002-08-27 Mark Mitchell <mark@codesourcery.com>
3328 * class.c (layout_virtual_bases): Warn about bugs in G++ that
3329 result in incorrect object layouts.
3330 (layout_class_type): Likewise.
3332 2002-08-24 Matt Austern <austern@apple.com>
3334 * tree.c (lvalue_p_1): Add argument for whether casts of lvalues
3336 (real_lvalue_p): Update caller.
3338 (non_cast_lvalue_or_else): New.
3339 * tree.h: Declare it.
3340 * typeck.c (build_unary_op): Use non_cast_lvalue_or_else.
3342 2002-08-22 Mark Mitchell <mark@codesourcery.com>
3344 * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR
3345 and COND_EXPR specially; fix error message output.
3347 2002-08-22 Jason Merrill <jason@redhat.com>
3349 * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR.
3350 * semantics.c (nullify_returns_r): Likewise.
3352 2002-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
3355 * typeck.c (finish_class_member_access_expr): Diagnose cases where
3356 name lookup finds nothing.
3358 2002-08-15 Jason Merrill <jason@redhat.com>
3360 * semantics.c (finish_then_clause): Remove redundant assignment.
3361 (finish_if_stmt, begin_switch_stmt, finish_switch_stmt): Move the
3362 extra binding level outside the if/switch statement.
3363 (finish_while_cond, finish_for_cond): Rewrite complex condition
3366 2002-08-15 Alexandre Oliva <aoliva@redhat.com>
3368 * parse.y (sizeof, alignof, typeof): New non-terminals to
3369 increment skip_evaluation. Replace terminals with them and
3370 decrement skip_evaluation at the end of rules using them.
3371 * decl2.c (mark_used): Don't assemble_external if
3372 skipping evaluation.
3374 2002-08-15 Gabriel Dos Reis <gdr@nerim.net>
3377 * parse.y (parse_finish_call_expr): Handle incomplete
3378 type used to name a scope.
3380 2002-08-15 Nathan Sidwell <nathan@codesourcery.com>
3383 * typeck.c (build_unary_op): Fold offsetof idiom. Fixes
3384 regression caused by my 2002-08-08 patch.
3386 2002-08-13 Mark Mitchell <mark@codesourcery.com>
3388 * decl.c (pushdecl_class_level): Honor requests to bind names to
3391 2002-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3393 * decl2.c (build_call_from_tree): Fix uninitialized variable.
3394 * parse.y (parse_finish_call_expr): Likewise.
3395 * repo.c (old_args, old_dir, old_main): Const-ify.
3397 2002-08-11 Gabriel Dos Reis <gdr@nerim.net>
3399 * decl.c (duplicate_decls): Replace DECL_SOURCE_FILE +
3400 DECL_SOURCE_LINE with DECL_SOURCE_LOCATION.
3401 * optimize.c (maybe_clone_body): Likewise.
3402 * pt.c (tsubst_enum): Likewise.
3403 (lookup_template_class): Likewise.
3404 * tree.c (cp_copy_res_decl_for_inlining): Likewise.
3406 2002-08-10 Neil Booth <neil@daikokuya.co.uk>
3408 * lang-specs.h: Remove -ansi.
3410 2002-08-10 Nathan Sidwell <nathan@codesourcery.com>
3412 * tree.c (maybe_dummy_object): Replace // with /* */
3414 2002-08-09 Mark Mitchell <mark@codesourcery.com>
3416 * call.c (standard_conversion): Use build_ptrmem_type.
3417 * cp-tree.h (build_ptrmem_type): New function.
3418 (adjust_result_of_qualified_name_lookup): Likewise.
3419 * decl.c (grokvardecl): Do not look for OFFSET_TYPEs to indicate
3420 static data members.
3421 (build_ptrmem_type): New function.
3422 (grokdeclarator): Do not use build_offset_type when encountering a
3424 * parse.y (parse_finish_call_expr): Use
3425 adjust_result_of_qualified_name_lookup.
3426 * search.c (adjust_result_of_qualified_name_lookup): New function.
3427 * typeck.c (qualify_type_recursive): Use TYPE_PTRMEM_* rather than
3428 accessing OFFSET_TYPEs directly.
3430 2002-08-08 Mike Stump <mrs@apple.com>
3432 * call.c (add_builtin_candidate): legal -> valid, illegal -> invalid.