1 2003-04-22 Mark Mitchell <mark@codesourcery.com>
3 * rtti.c (throw_bad_typeid): Use build_cxx_call.
5 2003-04-21 Mark Mitchell <mark@codesourcery.com>
7 * call.c (build_over_call): Use build_cxx_call.
8 (build_cxx_call): New method, split out of build_over_call.
9 * cp-tree.h (language_function): Add can_throw.
10 (build_cxx_call): Declare it.
11 * decl.c (finish_function): If a function does not contain any
12 calls to functions that can throw an exception, indicate that
14 * decl2.c (mark_used): Do not defer the instantiation of
15 functions, if the current function does not throw.
16 * optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones.
17 * pt.c (instantiate_decl): Make sure import_export_decl is called
18 before emitting things.
19 * rtti.c (throw_bad_cast): Use build_cxx_call.
20 (build_dynamic_cast_1): Likewise.
21 * typeck.c (build_function_call): Likewise.
23 2003-04-21 Nathan Sidwell <nathan@codesourcery.com>
26 * typeck.c (build_unary_op): Fold all COMPONENT_REF addr
27 expressions. Reverts my 2002-08-08 patch.
29 * typeck.c (comp_ptr_ttypes_real): Swap final && operands for
32 2003-04-20 Nathan Sidwell <nathan@codesourcery.com>
34 * cp/decl2.c (start_static_storage_duration_function): Take count
35 arg, don't check if it wraps round.
36 (generate_ctor_or_dtor_function): Add locus arg, use it.
37 (generate_ctor_and_dtor_functions_for_priority): Data arg is a
39 (finish_file): Set line numbers to past EOF for synthesized
42 2003-04-20 Nathan Sidwell <nathan@codesourcery.com>
45 * search.c (lookup_field_1): Final scan goes backwards for
46 types, forwards for non-types.
48 2003-04-17 Roger Sayle <roger@eyesopen.com>
51 * decl.c (duplicate_decls): Preserve "const", "noreturn" and
52 "nothrow" function attributes.
54 2003-04-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
57 * pt.c (type_dependent_expression_p): Handle array new.
59 2003-04-15 Mark Mitchell <mark@codesourcery.com>
62 * parser.c (cp_parser_primary_expression): Reorganize logic for
63 dealing with name lookup failures.
65 2003-04-15 Jason Merrill <jason@redhat.com>
67 * decl2.c (mark_used): Don't instantiate anything if
70 2003-04-14 Ziemowit Laski <zlaski@apple.com>
72 * tree.c (build_cplus_array_type_1): Do not call
73 uses_template_parms() on a NULL index_type.
75 2003-04-13 Roger Sayle <roger@eyesopen.com>
77 * decl.c (duplicate_decls): Preserve pure and malloc attributes.
79 2003-04-12 Mark Mitchell <mark@codesourcery.com>
82 * init.c (build_new_1): Reorganize.
84 2003-04-12 Zack Weinberg <zack@codesourcery.com>
86 * class.c (initialize_array)
87 * decl.c (reshape_init)
88 * decl2.c (build_expr_from_tree)
89 * init.c (build_zero_init)
90 * pt.c (tsubst_copy, tsubst_copy_and_build)
91 * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
92 (ptm_initializer, class_initializer, get_pseudo_ti_init)
93 * semantics.c (finish_compound_literal)
94 * typeck.c (build_ptrmemfunc1)
95 * typeck2.c (store_init_value, process_init_constructor)
96 (build_functional_cast): Use build_constructor.
98 2003-04-12 Zack Weinberg <zack@codesourcery.com>
100 * call.c (print_z_candidates): Use gcc_gettext_width, not
101 strlen, to determine how much padding to use.
103 2003-04-10 Zack Weinberg <zack@codesourcery.com>
105 * decl.c: Update all calls to shadow_warning.
107 2003-04-10 Mark Mitchell <mark@codesourcery.com>
109 * class.c (layout_class_type): Correct handling for overlong
110 bit-fields whose width is the same as an integer type.
112 2003-04-06 Zack Weinberg <zack@codesourcery.com>
114 * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero.
115 * cp-lang.c (cp_tree_size): New function.
116 (LANG_HOOKS_TREE_SIZE): Override.
118 * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct
119 tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill.
120 (union lang_tree_node): Remove common and srcloc members.
121 (build_srcloc_here): Don't prototype.
122 * decl.c (cp_tree_node_structure): Kill SRCLOC case.
123 * pt.c (pending_templates): Correct comment.
124 * tree.c (build_srcloc, build_srcloc_here): Kill.
126 2003-04-06 Zack Weinberg <zack@codesourcery.com>
128 * call.c: Include intl.h.
129 (print_z_candidate): Always use inform; get rid of errfn
130 argument. Reorganize so that all the strings get picked up
131 by xgettext. Note obligation of caller to pass first argument
133 (print_z_candidates): Update to match. Indent second and
134 successive candidates by strlen() of translated message.
135 (joust): Restructure ambiguous-conversion pedwarn so that
136 translators see a complete sentence. Update calls to
139 * Make-lang.in (cp/call.o): Update dependencies.
141 2003-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
143 * decl.c (set_current_binding_level): Delete, revert last change.
144 (current_binding_level): Modify to allow it as as lvalue.
146 2003-04-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
148 * name-lookup.c (find_binding): Pass appropriate pointer type to
149 POP_TIMEVAR_AND_RETURN.
151 2003-04-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
153 * Make-lang.in (cp-warn): Add $(STRICT_WARN).
154 * cp-tree.h: Don't insist on having GNUC.
156 2003-04-03 Jason Merrill <jason@redhat.com>
158 * cvt.c (ocp_convert): Only abort if we try to convert an object
159 of TREE_ADDRESSABLE type.
161 * class.c (build_vtable): Set DECL_ALIGN here.
162 (get_vtable_decl): Not here.
163 (layout_vtable_decl): Or here.
164 (create_vtable_ptr): Or here.
165 (layout_class_type): Or here.
166 (check_bitfield_decl): Don't mess with field alignment.
168 2003-04-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
170 * operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR,
171 DEF_ASSN_OPERATOR): Delete spurious semi-colon.
172 * rtti.c (dfs_class_hint_mark): Likewise.
174 * decl.c (push_local_name, push_class_level_binding,
175 maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in
176 functions returning void.
177 * decl2.c (add_using_namespace): Likewise.
179 * decl.c (print_binding_level, print_other_binding_stack,
180 print_binding_stack): Cast argument of %p specifier to void*.
181 * ptree.c (cxx_print_decl): Likewise.
183 * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
184 VAR_FUNCTION_OR_PARM_DECL_CHECK,
185 VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
186 BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK,
187 LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__.
189 * decl.c (set_current_binding_level): New macro. Use throughout
190 when setting the current binding level.
192 * cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma
194 * method.c (mangling_flags): Likewise.
196 * cp-tree.h (lang_type_header): Add __extension__ and use
197 CHAR_BITFIELD for members.
199 2003-04-02 Geoffrey Keating <geoffk@apple.com>
202 * mangle.c: Include gt-cp-mangle.h.
203 (subst_identifiers): Mark with GTY.
204 * config-lang.in (gtfiles): Add cp/mangle.c.
205 * Make-lang.in: (gt-cp-mangle.h): New rule.
206 (cp/mangle.o): Depends on gt-cp-mangle.h.
208 2003-04-01 Andrew Pinski <pinskia@physics.uc.edu>
210 * config-lang.in (gtfiles): Add \$(srcdir)/cp/name-lookup.c
211 after \$(srcdir)/cp/name-lookup.h.
212 * name-lookup.c: (cxx_binding_make): Use ggc_alloc_clearedinstead
213 of ggc_alloc. Include gt-cp-name-lookup.h at the end of the file.
214 * Make-lang.in: (gt-cp-name-lookup.h): Is generated by gengtype.
215 (cp/name-lookup.o): Depends on gt-cp-name-lookup.h.
217 2003-03-31 Jason Merrill <jason@redhat.com>
220 * class.c (check_field_decl): Don't set DECL_ALIGN.
222 2003-03-30 Mark Mitchell <mark@codesourcery.com>
225 * decl.c (grokdeclarator): Tidy, slightly.
226 * search.c (lookup_field_1): Add want_type parameter.
227 (lookup_field_r): Adjust call to lookup_field_1.
229 2003-03-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
231 * Make-lang.in (cp/name-lookup.o): Add more dependencies.
233 2003-03-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
235 * cp-tree.h (binding_for_name: Move to name-lookup.h Adjust
237 (cxx_scope_find_binding_for_name): Likewise.
238 * decl.c (find_binding: Move to name-lookup.c.
239 (binding_for_name): Likewise.
240 (cxx_scope_find_binding_for_name): Likewise.
241 (BINDING_LEVEL): Remove.
242 (push_binding): Tidy.
243 (push_class_binding): Likewise.
244 (pop_binding): Likewise.
245 (poplevel): Likewise.
246 (poplevel_class): Likewise.
247 (set_identifier_type_value_with_scope): Likewise.
248 (push_overloaded_decl): Likewise.
249 (lookup_tag): Likewise.
250 (unqualified_namespace_lookup): Likewise.
251 (lookup_name_current_level): Likewise.
252 (maybe_inject_for_scope_var): Likewise.
253 (namespace_binding): Move to name-lookup.c.
254 (set_namespace_binding): Likewise.
255 * decl2.c (lookup_using_namespace): Tidy.
256 (qualified_lookup_using_namespace): Likewise.
257 (do_toplevel_using_decl): Likewise.
258 * name-lookup.c: Include "timevar.h"
259 * name-lookup.h (cxx_scope): Declare.
260 (struct cxx_binding): Lose member "has_level". Adjust "scope"
262 (BINDING_SCOPE): Adjust definition.
263 (BINDING_HAS_LEVEL_P): Remove.
265 2003-03-30 Gabriel Dos Reis <gdr@integrable-solutions.net>
267 * name-lookup.c: New file.
268 * name-lookup.h: Likewise..
269 * decl.c (push_binding): Adjust use cxx_binding_make.
270 (free_bindings): Move to name-lookup.c
271 (pop_binding): Use cxx_binding_free.
272 (binding_for_name): Tidy.
273 * cp-tree.h: Include "name-lookup.h"
274 (cxx_binding_make): Move to name-lookup.h
275 (cxx_binding_clear): Likewise.
276 (struct cxx_binding): Likewise.
277 (LOCAL_BINDING_P): Likewise.
278 (INHERITED_VALUE_BINDING_P): Likewise.
279 (BINDING_SCOPE): Likewise.
280 (BINDING_HAS_LEVEL_P): Likewise.
281 (BINDING_VALUE): Likewise.
282 (BINDING_TYPE): Likewise.
283 * config-lang.in (gtfiles): Add cp/name-lookup.h
284 * Make-lang.in (cp/name-lookup.o): New rule.
285 (CXX_OBJS): Add cp/name-lookup.o
286 (CXX_TREE_H): Add cp/name-lookup.h
288 2003-03-28 Jason Merrill <jason@redhat.com>
291 * cvt.c (force_rvalue): New fn.
292 * call.c (build_conditional_expr): Use it.
293 * cp-tree.h: Declare it.
295 2003-03-28 Mike Stump <mrs@apple.com>
297 * error.c (dump_expr): Add 0x to printed hex numbers to make
298 output match source code better.
300 2003-03-28 Mark Mitchell <mark@codesourcery.com>
303 * decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class
306 * decl2.c (generate_ctor_or_dtor_function): Tolerate a
307 non-existant ssdf_decls array.
308 (finish_file): Call generator_ctor_or_dtor_function when there are
309 static constructors or destructors and no other static
312 2003-03-28 Nathan Sidwell <nathan@codesourcery.com>
315 * decl2.c (finish_file): Don't warn about explicitly instantiated
318 2003-03-27 Nathan Sidwell <nathan@codesourcery.com>
321 * pt.c (lookup_template_class): Only check instantiated args if
322 they do not contain template parameters.
324 2003-03-27 Nathan Sidwell <nathan@codesourcery.com>
327 * parser.c (cp_parser_function_definition): Set
328 DECL_INITIALIZED_IN_CLASS for members.
329 * pt.c (instantiate_decl): Only reduce the template args for
330 friends that are not defined in class.
332 2003-03-25 Jason Merrill <jason@redhat.com>
334 * call.c (print_z_candidate): Change name of first arg to msgid.
335 (joust): Add comment for translators.
337 2003-03-24 Nathan Sidwell <nathan@codesourcery.com>
339 PR c++/9898, PR c++/383, DR 322
340 * pt.c (maybe_adjust_types_for_deduction) <DEDUCE_CONV>: Look
341 through reference types on both PARM and ARG.
343 2003-03-24 Nathan Sidwell <nathan@codesourcery.com>
346 * error.c (dump_expr) <BASELINK>: Use dump_expr.
347 * pt.c (maybe_fold_nontype_args): New function.
348 (tsubst_copy) <SCOPE_REF>: Subst any template_id args.
349 <TEMPLATE_ID_EXPR>: Break out folding code, call it.
350 (tsubst_copy_and_build) <TEMPLATE_ID_EXPR>: Call
351 maybe_fold_nontype_args.
353 2003-03-24 Nathan Sidwell <nathan@codesourcery.com>
356 * decl2.c (arg_assoc_type) <ERROR_MARK>: Don't die.
358 2003-03-23 Mark Mitchell <mark@codesourcery.com>
361 * typeck.c (cxx_mark_addressable): Adjust call to
362 gen_mem_addressof or put_var_into_stack.
364 2003-03-22 Nathan Sidwell <nathan@codesourcery.com>
366 PR c++/9978, c++/9708
367 * cp-tree.h (instantiate_template): Add tsubst_flags parameter.
368 * call.c (add_template_candidate_real): Adjust
369 instantiate_template call.
370 * class.c (resolve_address_of_overloaded_function): Likewise.
371 * decl.c (build_enumerator): Set TREE_CONSTANT.
372 * pt.c (check_instantiated_args): New.
373 (push_inline_template_parms_recursive): Set TREE_CONSTANT,
375 (build_template_parm_index): Copy TREE_CONSTANT, TREE_READONLY.
376 (reduce_template_parm_level): Likewise.
377 (process_template_parm): Likewise.
378 (check_explicit_specialization): Adjust instantiate_template call.
379 (convert_template_argument): Don't check non-type argument here.
380 (lookup_template_class): Check them here.
381 (tsubst_friend_function): Adjust instantiate_template call.
382 (instantiate_template): Add tsubst_flags parameter, use it. Check
385 2003-03-21 Zack Weinberg <zack@codesourcery.com>
387 * decl.c: Update calls to shadow_warning.
389 2003-03-21 Nathan Sidwell <nathan@codesourcery.com>
392 * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'.
393 (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call.
395 2003-03-20 Mark Mitchell <mark@codesourcery.com>
397 * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
399 * cp/pt.c (instantiate_class_template): Fix formatting.
401 2003-03-14 Matt Austern <austern@apple.com>
403 * cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray.
404 (unemitted_tinfo_decl_p): Remove.
405 (emit_tinfo_decl): Change declaration to remove unused parameter.
406 * decl2.c (finish_file): Change tinfo emission to loop through
407 unemitted_tinfo_decls array instead of looping through all decls.
408 * rtti.c (unemitted_tinfo_decl_p): Declare as static, remove
409 unused second parameter.
410 (init_rtti_processing): initialize unemitted_tinfo_decls varray.
411 (get_tinfo_decls): push new tinfo decl on unemitted_tinfo_decls.
412 (emit_tinfo_decl): remove unused second parameter, add assertion
413 that decl hasn't already been emitted.
415 2003-03-19 Nathanael Nerode <neroden@gcc.gnu.org>
417 * dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return
418 type from 'int' to 'bool'. Replace 0 and 1 with true and false in
421 2003-03-19 Jason Merrill <jason@redhat.com>
423 PR c++/8316, c++/9315, c++/10136
424 * call.c (print_z_candidate): Split out from...
425 (print_z_candidiates): ...here.
428 2003-03-17 Roger Sayle <roger@eyesopen.com>
431 * decl.c (duplicate_decls): Use the new type when prototyping
432 anticipated decls, even when the types match. This defines the
433 exception list for the built-in function.
435 2003-03-17 Jason Merrill <jason@redhat.com>
438 * typeck.c (build_class_member_access_expr): Compare
441 2003-03-17 Mark Mitchell <mark@codesourcery.com>
444 * parser.c (cp_parser_declarator_id): Clear parser->scope.
446 2003-03-16 Jason Merrill <jason@redhat.com>
449 * decl.c (finish_function): Only allow the NRVO to use variables
450 declared at function scope.
452 2003-03-17 Andreas Jaeger <aj@suse.de>
454 * Make-lang.in (cp/TAGS): Remove.
456 2003-03-16 Nathan Sidwell <nathan@codesourcery.com>
459 * cp-tree.h (struct language_function): Add in_base_initializer.
460 (in_base_initializer): define it.
461 (expand_member_init): Remove INIT param.
462 * init.c (expand_member_init): Remove INIT param, return the member.
463 (emit_mem_initializers): Set in_base_initializer.
464 * class.c (build_base_path): Check in_base_initializer.
465 * parser.c (cp_parser_mem_initializer): Set in_base_initializer.
466 * pt.c (tsubst_initializer_list): Likewise.
468 2003-03-16 Gabriel Dos Reis <gdr@integrable-solutions.net>
470 * decl.c (binding_for_name): Fix initialization thinko.
472 2003-03-15 Gabriel Dos Reis <gdr@integrable-solutions.net>
474 Compile-time improvement: 2/n.
475 * cp-tree.h (struct cxx_binding): New datatype;
476 (struct lang_identifier): Use it.
477 (LOCAL_BINDING_P): Adjust definition.
478 (INHERITED_VALUE_BINDING_P): Likewise.
479 (BINDING_SCOPE): Likewise.
480 (BINDING_HAS_LEVEL_P): Likewise.
481 (BINDING_VALUE): Likewise.
482 (BINDING_TYPE): Likewise.
483 (IDENTIFIER_VALUE): Likewise.
484 (struct tree_binding): Remove.
485 (TS_CP_BINDING): Likewise.
486 ((union lang_tree_node): Remove field "binding".
487 (cxx_binding_clear): New macro.
488 (binding_for_name): Adjust return type.
489 (qualified_lookup_using_namespace): Adjust prototype.
490 (lookup_using_namespace): Adjust prototype.
491 (cxx_scope_find_binding_for_name): Declare.
492 * cp-tree.def: Remove CPLUS_BINDING definition.
493 * decl.c (push_binding): Adjust local variable type.
494 (add_binding): Likewise.
495 (push_class_binding): Likewise.
496 (pop_binding): Likewise.
497 (poplevel): Likewise.
498 (poplevel_class): Likewise.
499 (free_bindings): Adjust type.
500 (find_binding): Adjust return type, add a third parameter. Remove
501 non-useful assertion now that we use static typing.
502 (cxx_scope_find_binding_for_name): New function.
503 (binding_for_name): Use it. Adjust local variable type. Simplify.
504 (namespace_binding): Simplify.
505 (set_namespace_binding): Likewise.
506 (set_identifier_type_value_with_scope): Adjust local variable type.
507 (lookup_tag): Don't type-abuse of local variable 'old'.
508 (lookup_namespace_name): Likewise. Allocate binding on stack.
509 (select_decl): Adjust prototype.
510 (unqualified_namespace_lookup): Allocate binding on stack.
511 Don't type-abuse of local variable 'val'.
512 (lookup_name_real): Likewise.
513 (maybe_inject_for_scope_var): Adjust local variable type.
514 (cp_tree_node_structure): Remove CPLUS_BINDING case label.
515 (namespace_binding): Adjust logic, simplify.
516 (BINDING_LEVEL): Adjust definition.
517 (push_class_level_binding): Adjust local variable type.
518 (struct cxx_saved_binding): Adjust field 'binding' type.
519 * decl2.c (ambiguous_decl): Adjust prototype.
520 (lookup_using_namespace): Adjust local variable type.
521 (qualified_lookup_using_namespace): Catch type error and correct
522 ensueing logic error.
523 (do_nonmember_using_decl): Adjust local variable type. Allocate
524 temporary cxx_binding on stack.
525 (do_toplevel_using_decl): Adjust local variable type.
526 * ptree.c (cxx_print_cxx_binding): New function.
527 (cxx_print_identifier): Use it.
528 (cxx_print_xnode): Delete CPLUS_BINDING case label.
530 2003-03-15 Roger Sayle <roger@eyesopen.com>
532 * tree.c (count_functions): Fix whitespace.
534 2003-03-15 Neil Booth <neil@daikokuya.co.uk>
536 * Make-lang.in: Update.
538 2003-03-15 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
541 * pt.c (maybe_process_partial_specialization): Handle
542 member class template when enclosing class template is
543 explicit specialized.
544 (most_general_template): Stop looking when DECL is already
547 2003-03-13 Jason Merrill <jason@redhat.com>
550 * search.c (lookup_conversions): Call complete_type here.
551 * call.c (implicit_conversion): Not here.
553 2003-03-13 Mark Mitchell <mark@codesourcery.com>
555 * decl2.c (do_nonmember_using_decl): Correct handling of
556 simultaneous type/non-type bindings.
558 * call.c (initialize_reference): Remove bogus assertion.
559 * decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09.
561 2003-03-12 Andrew Lewycky <andrew@mxc.ca>
564 * expr.c (cxx_expand_expr): Return const0_rtx for throw
567 2003-03-11 Mark Mitchell <mark@codesourcery.com>
570 * decl2.c (do_nonmember_using_decl): Do not call duplicate decls
571 to merge old and new declarations.
573 2003-03-12 Alexandre Oliva <aoliva@redhat.com>
576 * Make-lang.in (c++.generated-manpages): Build cp/g++.1.
577 (cp/g++.1): Build it from scratch in the build tree.
578 (c++.install-man): Depend on it. Install it from the build tree.
579 (c++.mostlyclean): Clean it.
581 2003-03-11 Mark Mitchell <mark@codesourcery.com>
584 * decl2.c (do_nonmember_using_decl): Do not call duplicate decls
585 to merge old and new declarations.
588 * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins.
590 2003-03-11 Jason Merrill <jason@redhat.com>
593 * search.c (lookup_member): Fix handling of functions in a class
596 2003-03-11 Mark Mitchell <mark@codesourcery.com>
599 * call.c (convert_class_to_reference): Adjust usage of
601 (any_viable): Remove.
602 (splice_viable): Combine with any_viable.
603 (print_z_candidates): Avoid printing duplicates.
604 (build_user_type_conversion_1): Adjust usage of splice_viable.
605 (build_new_function_call): Likewise.
606 (build_operator_new_call): Likewise.
607 (build_object_call): Likewise.
608 (build_conditional_expr): Likewise.
609 (build_new_op): Likewise.
610 (build_new_method_call): Likewise.
611 (joust): Remove spurious comment.
612 * cp-tree.h (DECL_FRIENDLIST): Correct documentation.
613 * decl2.c (arg_assoc_class): Simplify.
614 * friend.c (add_friend): Likewise.
616 2003-03-11 Jason Merrill <jason@redhat.com>
619 * decl2.c (check_classfn): A member template only matches a
622 2003-03-11 Neil Booth <neil@daikokuya.co.uk>
624 * Make-lang.in (CXX_C_OBJS): Update.
625 * lang-specs.h: Don't define __GNUG__ here.
627 2003-03-10 Mark Mitchell <mark@codesourcery.com>
629 * call.c (perform_overload_resolution): New function.
630 (build_new_function_call): Use it.
631 (build_operator_new_call): Likewise.
632 (add_candidates): Add explicit_targs and template_only parameters.
633 (build_new_op): Adjust accordingly.
634 * cp-tree.h (build_operator_new_call): New function.
635 (build_function_call_real): Remove.
636 (build_function_call_maybe): Likewise.
637 * init.c (build_new_1): Use build_operator_new_call.
638 * typeck.c (build_function_call_real): Rename to ...
639 (build_function_call): ... this.
641 2003-03-10 Devang Patel <dpatel@apple.com>
644 * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG.
646 2003-03-10 Jason Merrill <jason@redhat.com>
649 * decl.c (push_using_directive): Push before recursing.
651 PR c++/9868, c++/9524
652 * call.c (resolve_scoped_fn_name): Handle the case of a function
655 * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this'
656 argument in the pointer-to-member case.
658 2003-03-09 Mark Mitchell <mark@codesourcery.com>
661 * cp-lang.c (cxx_get_alias_set): Use alias set zero for
662 pointers to member functions.
665 * decl.c (build_ptrmemfunc_type): Do not allow default arugments
666 in pointer-to-member-function types.
668 2003-03-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
670 * expr.c (cplus_expand_constant): Use C90 prototype style.
671 (cxx_expand_expr): Likewise.
673 2003-03-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
676 * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual
679 2003-03-08 Geoffrey Keating <geoffk@apple.com>
681 * lang-specs.h (c++-header): Change .pch to .gch.
683 2003-03-08 Neil Booth <neil@daikokuya.co.uk>
685 * cp-tree.h (cxx_init): Update prototype.
686 * lex.c (cxx_init): Similarly.
688 2003-03-08 Mark Mitchell <mark@codesourcery.com>
691 * cp-tree.h (begin_mem_initializers): Remove.
692 * parser.c (cp_parser_mem_initializer_list): Inline it here.
693 Do not call finish_mem_initializers if not in a constructor.
694 (cp_parser_class_head): Fix typo in error message.
695 * semantics.c (begin_mem_initializers): Remove.
696 * testsuite/g++.dg/parser/constructor1.C: New test.
699 * call.c (add_function_candidate): Skip builtin fuctions that have
700 not yet been declared.
703 * init.c (build_new_1): Correct logic for determining whether or
704 not to use an array cookie.
707 * parser.c (cp_parser_postfix_expression): Call
708 finish_non_static_data_member, even when processing_template_decl.
711 * cp-tree.h (is_ancestor): New function.
712 (handle_class_head): Change prototype.
713 * decl2.c (is_namespace_ancestor): Rename to ...
714 (namespace_anecestor): ... this.
715 (set_decl_namespace): Adjust accordingly.
716 (handle_class_head): Remove unncessary parameters.
717 * parser.c (cp_parser_class_head): Check that
718 nested-name-specifiers are used appropriately.
720 2003-03-07 Mark Mitchell <mark@codesourcery.com>
722 * call.c (reference_binding): Remove REF_IS_VAR parameter.
723 (implicit_conversion): Adjust call to reference_binding.
724 (make_temporary_var_for_ref_to_type): Add TYPE parameter.
725 (initialize_reference): Adjust handling for references bound to
727 * cp-tree.h (make_temporary_var_for_ref_to_temp): Change
729 (real_non_cast_lvalue_p): New method.
730 * cvt.c (build_up_reference): Adjust use of
731 make_temporary_var_for_ref_to_temp.
732 * tree.c (real_non_cast_lvalue_p): New method.
734 2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
736 * except.c (init_exception_processing): Use C90 prototype style.
737 (cp_protect_cleanup_actions): Likewise.
738 (prepare_eh_type): Likewise.
739 (build_eh_type_type): Likewise.
740 (build_exc_ptr): Likewise.
741 (do_begin_catch): Likewise.
742 (dtor_nothrow): Likewise.
743 (do_end_catch): Likewise.
744 (push_eh_cleanup): Likewise.
745 (decl_is_java_type): Likewise.
746 (choose_personality_routine): Likewise.
747 (initialize_handler_parm): Likewise.
748 (expand_start_catch_block): Likewise.
749 (expand_end_catch_block): Likewise.
750 (begin_eh_spec_block): Likewise.
751 (finish_eh_spec_block): Likewise.
752 (do_allocate_exception): Likewise.
753 (do_free_exception): Likewise.
754 (wrap_cleanups_r): Likewise.
755 (stabilize_throw_expr): Likewise.
756 (build_throw): Likewise.
757 (complete_ptr_ref_or_void_ptr_p): Likewise.
758 (is_admissible_throw_operand): Likewise.
759 (nothrow_libfn_p): Likewise.
760 (can_convert_eh): Likewise.
761 (check_handlers_1): Likewise.
762 (check_handlers): Likewise.
764 2003-03-06 Mark Mitchell <mark@codesourcery.com>
766 * call.c (merge_conversion_sequences): New function.
767 (build_conv): Set ICS_USER_FLAG for USER_CONVs.
768 (convert_class_to_reference): Correct handling of second
769 standard conversion sequence in a user-defined conversion
771 (build_user_type_conversion_1): Use merge_conversion_sequences.
772 * cp-tree.def: Add comments for CONV nodes.
773 * rtti.c (get_tinfo_decl): Use build_address/build_nop.
775 2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
777 * error.c (init_error): Use C90 prototype style.
778 (dump_scope): Likewise.
779 (dump_qualifiers): Likewise.
780 (dump_template_argument): Likewise.
781 (dump_template_argument_list): Likewise.
782 (dump_template_parameter): Likewise.
783 (dump_template_bindings): Likewise.
784 (dump_type): Likewise.
785 (dump_typename): Likewise.
786 (class_key_or_enum): Likewise.
787 (dump_aggr_type): Likewise.
788 (dump_type_prefix): Likewise.
789 (dump_type_suffix): Likewise.
790 (dump_global_iord): Likewise.
791 (dump_simple_decl): Likewise.
792 (dump_decl): Likewise.
793 (dump_template_decl): Likewise.
794 (dump_function_decl): Likewise.
795 (dump_parameters): Likewise.
796 (dump_exception_spec): Likewise.
797 (dump_function_name): Likewise.
798 (dump_template_parms): Likewise.
799 (dump_char): Likewise.
800 (dump_expr_list): Likewise.
801 (dump_expr): Likewise.
802 (dump_binary_op): Likewise.
803 (dump_unary_op): Likewise.
804 (type_as_string): Likewise.
805 (expr_as_string): Likewise.
806 (decl_as_string): Likewise.
807 (context_as_string): Likewise.
808 (lang_decl_name): Likewise.
809 (cp_file_of): Likewise.
810 (cp_line_of): Likewise.
811 (decl_to_string): Likewise.
812 (expr_to_string): Likewise.
813 (fndecl_to_string): Likewise.
814 (code_to_string): Likewise.
815 (language_to_string): Likewise.
816 (parm_to_string): Likewise.
817 (op_to_string): Likewise.
818 (type_to_string): Likewise.
819 (assop_to_string): Likewise.
820 (args_to_string): Likewise.
821 (cv_to_string): Likewise.
822 (cxx_print_error_function): Likewise.
823 (cp_diagnostic_starter): Likewise.
824 (cp_diagnostic_finalizer): Likewise.
825 (cp_print_error_function): Likewise.
826 (function_category): Likewise.
827 (print_instantiation_full_context): Likewise.
828 (print_instantiation_partial_context): Likewise.
829 (maybe_print_instantiation_context): Likewise.
830 (print_instantiation_context): Likewise.
831 (cp_printer): Likewise.
832 (print_integer): Likewise.
833 (print_non_consecutive_character): Likewise.
834 (locate_error): Likewise.
836 2003-03-06 Mark Mitchell <mark@codesourcery.com>
839 * call.c (reference_binding): Add ref_is_var parameter.
840 (implicit_conversion): Adjust call to reference_binding.
841 (initialize_reference): Likewise.
844 * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
848 * class.c (get_basefndecls): Use lookup_fnfields_1.
850 2003-03-06 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
853 * parser.c (cp_parser_type_parameter): Remove redundant `expect'
855 (cp_parser_single_declaration): Likewise.
857 2003-03-05 Jason Merrill <jason@redhat.com>
860 * call.c (build_conditional_expr): Use convert rather than an
863 2003-03-02 Matt Austern <austern@apple.com>
865 * decl.c (cp_binding_level): Add static_decls varray member.
866 (add_decl_to_level): Add static/inline namespace scope
867 declarations to static_decls array.
868 (wrapup_global_for_namespace): Pass static_decls only, instead of
869 all decls, to wrapup_global_declarations/check_global_declarations.
870 (push_namespace): Initialize static_decls for ordinary namespaces.
871 (cxx_init_decl_processing): Initialize static_decls for global
874 2003-03-05 Mark Mitchell <mark@codesourcery.com>
876 * class.c (end_of_class): Correct thinko.
878 2003-03-04 Nathanael Nerode <neroden@gcc.gnu.org>
880 * config-lang.in: Replace ${libstdcxx_version} by its value.
882 2003-03-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
884 * cp-tree.h (cxx_saved_binding): Declare.
885 (struct saved_scope): Adjust type of field 'old_binding'.
886 * decl.c (cxx_saved_binding_make): New macro.
887 (struct cxx_saved_binding): Define.
888 (store_bindings): Adjust prototype. Use cxx_saved_binding to save
890 (maybe_push_to_top_level): Adjust local variable type.
891 (pop_from_top_level): Likewise.
893 2003-03-04 Tom Tromey <tromey@redhat.com>
895 * Make-lang.in (c++.tags): New target.
897 2003-03-04 Neil Booth <neil@daikokuya.co.uk>
899 * Make-lang.in: Update.
901 2003-03-03 Jason Merrill <jason@redhat.com>
903 * decl.c (finish_enum): Do set the type in a template. Simplify.
904 * pt.c (tsubst_enum, tsubst_copy): Revert last patch.
906 2003-03-03 Mark Mitchell <mark@codesourcery.com>
909 * call.c (convert_class_to_reference): Correct conversion
911 (reference_binding): Add ref_bound_directly_to_rvalue_p parameter.
912 (implicit_conversion): Adjust call to reference_binding.
913 (add_candidate): Change type of candidates parameter.
914 (add_function_candidate): Likewise.
915 (add_conv_candidate): Likewise.
916 (build_builtin_candidate): Likewise.
917 (add_builtin_candidate): Likewise.
918 (add_builtin_candidates): Likewise.
919 (add_template_candidate_real): Likewise.
920 (add_template_candidate): Likewise.
921 (add_template_conv_candidate): Likewise.
922 (build_user_type_conversion_1): Adjust accordingly.
923 (build_object_call): Likewise.
924 (build_conditional_expr): Likewise.
925 (add_candidates): Likewise.
926 (build_new_op): Likewise.
927 (convert_like_real): Use USER_CONV_CAND. Use build_nop.
928 (build_new_method_call): Adjust calls to add_function_candidate.
929 (make_temporary_var_for_ref_to_temp): New function.
930 (initialize_reference): Add decl parameter.
931 * class.c (build_rtti_vtbl_entries): Use build_address and
933 * cp-tree.h (initialize_reference): Change prototype.
934 (make_temporary_var_for_ref_to_temp): New function.
935 (build_type_conversion): Change prototype.
936 (build_address): New function.
937 (build_nop): Likewise.
938 * cvt.c (cp_convert_to_pointer): Adjust call to
939 build_type_conversion. Avoid indicating redundant NOP_EXPRs.
941 (convert_to_pointer_force): Use build_nop.
942 (build_up_reference): Use make_temporary_var_for_ref_to_temp.
943 (convert_to_reference): Adjust call to build_type_conversion.
944 (ocp_convert): Likewise.
945 (build_type_conversion): Remove for_sure parameter.
946 * decl.c (grok_reference_init): Use initialize_reference.
947 * typeck.c (build_address): New function.
948 (build_nop): Likewise.
949 (build_unary_op): Use them.
950 (build_ptrmemfunc): Tidy slightly.
951 (convert_for_initialization): Adjust call to
952 initialize_reference.
953 * typeck2.c (store_init_value): Remove #if 0'd code.
955 2003-03-03 Jason Merrill <jason@redhat.com>
957 * decl.c (start_function): Clear DECL_NUM_STMTS.
959 * class.c (get_vtable_decl): Use vtbl_type_node.
960 (build_primary_vtable): Check for it.
962 2003-03-02 Aldy Hernandez <aldyh@redhat.com>
964 * decl.c (check_initializer): Check for vector_opaque_p.
966 2003-03-02 Ashif Harji <asharji@uwaterloo.ca>
968 * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to
969 invoke an external cpp during compilation.
971 2003-03-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
973 * decl.c (duplicate_decls): Convert use of warning_with_decl() to
975 (start_decl): Likewise.
976 (start_function): Likewise.
978 2003-03-01 Neil Booth <neil@daikokuya.co.uk>
980 * Make-lang.in (CXX_C_OBJS): Update.
982 2003-02-28 Mark Mitchell <mark@codesourcery.com>
985 * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when
988 2003-02-28 Aldy Hernandez <aldyh@redhat.com>
990 * parser.c (cp_parser_init_declarator): Revert opaque
991 vector_opaque_p change.
992 Do not include target.h.
994 2003-02-28 Mark Mitchell <mark@codesourcery.com>
997 * cp-tree.h (build_zero_init): Add parameter.
998 * decl.c (cp_finish_decl): Adjust call.
999 * init.c (build_zero_init): Add nelts parameter. Adjust recursive
1001 (build_default_init): Add nelts parameter. Adjust calls to
1003 (build_new_1): Adjust call to build_default_init.
1004 * typeck2.c (process_init_constructor): Adjust call to build_zero_init.
1006 2003-02-26 Devang Patel <dpatel@apple.com>
1008 * decl.c (finish_enum): Merge two 'for' loops. Copy value node if
1009 required. Postpone enum setting for template decls.
1010 (build_enumerator): Delay copying value node until finish_enum
1011 (). Remove #if 0'ed code.
1012 * pt.c (tsubst_enum): Set TREE_TYPE and copy value node.
1013 (tsubst_copy): Add check for enum type.
1015 2003-02-25 Mark Mitchell <mark@codesourcery.com>
1018 * decl2.c (prune_vars_needing_no_initialization): Do not throw
1019 away initializations for DECL_EXTERNAL VAR_DECLs.
1020 (finish_file): Adjust accordingly.
1021 * pt.c (instantiate_decl): Do not defer VAR_DECLs.
1023 2003-02-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
1025 * decl.c (add_binding): Time TV_NAME_LOOKUP.
1026 (push_class_binding): Likewise.
1027 (set_namespace_binding): Likewise.
1029 2003-02-24 Mark Mitchell <mark@codesourcery.com>
1032 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from
1033 specializations back to the main template.
1034 * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use.
1035 * pt.c (resolve_typename_type): Likewise.
1037 2003-02-24 Jeffrey D. Oldham <oldham@codesourcery.com>
1040 * pt.c (tsubst_copy_and_build): For a templated function inside a
1041 scope, process template arguments.
1043 2003-02-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1046 * typeck2.c (abstract_virtuals_error): Don't check when
1047 TYPE is still template parameter dependent.
1049 2003-02-23 Mark Mitchell <mark@codesourcery.com>
1052 * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro.
1053 * parser.c (cp_parser_diagnose_invalid_type_name): Use it.
1054 * pt.c (instantiate_class_template): Don't try to instantiate
1056 (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE.
1058 2003-02-21 Mark Mitchell <mark@codesourcery.com>
1061 * decl.c (grokdeclarator): Do not allow parameters with variably
1064 2003-02-21 Nathan Sidwell <nathan@codesourcery.com>
1066 * search.c (grow_bfs_bases): Remove. Fold into ...
1067 (bfs_walk): ... here, fix fencepost error. Fix merge lossage
1070 2003-02-20 Mark Mitchell <mark@codesourcery.com>
1073 * mangle.c (mangle_conv_op_name_for_type): Issue an error message
1074 when the G++ 3.2 ABI prevents correct compilation.
1076 2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
1078 Change base class access representation. Share virtual base
1080 * cp/call.c (build_special_member_call): Remove binfo_for_vbase
1082 * cp/class.c (build_base_path): Likewise.
1083 (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
1084 (build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
1085 (make_new_vtable): Adjust.
1086 (force_canonical_binfo_r): Delete.
1087 (force_canonical_binfo): Delete.
1088 (mark_primary_virtual_base): Delete.
1089 (dfs_unshared_virtual_bases): Delete.
1090 (mark_primary_bases): Adjust.
1091 (maybe_warn_about_overly_private_class): Adjust.
1092 (dfs_base_derived_from): Delete.
1093 (base_derived_from): Follow the inheritance chain.
1094 (struct find_final_overrider_data): Add vpath member.
1095 (dfs_find_final_overrider): Adjust.
1096 (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
1097 (find_final_overrider): Adjust.
1098 (update_vtable_entry_for_fn): Adjust.
1099 (modify_all_vtables): Adjust.
1100 (walk_subobject_offsets): Adjust.
1101 (layout_nonempty_base_or_field): Adjust.
1102 (layout_empty_base): Remove last parameter. Adjust.
1103 (build_base_field): Adjust.
1104 (build_base_fields): Adjust.
1105 (propagate_binfo_offsets): Remove last parameter. Adjust.
1106 (dfs_set_offset_for_unshared_vbases): Delete.
1107 (layout_virtual_bases): Adjust.
1108 (finish_struct_1): Adjust.
1109 (init_class_processing): Don't init access nodes.
1110 (dfs_get_primary_binfo): Delete.
1111 (get_primary_binfo): Adjust.
1112 (dump_class_hierarchy_r): Remove most derived arg, add IGO
1114 (dump_class_hierarchy): Adjust.
1115 (finish_vtbls): Adjust.
1116 (get_original_base): Delete.
1117 (build_vtt_inits): Adjust.
1118 (dfs_build_secondary_vptr_vtt_inits): Adjust.
1119 (dfs_ctor_vtable_bases_queue_p): Adjust.
1120 (build_ctor_vtbl_group): Adjust.
1121 (dfs_accumulate_vtbl_inits): Adjust.
1122 (build_vtbl_initializer): Adjust.
1123 (build_vbase_offset_vtbl_entries): Adjust.
1124 (add_vcall_offset_vtbl_entries_1): Adjust.
1125 * cp/cp-tree.h (CPTI_ACCESS_*): Remove.
1126 (access_*_node): Remove.
1127 (CANONICAL_BINFO): Delete.
1128 (BINFO_UNSHARED_MARKED): Remove.
1129 (BINFO_MARKED): Set LANG_FLAG_0 directly.
1130 (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
1131 (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
1132 (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
1134 (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
1135 (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
1136 (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
1138 (BINFO_DEPENDENT_BASE_P): New.
1139 (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
1141 (markedp, unmarkedp): Adjust.
1142 (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
1143 dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
1144 find_vbase_instance, binfo_for_vbase): Delete.
1145 (copied_binfo, original_binfo): Declare.
1146 (finish_base_specifier): Add virtual_p arg.
1147 (unshare_base_binfos): Delete.
1148 (copy_base_binfos): Declare.
1149 (reverse_path): Delete.
1150 * cp/decl.c (xref_basetypes): Access and virtuality passed
1151 differently. Don't copy direct base binfos here. Call
1153 * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
1154 (initialize_vtbl_ptrs): Adjust.
1155 (expand_member_init): Adjust.
1156 * cp/parser.c (cp_parser_base_specifier): Adjust.
1157 * cp/pt.c (instantiate_class_template): Adjust.
1158 (get_template_base_recursive): Adjust.
1159 * cp/rtti.c (get_pseudo_ti_init): Adjust.
1160 (get_pseudo_ti_desc): Adjust.
1161 * cp/tree.c (unshare_base_binfos): Rename to ...
1162 (copy_base_binfos): ... here, reimplement.
1163 (make_binfo): Set BINFO_DEPENDENT_BASE_P.
1164 (reverse_path): Remove.
1165 * cp/typeck.c (get_delta_difference): Adjust error messages.
1166 * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
1167 * cp/search.c (lookup_base_r): Adjust.
1168 (dynamic_cast_base_recurse): Adjust.
1169 (canonical_binfo): Remove.
1170 (dfs_canonical_queue): Remove.
1171 (dfs_assert_unmarked_p): Remove.
1172 (assert_canonical_unmarked): Remove.
1173 (shared_marked_p, shared_unmarked_p): Remove.
1174 (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
1175 (dfs_access_in_type): Adjust.
1176 (access_in_type): Adjust.
1177 (dfs_accessible_queue_p): Adjust.
1178 (dfs_accessible_p): Adjust.
1179 (is_subobject_of_p_1, is_subobject_of_p): Remove.
1180 (struct lookup_field_info): Remove from_dep_base_p field.
1181 (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
1182 (lookup_field_r): Remove dependent base code.
1183 (lookup_member): Likewise.
1184 (dfs_walk, dfs_walk_real): Add access arg to queue fn.
1185 (dfs_unmarked_real_bases_queue_p): Remove.
1186 (dfs_marked_real_bases_queue_p): Remove.
1187 (dfs_skip_vbases): Remove.
1188 (dfs_get_pure_virtuals): Adjust.
1189 (markedp, unmarkedp): Adjust.
1190 (marked_vtable_pathp, unmarked_vtable_pathp): Remove.
1191 (marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
1192 (dfs_unmark): Adjust.
1193 (dfs_get_vbase_types):Remove.
1194 (dfs_build_inheritance_graph_order): Remove.
1195 (get_vbase_types): Remove
1196 (dfs_find_vbase_instance): Remove.
1197 (find_vbase_instance): Remove.
1198 (dfs_debug_unmarkedp): Adjust.
1199 (dependent_base_p): Remove.
1200 (dfs_push_type_decls): Adjust.
1201 (dfs_push_decls): Adjust.
1202 (dfs_no_overlap_yet): Adjust.
1203 (copied_binfo): New function.
1204 (original_binfo): New function.
1205 (binfo_for_vbase): Remove.
1207 2003-02-18 Zack Weinberg <zack@codesourcery.com>
1209 * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk.
1210 (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES
1213 2003-02-18 Mark Mitchell <mark@codesourcery.com>
1216 * class.c (layout_class_type): In the 3.2 ABI, take into account
1217 trailing bit fields when computing CLASSTYPE_SIZE_UNIT.
1219 2003-02-18 Matt Austern <austern@apple.com>
1221 * cp/cp-lang.c: Change lang hooks so that final_write_globals does
1223 * cp/decl.c (wrapup_globals_for_namespace): Remove special
1224 handling of global namespace.
1226 2003-02-18 Geoffrey Keating <geoffk@apple.com>
1228 * cp-tree.h (rid_to_yy): Delete.
1229 (C_RID_YYCODE): Delete.
1230 (finish_file): Delete redundant declaration.
1232 2003-02-18 Jason Merrill <jason@redhat.com>
1235 * decl.c (reshape_init): Don't mess with initializer labels.
1238 * parser.c (cp_parser_postfix_expression): Set idk properly for
1239 object->scope::member.
1241 2003-02-18 Ben Elliston <bje@redhat.com>
1244 * decl.c (duplicate_decls): Fix typo in comment.
1246 2003-02-17 Michael Elizabeth Chastain <mec@shout.net>
1249 * class.c (build_base_field): Mark fields for base classes with
1252 2003-02-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1255 * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
1256 CONSTRUCTOR_ELTS only once.
1258 2003-02-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1261 * error.c (dump_type_prefix): Handle TYPEOF_TYPE.
1262 (dump_type_suffix): Likewise.
1264 2003-02-14 Nathan Sidwell <nathan@codesourcery.com>
1266 * search.c: ANSIfy function declarations and definitions.
1267 * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool.
1268 * call.c (build_method_call, resolve_scoped_fn_name,
1269 build_java_interface_fn_ref): Adjust lookup_field, lookup_member
1271 * class.c (handle_using_decl): Likewise.
1272 * decl.c (make_typename_type, make_unmound_class_template,
1273 start_decl, compute_array_index_type): Likewise.
1274 * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise.
1275 * init.c (expand_member_init, build_member_call): Likewise.
1276 * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation,
1277 resolve_typename_type): Likewise.
1278 * typeck.c (lookup_destructor, finish_class_member_access_exprm
1279 build_prememfunc_access_expr): Likewise.
1281 2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
1283 * decl2.c: Include "timevar.h".
1284 (namespace_ancestor): Time name lookup.
1285 (add_using_namespace): Likewise.
1286 (lookup_using_namespace): Likewise.
1287 (qualified_lookup_using_namespace): Likewise.
1288 (decl_namespace): Likewise.
1289 (lookup_arg_dependent): Likewise.
1290 * lex.c (do_identifier): Likewise.
1291 (do_scoped_id): Likewise.
1292 * pt.c (lookup_template_class): Likewise.
1294 2003-02-14 Andrew Pinski <pinskia@physics.uc.edu>
1296 * decl.c: (define_label): Fix warning for return 0 instead of NULL.
1298 2003-02-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
1300 * decl.c: Include "timevar.h".
1301 (poplevel): Time name lookup.
1302 (find_binding): Likewise.
1303 (push_namespace): Likewise.
1304 (pop_nested_namespace): Likewise.
1305 (store_bindings): Likewise.
1306 (maybe_push_to_top_level): Likewise.
1307 (pop_from_top_level): Likewise.
1308 (push_local_name): Likewise.
1309 (pushtag): Likewise.
1310 (pushdecl): Likewise.
1311 (pushdecl_with_scope): Likewise.
1312 (pushdecl_namespace_level): Likewise.
1313 (pushdecl_top_level): Likewise.
1314 (pushdecl_class_level): Likewise.
1315 (push_class_level_binding): Likewise.
1316 (push_using_decl): Likewise.
1317 (push_using_directive): Likewise.
1318 (push_overloaded_decl): Likewise.
1319 (lookup_label): Likewise.
1320 (define_label): Likewise.
1321 (lookup_tag): Likewise.
1322 (lookup_tag_reverse): Likewise.
1323 (lookup_namespace_name): Likewise.
1324 (select_decl): Likewise.
1325 (unqualified_namespace_lookup): Likewise.
1326 (lookup_name_real): Likewise.
1327 (lookup_name_current_level): Likewise.
1328 (lookup_type_current_level): Likewise.
1329 (maybe_inject_for_scope_var): Likewise.
1330 (xref_tag): Likewise.
1332 * Make-lang.in (cp/decl.o): Add dependency on timevar.h
1334 2003-02-12 Phil Edwards <pme@gcc.gnu.org>
1336 * decl.c (build_enumerator): Remove unneeded test.
1338 2003-02-09 Dan Nicolaescu <dann@ics.uci.edu>
1340 * cp-tree.h (struct lang_type_header): Make all fields unsigned
1343 2003-02-03 Mark Mitchell <mark@codesourcery.com>
1346 * call.c (z_candidate): Add args.
1347 (convert_class_to_reference): Set it.
1348 (implicit_conversion): Tidy.
1349 (add_candidate): Add args parameter.
1350 (add_function_candidate): Adjust call to add_candidate.
1351 (add_conv_candidate): Likewise.
1352 (build_builtin_candidate): Likewise.
1353 (build_user_type_conversion_1): Eliminate wasteful tree_cons
1355 (build_new_function_call): Likewise.
1356 (build_object_call): Likewise.
1357 (add_candidates): New function.
1358 (build_new_op): Use it.
1359 (covert_like_real): Adjust call to build_over_call.
1360 (build_over_call): Remove args parameter.
1361 * operators.def: Add <?= and >?=.
1363 2003-02-01 Richard Sandiford <rsandifo@redhat.com>
1365 * typeck.c (build_indirect_ref): Don't check flag_volatile.
1367 2003-01-31 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1370 * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL.
1372 2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
1374 * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
1375 BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
1376 (BINFO_LANG_ELTS): New #define.
1377 * tree.c (make_binfo): Use BINFO_LANG_ELTS.
1379 2003-01-30 Geoffrey Keating <geoffk@apple.com>
1381 * cp/Make-lang.in: Remove -Wno-error from cp/decl.o.
1383 2003-01-30 Mark Mitchell <mark@codesourcery.com>
1385 * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY
1387 * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit
1388 rather than TYPE_LANG_FLAG_0.
1389 (TYPE_BUILT_IN): Remove.
1390 (TYPE_DEPENDENT_P): New macro.
1391 (TYPE_DEPENDENT_P_VALID): Likewise.
1392 (lang_type_class): Add fields_readonly.
1393 * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN.
1394 * pt.c (dependent_type_p_r): New function, split out from ...
1395 (dependent_type_p): ... here. Memoize results.
1396 * search.c (dependent_base_p): Use dependent_type_p, not
1397 uses_template_parms.
1398 * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY
1401 2003-01-29 Mark Mitchell <mark@codesourcery.com>
1403 * call.c (build_field_call): Use build_new_op, not build_opfncall.
1404 (prep_operand): New function.
1405 (build_new_op): Use it. Remove dead code.
1406 * class.c (pushclass): Change "modify" parameter type from int to
1408 (currently_open_class): Use same_type_p, not pointer equality.
1409 (push_nested_class): Adjust calls to pushclass, remove modify
1411 * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
1412 (pushclass): Change prototype.
1413 (push_nested_class): Likewise.
1414 (grokoptypename): Remove.
1415 (build_opfncall): Remove.
1416 (value_dependent_expression_p): Declare.
1417 (resolve_typename_type): Likewise.
1418 (resolve_typename_type_in_current_instantiation): Likewise.
1419 (enter_scope_of): Remove.
1421 (tsubst_expr): Likewise.
1422 (tsubst_copy): Likewise.
1423 (tsubst_copy_and_build): Likewise.
1424 * decl.c (warn_about_implicit_typename_lookup): Remove.
1425 (finish_case_label): Return error_mark_node for erroneous labels.
1426 (start_decl): Adjust calls to push_nested_class.
1427 (grokfndecl): Call push_scope/pop_scope around call to
1429 (grokdeclarator): Do not call tsubst.
1430 (start_function): Adjust calls to push_nested_class.
1431 * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
1432 (check_classfn): Use push_scope/pop_scope around type comparisions.
1433 (grokoptypename): Remove.
1434 (push_sscope): Adjust call to push_nested_class.
1435 * error.c (dump_type): Show cv-qualification of typename types.
1436 * init.c (build_member_call): Use build_new_op, not
1438 * method.c (build_opfncall): Remove.
1439 * parser.c (cp_parser): Add allow_non_constant_expression_p and
1440 non_constant_expression_p.
1441 (cp_parser_constant_expression): Adjust prototype.
1442 (cp_parser_resolve_typename_type): Remove.
1443 (cp_parser_non_constant_expression): New function.
1444 (cp_parser_non_constant_id_expression): Likewise.
1445 (cp_parser_new): Set allow_non_constant_expression_p and
1446 non_constant_expression_p.
1447 (cp_parser_primary_expression): Reject `this' and `va_arg' in
1448 constant-expressions. Note that dependent names aren't really
1450 (cp_parser_postfix_expression): Reject conversions to non-integral
1451 types in constant-expressions. Neither are increments or
1453 (cp_parser_unary_expression): Reject increments and decrements in
1454 constant-expressions.
1455 (cp_parser_direct_new_declarator): Adjust call to
1456 cp_parser_constant_expression.
1457 (cp_parser_cast_expression): Reject conversions to non-integral
1458 types in constant-expressions.
1459 (cp_parser_assignment_expression): Rejects assignments in
1460 constant-expressions.
1461 (cp_parser_expression): Reject commas in constant-expressions.
1462 (cp_parser_labeled_statement): Adjust call to
1463 cp_parser_constant_expression.
1464 (cp_parser_direct_declarator): Simplify array bounds, even in
1465 templates, when they are non-dependent. Use
1466 resolve_typename_type, not cp_parser_resolve_typename_type.
1467 (cp_parser_class_head): Use resolve_typename_type, not
1468 cp_parser_resolve_typename_type.
1469 (cp_parser_member_declaration): Adjust call to
1470 cp_parser_constant_expression.
1471 (cp_parser_constant_initializer): Likewise.
1472 (cp_parser_constructor_declarator): Use resolve_typename_type, not
1473 cp_parser_resolve_typename_type.
1474 (cp_parser_late_parsing_default_args): Adjust call to
1476 * pt.c (tsubst): Give it internal linkage.
1477 (tsubst_expr): Likewise.
1478 (tsubst_copy): Likewise.
1479 (tsubst_copy_and_build): Likewise.
1480 (push_access_scope_real): Likewise.
1481 (tsubst_friend_class): Likewise.
1482 (instantiate_class_template): Adjust call to pushclass.
1483 (value_dependent_expression_p): Give it external linkage.
1485 (resolve_typename_type): New function.
1486 * semantics.c (finish_call_expr): Use build_new_op, not
1488 (begin_constructor_declarator): Remove.
1489 (begin_class_definition): Adjust call to pushclass.
1490 (enter_scope_of): Remove.
1491 * typeck.c (comptypes): Resolve typename types as appropriate.
1492 (build_x_indirect_ref): Use build_new_op, not build_opfncall.
1493 (build_x_compound_expr): Likewise.
1494 (build_modify_expr): Likewise.
1495 (build_x_modify_expr): Likewise.
1496 * typeck2.c (build_x_arrow): Likewise.
1498 2003-01-29 Fariborz Jahanian <fjahanian@apple.com>
1500 * pt.c (last_pending_template) Declare GTY().
1502 2003-01-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1505 * parser.c (cp_parser_elaborated_type_specifier): Convert
1506 TEMPLATE_DECL to TYPE_DECL only when processing template friends.
1507 (cp_parser_maybe_treat_template_as_class): Remove redundant tests.
1509 2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
1512 * pt.c (unify): Don't unify '*T' with 'U C::*'.
1515 * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
1516 inside a declarator.
1518 2003-01-27 Nathan Sidwell <nathan@codesourcery.com>
1520 * class.c (update_vtable_entry_for_fn): Add index parameter.
1521 Generate vcall thunk for covariant overriding from a virtual
1523 (dfs_modify_vtables): Adjust.
1525 2003-01-25 Nathan Sidwell <nathan@codesourcery.com>
1528 * parser.c (cp_parser_class_or_namespace_name): Reject duplicate
1530 (cp_parser_base_specifier): Look for and consume a
1531 TEMPLATE keyword. Replace switch with array index.
1534 * semantics.c (finish_non_static_data_member): Remember the
1535 field's type even in a template.
1538 * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are
1542 * parser.c (cp_parser_cast_expression): Be more tentative.
1544 2003-01-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1546 * cp-tree.h (flagged_type_tree_s): Remove.
1547 (check_for_new_type): Likewise.
1548 * typeck2.c (check_for_new_type): Likewise.
1550 2003-01-23 Nathanael Nerode <neroden@gcc.gnu.org>
1552 * dump.c: ANSIfy function declarations and definitions.
1554 * cp-tree.h, decl.h: Get rid of PARAMS. Again.
1556 2003-01-22 Mark Mitchell <mark@codesourcery.com>
1559 * init.c (build_new): Set the type of the new-expression, even
1560 when processing_templte_decl.
1563 * parser.c (cp_parser_primary_expression): Improve error message
1564 for templates used in an expression context.
1567 * parser.c (cp_parser_decl_specifier_seq): Commit to tentative
1568 parse when encountering "typedef".
1570 2003-01-22 Nathanael Nerode <neroden@gcc.gnu.org>
1572 * class.c, parser.c: ANSIfy function definitions and declarations.
1574 2003-01-22 Mark Mitchell <mark@codesourcery.com>
1577 * error.c (dump_decl): For an OVERLOAD, just print the name of the
1578 function; it doesn't make sense to try to print its type.
1579 * semantics.c (finish_typeof): Issue errors about invalid uses.
1582 * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New
1584 (cp_parser_expression_statement): Use it.
1585 (cp_parser_explicit_instantiation): Likewise.
1586 * pt.c (do_decl_instantiation): Improve error handling logic.
1588 2003-01-22 Mark Mitchell <mark@codesourcery.com>
1591 * parser.c (cp_parser_using_declaration): Issue error messages
1592 about name resolution failures here.
1595 * class.c (currently_open_derived_class): Use dependent_type_p.
1596 * cp-tree.h (dependent_type_p): New function.
1597 (dependent_template_arg_p): Likewise.
1598 (dependent_template_p): Likewise.
1599 (type_dependent_expression_p): Likewise.
1600 * parser.c (cp_parser_dependent_type_p): Remove.
1601 (cp_parser_value_dependent_type_p): Likewise.
1602 (cp_parser_type_dependent_expression_p): Likewise.
1603 (cp_parser_dependent_template_arg_p): Likewise.
1604 (cp_parser_dependent_template_id_p): Likewise.
1605 (cp_parser_dependent_template_p): Likewise.
1606 (cp_parser_diagnose_invalid_type_name): Replace
1607 cp_parser_dependent_type_p with dependent_type_p, etc.
1608 (cp_parser_primary_expresion): Likewise.
1609 (cp_parser_nested_name_specifier_opt): Likewise.
1610 (cp_parser_postfix_expression): Likewise.
1611 (cp_parser_unary_expression): Likewise.
1612 (cp_parser_template_name): Likewise.
1613 (cp_parser_class_name): Likewise.
1614 (cp_parser_lookup_name): Likewise.
1615 * pt.c (dependent_type_p): New function.
1616 (value_dependent_expression_p): Likewise.
1617 (type_dependent_expression_p): Likewise.
1618 (dependent_template_arg_p): Likewise.
1619 (dependent_template_id_p): Likewise.
1620 (dependent_template_p): Likewise.
1624 * parser.c (cp_parser_simple_declaration): Return quickly when
1625 encountering errors.
1627 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1629 Make-lang.in (cp/decl.o-warn): Add -Wno-error.
1631 2003-01-17 Jason Merrill <jason@redhat.com>
1633 PR c++/9167, c++/9358
1634 * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
1636 2003-01-17 Jason Merrill <jason@redhat.com>
1639 * call.c (build_conditional_expr): Always do lvalue-rvalue
1642 2003-01-17 Mark Mitchell <mark@codesourcery.com>
1645 * cp-tree.def (BASELINK): Make it class 'x', not class 'e'.
1646 * cp-tree.h (BASELINK_BINFO): Adjust.
1647 (BASELINK_FUNCTIONS): Likewise.
1648 (BASELINK_ACCESS_BINFO): Likewise.
1649 (tree_baselink): New structure.
1650 (cp_tree_node_structure_enum): Add TS_CP_BASELINK.
1651 (lang_tree_node): Add baselink.
1652 * decl.c (cp_tree_node_structure): Add BASELINK case.
1653 * search.c (build_baselink): Adjust.
1654 * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P
1655 test from TREE_LIST case.
1658 * parser.c (cp_parser_constructor_declarator_p): Do not assume
1659 that a constructor cannot be declared outside of its own class.
1661 * parser.c (cp_parser_resolve_typename_type): If the scope cannot
1662 be resolved, neither can the qualified name.
1664 * rtti.c (get_pseudo_ti_desc): Fix thinko.
1666 2003-01-16 Jason Merrill <jason@redhat.com>
1669 * init.c (build_vec_init): Re-add maxindex parm.
1670 (perform_member_init, build_aggr_init): Pass it.
1671 (build_new_1): Pass it. Use an incomplete array type for full_type.
1672 * typeck.c (build_modify_expr): Pass it.
1673 * cp-tree.h: Adjust.
1675 2003-01-16 Jeffrey D. Oldham <oldham@codesourcery.com>
1677 * cp-tree.h (tsubst_copy_and_build): New declaration.
1678 * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment.
1679 (tsubst_expr): Use 'tsubst_copy_and_build'. Update initial comment.
1680 (tsubst_copy_and_build): New function.
1682 2003-01-16 Mark Mitchell <mark@codesourcery.com>
1684 * cp-tree.h (lang_type_class): Remove is_partial_instantiation.
1685 (PARTIAL_INSTANTIATION_P): Remove.
1686 (IMPLICIT_TYPENAME_P): Likewise.
1687 (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise.
1688 (build_typename_type): Remove declaration.
1689 (parmlist_is_exprlist): Likewise.
1690 * decl.c (build_typename_type): Make it static, remove third
1692 (push_class_binding): Don't do implicit typename stuff.
1693 (make_typename_type): Likewise.
1694 (lookup_name_real): Likewise.
1695 (grokdeclarator): Don't try to convert declarations into
1696 initializations. Don't do implicit typename stuff.
1697 (parmlist_is_exprlist): Remove.
1698 (xref_basetypes): Simplify.
1699 * decl2.c (grokfield): Don't try to convert declarations into
1701 (build_anon_union_vars): Do this while processing templates, too.
1702 (finish_anon_union): Likewise.
1703 * error.c (dump_type): Remove implicit typename handling.
1704 * parser.c (cp_parser_diagnose_invalid_type_name): New method.
1705 (cp_parser_primary_expression): Correct handling of names not
1706 found by unqualified name lookup in templates.
1707 (cp_parser_nested_name_specifier_opt): Avoid checking dependency
1708 of types when possible.
1709 (cp_parser_simple_declaration): Complain intelligently about some
1710 invalid declarations.
1711 (cp_parser_member_declaration): Likewise.
1712 (cp_parser_constructor_declarator_p): Don't check when we're in a
1714 * pt.c (instantiate_class_template): Remove
1715 PARTIAL_INSTANTIATION_P gunk.
1716 * search.c (lookup_field_r): Don't build implicit typenames.
1717 (marked_pushdecls_p): Don't enter dependent base types.
1718 (unmarked_pushdecls_p): Likewise.
1719 * semantics.c (begin_class_definition): Remove implicit typename
1722 2003-01-16 Nathan Sidwell <nathan@codesourcery.com>
1725 * parser.c (cp_parser_direct_declarator): If accepting either
1726 abstract or named, the name must be an unqualified-id.
1728 2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1730 * class.c (layout_virtual_bases): Avoid signed/unsigned warning.
1732 2003-01-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1734 * decl2.c (check_classfn): Fix uninitialized warning.
1735 (build_anon_union_vars): Likewise.
1736 * pt.c (tsubst_copy): Likewise.
1738 2003-01-14 Jeffrey D. Oldham <oldham@codesourcery.com>
1740 Further conform g++'s __vmi_class_type_info to the C++ ABI
1742 * rtti.c (dfs_class_hint_mark): Do not set hints not specified by
1744 (class_hint_flags): Likewise.
1746 2003-01-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
1748 * config-lang.in: Add semantics.c to gtfiles.
1749 * cp-tree.h (flagged_type_tree_s): Remove lookups field.
1750 (saved_scope): Likewise.
1751 (type_lookups): Remove.
1752 (deferred_access): New structure.
1753 (type_access_control): Remove.
1754 (save_type_access_control): Likewise.
1755 (reset_type_access_control): Likewise.
1756 (decl_type_access_control): Likewise.
1757 (push_deferring_access_checks): Declare.
1758 (resume_deferring_access_checks): Likewise.
1759 (stop_deferring_access_checks): Likewise.
1760 (pop_deferring_access_checks): Likewise.
1761 (get_deferred_access_checks): Likewise.
1762 (pop_to_parent_deferring_access_checks): Likewise.
1763 (perform_deferred_access_checks): Likewise.
1764 (perform_or_defer_access_check): Likewise.
1765 * decl.c (make_typename_type): Use perform_or_defer_access_check.
1766 (make_unbound_class_template): Likewise.
1767 (grokdeclarator): Don't call decl_type_access_control.
1768 * parser.c (cp_parser_context): Remove deferred_access_checks
1769 and deferring_access_checks_p fields.
1770 (cp_parser_context_new): Adjust.
1771 (cp_parser): Remove access_checks_lists.
1772 (cp_parser_defer_access_check): Remove.
1773 (cp_parser_start_deferring_access_checks): Remove.
1774 (cp_parser_stop_deferring_access_checks): Remove.
1775 (cp_parser_perform_deferred_access_checks): Remove.
1776 (cp_parser_nested_name_specifier_opt): Use new deferred access
1778 (cp_parser_simple_declaration): Likewise.
1779 (cp_parser_template_id): Likewise.
1780 (cp_parser_function_definition): Likewise.
1781 (cp_parser_class_specifier): Likewise.
1782 (cp_parser_lookup_name): Likewise.
1783 (cp_parser_single_declaration): Likewise.
1784 (cp_parser_pre_parsed_nested_name_specifier): Likewise.
1785 (cp_parser_parse_tentatively): Likewise.
1786 (cp_parser_parse_definitely): Likewise.
1787 (yyparse): Likewise.
1788 (cp_parser_init_declarator): Remove access_checks parameter.
1789 Use new deferred access functions.
1790 (cp_parser_function_definition_from_specifiers_and_declarator):
1792 (cp_parser_class_head): Remove deferring_access_checks_p and
1793 saved_access_checks parameters. Use new deferred access functions.
1794 (cp_parser_member_specification_opt): Don't call
1795 reset_type_access_control.
1796 * search.c (type_access_control): Remove.
1797 * semantics.c: Include "gt-cp-semantics.h".
1798 (deferred_type_access_control): Remove.
1799 (deferred_access_stack): New variable.
1800 (deferred_access_free_list): Likewise.
1801 (push_deferring_access_checks): New function.
1802 (resume_deferring_access_checks): Likewise.
1803 (stop_deferring_access_checks): Likewise.
1804 (pop_deferring_access_checks): Likewise.
1805 (get_deferred_access_checks): Likewise.
1806 (pop_to_parent_deferring_access_checks): Likewise.
1807 (perform_deferred_access_checks): New function, adapted from
1808 cp_parser_perform_deferred_access_checks.
1809 (perform_or_defer_access_check): New function, adapted from
1810 cp_parser_defer_access_check.
1811 (current_type_lookups): Remove.
1812 (deferred_type_access_control): Likewise.
1813 (decl_type_access_control): Likewise.
1814 (save_type_access_control): Likewise.
1815 (reset_type_access_control): Likewise.
1816 (begin_function_definition): Adjust.
1817 (begin_class_definiton): Likewise.
1819 2003-01-13 Jason Merrill <jason@redhat.com>
1822 * class.c (build_base_path): Take the address before calling save_expr.
1824 * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
1825 all the ambiguous conversions are bad.
1827 * class.c (maybe_warn_about_overly_private_class): Don't stop
1828 searching when we find a nonprivate method.
1830 * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue.
1832 2003-01-12 Mark Mitchell <mark@codesourcery.com>
1834 * cp-tree.h (get_arglist_len_in_bytes): Remove.
1837 * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
1838 typeame types more robustly.
1840 2003-01-11 Phil Edwards <pme@gcc.gnu.org>
1842 * parser.c: Fix comment typos.
1844 2003-01-10 Mark Mitchell <mark@codesourcery.com>
1847 * parser.c (cp_parser_scope_through_which_access_occurs): Handle
1848 an object_type which is not a class type.
1850 2003-01-10 Geoffrey Keating <geoffk@apple.com>
1852 * parser.c (cp_parser_late_parsing_for_member): Don't cast to void.
1853 (cp_parser_late_parsing_default_args): Likewise.
1855 2003-01-10 Nathanael Nerode <neroden@gcc.gnu.org>
1857 * cfns.gperf: ANSIfy function declarations.
1858 * cfns.h: Regenerate.
1859 * cp-tree.h: ANSIfy function declarations.
1861 2003-01-10 Mark Mitchell <mark@codesourcery.com>
1863 * cp-tree.h (reparse_absdcl_as_expr): Remove.
1864 (reparse_absdcl_as_casts): Likewise.
1865 (reparse_decl_as_expr): Likewise.
1866 (finish_decl_parsing): Likewise.
1867 * decl2.c (reparse_absdcl_as_expr): Remove.
1868 (reparse_absdcl_as_casts): Likewise.
1869 (repase_decl_as_expr): Likewise.
1870 (finish_decl_parsing): Likewise.
1875 * parser.c (cp_parser_pre_parsed_nested_name_specifier): New
1877 (cp_parser_nested_name_specifier_opt): Correct the
1878 check_dependency_p false.
1879 (cp_parser_postfix_expression): Fix formatting.
1880 (cp_parser_decl_specifier_seq): Avoid looking for constructor
1881 declarators when possible.
1882 (cp_parser_template_id): Avoid performing name-lookup when
1884 (cp_parser_class_head): Do not count specializations when counting
1885 levels of templates.
1886 (cp_parser_constructor_declarator_p): Return immediately if
1887 there's no chance that the tokens form a constructor declarator.
1888 * rtti.c (throw_bad_typeid): Add comment. Do not return an
1889 expression with reference type.
1890 (get_tinfo_decl_dynamic): Do not return an expression with
1892 (build_typeid): Add comment. Do not return an expression with
1894 * typeck.c (build_class_member_access_expr): Improve handling of
1895 conditionals and comma-expressions as objects.
1897 2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
1899 * cfns.gperf: ANSIfy function declarations.
1900 * cfns.h: Regenerate.
1901 * cp-tree.h: ANSIfy function declarations.
1902 * parser.c: ANSIfy function declarations & definitions.
1904 * decl.c (bad_specifiers): Fix parameter order error I introduced.
1906 2003-01-09 Geoffrey Keating <geoffk@apple.com>
1908 Merge from pch-branch:
1910 2003-01-09 Geoffrey Keating <geoffk@apple.com>
1912 Merge to tag pch-merge-20030102:
1914 * semantics.c (finish_translation_unit): Don't call finish_file.
1915 * parser.c: Don't include ggc.h.
1916 (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer,
1917 read first token here. Don't allow PCH files after the first
1919 (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new.
1920 (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL.
1921 (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory.
1922 (cp_parser_late_parsing_for_member): Don't duplicate call to
1923 cp_lexer_set_source_position_from_token.
1924 (cp_parser_late_parsing_default_args): Likewise.
1925 (yyparse): Call finish_file after clearing the_parser.
1927 2002-12-11 Geoffrey Keating <geoffk@apple.com>
1929 * Make-lang.in: Remove $(GGC_H) from all dependencies.
1930 (CXX_TREE_H): Add $(GGC_H).
1931 * class.c: Don't include ggc.h.
1932 (field_decl_cmp): Make parameters be 'const void *' to match qsort.
1933 (method_name_cmp): Likewise.
1934 (resort_data): New variable.
1935 (resort_field_decl_cmp): New.
1936 (resort_method_name_cmp): New.
1937 (resort_sorted_fields): New.
1938 (resort_type_method_vec): New.
1939 (finish_struct_methods): Delete cast.
1940 (finish_struct_1): Delete cast.
1941 * cp-tree.h: Include ggc.h.
1942 (struct lang_type_class): Add reorder attribute to field `methods'.
1943 (union lang_decl_u3): Add reorder attribute to field `sorted_fields'.
1944 (resort_sorted_fields): New prototype.
1945 (resort_type_method_vec): New prototype.
1946 * call.c: Don't include ggc.h.
1948 * decl2.c: Likewise.
1951 * method.c: Likewise.
1952 * optimize.c: Likewise.
1953 * parse.y: Likewise.
1956 * search.c: Likewise.
1957 * semantics.c: Likewise.
1961 * lang-specs.h: Remove comment.
1963 2002-12-03 Geoffrey Keating <geoffk@apple.com>
1965 * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery.
1966 (operator_name_info): Mark to be saved for PCH, specify size.
1967 (assignment_operator_name_info): Likewise.
1969 2002-11-19 Geoffrey Keating <geoffk@apple.com>
1971 * decl.c (anon_cnt): Mark to be saved for PCH.
1973 2002-10-25 Geoffrey Keating <geoffk@apple.com>
1975 * lex.c (init_reswords): Delete now-untrue comment.
1976 Allocate ridpointers using GGC.
1978 2002-10-04 Geoffrey Keating <geoffk@apple.com>
1980 * cp-tree.h (union lang_decl_u2): Add tags to all fields.
1982 * g++spec.c (lang_specific_driver): Don't include standard
1983 libraries in `added'.
1985 2002-08-27 Geoffrey Keating <geoffk@redhat.com>
1987 * decl2.c (finish_file): Call c_common_write_pch.
1988 * Make-lang.in (CXX_C_OBJS): Add c-pch.o.
1990 2002-08-17 Geoffrey Keating <geoffk@redhat.com>
1992 * g++spec.c (lang_specific_driver): Treat .h files as C++ header
1993 files when using g++.
1994 * lang-specs.h: Handle compiling C++ header files.
1996 2003-01-09 Jakub Jelinek <jakub@redhat.com>
1998 * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs.
2000 2003-01-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2002 * pt.c (push_access_scope_real): Call push_to_top_level for
2003 function in namespace scope.
2004 (pop_access_scope): Call pop_from_top_level for function in
2007 2003-01-09 Jakub Jelinek <jakub@redhat.com>
2009 * decl.c (start_decl): Don't set DECL_COMMON for __thread variables.
2011 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
2013 * Make-lang.in (c++.install-common, c++.install-man,
2014 c++.uninstall): Prepend $(DESTDIR) to destination paths in
2015 all (un)installation commands.
2016 (c++.install-common): Rewrite $(LN) commands to support
2017 DESTDIR with "ln" as well as with "ln -s".
2019 2003-01-08 Jason Merrill <jason@redhat.com>
2021 * parser.c (cp_parser_primary_expression): See through explicitly
2022 scoped ALIAS_DECLs, too.
2024 2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
2026 * decl.c: Remove some #if 0 code.
2028 * decl.c: ANSIfy function declarations.
2030 2003-01-07 Mark Mitchell <mark@codesourcery.com>
2032 * parser.c (cp_parser_asm_definition): Correct handling of omitted
2035 2003-01-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2038 * decl.c (make_typename_type): Check access only when tf_error.
2039 (make_unbound_class_template): Likewise.
2040 * pt.c (saved_access_scope): New variable.
2041 (push_access_scope_real): New function.
2042 (push_access_scope): Likewise.
2043 (pop_access_scope): Likewise.
2044 (tsubst_default_argument): Use them.
2045 (instantiate_template): Likewise.
2046 (regenerate_decl_from_template): Likewise.
2047 (instantiate_decl): Likewise.
2048 (get_mostly_instantiated_function_type): Likewise.
2050 2003-01-07 Nathanael Nerode <neroden@gcc.gnu.org>
2052 * tree.c: Delete bogus #if 0 code.
2054 2003-01-07 Andreas Schwab <schwab@suse.de>
2056 * class.c (layout_class_type): Don't use
2057 PCC_BITFIELD_TYPE_MATTERS if not defined.
2059 2003-01-06 Mark Mitchell <mark@codesourcery.com>
2062 * decl2.c (build_cleanup): Mark the object as used.
2064 * pt.c (retrieve_local_specialization): Revert 2003-01-05 change.
2065 (hash_local_specialization): New function.
2066 (register_local_specialization): Revert 2003-01-05 change.
2067 (instantiate_decl): Use hash_local_specialization when creating
2068 the local_specializations table.
2070 * decl2.c (mark_used): Do not synthesize thunks.
2072 * class.c (layout_class_type): Correct handling of unnamed
2073 bitfields wider than their types.
2076 * parser.c (cp_parser): Remove default_arg_types. Update
2077 documentation for unparsed_functions_queues.
2078 (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the
2080 (cp_parser_new): Don't set parser->default_arg_types.
2081 (cp_parser_function_definition): Adjust usage of
2082 unparsed_funtions_queues.
2083 (cp_parser_class_specifier): Don't mess with
2084 parser->default_arg_types. Handle default argument processing in
2085 a separate phase from function body processing.
2086 (cp_parser_template_declaration_after_export): Adjust usage of
2087 unparsed_functions_queues.
2088 (cp_parser_late_parsing_for_member): Do not handle default
2091 2003-01-06 Nathan Sidwell <nathan@codesourcery.com>
2094 * parser.c (cp_parser_declarator_kind): New enum.
2095 (cp_parser_declarator): Adjust.
2096 (cp_parser_direct_declarator): Adjust. Allow for either named or
2097 abstract declarator. Prefer abstract, if possible. Allow
2098 parenthesized function name.
2099 (cp_parser_condition): Adjust cp_parser_declarator call.
2100 (cp_parser_explicit_instantiation): Likewise.
2101 (cp_parser_init_declarator): Likewise.
2102 (cp_parser_type_id): Likewise.
2103 (cp_parser_function_definition): Likewise.
2104 (cp_parser_member_declaration): Likewise.
2105 (cp_parser_parameter_declaration): Use cp_parser_declarator to do
2106 the tentative parsing.
2107 (cp_parser_exception_declaration): Likewise.
2109 2003-01-05 Mark Mitchell <mark@codesourcery.com>
2111 * parser.c (cp_parser_template_parameter): Adjust call to
2112 cp_parser_parameter_declaration.
2113 (cp_parser_parameter_declaration_list): Likewise.
2114 (cp_parser_parameter_declaration): Replace
2115 greater_than_is_operator_p with template_parm_p parameter. Do not
2116 cache tokens for template default arguments.
2118 * pt.c (retrieve_local_specialization): Use htab_find, not
2119 htab_find_with_hash.
2120 (register_local_specialization): Use htab_find_slot, not
2121 htab_find_slot_with_hash.
2122 (instantiate_decl): Pass a hash function to htab_create.
2124 2003-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2126 * parser.c (cp_parser_binary_expression,
2127 cp_parser_multiplicative_expression,
2128 cp_parser_additive_expression, cp_parser_shift_expression,
2129 cp_parser_relational_expression, cp_parser_equality_expression,
2130 cp_parser_and_expression, cp_parser_exclusive_or_expression,
2131 cp_parser_inclusive_or_expression,
2132 cp_parser_logical_and_expression, cp_parser_logical_or_expression,
2133 cp_parser_binary_expression): Const-ify.
2135 2003-01-04 Mark Mitchell <mark@codesourcery.com>
2137 * method.c (use_thunk): Disable access control while building the
2140 2003-01-03 Nathanael Nerode <neroden@gcc.gnu.org>
2142 * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C
2145 2003-01-03 Matt Austern <austern@apple.com>
2147 * cp-tree.h (struct lang_type_class): add field for key method
2148 (cp_global_trees): rename dynamic_classes to keyed_classes
2149 (key_method): add definition
2150 * class.c (finish_struct_1): compute class's key method, and add
2151 the class to keyed_classes list if there is no key method.
2152 * decl.c (finish_function): add class to keyed_classes list if we
2153 see a definition of the class's key method.
2154 * pt.c (instantiate_class_template): add template specialization
2155 of a dynamic class to keyed_classes list.
2156 * decl2.c (key_method): remove
2157 (finish_file): iterate only through keyed_classes list when
2158 deciding whether to emit vtables, remove class from its list after
2161 2003-01-02 Jason Merrill <jason@redhat.com>
2163 * call.c (build_conditional_expr): Stabilize lvalues properly.
2164 * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type.
2165 * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues.
2166 Don't allow CALL_EXPR or VA_ARG_EXPR, either.
2168 * call.c (convert_like_real): Call decl_constant_value for an
2169 IDENTITY_CONV even if there are no more conversions.
2171 * cvt.c (build_up_reference): Don't push unnamed temps.
2173 * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL.
2175 * dump.c (cp_dump_tree): Don't try to dump class-specific fields
2176 for a backend struct.
2178 * except.c (wrap_cleanups_r, build_throw): Make
2179 MUST_NOT_THROW_EXPRs void.
2180 * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR.
2182 * init.c (build_vec_delete_1): Pre-evaluate the base address.
2184 * init.c (get_temp_regvar): Simplify logic.
2186 * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if
2187 our replacement is a decl.
2189 * decl.c (cp_make_fname_decl): Push the decls inside the
2192 2003-01-03 Nathan Sidwell <nathan@codesourcery.com>
2195 * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be
2198 2003-01-03 Graham Stott <graham.stott@btinternet.com>
2200 * parser.c (struct cp_parser): Add access_checks_lists field
2201 (cp_parser_simple_declaration): Use.
2202 (cp_parser_init_declarator): Likewise.
2204 2003-01-02 Mark Mitchell <mark@codesourcery.com>
2206 * parser.c (cp_parser_declaration): Accept the __extension__
2207 keyword before the declaration.
2210 * parser.c (cp_parser_parameter_declaration): Allow attributes to
2211 appear after the declarator.
2213 * call.c (build_new_method_call): Fix typo in message format
2216 2003-01-02 Mark Mitchell <mark@codesourcery.com>
2218 * parser.c (cp_lexer_next_token_is): Declare it inline.
2219 (cp_lexer_set_source_position_from_token): Likewise.
2220 (cp_lexer_debugging_p): Likewise.
2221 (cp_parser_parsing_tentatively): Likewise.
2222 (cp_parser_nested_name_specifier_opt): Reduce the number of calls
2223 to the cp_lexer_peek_token.
2225 * parser.c (cp_parser_sizeof_operand): Do not evaluate the
2228 2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
2230 * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c,
2231 cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c,
2232 cp/repo.c: Fix copyright years.
2234 2003-01-01 Neil Booth <neil@daikokuya.co.uk>
2236 * lex.c: Remove superfluous include of cpplib.h.
2237 (CONSTRAINT): Define without conditions.
2238 (init_cp_pragma): Use c_register_pragma.
2240 2002-12-31 Neil Booth <neil@daikokuya.co.uk>
2242 * .cvsignore: Remove.
2244 2002-12-31 Steven Bosscher <s.bosscher@student.tudelft.nl>
2246 * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
2247 except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
2248 lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
2249 pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
2250 typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
2252 * lex.h: parse.y is dead, so don't mention it. Also replace the
2253 copyright header with the default GNU copyright header.
2255 2002-12-31 Mark Mitchell <mark@codesourcery.com>
2257 * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove.
2258 (lookup_name_namespace_only): Likewise.
2259 (begin_only_namespace_names): Likewise.
2260 (end_only_namespace_names): Likewise.
2261 * decl.c (only_namespace_names): Remove.
2262 (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED.
2263 (lookup_name_real): Do not check only_namespace_names.
2264 (lookup_name_namespace_only): Remove.
2265 (begin_only_namespace_names): Likewise.
2266 (end_only_namespace_names): Likewise.
2267 * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous
2268 nested-name-specifiers more gracefully.
2269 (cp_parser_class_or_namespace_name): Avoid looking up namespace
2270 names when they cannot possibly appear.
2271 (cp_parser_template_name): Adjust call to cp_parser_lookup_name.
2272 (cp_parser_elaborated_type_specifier): Likewise.
2273 (cp_parser_namespace_name): Only look for namespace names.
2274 (cp_parser_lookup_name): Add is_namespace parameter.
2275 (cp_parser_lookup_name_simple): Adjust call to
2276 cp_parser_lookup_name.
2278 * parser.c (cp_parser_dependent_type_p): Fix thinko.
2280 2002-12-31 Neil Booth <neil@daikokuya.co.uk>
2282 * .cvsignore: Update.
2284 2002-12-31 Nathan Sidwell <nathan@codesourcery.com>
2286 * class.c (modify_vtable_entry): Remove unused variable.
2287 (get_vcall_index): Always expect a non-thunk.
2288 (update_vtable_entry_for_fn): Combine covariant adjustments, when
2289 overriding a thunk. Pass get_vcall_index a non-thunk.
2291 * decl2.c (finish_file): Mark undefined inlines as extern.
2293 2002-12-31 Mark Mitchell <mark@codesourcery.com>
2295 * cp-tree.def (RETURN_INIT): Remove.
2296 * cp-tree.h (DECL_IN_MEMORY_P): Remove.
2297 (scope_kind): Add sk_block, sk_try, sk_catch, sk_for.
2298 (note_level_for_for): Remove.
2299 (note_level_for_try): Likewise.
2300 (note_level_for_catch): Likewise.
2301 (finish_named_return_value): Likewise.
2302 (do_pushlevel): Change prototype.
2303 (pending_lang_change): Remove.
2304 * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch,
2306 (note_level_for_for): Remove.
2307 (note_level_for_try): Likewise.
2308 (note_level_for_catch): Likewise.
2309 (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P.
2310 * parser.c (cp_parser_context_free_list): Make it "deletable".
2311 (cp_parser_template_argument): Remove misleading comment.
2312 * pt.c (tsubst_expr): Remove RETURN_INIT code.
2313 * semantics.c (genrtl_named_return_value): Remove.
2314 (do_pushlevel): Take a scope kind as an argument.
2315 (begin_if_stmt): Adjust.
2316 (begin_while_stmt): Likewise.
2317 (begin_for_stmt): Likewise.
2318 (finish_for_init_stmt): Likewise.
2319 (begin_switch_stmt): Likewise.
2320 (begin_handler): Likewise.
2321 (begin_compound_stmt): Likewise.
2322 (finish_named_return_value): Remove.
2323 (cp_expand_stmt): Remove RETURN_INIT case.
2324 * tree.c (cp_statement_code_p): Remove RETURN_INIT case.
2326 2002-12-31 Mark Mitchell <mark@codesourcery.com>
2329 * parser.c (cp_parser_direct_declarator): Handle erroneous
2330 parenthesized declarators correctly.
2332 2002-12-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
2334 * cp-tree.h (pending_lang_change): Declare.
2336 2002-12-30 Mark Mitchell <mark@codesourcery.com>
2338 * parser.c (cp_parser_context_free_list): New variable.
2339 (cp_parser_context_new): Use it.
2340 (cp_parser_error): Check return code from
2341 cp_parser_simulate_error.
2342 (cp_parser_simulate_error): Return a value.
2343 (cp_parser_id_expression): Optimize common case.
2344 (cp_parser_class_name): Likewise.
2345 (cp_parser_class_specifier): Adjust call to
2346 cp_parser_late_parsing_default_args.
2347 (cp_parser_lookup_name): Optimize common case.
2348 (cp_parser_late_parsing_for_member): Adjust call to
2349 cp_parser_late_parsing_default_args.
2350 (cp_parser_late_parsing_default_args): Add scope parameter.
2351 (cp_parser_require): Avoid creating the error message unless it's
2353 (cp_parser_parse_definitely): Place free'd contexts on the free
2356 * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change.
2358 2002-12-30 David Edelsohn <edelsohn@gnu.org>
2360 * parser.c (cp_parser_parameter_declaration_clause): Treat system
2361 header as extern "C" if NO_IMPLICIT_EXTERN_C undefined.
2363 2002-12-30 Nathanael Nerode <neroden@gcc.gnu.org>
2365 * config-lang.in, Make-lang.in, operators.def, cp-tree.def:
2368 2002-12-30 Mark Mitchell <mark@codesourcery.com>
2372 * Make-lang.in (gt-cp-spew.h): Remove.
2373 * cp-tree.h (do_pending_lang_change): Remove.
2374 (do_identifier): Change prototype.
2375 (finish_id_expr): Remove.
2376 * decl.c (lookup_name_real): Remove yylex variable.
2377 * decl2.c (build_expr_from_tree): Adjust call to do_identifier.
2378 * lex.c (init_cpp_parse): Remove.
2379 (reduce_cmp): Likewise.
2380 (token_cmp): Likewise.
2382 (lastiddecl): Likewise.
2383 (token_count): Likewise.
2384 (reduce_count): Likewise.
2386 (print_parse_statistics): Likewise.
2387 (do_pending_lang_change): Likewise.
2388 (do_identifier): Remove parsing parameter.
2389 * lex.h (lastiddecl): Remove.
2390 (looking_for_typename): Remove.
2391 (looking_for_template): Likewise.
2392 (pending_lang_change): Likewise.
2394 * semantics.c (finish_id_expr): Remove.
2396 * decl.c (grokdeclarator): Diagnost "extern thread" and "static
2399 2002-12-30 Nathanael Nerode <neroden@gcc.gnu.org>
2401 * decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front
2402 end, not the C front end.
2404 2002-12-30 Nathan Sidwell <nathan@codesourcery.com>
2406 * cp-tree.h (THUNK_TARGET): New macro.
2407 (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo.
2408 (finish_thunk): Remove offset parms.
2409 * class.c (find_final_overrider): Look through thunks.
2410 (get_vcall_index): Use THUNK_TARGET.
2411 (update_vtable_entry_for_fn): Look through thunks. Set covariant
2412 fixed offset here. Adjust finish_thunk call.
2413 (build_vtbl_initializer): Adjust finish_thunk calls.
2414 * mangle.c (mangle_call_offset): Remove superfluous if.
2415 (mangle_thunk): Adjust.
2416 * method.c (make_thunk): Adjust.
2417 (finish_thunk): Adjust.
2418 (thunk_adjust): Remove assert.
2419 (use_thunk): Use THUNK_TARGET
2420 * dump1.c (cp_dump_tree): Adjust thunk dumping.
2423 * class.c (layout_class_type): Set TYPE_CONTEXT of type for base.
2424 * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types.
2426 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2428 Remove traditional C constructs 4/n.
2429 * decl2.c (grok_method_quals, warn_if_unknown_interface,
2430 grok_x_components, cp_build_parm_decl, build_artificial_parm,
2431 maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
2432 delete_sanity, check_member_template, check_java_method,
2433 check_classfn, finish_static_data_member_decl, grokfield,
2434 grokbitfield, grokoptypename, grok_function_init,
2435 cplus_decl_attributes, constructor_name, defer_fn,
2436 build_anon_union_vars, finish_anon_union, coerce_new_type,
2437 coerce_delete_type, comdat_linkage, maybe_make_one_only,
2438 key_method, import_export_vtable, import_export_class,
2439 output_vtable_inherit, import_export_decl, import_export_tinfo,
2440 build_cleanup, get_guard, get_guard_bits, get_guard_cond,
2441 set_guard, start_objects, finish_objects,
2442 start_static_storage_duration_function,
2443 finish_static_storage_duration_function, get_priority_info,
2444 start_static_initialization_or_destruction,
2445 finish_static_initialization_or_destruction,
2446 do_static_initialization, do_static_destruction,
2447 prune_vars_needing_no_initialization, write_out_vars,
2448 reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
2449 add_using_namespace, merge_functions, ambiguous_decl,
2450 lookup_using_namespace, lookup_using_namespace,
2451 qualified_lookup_using_namespace, set_decl_namespace,
2452 decl_namespace, current_decl_namespace, push_decl_namespace,
2453 pop_decl_namespace, push_scope, pop_scope, add_function,
2454 arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
2455 lookup_arg_dependent, do_namespace_alias,
2456 validate_nonmember_using_decl, do_nonmember_using_decl,
2457 do_toplevel_using_decl, do_local_using_decl,
2458 do_class_using_decl, do_using_directive, check_default_args,
2459 mark_used, handle_class_head): Use C90 prototypings. Use booleans.
2460 * parser.c (cp_parser_class_head): Use booleanss.
2461 * decl.c (walk_globals, walk_vtables): Likewise.
2462 * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
2463 walk_globals): Change return type from 'int' to 'bool'.
2464 * rtti.c (init_rtti_processing, build_headof, throw_bad_cast
2465 throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
2466 build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
2467 get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
2468 qualifier_flags, tinfo_base_init, generic_initializer,
2469 ptr_initializer, dfs_class_hint_mark, ptm_initializer,
2470 dfs_class_hint_unmark, class_hint_flags, class_initializer,
2471 typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
2472 get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
2473 unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
2474 * repo.c (repo_compile_flags, repo_template_declared,
2475 repo_template_defined, repo_class_defined, repo_get_id,
2476 repo_template_used, repo_vtable_used, repo_inline_used,
2477 repo_tinfo_used, repo_template_instantiated, extract_string,
2478 open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
2479 finish_repo): Likewise.
2480 * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
2481 cxx_print_xnode): Likewise..
2482 * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
2483 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
2484 * cxxfilt.c (demangle_it, print_demangler_list, usage,
2485 standard_symbol_characters, hp_symbol_characters, main, fatal):
2487 (strip_underscore): Change type from 'int' to 'bool'.
2488 (main): Use boolean constants.
2490 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2492 Remove traditional C constructs 3/n.
2493 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2494 build_up_reference, warn_ref_binding, convert_to_reference,
2495 convert_from_reference, convert_lvalue, cp_convert, ocp_convert,
2496 convert_to_void, convert, convert_force, build_type_conversion,
2497 build_expr_type_conversion, type_promotes_to,
2498 perform_qualification_conversions): Use C90 prototyping style.
2499 * decl2.c (grok_array_decl): Use boolean constant.
2500 (delete_sanity): Likewise.
2501 * typeck.c (build_unary_op): Likewise.
2502 * semantics.c (finish_switch_cond): Likewise.
2503 * parser.c (cp_parser_direct_new_declarator): Likewise.
2504 * init.c (build_new): Likewise.
2506 2002-12-27 Mark Mitchell <mark@codesourcery.com>
2508 * Make-lang.in (po-generated): Remove parse.c.
2509 (CXX_OBJS): Remove parse.o and spew.o. Add parser.o.
2510 ($(srcdir)/cp/parse.h): Remove target.
2511 ($(srcdir)/cp/parse.c): Likewise.
2512 (gt-cp-parse.h): Likewise.
2513 (gt-cp-parser.h): New target.
2514 (c++.distclean): Do not remove parse.output.
2515 (c++.maintainer-clean): Do not remove parse.c or parse.h.
2516 (cp/spew.o): Remove target.
2517 (cp/lex.o): Adjust dependencies.
2518 (cp/pt.o): Likewise.
2519 (cp/parse.o): Likewise.
2520 (cp/TAGS): Do not mention parse.c.
2521 (cp/parser.o): New target.
2522 * NEWS: Mention the new parser.
2523 * call.c (build_scoped_method_call): Simplify.
2524 (build_method_call): Likewise.
2525 (build_new_function_call): Adjust calls to add_function_candidate
2526 and add_template_candidate.
2527 (build_new_op): Improve handling of erroroneous operands.
2528 (convert_default_arg): Remove circular argument processing.
2529 (name_as_c_string): New function.
2530 (build_new_method_call): Use it.
2531 (perform_implicit_conversion): Use error_operand_p.
2532 * class.c (finish_struct_anon): Use constructor_name_p.
2533 (check_field_decls): Likewise.
2534 (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN.
2535 (resolve_address_of_overloaded_function): Likewise.
2536 (instantiate_type): Tweak pointer-to-member handling.
2537 (get_primary_binfo): Remove incorrect assertion.
2538 * config-lang.in (gtfiles): Add parser.c, remove parse.c.
2539 * cp-tree.h (DEFARG_TOKENS): New macro.
2540 (default_arg): New structure.
2541 (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG.
2542 (lang_tree_node): Add default_arg.
2543 (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE.
2544 (type_info_ref_type): New macro.
2545 (saved_scope): Make processing_explicit_instantiation a boolean.
2546 (check_access): New field.
2547 (unparsed_text): Remove.
2548 (language_function): Remove unparsed_inlines.
2549 (error_operand_p): New macro.
2550 (lang_decl): Adjust pending_inline_info.
2551 (DEFARG_POINTER): Remove.
2552 (tag_types): Add typenames.
2553 (lookup_ualified_name): Declare.
2554 (lookup_name_real): Likewise.
2555 (shadow_tag): Adjust prototype.
2556 (get_scope_of_declarator): Declare it.
2557 (process_next_inline): Remove it.
2558 (check_for_missing_semicolon): Likewise.
2559 (maybe_get_template_decl_from_type_decl): Declare it.
2560 (finish_label_stmt): Adjust prototype.
2561 (finish_non_static_data_meber): Declare it.
2562 (finish_pseudo_destructor_call_expr): Rename to ...
2563 (finish_pseudo_destructor_expr): ... this.
2564 (finish_compound_literal): Declare it.
2565 (begin_inline_definitions): Remove it.
2566 (init_spew): Remove.
2567 (peekyylex): Likewise.
2568 (arbitrate_lookup): Likewise.
2569 (frob_opname): Likewise.
2570 (maybe_snarf_defarg): Likewise.
2571 (add_defarg_fn): Likewise.
2572 (do_pending_defargs): Likewise.
2573 (done_pending_defargs): Likewise.
2574 (unprocessed_defarg_fn): Likewise.
2575 (replace_defarg): Likewise.
2576 (end_input): Likewise.
2577 (get_overloaded_fn): Likewise.
2578 * cvt.c (convert_to_reference): Improve error handling.
2579 * decl.c (lookup_name_real): Do not declare it static.
2580 (maybe_push_to_top_level): Set check_access.
2581 (identifier_type_value): Adjust call to lookup_name_real.
2582 (lookup_qualified_name): New method.
2583 (lookup_name_real): Remove special-case parsing code.
2584 (lookup_name-nonclass): Adjust call to lookup_name_real.
2585 (lookup_name_namespace_only): Likewise.
2586 (lookup_name): Likewise.
2587 (check_tag_decl): Return the type declared.
2588 (shadow_tag): Likewise.
2589 (register_dtor_fn): Tweak check_access.
2590 (grokfndecl): Use constructor_name_p.
2591 (get_scope_of_declarator): New function.
2592 (grokdeclarator): Obscure tweaks for slightly different declarator
2594 (start_method): Return error_mark_node to indicate failure.
2595 (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs.
2596 * decl2.c (constructor_name_full): Simplify.
2597 (constructor_name): Use it.
2598 (build_expr_from_tree): Adjust for changes to do new parser.
2599 (push_scope): Improve robustness.
2600 (validate_nonmember_using_decl): Process declarations, not names.
2601 (do_class_using_decl): Likewise.
2602 (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS
2604 * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs.
2605 * expr.c (cxx_expand_expr): Handle BASELINKs.
2606 * init.c (member_init_ok_or_else): Issue more errors.
2607 (build_offset_ref): Tweak handling of FUNCTION_DECLs.
2608 * lex.c: Do not include parse.h.
2609 (yypring): Do not declare.
2611 (make_reference_declarator): Remove error-generating code.
2612 (rid_to_yy): Remove.
2613 (cxx_init): Do not call init_spew.
2615 (check_for_missing_semicolon): Remove.
2616 * lex.h (got_scope): Remove.
2617 (got_object): Remove.
2618 * method.c (hack_identifier): Use finish_non_static_data_member.
2619 (implicitly_declare_fn): Adjust use of constructor_name.
2620 * parser.c: New file.
2621 * pt.c (parse.h): Do not include it.
2622 (maybe_get_template_decl_from_template): Do not declare it.
2623 (finish_member_template_decl): Tweak.
2624 (begin_explicit_instantiation): Adjust for
2625 processing_explicit_instantiation being boolean.
2626 (end_explicit_instantiation): Likewise.
2627 (maybe_process_partial_specialization): Tighten specialization
2629 (retrieve_local_specialization): Adjust ue of hash table.
2630 (eq_local_specializations): New function.
2631 (register_local_specialization): Likewise.
2632 (push_template_decl_real): Remove unnecessary test.
2633 (maybe_get_template_decl_from_type_decl): Don't make it static.
2634 (for_each_template_parm_r): Handle TYPEOF_TYPE.
2635 (tsubst_copy): Use retrieive_local_specialization to handle
2636 PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs.
2637 Handle COMPONENT_REFs with pseudo-destructor-expressions.
2638 Simplify handling of CALL_EXPR and METHOD_CALL_EXPR.
2639 (tsubst_expr): Pass decls, not names, to do_local_using_decl.
2640 (unify): Tweak handling of CONST_DECLs.
2641 (regenerate_decl_from_template): Use push_nested_class.
2642 (template_for_substitution): New funciton.
2643 (instantiate_decl): Use it. Register parameters as local
2645 * rtti.c (init_rtti_processing): Set type_info_ref_type.
2646 (build_typeid): Use it.
2647 (get_typeid): Likeise.
2648 * search.c (accessible_p): Use check_access, not
2649 flag_access_control.
2650 (adjust_result_of_qualified_name_lookup): Pay attention to the
2652 * semantics.c (finish_asm_stmt): Adjust error handling.
2653 (finish_label_stmt): Return the statement.
2654 (finish_non_static_data_member): New function.
2655 (finish_class_expr): Handle BASELINKs.
2656 (finish_call_expr): Handle PSEUDO_DTOR_EXPR.
2657 (finish_object_call_expr): Simplify handling during templates.
2658 (finish_pseudo_destructor_call_expr): Rename to ...
2659 (finish_pseudo_dtor_expr): ... this.
2660 (finish_compound_literal): New function.
2661 (begin_inline_definitions): Remove.
2662 (finish_sizeof): Remove special template handling.
2663 * spew.c: Do not include parse.h.
2664 * tree.c (get_overloaded_fn): Remove.
2665 * typeck.c (build_class_member_access_expr): Handle
2666 PSEUDO_DTOR_EXPR. Adjust handling of static member functions.
2667 (lookup_destructor): New function.
2668 (finish_class_member_access_expr): Use it.
2669 (convert_arguments): Simplify.
2670 (build_unary_op): Handle BASELINKs.
2672 2002-12-26 Nathan Sidwell <nathan@codesourcery.com>
2675 * decl2.c (mark_used): Defer inline functions.
2676 (finish_file): Merge deferred_fns loops. Check all used
2677 inline functions have a definition.
2678 * method.c (make_thunk): Thunks are not inline.
2680 PR c++/5116, c++/764
2681 * call.c (build_new_op): Make sure template class operands are
2684 2002-12-24 Nathan Sidwell <nathan@codesourcery.com>
2687 * cp-tree.h (resolve_scoped_fn_name): Prototype.
2688 * call.c (resolve_scoped_fn_name): New function. Deal with
2689 more template expansion. Broken out of ...
2690 * parse.y (parse_finish_call_expr): ... here. Call it.
2691 * decl2.c (build_expr_from_tree, CALL_EXPR): Use
2692 resolve_scoped_fn_name and build_call_from_tree.
2695 * decl.c (duplicate_decls): Templates may be disambiguated by
2699 * decl2.c (check_classfn): Use lookup_fnfield_1. List all
2700 conversion operators on failure.
2702 2002-12-23 Gabriel Dos Reis <gdr@integrable-solutions.net>
2704 Remove traditional C constructs 2/n.
2705 * call.c (tourney, build_field_call, equal_functions, joust,
2706 compare_ics, build_over_call, build_java_interface_fn_ref,
2707 convert_like_real, op_error, build_object_call, resolve_args,
2708 build_vfield_ref, check_dtor_name, build_scoped_method_call,
2709 build_addr_func, build_call, build_method_call, null_ptr_cst_p,
2710 sufficient_parms_p, build_conv, non_reference, strip_top_quals,
2711 standard_conversion, reference_related_p,
2712 reference_compatible_p, convert_class_to_reference,
2713 direct_reference_binding, reference_binding,
2714 ,implicit_conversion, is_complete, promoted_arithmetic_type_p,
2715 add_template_conv_candidate, any_viable, any_strictly_viable,
2716 build_this, splice_viable, print_z_candidates,
2717 build_user_type_conversion, build_new_function_call,
2718 conditional_conversion, build_conditional_expr, build_new_op,
2719 build_op_delete_call, enforce_access, call_builtin_trap,
2720 convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to,
2721 convert_default_arg, type_passed_as, convert_for_arg_passing,
2722 in_charge_arg_for_name, is_properly_derived_from,
2723 maybe_handle_implicit_object, maybe_handle_ref_bind,
2724 source_type, add_warning, can_convert, can_convert_arg,
2725 perform_implicit_conversion, can_convert_arg_bad,
2726 initialize_reference, add_conv_candidate,
2727 add_template_candidate_real, add_template_candidate): Ansify.
2729 2002-12-22 Nathan Sidwell <nathan@codesourcery.com>
2732 * cp-tree.h (grokoptypename): Add SCOPE parameter.
2733 * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type
2734 if in a template scope.
2735 * parse.y (unoperator): Return the scope.
2736 (operator_name): Adjust grokoptypename call.
2738 2002-12-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2740 * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t.
2741 * decl.c (make_unbound_class_template): Adjust. Check for tf_error.
2742 * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error.
2744 2002-12-20 Kazu Hirata <kazu@cs.umass.edu>
2746 * ChangeLog: Fix a typo.
2747 * class.c: Fix comment typos.
2748 * cp-tree.h: Likewise.
2750 2002-12-18 Jason Merrill <jason@redhat.com>
2752 Handle anonymous unions at the tree level.
2753 C++ ABI change: Mangle anonymous unions using the name of their
2754 first named field (by depth-first search). Should not cause
2755 binary compatibility problems, though, as the compiler previously
2756 didn't emit anything for affected unions.
2757 * cp-tree.def (ALIAS_DECL): New tree code.
2758 * decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the
2759 first field, not the largest.
2760 (finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME,
2761 push the decl, and write it out at namespace scope.
2762 * decl.c (lookup_name_real): See through an ALIAS_DECL.
2763 (pushdecl): Add namespace bindings for ALIAS_DECLs.
2764 * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
2765 of a decl which doesn't have one.
2766 * typeck.c (build_class_member_access_expr): Don't recurse if
2767 we already have the type we want.
2769 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2772 * friend.c (make_friend_class): Allow partial specialization
2773 when declaration is not a template friend.
2775 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2778 * pt.c (lookup_template_class): Copy TREE_PRIVATE and
2779 TREE_PROTECTED to created decl nodes.
2781 2002-12-18 Mark Mitchell <mark@codesourcery.com>
2783 * class.c (build_base_field): Do not set DECL_PACKED on the
2786 2002-12-18 Gabriel Dos Reis <gdr@integrable-solutions.net>
2788 * cp-tree.h (struct tree_srcloc): Use location_t.
2789 (SOURCE_LOCUS): New.
2790 (SRCLOC_FILE, SRCLOC_LINE): Adjust.
2792 2002-12-17 Jason Merrill <jason@redhat.com>
2794 * decl.c (finish_function): Also complain about no return in
2796 * semantics.c (finish_return_stmt): Also call check_return_expr in
2798 * typeck.c (check_return_expr): In a template, just remember that we
2801 2002-12-16 Jason Merrill <jason@redhat.com>
2803 * semantics.c (simplify_aggr_init_exprs_r): Don't change the type
2806 * semantics.c (do_pushlevel): Call pushlevel after adding the
2808 (do_poplevel): Call poplevel before adding the SCOPE_STMT.
2809 * parse.y (function_body): Go back to using compstmt.
2810 * decl.c (pushdecl): Skip another level to get to the parms level.
2812 * call.c (build_new_method_call): Use is_dummy_object to determine
2813 whether or not to evaluate the object parameter to a static member
2816 2002-12-14 Jason Merrill <jason@redhat.com>
2818 * semantics.c (simplify_aggr_init_exprs_r): Also prepend the
2819 return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR.
2820 * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE,
2821 don't bother with an AGGR_INIT_EXPR.
2822 (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE,
2823 just generate a new decl normally. Take return slot parm.
2824 * cp-tree.h: Adjust prototype.
2826 2002-12-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
2829 * cvt.c (convert_to_pointer_force): Don't try comparing against
2832 2002-12-13 Geoffrey Keating <geoffk@apple.com>
2834 * cp-tree.h: Have the multiple-include guards around
2837 2002-12-10 David Edelsohn <edelsohn@gnu.org>
2839 * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos
2841 (snarf_method): Same.
2842 (snarf_defarg): Same.
2844 2002-12-10 Mark Mitchell <mark@codesourcery.com>
2847 * pt.c (tsubst_copy): Handle destructor names more correctly.
2849 2002-12-10 Matt Austern <austern@apple.com>
2851 * cp-tree.h: get rid of needs_virtual_reinit bit.
2853 2002-12-09 Mark Mitchell <mark@codesourcery.com>
2855 * NEWS: Document removal of in-class initialization extension for
2856 static data members of non-arithmetic, non-enumeration type.
2857 * decl.c (check_static_variable_definition): Do not allow that
2859 * decl2.c (grokfield): Do not call digest_init when processing
2862 2002-12-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2864 * error.c (dump_expr): Fix format specifier warning.
2866 2002-12-04 Geoffrey Keating <geoffk@apple.com>
2868 * class.c (finish_struct_1): Correct comment.
2869 * cp-tree.c (DECL_SORTED_FIELDS): Likewise.
2871 2002-12-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
2874 * error.c (dump_expr): Don't ever try to dump a non-existent
2877 2002-12-03 Nathan Sidwell <nathan@codesourcery.com>
2879 Implement covariant returns.
2880 * cp-tree.h (IS_AGGR_TYPE_2): Remove.
2881 (struct lang_decl_flags): Add this_thunk_p flag.
2882 Rename vcall_offset to virtual_offset.
2883 (struct lang_decl): Rename delta to fixed_offset.
2884 (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines.
2885 (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg.
2886 (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ...
2887 (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here.
2888 (make_thunk): Add this_adjusting arg.
2889 (finish_thunk): Declare.
2890 (mangle_thunk): Add this_adjusting arg.
2891 * class.c (get_vcall_index): Use base function for lookup.
2892 (update_vtable_entry_for_fn): Generate covariant thunk.
2893 (finish_struct_1): Set DECL_VINDEX to NULL for thunks.
2894 (build_vtbl_initializer): Use base function for lookup.
2895 Finish covariant thunk here. Adjust thunk generation.
2896 * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling.
2897 Adjust thunk dumping.
2898 * mangle.c (mangle_call_offset): New function.
2899 (mangle_thunk): Adjust for covariant thunks.
2900 * method.c (make_thunk): Adjust. Do not set name here.
2901 (finish_thunk): New function. Set name here.
2902 (use_thunk): Generate covariant thunks too.
2903 (thunk_adjust): New function.
2904 * search.c (covariant_return_p): Remove. Fold into ...
2905 (check_final_overrider): ... here. Simplify.
2906 * semantics.c (emit_associated_thunks): Walk covariant thunk lists.
2908 2002-12-03 Jason Merrill <jason@redhat.com>
2911 * call.c (build_over_call): Check specifically for TARGET_EXPR
2914 PR c++/8461, c++/8625
2915 * call.c (convert_for_arg_passing): Don't mess with error_mark_node.
2916 (cp_convert_parm_for_inlining): Remove.
2917 * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
2919 * cp-tree.h (ADDR_IS_INVISIREF): Remove.
2920 * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code.
2922 * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on
2923 an ambiguous conversion.
2925 2002-12-03 Mark Mitchell <mark@codesourcery.com>
2928 * decl.c (reshape_init): Handle erroneous initializers.
2930 2002-12-02 Mark Mitchell <mark@codesourcery.com>
2933 * spew.c (remove_last_token): Make sure that last_chunk is set
2937 * error.c (dump_expr): Handle character constants with
2940 2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
2943 * decl.c (grokdeclarator): Require class-key for all friend class.
2944 Output the correct type and context in the error message.
2946 2002-12-01 Mark Mitchell <mark@codesourcery.com>
2949 * pt.c (unify): Use variably_modified_type_p to test validity of
2950 template argument types.
2953 * cp-tree.h (lang_type_class): Add typeinfo_var.
2954 (CLASSTYPE_TYPEINFO_VAR): New macro.
2955 * rtti.c (get_tinfo_decl): Use it.
2958 * init.c (expand_member_init): Always get the main variant of a
2961 2002-12-01 Mark Mitchell <mark@codesourcery.com>
2965 * decl.c (cxx_init_decl_processing): Use size_type_node, not
2967 * decl2.c (coerce_new_type): Likewise.
2968 * except.c (do_allocate_exception): Likewise.
2970 2002-11-30 Zack Weinberg <zack@codesourcery.com>
2972 * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c,
2973 dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c,
2974 lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c,
2975 repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
2976 typeck2.c: Include coretypes.h and tm.h.
2977 * Make-lang.in: Update dependencies.
2979 2002-11-30 Mark Mitchell <mark@codesourcery.com>
2982 * decl.c (layout_var_decl): Deal gracefully with erroneous types.
2983 (check_initializer): Validate the type of the initialized
2984 variable, even if the initializer is absent.
2985 * typeck.c (cp_type_quals): Deal gracefully with erroneous types.
2988 * typeck.c (convert_for_assignment): Do not use
2989 decl_constant_value on the operand.
2992 * pt.c (instantiate_decl): Handle template friends defined outside
2993 of the class correctly.
2995 2002-11-29 Joe Buck <jbuck@synopsys.com>
2997 * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
3000 2002-11-29 Mark Mitchell <mark@codesourcery.com>
3002 * class.c (walk_subobject_offsets): Recur on binfos as well as on
3004 (layout_nonempty_base_or_field): Pass it a binfo when processing a
3006 (layout_empty_base): Likewise.
3007 (build_base_field): Likewise.
3009 2002-11-27 Mark Mitchell <mark@codesourcery.com>
3011 * class.c (build_base_field): Make sure we get the canonical base
3012 when descending through primary bases.
3014 2002-11-26 Geoffrey Keating <geoffk@apple.com>
3016 * decl.c (check_initializer): Don't error on initialisation of
3017 a scalar with a brace-enclosed expression.
3019 2002-11-26 Nathan Sidwell <nathan@codesourcery.com>
3021 * cp-tree.h (DECL_LANG_FLAG_4): Document more uses.
3022 (template_parms_equal): Remove prototype.
3023 * typeck.c (buuld_indirect_ref): Reformat.
3025 2002-11-25 Jason Merrill <jason@redhat.com>
3027 * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT
3030 2002-11-25 Mark Mitchell <mark@codesourcery.com>
3032 * tree.c (cp_build_qualified_type_real): Correct handling of
3034 * class.c (walk_subobject_offsets): Fix thinko.
3035 (build_base_field): Record offsets of empty bases in primary
3037 (layout_class_type): Record offsets of empty bases in fields.
3039 * search.c (is_subobject_of_p_1): Fix thinko.
3040 (lookup_field_queue_p): Likewise.
3042 2002-11-24 Mark Mitchell <mark@codesourcery.com>
3044 * class.c (layout_class_type): Reuse tail padding when laying out
3047 2002-11-22 Mark Mitchell <mark@codesourcery.com>
3049 * rtti.c (qualifier_flags): Fix thinko.
3051 2002-11-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
3053 Remove traditional C constructs 1/n.
3054 * cp-tree.h (init_method, set_mangled_name_for_decl,
3055 build_opfncall, hack_identifier, make_thunk, use_thunk,
3056 synthesize_method, implicitly_declare_fn,
3057 skip_artificial_parms_for, optimize_function, calls_setjmp_p,
3058 maybe_clone_body): Remove use of PARAMS.
3060 * method.c (do_build_assign_ref, do_build_copy_constructor,
3061 synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy):
3063 (synthesize_method): Use 'bool' type and constants instead of
3065 (locate_copy): Likewise.
3066 (implicitly_declare_fn): Likewise.
3068 * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function):
3069 Remove old-style declaration.
3070 (maybe_clone_body): Use 'bool' type and constants.
3072 2002-11-21 Glen Nakamura <glen@imodulo.com>
3075 * typeck.c (get_member_function_from_ptrfunc): Make sure that a
3076 SAVE_EXPR for instance_ptr doesn't get evaluated first inside one
3077 of the branches of a COND_EXPR.
3079 2002-11-19 Mark Mitchell <mark@codesourcery.com>
3081 * pt.c (for_each_template_parm): Free allocated memory.
3082 * search.c (is_subobject_of_p_1): New function.
3083 (is_subobject_of_p): Avoid walking virtual bases multiple times.
3085 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
3087 * g++spec.c (lang_specific_spec_functions): New.
3089 2002-11-15 Kazu Hirata <kazu@cs.umass.edu>
3091 * ChangeLog: Follow spelling conventions.
3092 * class.c: Likewise.
3093 * decl2.c: Likewise.
3095 2002-11-14 Zack Weinberg <zack@codesourcery.com>
3097 * search.c (dfs_push_decls): Do not try to reorder elements
3098 3..n of method_vec if method_vec has only two elements.
3099 Reverse order of two tests to avoid accessing unallocated
3102 2002-11-14 Mark Mitchell <mark@codesourcery.com>
3104 * class.c (dfs_find_final_overrider): Adjust so that the most
3105 derived object is a binfo, rather than a class type.
3106 (find_final_overrider): Likewise.
3107 (add_vcall_offset_vtbl_entries_1): Simplify accordingly.
3108 (add_vcall_offset): Likewise.
3110 2002-11-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
3113 * pt.c (instantiate_template): Push class scope for member
3115 (get_mostly_instantiated_function_type): Likewise. Don't call
3116 tsubst on context. Remove CONTEXTP and TPARMSP parameters.
3117 * cp-tree.h (get_mostly_instantiated_function_type): Adjust.
3118 * mangle.c (write_encoding, write_unqualified_name): Adjust.
3120 2002-11-07 Mark Mitchell <mark@codesourcery.com>
3122 * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of
3123 vcall offfsets. Split out ...
3124 (add_vcall_offset): ... new function.
3127 * pt.c (for_each_template_parm): Add htab parameter.
3128 (process_partial_specialization): Adjust call.
3129 (push_template_decl_real): Likewise.
3130 (pair_fn_data): Add visited.
3131 (for_each_template_parm_r): Avoid walking duplicates more than
3133 (uses_template_parms): Adjust call to for_each_template_parm.
3135 2002-11-07 Mark Mitchell <mark@codesourcery.com>
3137 * class.c (add_implicitly_declared_members): Put implicitly
3138 declared functions at the end of TYPE_METHODs when -fabi-version
3141 2002-11-05 Geoffrey Keating <geoffk@apple.com>
3143 * decl2.c (finish_file): Correct spelling.
3145 2002-11-03 Mark Mitchell <mark@codesourcery.com>
3147 * call.c (build_special_member_call): Do not try to lookup VTTs by
3149 * class.c (vtbl_init_data): Add generate_vcall_entries.
3150 (get_vtable_decl): Do not look up virtual tables by name.
3151 (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P.
3152 (set_primary_base): Do not set CLASSTYPE_RTTI.
3153 (determine_primary_base): Likewise.
3154 (get_matching_virtual): Remove.
3155 (get_vcall_index): New function.
3156 (update_vtable_entry_for_fn): Do not try to use virtual thunks
3157 when they are not required. Assign vcall indices at this point.
3158 (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT.
3159 Do update dynamic_classes.
3160 (build_vtt): Do not add VTTs to the symbol table.
3161 (build_ctor_vtbl_group): Likewise.
3162 (build_vtbl_initializer): Simplify handling of vcall indices.
3163 (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets
3164 for the most derived class.
3165 (add_vcall_offset_vtbl_entries_1): But do not actually add them to
3167 * cp-tree.h (dynamic_classes): New macro.
3168 (lang_type_class): Remove rtti. Add vtables. Add vcall_indices.
3169 (CLASSTYPE_RTTI): Remove.
3170 (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove.
3171 (CLASSTYPE_VCALL_INDICES): New macro.
3172 (CLASSTYPE_VTABLES): Likewise.
3173 (BV_USE_VCALL_INDEX_P): Remove.
3174 (build_vtable_path): Remove.
3175 * decl2.c (finish_vtable_vardecl): Remove.
3176 (key_method): Remove #if 0'd code.
3177 (finish_vtable_vardecl): Rename to ...
3178 (maybe_emit_vtables): ... this.
3179 (finish_file): Use it.
3180 * search.c (look_for_overrides_here): Update comment.
3182 2002-11-01 Zack Weinberg <zack@codesourcery.com>
3185 * decl2.c (grokfield): Reject TYPE_DECLs with initializers.
3187 2002-10-30 Jason Merrill <jason@redhat.com>
3190 * cp-tree.h (ADDR_IS_INVISIREF): New macro.
3191 * call.c (convert_for_arg_passing): Set it.
3192 * except.c (stabilize_throw_expr): Recurse for such an arg.
3194 2002-10-31 Mark Mitchell <mark@codesourcery.com>
3196 * cp-tree.h (lang_decl_flags): Remove init_priority.
3197 (lang_decl): Add delta.
3198 (GLOBAL_INIT_PRIORITY): Remove.
3199 (THUNK_DELTA): Revise definition.
3200 * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY.
3201 * dump.c (cp_dump_tree): Don't dump it.
3203 2002-10-30 Mark Mitchell <mark@codesourcery.com>
3206 * typeck2.c (process_init_constructor): Call complete_array_type.
3209 * decl.c (make_typename_type): Issue errors about invalid results.
3211 2002-10-30 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
3213 Core issue 287, PR c++/7639
3214 * cp-tree.h (lang_type_class): Add decl_list field.
3215 (CLASSTYPE_DECL_LIST): New macro.
3216 (maybe_add_class_template_decl_list): Add declaration.
3217 * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST.
3218 (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST.
3219 (maybe_add_class_template_decl_list): New function.
3220 (add_implicitly_declared_members): Use it.
3221 * decl.c (maybe_process_template_type_declaration): Likewise.
3222 (pushtag): Likewise.
3223 * friend.c (add_friend): Likewise.
3224 (make_friend_class): Likewise.
3225 * semantics.c (finish_member_declaration): Likewise.
3226 (begin_class_definition): Initialize CLASSTYPE_DECL_LIST.
3227 * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST
3228 to process members and friends in the order of declaration.
3230 2002-10-29 Mark Mitchell <mark@codesourcery.com>
3233 * decl.c (finish_destructor_body): Create the label to jump to
3234 when returning from a destructor here.
3235 (finish_function_body): Rather than here.
3237 2002-10-25 Zack Weinberg <zack@codesourcery.com>
3240 * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a
3241 SCOPE_REF is not null before dereferencing it.
3243 2002-10-25 Mark Mitchell <mark@codesourcery.com>
3245 * call.c (build_over_call): Use DECL_CONTEXT, not
3246 DECL_VIRTUAL_CONTEXT.
3247 * class.c (modify_vtable_entry): Don't mess with
3248 DECL_VIRTUAL_CONTEXT.
3249 (set_vindex): Remove.
3250 (set_primary_base): Remove vfuns_p parameter.
3251 (determine_primary_base): Likewise.
3252 (modify_all_vtables): Likewise.
3253 (layout_class_type): Likewise. Adjust calls to other functions
3255 (finish_struct_1): Adjust calls to modified functions. Set
3257 * cp-tree.h (lang_type_class): Remove vsize.
3258 (CLASSTYPE_VSIZE): Remove.
3259 (lang_decl): Remove thunks.
3260 (DECL_THUNKS): Adjust.
3261 (DECL_VIRTUAL_CONTEXT): Remove.
3262 (duplicate_decls): Don't copy it.
3263 * pt.c (build_template_decl): Don't set it.
3264 (tsubst_decl): Likewise.
3265 * typeck.c (expand_ptrmemfunc_cst): Don't use it.
3267 * class.c (build_vtbl_initializer): Don't use build_vtable_entry.
3268 (build_vtable_entry): Remove.
3269 * cp-tree.h (BINFO_VIRTUALS): Expand documentation.
3270 (lang_decl): Add thunks.
3271 (DECL_THUNKS): New macro.
3272 * decl.c (duplicate_decls): Copy it.
3273 * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS.
3274 * semantics.c (emit_associated_thunks): Simplify.
3276 2002-10-24 David Edelsohn <edelsohn@gnu.org>
3279 * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that
3280 lang_type structure exists before accessing field.
3281 (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro.
3282 (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar.
3283 (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro.
3284 * class.c (check_field_decls): Use new macros.
3285 * typeck2.c (process_init_constructor): Remove redundant check for
3286 existence of lang_type structure.
3288 2002-10-24 Mark Mitchell <mark@codesourcery.com>
3290 * class.c (end_of_base): New method.
3291 (end_of_class): Use it. Check indirect virtual bases.
3293 * class.c (check_field_decls): Fix typo.
3295 2002-10-23 Mark Mitchell <mark@codesourcery.com>
3298 * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
3302 * spew.c (next_token): Do not return an endless stream of
3303 END_OF_SAVED_INPUT tokens.
3304 (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of
3305 the cached token stream.
3306 (snarf_defarg): Likewise.
3308 2002-10-23 Zack Weinberg <zack@codesourcery.com>
3310 * cp-lang.c (cp_var_mod_type_p): New: C++ hook for
3311 variably_modified_type_p.
3312 * cp-tree.h: Remove prototype of variably_modified_type_p.
3313 * tree.c (variably_modified_type_p): Remove; now implemented
3314 in language-independent code.
3316 2002-10-22 Mark Mitchell <mark@codesourcery.com>
3319 * spew.c (snarf_parenthesized_expression): New function.
3320 (snarf_block): Use it.
3322 2002-10-22 Richard Henderson <rth@redhat.com>
3324 * method.c (use_thunk): Always compute vcall_value; assert that
3325 it is not zero. Use can_output_mi_thunk; use output_mi_thunk
3326 for vcall thunks as well.
3328 2002-10-21 Mark Mitchell <mark@codesourcery.com>
3330 * class.c (empty_base_at_nonzero_offset_p): New function.
3331 (layout_nonempty_base_or_field): Do not check for conflicts when
3332 laying out a virtual base using the GCC 3.2 ABI.
3333 (build_base_field): Correct checking for presence of empty classes
3334 at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P.
3336 * class.c (include_empty_classes): Use normalize_rli.
3337 (layout_class_type): Likewise.
3339 * decl.c (reshape_init): Tweak handling of character arrays.
3342 * cp-tree.h (lang_type_class): Add contains_empty_class_p.
3343 (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro.
3344 * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P.
3345 (check_field_decls): Likewise.
3346 (layout_class_type): Likewise.
3347 (finish_struct_1): Initialize it.
3348 (walk_subobject_offsets): Use it to prune searches.
3350 2002-10-20 Mark Mitchell <mark@codesourcery.com>
3352 * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT.
3353 * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with
3354 TARGET_ASM_OUTPUT_MI_THUNK in comments.
3356 2002-10-18 Zack Weinberg <zack@codesourcery.com>
3358 * decl.c (start_decl): Point users of the old initialized-
3359 typedef extension at __typeof__.
3361 2002-10-18 Mark Mitchell <mark@codesourcery.com>
3363 * Make-lang.in (method.o): Depend on TARGET_H.
3364 * method.c (target.h): Include it.
3365 (use_thunk): Use target hooks. Use vcall thunks, if available.
3367 2002-10-18 Mark Mitchell <mark@codesourcery.com>
3369 * class.c (base_derived_from): Make sure return value is a bool.
3371 2002-10-18 Mark Mitchell <mark@codesourcery.com>
3373 * class.c (find_final_overrider_data_s): Remove overriding_fn and
3375 (dfs_base_derived_from): New function.
3376 (base_derived_from): Likewise.
3377 (dfs_find_final_overrider): Use base_derived_from.
3378 (find_final_overrider): Adjust.
3380 2002-10-18 Jason Merrill <jason@redhat.com>
3383 * semantics.c (finish_for_cond, finish_while_cond): Don't mess
3384 with condition decls in a template.
3386 2002-10-17 Nathan Sidwell <nathan@codesourcery.com>
3388 * class.c (add_method): Compare template parms too.
3390 2002-10-17 Mark Mitchell <mark@codesourcery.com>
3393 * class.c (handle_using_decl): Allow the declaration used to be
3394 from an ambiguous base.
3396 * pt.c (convert_template_argument): Revert this change:
3397 2002-10-16 Mark Mitchell <mark@codesourcery.com>
3398 * pt.c (convert_template_argument): Do not fold non-type
3399 template rguments when inside a template.
3401 * init.c (expand_default_init): Handle brace-enclosed initializers
3404 2002-10-16 Mark Mitchell <mark@codesourcery.com>
3406 * mangle.c (write_expression): Correct handling of enumeration
3408 (write_template_arg): Likewise.
3409 * pt.c (convert_template_argument): Do not fold non-type template
3410 arguments when inside a template.
3413 * cvt.c (convert_to_reference): Allow references as the incoming
3416 2002-10-16 Mark Mitchell <mark@codesourcery.com>
3419 * method.c (do_build_assign_ref): Use cp_build_qualified_type, not
3420 build_qualified_type.
3422 2002-10-15 Richard Henderson <rth@redhat.com>
3424 * error.c (dump_expr): Use real_to_decimal directly, and with
3427 2002-10-15 Mark Mitchell <mark@codesourcery.com>
3429 * decl.c (reshape_init): Fix typo.
3431 * cp-tree.h (operator_name_info_t): Add arity.
3432 * lex.c (init_operators): Initialize it.
3433 * mangle.c (write_conversion_operator_name): New function.
3434 (write_unqualified_name): Use it.
3435 (write_template_args): Accept template arguments as a TREE_LIST.
3436 (write_expression): Adjust handling of qualified names to match
3439 2002-10-15 Jason Merrill <jason@redhat.com>
3441 * call.c (call_builtin_trap): New fn.
3442 (convert_arg_to_ellipsis): Use it. Downgrade error to warning.
3443 (build_call): Don't set current_function_returns_abnormally outside
3446 2002-10-14 Mark Mitchell <mark@codesourcery.com>
3448 * class.c (check_field_decls): Remove empty_p parameter. Instead,
3449 clear CLASSTYPE_EMPTY_P.
3450 (build_base_field): Likewise.
3451 (build_base_fields): Likewise.
3452 (check_bases_and_members): Likewise.
3453 (create_vtbl_ptr): Likewise.
3454 (layout_class_type): Likewise. Ensure that empty classes have
3455 size zero when used as base classes in the 3.2 ABI.
3456 (finish_struct_1): Initialize CLASSTYPE_EMPTY_P and
3457 CLASSTYPE_NEARLY_EMPTY_P. Adjust calls to avoid passing empty_p
3459 (is_empty_class): Correct definition when using post-3.2 ABI.
3460 * cp-tree.h (lang_type_class): Add empty_p.
3461 (CLASSTYPE_EMPTY_P): New macro.
3463 2002-10-12 Nathan Sidwell <nathan@codesourcery.com>
3465 * init.c (build_delete): Do not apply save_expr for arrays.
3466 (build_vec_delete): Likewise.
3468 2002-10-14 Mark Mitchell <mark@codesourcery.com>
3470 * decl.c (layout_var_decl): Call layout_decl even for variables
3471 whose type is an array with unspecified bounds.
3474 * lex.c (do_identifier): Add another option for the parsing
3476 * parse.y (do_id): Use it.
3478 2002-10-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
3480 PRs C++/6803, C++/7721 and C++/7803
3481 * decl.c (grokdeclarator): Gracefully handle template-name as
3484 2002-10-11 Jason Molenda <jmolenda@apple.com>
3486 * init.c (build_field_list): Provide uses_unions_p with a default
3489 2002-10-11 Mark Mitchell <mark@codesourcery.com>
3492 * cp-tree.h (variably_modified_type_p): New function.
3493 (grokdeclarator) Tighten check for variably modified types as
3495 * pt.c (convert_template_argument): Do not allow variably modified
3496 types as template arguments.
3497 * tree.c (variably_modified_type_p): New function.
3499 * NEWS: Document removal of "new X = ..." extension.
3500 * class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on
3501 brace-enclosed initializers.
3502 * cp-tree.h (CP_AGGREGATE_TYPE_P): New macro.
3503 (initialize_local_var): Remove declaration.
3504 (expand_static_init): Likewise.
3505 * decl.c (next_initializable_field): New function.
3506 (reshape_init): Likewise.
3507 (check_initializer): Use them. Build dynamic initializer for
3508 aggregates here too.
3509 (initialize_local_var): Simplify, and incorporate cleanup
3510 insertion code as well.
3511 (destroy_local_var): Remove.
3512 (cp_finish_decl): Tidy.
3513 (expand_static_init): Fold checks for whether or not a variable
3514 needs initialization into this function. Simplify.
3515 * decl2.c (do_static_initialization): Simplify.
3516 * init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will
3517 be done for us automatically.
3518 (expand_default_init): Handle brace-enclosed initializers
3520 (expand_aggr_init_1): Remove RTL-generation code.
3521 (build_vec_init): Remove "new X = ..." support.
3522 * parse.y (new_initializer): Likewise.
3523 * rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on
3524 brace-enclosed initializer.
3525 (create_pseudo_type_info): Likewise.
3526 * typeck2.c (store_init_value): Don't try to handle digest_init
3527 being called more than once.
3528 (digest_init): Tidy handling of brace-enclosed initializers.
3530 2002-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3532 * decl.c (typename_hash): Use htab_hash_pointer.
3534 2002-10-10 Jim Wilson <wilson@redhat.com>
3536 * decl.c (duplicate_decls): Don't call decl_attributes.
3538 2002-10-09 Zack Weinberg <zack@codesourcery.com>
3541 * decl.c (start_decl): Unconditionally issue error for
3542 'typedef foo = bar'.
3543 (cp_finish_decl): Remove special case for TYPE_DECL with initializer.
3544 (grokdeclarator): Remove redundant error for 'typedef foo = bar'.
3546 2002-10-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3548 * decl2.c (prune_vtable_vardecl): Delete unused function.
3550 2002-10-03 Mark Mitchell <mark@codesourcery.com>
3553 * decl2.c (finish_anon_union): Do not expand anonymous unions when
3554 procesing template functions.
3555 * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
3556 type. Call layout_decl.
3557 (tsubst_expr, case DECL_STMT): Handle anonymous unions.
3559 2002-10-07 Richard Henderson <rth@redhat.com>
3561 * decl2.c, pt.c: Revert c++/7754 fix.
3563 2002-10-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
3566 * error.c (dump_expr) [REAL_CST]: Output in decimal format.
3568 2002-10-03 Mark Mitchell <mark@codesourcery.com>
3571 * pt.c (for_each_template_parm_r): Handle BASELINKs.
3574 * decl2.c (finish_anon_union): Do not expand anonymous unions when
3575 procesing template functions.
3576 * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
3577 type. Call layout_decl.
3578 (tsubst_expr, case DECL_STMT): Handle anonymous unions.
3580 2002-10-03 Mark Mitchell <mark@codesourcery.com>
3583 * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template
3584 template parameters.
3585 (globals): Add entity and need_abi_warning.
3586 (decl_is_template_id): Use TYPE_TEMPLATE_INFO, not
3587 CLASSTYPE_TEMPLATE_INFO.
3588 (is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not
3590 (write_prefix): Handle typename types correctly.
3591 (write_template_prefix): Handle template template parameters
3593 (start_mangling): Add entity parameter.
3594 (finish_mangling): Warn about names whose mangling will change.
3595 (mangle_decl_string): Adjust.
3596 (mangle_type_string): Likewise.
3597 (mangle_special_for_type): Likewise.
3598 (mangle_ctor_vtbl_for_type): Likewise.
3599 (mangle_thunk): Likewise.
3600 (mangle_guard_variable): Likewise.
3601 (mangle_ref_init_variable): Likewise.
3603 2002-10-02 Mark Mitchell <mark@codesourcery.com>
3606 * cp-tree.def (CTOR_INITIALIZER): Use one slot, not two.
3607 * cp-tree.h (emit_base_init): Rename to ....
3608 (emit_mem_initializers): ... this.
3609 (expand_member_init): Change prototype.
3610 * init.c (perform_member_init): Compute explicit, rather than
3611 requiring it as a parameter.
3612 (sort_member_init): Rename to ...
3613 (sort_mem_initializers): ... this. Process bases and data members
3615 (sort_base_init): Remove.
3616 (emit_base_init): Rename to ...
3617 (emit_mem_initializers): ... this.
3618 (expand_aggr_vbase_init_1): Remove.
3619 (construct_virtual_bases): Rename to ...
3620 (construct_virtual_base): ... this.
3621 (expand_member_init): Rework handling of base initializers.
3622 * method.c (do_build_copy_constructor): Use
3623 finish_mem_initializers.
3624 * parse.y (member_init): Adjust calls to expand_member_init.
3625 * pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case.
3626 (tsubst_initializer_list): Use expand_member_init.
3627 * semantics.c (finish_mem_intiailizers): Simplify.
3629 2002-10-02 Matt Austern <austern@apple.com>
3630 * decl.c (walk_vtables_r): Fixed typo that caused result to
3631 never get a nonzero value.
3633 2002-10-02 Roger Sayle <roger@eyesopen.com>
3635 PR optimization/6627
3636 * cp-tree.h (enum ptrmemfunc_vbit_where_t): Delete definition
3637 from here, and move it to tree.h.
3638 * decl.c (cxx_init_decl_processing): If storing the vbit
3639 in function pointers, ensure that force_align_functions_log
3642 2002-10-02 Matt Austern <austern@apple.com>
3644 * class.c (check_field_decls): Changed warning about const member
3645 variables so that it doesn't get issued for a class aggregate.
3647 2002-10-01 Mark Mitchell <mark@codesourcery.com>
3649 * decl.c (cp_finish_decl): Make sure array types are laid out,
3650 even if the array bounds are unknown.
3652 2002-10-01 Steve Ellcey <sje@cup.hp.com>
3654 * class.c (build_vtbl_initializer): Change build_c_cast
3657 2002-10-01 Mark Mitchell <mark@codesourcery.com>
3659 * decl.c (cp_finish_decl): Make sure array types are laid out,
3660 even if the array bounds are unknown.
3662 * decl.c (cp_finish_decl): Correct check for dynamic
3663 initialization of thread-local storage.
3665 2002-09-30 Nathan Sidwell <nathan@codesourcery.com>
3667 * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
3670 2002-09-30 Steve Ellcey <sje@cup.hp.com>
3672 * class.c (build_vtbl_initializer): Add cast.
3673 (add_vcall_offset_vtbl_entries_1):
3674 Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.
3676 2002-09-30 Mark Mitchell <mark@codesourcery.com>
3678 * class.c (walk_subobject_offsets): Correct the calculation of
3679 offsets for virtual bases. Correct the counting of array
3681 (layout_nonempty_base_or_field): Simplify. Correct the
3682 calculation of offsets to be propagated through the binfo
3684 (build_base_field): Avoid creating a FIELD_DECL for empty bases.
3685 Add the FIELD_DECL to TYPE_FIELDS.
3686 (build_base_fields): Adjust accordingly.
3687 (layout_virtual_bases): Use build_base_field.
3688 (end_of_class): Return a tree, not an integer.
3689 (warn_about_ambiguous_direct_bases): Rename to ...
3690 (warn_about_ambiguous_bases): ... this.
3691 (include_empty_classes): New function.
3692 (layout_class_type): Create an alternative version of the type to
3693 be used when as a base class type. Do not call
3694 finish_record_layout until we are done laying out the class.
3695 * cp-tree.h (lang_type_class): Remove size, size_unit. Add
3697 (CLASSTYPE_SIZE): Reimplement.
3698 (CLASSTYPE_SIZE_UNIT): Likewise.
3699 (CLASSTYPE_ALIGN): Likweise.
3700 (CLASSTYPE_USER_ALIGN): Likewise.
3701 (CLASSTYPE_AS_BASE): New macro.
3702 (DECL_INITIALIZED_P): Likewise.
3703 (extract_init): Remove prototype.
3704 (build_forced_zero_init): Rename to ...
3705 (build_zero_init): ... this.
3706 (force_store_init_value): Remove.
3707 * decl.c (obscure_complex_init): Remove.
3708 (duplicate_decls): Copy DECL_INITIALIZED_P.
3709 (check_initializer): Do not leave junk in DECL_INITIAL.
3710 (cp_finish_decl): Handle zero-initialization of entities with
3711 static storage duration.
3712 * expr.c (extract_init): Remove.
3713 * init.c (build_forced_zero_init): Remove.
3714 (build_zero_init): New function.
3715 (build_default_init): Use it.
3716 (build_field_list): Skip FIELD_DECLs for base subobjects.
3717 (push_base_cleanups): Likewise.
3718 * method.c (do_build_assign_ref): Likewise.
3719 (synthesize_exception_spec): Likewise.
3720 * pt.c (tsubst_decl): Clear DECL_INITIALIZED_P.
3721 (regenerate_decl_from_template): To not set DECL_INITIAL for a
3722 static data member whose initialization took place in its class.
3723 (instantiate_decl): Do not pass an initializer to cp_finish_decl
3725 * search.c (dfs_push_decls): Skip FIELD_DECLs for base subobjects.
3726 (dfs_unuse_fields): Likewise.
3727 * tree.c (pod_type_p): Handle error_mark_node.
3728 (zero_init_p): Likewise.
3729 * typeck.c (lookup_anon_field): Skip FIELD_DECLs for base
3731 * typeck2.c (store_init_value): Remove #if 0'd code.
3732 (force_store_init_value): Remove.
3733 (process_init_constructor): Use build_zero_init.
3735 2002-09-29 Nathan Sidwell <nathan@codesourcery.com>
3738 * rtti.c (unemitted_tinfo_decl_p): Check it has a field.
3740 2002-09-29 Kazu Hirata <kazu@cs.umass.edu>
3742 * cp-tree.h: Fix comment typos.
3746 2002-09-25 Mark Mitchell <mark@codesourcery.com>
3748 * cp/class.c (contains_empty_class_p): New method.
3749 (walk_subobject_offsets): Correct computation of field offset.
3750 (layout_empty_base): Correct placement of emtpy base classes.
3751 (layout_class_type): Warn about ABI changes.
3753 2002-09-23 Mark Mitchell <mark@codesourcery.com>
3755 * cp/class.c (layout_virtual_bases): Do not round the size of the
3756 type to a multiple of the alignment before laying out virtual bases.
3757 (layout_class_type): Correct handling of bit-fields that are wider
3758 than their type inside unions. Round the size of the type to a
3759 even number of bytes when computing the size without virtual
3761 * cp/cp-tree.h (abi_version_at_least): New macro.
3763 2002-09-21 Kazu Hirata <kazu@cs.umass.edu>
3765 * ChangeLog: Follow spelling conventions.
3766 * ChangeLog.2: Likewise.
3768 * class.c: Likewise.
3769 * cp-tree.h: Likewise.
3772 * decl2.c: Likewise.
3773 * except.c: Likewise.
3774 * friend.c: Likewise.
3775 * g++spec.c: Likewise.
3778 * mangle.c: Likewise.
3779 * method.c: Likewise.
3780 * operators.def: Likewise.
3781 * optimize.c: Likewise.
3784 * search.c: Likewise.
3785 * semantics.c: Likewise.
3788 * typeck.c: Likewise.
3790 2002-09-18 Devang Patel <dpatel@apple.com>
3792 * cp/cp-tree.h: New prototype for walk_vtabls().
3793 * cp/decl.c (walk_vtables_r): New function.
3794 (struct cp_binding_level): Add new members, namespaces,
3795 names_size and vtables.
3796 (add_decl_to_level): Add decl in namespaces or vtables
3797 chain, if conditions match.
3798 (walk_vtables): New function.
3799 (walk_namespaces_r): Travers separate namespace chain
3800 for namespace decls.
3801 (wrapup_globals_for_namespace): Use names_size instead
3803 * cp/decl2.c (finish_file): Use walk_vtables() instead of
3804 walk_globals() to walk vtable decls.
3806 2002-09-18 Nathan Sidwell <nathan@codesourcery.com>
3808 * decl.c (grokdeclarator): Use assert, not internal_error. Don't
3809 ICE with invalid pointers & references.
3811 2002-09-17 Zack Weinberg <zack@codesourcery.com>
3813 * Make-lang.in: Remove all references to the demangler.
3814 * cxxfilt.c: Moved to binutils.
3816 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
3819 * pt.c (tsubst_decl): Remove assert.
3821 Remove DR 295 implementation.
3822 * pt.c (check_cv_quals_for_unify): Disable function & method cases.
3823 * tree.c (cp_build_qualified_type_real): Likewise. Don't warn
3824 about ignoring volatile qualifiers.
3826 * search.c (lookup_member): Correct documentation.
3828 2002-09-16 Geoffrey Keating <geoffk@apple.com>
3830 * cp-tree.h (union lang_tree_node): Add chain_next option.
3832 2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
3834 * parse.y (parse_finish_call_expr): Check lookup_member result.
3837 * semantic.c (finish_asm_stmt): Fix operand/output_operands
3839 * typeck.c (c_expand_asm_operands): Protect from error_mark_node.
3841 2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
3844 * call.c (build_over_call): Convert this pointer for fns found by
3847 2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
3849 * ChangeLog: Follow spelling conventions.
3850 * ChangeLog.1: Likewise.
3852 2002-09-14 Nathan Sidwell <nathan@codesourcery.com>
3855 * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
3857 2002-09-14 Kazu Hirata <kazu@cs.umass.edu>
3859 * error.c: Fix comment formatting.
3860 * except.c: Likewise.
3862 * friend.c: Likewise.
3863 * g++spec.c: Likewise.
3866 * mangle.c: Likewise.
3867 * method.c: Likewise.
3868 * optimize.c: Likewise.
3871 * search.c: Likewise.
3872 * semantics.c: Likewise.
3875 * typeck.c: Likewise.
3876 * typeck2.c: Likewise.
3878 2002-09-13 Matt Austern <austern@apple.com>
3881 * cp/cp-tree.h, cp/tree.c: New function non_cast_lvalue_p.
3882 * cp/call.c: Change call-by-const-reference mechanism to use
3883 non_cast_lvalue_p when deciding whether the create a temporary.
3884 We need a temporary when passing, e.g. (long) x by const ref.
3886 2002-09-13 Nathan Sidwell <nathan@codesourcery.com>
3888 * pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
3890 2002-09-13 Kazu Hirata <kazu@cs.umass.edu>
3892 * decl.c: Fix comment formatting.
3893 * decl2.c: Likewise.
3895 2002-09-12 Kazu Hirata <kazu@cs.umass.edu>
3897 * call.c: Fix comment formatting.
3898 * class.c: Likewise.
3899 * cp-lang.c: Likewise.
3900 * cp-tree.h: Likewise.
3903 2002-09-11 Zack Weinberg <zack@codesourcery.com>
3905 * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c,
3906 and c++filt from cxxfilt.o + version.o + $(LIBDEPS).
3907 * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with
3908 minor adjustments (use version_string, eliminate yet another
3909 duplicate of xmalloc)
3911 2002-09-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3913 * cp-tree.h (require_complete_eh_spec_types): Add prototype.
3915 2002-09-05 Jason Merrill <jason@redhat.com>
3917 * typeck2.c (add_exception_specifier): Only pedwarn for an
3919 (require_complete_eh_spec_types): New fn.
3920 (cxx_incomplete_type_diagnostic): Also support pedwarning.
3921 * typeck.c (complete_type_or_diagnostic): Likewise.
3922 * call.c (build_call): Call require_complete_eh_spec_types.
3923 * rtti.c (get_pseudo_ti_desc): Give an error rather than aborting
3924 on an incomplete type.
3926 2002-09-04 Jakub Jelinek <jakub@redhat.com>
3928 * decl.c (start_cleanup_fn): Clear interface_only before
3929 start_function, restore it afterwards.
3931 2002-09-02 Nathan Sidwell <nathan@codesourcery.com>
3933 * cp-tree.h (finish_builtin_type): Remove.
3934 * decl2.c (finish_builtin_type): Move to common code.
3935 * decl.c (build_ptrmemfunc_type): Adjust.
3936 * rtti.c (create_pseudo_type_info): Adjust.
3937 (create_tinfo_types): Adjust.
3939 2002-08-31 Jason Merrill <jason@redhat.com>
3941 * cp-lang.c (cp_expr_size): Allow initialization from a
3944 2002-08-30 Richard Henderson <rth@redhat.com>
3947 * tree.c: Include target.h.
3948 (cp_cannot_inline_tree_fn): Don't auto-inline functions that
3950 * Makefile.in (tree.o): Update.
3952 2002-08-27 Mark Mitchell <mark@codesourcery.com>
3954 * class.c (layout_virtual_bases): Warn about bugs in G++ that
3955 result in incorrect object layouts.
3956 (layout_class_type): Likewise.
3958 2002-08-24 Matt Austern <austern@apple.com>
3960 * tree.c (lvalue_p_1): Add argument for whether casts of lvalues
3962 (real_lvalue_p): Update caller.
3964 (non_cast_lvalue_or_else): New.
3965 * tree.h: Declare it.
3966 * typeck.c (build_unary_op): Use non_cast_lvalue_or_else.
3968 2002-08-22 Mark Mitchell <mark@codesourcery.com>
3970 * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR
3971 and COND_EXPR specially; fix error message output.
3973 2002-08-22 Jason Merrill <jason@redhat.com>
3975 * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR.
3976 * semantics.c (nullify_returns_r): Likewise.
3978 2002-08-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
3981 * typeck.c (finish_class_member_access_expr): Diagnose cases where
3982 name lookup finds nothing.
3984 2002-08-15 Jason Merrill <jason@redhat.com>
3986 * semantics.c (finish_then_clause): Remove redundant assignment.
3987 (finish_if_stmt, begin_switch_stmt, finish_switch_stmt): Move the
3988 extra binding level outside the if/switch statement.
3989 (finish_while_cond, finish_for_cond): Rewrite complex condition
3992 2002-08-15 Alexandre Oliva <aoliva@redhat.com>
3994 * parse.y (sizeof, alignof, typeof): New non-terminals to
3995 increment skip_evaluation. Replace terminals with them and
3996 decrement skip_evaluation at the end of rules using them.
3997 * decl2.c (mark_used): Don't assemble_external if
3998 skipping evaluation.
4000 2002-08-15 Gabriel Dos Reis <gdr@nerim.net>
4003 * parse.y (parse_finish_call_expr): Handle incomplete
4004 type used to name a scope.
4006 2002-08-15 Nathan Sidwell <nathan@codesourcery.com>
4009 * typeck.c (build_unary_op): Fold offsetof idiom. Fixes
4010 regression caused by my 2002-08-08 patch.
4012 2002-08-13 Mark Mitchell <mark@codesourcery.com>
4014 * decl.c (pushdecl_class_level): Honor requests to bind names to
4017 2002-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4019 * decl2.c (build_call_from_tree): Fix uninitialized variable.
4020 * parse.y (parse_finish_call_expr): Likewise.
4021 * repo.c (old_args, old_dir, old_main): Const-ify.
4023 2002-08-11 Gabriel Dos Reis <gdr@nerim.net>
4025 * decl.c (duplicate_decls): Replace DECL_SOURCE_FILE
4026 DECL_SOURCE_LINE with DECL_SOURCE_LOCATION.
4027 * optimize.c (maybe_clone_body): Likewise.
4028 * pt.c (tsubst_enum): Likewise.
4029 (lookup_template_class): Likewise.
4030 * tree.c (cp_copy_res_decl_for_inlining): Likewise.