OSDN Git Service

e5940ffe6148d6d6cc6b7cb8656b1c4456110c7b
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2003-04-22  Mark Mitchell  <mark@codesourcery.com>
2
3         * rtti.c (throw_bad_typeid): Use build_cxx_call.
4
5 2003-04-21  Mark Mitchell  <mark@codesourcery.com>
6
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
13         fact.
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.
22
23 2003-04-21  Nathan Sidwell  <nathan@codesourcery.com>
24
25         PR c++/9881
26         * typeck.c (build_unary_op): Fold all COMPONENT_REF addr
27         expressions. Reverts my 2002-08-08 patch.
28         
29         * typeck.c (comp_ptr_ttypes_real): Swap final && operands for
30         cheaper early exit.
31
32 2003-04-20  Nathan Sidwell  <nathan@codesourcery.com>
33
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
38         locus.
39         (finish_file): Set line numbers to past EOF for synthesized
40         functions.
41
42 2003-04-20  Nathan Sidwell  <nathan@codesourcery.com>
43
44         PR c++/10405
45         * search.c (lookup_field_1): Final scan goes backwards for
46         types, forwards for non-types.
47
48 2003-04-17  Roger Sayle  <roger@eyesopen.com>
49
50         PR c/10375
51         * decl.c (duplicate_decls): Preserve "const", "noreturn" and
52         "nothrow" function attributes.
53
54 2003-04-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
55
56         PR c++/10347
57         * pt.c (type_dependent_expression_p): Handle array new.
58
59 2003-04-15  Mark Mitchell  <mark@codesourcery.com>
60
61         PR c++/10381
62         * parser.c (cp_parser_primary_expression): Reorganize logic for
63         dealing with name lookup failures.
64
65 2003-04-15  Jason Merrill  <jason@redhat.com>
66
67         * decl2.c (mark_used): Don't instantiate anything if
68         skip_evaluation.
69
70 2003-04-14  Ziemowit Laski  <zlaski@apple.com>
71
72         * tree.c (build_cplus_array_type_1): Do not call
73         uses_template_parms() on a NULL index_type.
74
75 2003-04-13  Roger Sayle  <roger@eyesopen.com>
76
77         * decl.c (duplicate_decls): Preserve pure and malloc attributes.
78
79 2003-04-12  Mark Mitchell  <mark@codesourcery.com>
80
81         PR c++/10300
82         * init.c (build_new_1): Reorganize.
83
84 2003-04-12  Zack Weinberg  <zack@codesourcery.com>
85
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.
97
98 2003-04-12  Zack Weinberg  <zack@codesourcery.com>
99
100         * call.c (print_z_candidates): Use gcc_gettext_width, not
101         strlen, to determine how much padding to use.
102
103 2003-04-10  Zack Weinberg  <zack@codesourcery.com>
104
105         * decl.c: Update all calls to shadow_warning.
106
107 2003-04-10  Mark Mitchell  <mark@codesourcery.com>
108
109         * class.c (layout_class_type): Correct handling for overlong
110         bit-fields whose width is the same as an integer type.
111
112 2003-04-06  Zack Weinberg   <zack@codesourcery.com>
113
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.
117
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.
125
126 2003-04-06  Zack Weinberg   <zack@codesourcery.com>
127
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
132         through gettext.
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
137         print_z_candidate.
138
139         * Make-lang.in (cp/call.o): Update dependencies.
140
141 2003-04-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
142
143         * decl.c (set_current_binding_level): Delete, revert last change.
144         (current_binding_level): Modify to allow it as as lvalue.
145
146 2003-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
147
148         * name-lookup.c (find_binding): Pass appropriate pointer type to
149         POP_TIMEVAR_AND_RETURN.
150
151 2003-04-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
152
153         * Make-lang.in (cp-warn): Add $(STRICT_WARN).
154         * cp-tree.h: Don't insist on having GNUC.
155
156 2003-04-03  Jason Merrill  <jason@redhat.com>
157
158         * cvt.c (ocp_convert): Only abort if we try to convert an object
159         of TREE_ADDRESSABLE type.
160
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.
167
168 2003-04-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
169
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.
173
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.
178
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.
182
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__.
188
189         * decl.c (set_current_binding_level): New macro.  Use throughout
190         when setting the current binding level.
191
192         * cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma
193         in enum.
194         * method.c (mangling_flags): Likewise.
195
196         * cp-tree.h (lang_type_header): Add __extension__ and use
197         CHAR_BITFIELD for members.
198
199 2003-04-02  Geoffrey Keating  <geoffk@apple.com>
200
201         PR other/9274
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.
207
208 2003-04-01  Andrew Pinski  <pinskia@physics.uc.edu>
209
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.
216
217 2003-03-31  Jason Merrill  <jason@redhat.com>
218
219         PR java/10145
220         * class.c (check_field_decl): Don't set DECL_ALIGN.
221
222 2003-03-30  Mark Mitchell  <mark@codesourcery.com>
223
224         PR c++/7647
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.
228
229 2003-03-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
230
231         * Make-lang.in (cp/name-lookup.o): Add more dependencies.
232
233 2003-03-30  Gabriel Dos Reis <gdr@integrable-solutions.net>
234
235         * cp-tree.h (binding_for_name: Move to name-lookup.h  Adjust
236         prototype.
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"
261         member declaration.
262         (BINDING_SCOPE): Adjust definition.
263         (BINDING_HAS_LEVEL_P): Remove.
264
265 2003-03-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
266
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
287
288 2003-03-28  Jason Merrill  <jason@redhat.com>
289
290         PR c++/10245
291         * cvt.c (force_rvalue): New fn.
292         * call.c (build_conditional_expr): Use it.
293         * cp-tree.h: Declare it.
294
295 2003-03-28  Mike Stump  <mrs@apple.com>
296
297         * error.c (dump_expr): Add 0x to printed hex numbers to make
298         output match source code better.
299
300 2003-03-28  Mark Mitchell  <mark@codesourcery.com>
301
302         PR c++/10218
303         * decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class
304         definitions.
305
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
310         initializations.
311
312 2003-03-28  Nathan Sidwell  <nathan@codesourcery.com>
313
314         PR c++/10047
315         * decl2.c (finish_file): Don't warn about explicitly instantiated
316         inline decls.
317
318 2003-03-27  Nathan Sidwell  <nathan@codesourcery.com>
319
320         PR c++/10224
321         * pt.c (lookup_template_class): Only check instantiated args if
322         they do not contain template parameters.
323
324 2003-03-27  Nathan Sidwell  <nathan@codesourcery.com>
325
326         PR c++/10158
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.
331
332 2003-03-25  Jason Merrill  <jason@redhat.com>
333
334         * call.c (print_z_candidate): Change name of first arg to msgid.
335         (joust): Add comment for translators.
336
337 2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
338
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.
342
343 2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
344
345         PR c++/10119
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.
352
353 2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
354
355         PR c++/10026
356         * decl2.c (arg_assoc_type) <ERROR_MARK>: Don't die.
357
358 2003-03-23  Mark Mitchell  <mark@codesourcery.com>
359
360         PR c++/7086
361         * typeck.c (cxx_mark_addressable):  Adjust call to
362         gen_mem_addressof or put_var_into_stack.
363
364 2003-03-22  Nathan Sidwell  <nathan@codesourcery.com>
365
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,
374         TREE_READONLY.
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
383         instantiated args.
384
385 2003-03-21  Zack Weinberg  <zack@codesourcery.com>
386
387         * decl.c: Update calls to shadow_warning.
388
389 2003-03-21  Nathan Sidwell  <nathan@codesourcery.com>
390
391         PR c++/9898
392         * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'.
393         (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call.
394
395 2003-03-20  Mark Mitchell  <mark@codesourcery.com>
396
397         * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
398         friends.
399         * cp/pt.c (instantiate_class_template): Fix formatting.
400
401 2003-03-14  Matt Austern  <austern@apple.com>
402
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.
414
415 2003-03-19  Nathanael Nerode  <neroden@gcc.gnu.org>
416
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
419         return statements.
420
421 2003-03-19  Jason Merrill  <jason@redhat.com>
422
423         PR c++/8316, c++/9315, c++/10136
424         * call.c (print_z_candidate): Split out from...
425         (print_z_candidiates): ...here.
426         (joust): Use it.
427
428 2003-03-17  Roger Sayle  <roger@eyesopen.com>
429
430         PR c++/10031
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.
434
435 2003-03-17  Jason Merrill  <jason@redhat.com>
436
437         PR c++/10091
438         * typeck.c (build_class_member_access_expr): Compare
439         TYPE_MAIN_VARIANTs.
440
441 2003-03-17  Mark Mitchell  <mark@codesourcery.com>
442
443         PR c++/9639
444         * parser.c (cp_parser_declarator_id): Clear parser->scope.
445
446 2003-03-16  Jason Merrill  <jason@redhat.com>
447
448         PR c++/9993
449         * decl.c (finish_function): Only allow the NRVO to use variables
450         declared at function scope.
451
452 2003-03-17  Andreas Jaeger  <aj@suse.de>
453
454         * Make-lang.in (cp/TAGS): Remove.
455
456 2003-03-16  Nathan Sidwell  <nathan@codesourcery.com>
457
458         PR c++/9629
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.
467
468 2003-03-16   Gabriel Dos Reis <gdr@integrable-solutions.net>
469
470         * decl.c (binding_for_name): Fix initialization thinko.
471
472 2003-03-15  Gabriel Dos Reis <gdr@integrable-solutions.net>
473
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.
529
530 2003-03-15  Roger Sayle  <roger@eyesopen.com>
531
532         * tree.c (count_functions): Fix whitespace.
533
534 2003-03-15  Neil Booth  <neil@daikokuya.co.uk>
535
536         * Make-lang.in: Update.
537
538 2003-03-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
539
540         PR c++/6440
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
545         specialized.
546
547 2003-03-13  Jason Merrill  <jason@redhat.com>
548
549         PR c++/9420
550         * search.c (lookup_conversions): Call complete_type here.
551         * call.c (implicit_conversion): Not here.
552
553 2003-03-13  Mark Mitchell  <mark@codesourcery.com>
554
555         * decl2.c (do_nonmember_using_decl): Correct handling of
556         simultaneous type/non-type bindings.
557
558         * call.c (initialize_reference): Remove bogus assertion.
559         * decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09.
560
561 2003-03-12  Andrew Lewycky  <andrew@mxc.ca>
562
563         PR c++/7050
564         * expr.c (cxx_expand_expr): Return const0_rtx for throw
565         expressions.
566
567 2003-03-11  Mark Mitchell  <mark@codesourcery.com>
568
569         PR c++/9474
570         * decl2.c (do_nonmember_using_decl): Do not call duplicate decls
571         to merge old and new declarations.
572
573 2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
574
575         * g++.1: Remove.
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.
580
581 2003-03-11  Mark Mitchell  <mark@codesourcery.com>
582
583         PR c++/9474
584         * decl2.c (do_nonmember_using_decl): Do not call duplicate decls
585         to merge old and new declarations.
586
587         PR c++/9924
588         * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins.
589
590 2003-03-11  Jason Merrill  <jason@redhat.com>
591
592         PR c++/9820
593         * search.c (lookup_member): Fix handling of functions in a class
594         being defined.
595
596 2003-03-11  Mark Mitchell  <mark@codesourcery.com>
597
598         PR c++/8700
599         * call.c (convert_class_to_reference): Adjust usage of
600         splice_viable.
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.
615
616 2003-03-11  Jason Merrill  <jason@redhat.com>
617
618         PR c++/8660
619         * decl2.c (check_classfn): A member template only matches a
620         member template.
621
622 2003-03-11  Neil Booth  <neil@daikokuya.co.uk>
623
624         * Make-lang.in (CXX_C_OBJS): Update.
625         * lang-specs.h: Don't define __GNUG__ here.
626
627 2003-03-10  Mark Mitchell  <mark@codesourcery.com>
628
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.
640
641 2003-03-10  Devang Patel  <dpatel@apple.com>
642
643         PR c++/9394
644         * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG.
645
646 2003-03-10  Jason Merrill  <jason@redhat.com>
647
648         PR c++/9798
649         * decl.c (push_using_directive): Push before recursing.
650
651         PR c++/9868, c++/9524
652         * call.c (resolve_scoped_fn_name): Handle the case of a function
653         pointer member.
654
655         * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this'
656         argument in the pointer-to-member case.
657
658 2003-03-09  Mark Mitchell  <mark@codesourcery.com>
659
660         PR c++/9373
661         * cp-lang.c (cxx_get_alias_set): Use alias set zero for
662         pointers to member functions.
663
664         PR c++/8534
665         * decl.c (build_ptrmemfunc_type): Do not allow default arugments
666         in pointer-to-member-function types.
667
668 2003-03-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
669
670         * expr.c (cplus_expand_constant): Use C90 prototype style.
671         (cxx_expand_expr): Likewise.
672
673 2003-03-09  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
674
675         PR c++/9970
676         * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual
677         functions.
678
679 2003-03-08  Geoffrey Keating  <geoffk@apple.com>
680
681         * lang-specs.h (c++-header): Change .pch to .gch.
682
683 2003-03-08  Neil Booth  <neil@daikokuya.co.uk>
684
685         * cp-tree.h (cxx_init): Update prototype.
686         * lex.c (cxx_init): Similarly.
687
688 2003-03-08  Mark Mitchell  <mark@codesourcery.com>
689
690         PR c++/9823
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.
697
698         PR c++/9809
699         * call.c (add_function_candidate): Skip builtin fuctions that have
700         not yet been declared.
701
702         PR c++/9982
703         * init.c (build_new_1): Correct logic for determining whether or
704         not to use an array cookie.
705
706         PR c++/9524
707         * parser.c (cp_parser_postfix_expression): Call
708         finish_non_static_data_member, even when processing_template_decl.
709
710         PR c++/9912
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.
719
720 2003-03-07  Mark Mitchell  <mark@codesourcery.com>
721
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
726         rvalues.
727         * cp-tree.h (make_temporary_var_for_ref_to_temp): Change
728         prototype.
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.
733
734 2003-03-07  Gabriel Dos Reis  <gdr@integrable-solutions.net>
735
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.
763
764 2003-03-06  Mark Mitchell  <mark@codesourcery.com>
765
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
770         sequence.
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.
774
775 2003-03-07  Gabriel Dos Reis  <gdr@integrable-solutions.net>
776
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.
835
836 2003-03-06  Mark Mitchell  <mark@codesourcery.com>
837
838         PR c++/9965
839         * call.c (reference_binding): Add ref_is_var parameter.
840         (implicit_conversion): Adjust call to reference_binding.
841         (initialize_reference): Likewise.
842
843         PR c++/9400
844         * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
845         PARM_DECLs.
846
847         PR c++/9791
848         * class.c (get_basefndecls): Use lookup_fnfields_1.
849
850 2003-03-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
851
852         PR c++/9188
853         * parser.c (cp_parser_type_parameter): Remove redundant `expect'
854         in error message.
855         (cp_parser_single_declaration): Likewise.
856
857 2003-03-05  Jason Merrill  <jason@redhat.com>
858
859         PR c++/9440
860         * call.c (build_conditional_expr): Use convert rather than an
861         explicit NOP_EXPR.
862
863 2003-03-02  Matt Austern  <austern@apple.com>
864
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
872         namespace.
873
874 2003-03-05  Mark Mitchell  <mark@codesourcery.com>
875
876         * class.c (end_of_class): Correct thinko.
877
878 2003-03-04  Nathanael Nerode  <neroden@gcc.gnu.org>
879
880         * config-lang.in: Replace ${libstdcxx_version} by its value.
881
882 2003-03-04  Gabriel Dos Reis <gdr@integrable-solutions.net>
883
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
889         C++ bindings.
890         (maybe_push_to_top_level): Adjust local variable type.
891         (pop_from_top_level): Likewise.
892
893 2003-03-04  Tom Tromey  <tromey@redhat.com>
894
895         * Make-lang.in (c++.tags): New target.
896
897 2003-03-04  Neil Booth  <neil@daikokuya.co.uk>
898
899         * Make-lang.in: Update.
900
901 2003-03-03  Jason Merrill  <jason@redhat.com>
902
903         * decl.c (finish_enum): Do set the type in a template. Simplify.
904         * pt.c (tsubst_enum, tsubst_copy): Revert last patch.
905
906 2003-03-03  Mark Mitchell  <mark@codesourcery.com>
907
908         PR c++/9878
909         * call.c (convert_class_to_reference): Correct conversion
910         sequences.
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
932         build_nop.
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.
940         Use build_nop.
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.
954
955 2003-03-03  Jason Merrill  <jason@redhat.com>
956
957         * decl.c (start_function): Clear DECL_NUM_STMTS.
958
959         * class.c (get_vtable_decl): Use vtbl_type_node.
960         (build_primary_vtable): Check for it.
961
962 2003-03-02  Aldy Hernandez  <aldyh@redhat.com>
963
964         * decl.c (check_initializer): Check for vector_opaque_p.
965
966 2003-03-02  Ashif Harji  <asharji@uwaterloo.ca>
967
968         * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to
969           invoke an external cpp during compilation.
970
971 2003-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
972
973         * decl.c (duplicate_decls): Convert use of warning_with_decl() to
974         that of warning().
975         (start_decl): Likewise.
976         (start_function): Likewise.
977
978 2003-03-01  Neil Booth  <neil@daikokuya.co.uk>
979
980         * Make-lang.in (CXX_C_OBJS): Update.
981
982 2003-02-28  Mark Mitchell  <mark@codesourcery.com>
983
984         PR c++/9892
985         * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when
986         instantiating it.
987
988 2003-02-28  Aldy Hernandez  <aldyh@redhat.com>
989
990         * parser.c (cp_parser_init_declarator): Revert opaque
991         vector_opaque_p change.
992         Do not include target.h.
993
994 2003-02-28  Mark Mitchell  <mark@codesourcery.com>
995
996         PR c++/9879
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
1000         calls.
1001         (build_default_init): Add nelts parameter.  Adjust calls to
1002         build_zero_init.
1003         (build_new_1): Adjust call to build_default_init.
1004         * typeck2.c (process_init_constructor): Adjust call to build_zero_init.
1005
1006 2003-02-26  Devang Patel  <dpatel@apple.com>
1007
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.
1014
1015 2003-02-25  Mark Mitchell  <mark@codesourcery.com>
1016
1017         PR c++/9683
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.
1022
1023 2003-02-24 Gabriel Dos Reis  <gdr@integrable-solutions.net>
1024
1025         * decl.c (add_binding): Time TV_NAME_LOOKUP.
1026         (push_class_binding): Likewise.
1027         (set_namespace_binding): Likewise.
1028
1029 2003-02-24  Mark Mitchell  <mark@codesourcery.com>
1030
1031         PR c++/9836
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.
1036
1037 2003-02-24  Jeffrey D. Oldham  <oldham@codesourcery.com>
1038
1039         PR c++/9778
1040         * pt.c (tsubst_copy_and_build): For a templated function inside a
1041         scope, process template arguments.
1042
1043 2003-02-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1044
1045         PR c++/9602
1046         * typeck2.c (abstract_virtuals_error): Don't check when
1047         TYPE is still template parameter dependent.
1048
1049 2003-02-23  Mark Mitchell  <mark@codesourcery.com>
1050
1051         PR c++/5333
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
1055         dependent types.
1056         (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE.
1057
1058 2003-02-21  Mark Mitchell  <mark@codesourcery.com>
1059
1060         PR c++/9749
1061         * decl.c (grokdeclarator): Do not allow parameters with variably
1062         modified types.
1063
1064 2003-02-21  Nathan Sidwell  <nathan@codesourcery.com>
1065
1066         * search.c (grow_bfs_bases): Remove. Fold into ...
1067         (bfs_walk): ... here, fix fencepost error. Fix merge lossage
1068         in previous patch.
1069
1070 2003-02-20  Mark Mitchell  <mark@codesourcery.com>
1071
1072         PR c++/9729
1073         * mangle.c (mangle_conv_op_name_for_type): Issue an error message
1074         when the G++ 3.2 ABI prevents correct compilation.
1075
1076 2003-02-20  Nathan Sidwell  <nathan@codesourcery.com>
1077
1078         Change base class access representation. Share virtual base
1079         binfos.
1080         * cp/call.c (build_special_member_call): Remove binfo_for_vbase
1081         call.
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
1113         parameter. Adjust.
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):
1133         Delete.
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):
1137         Delete.
1138         (BINFO_DEPENDENT_BASE_P): New.
1139         (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
1140         index.
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
1152         copy_base_binfos.
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.
1206
1207 2003-02-18  Zack Weinberg  <zack@codesourcery.com>
1208
1209         * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk.
1210         (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES
1211         vectors, for speed.
1212
1213 2003-02-18  Mark Mitchell  <mark@codesourcery.com>
1214
1215         PR c++/9704
1216         * class.c (layout_class_type): In the 3.2 ABI, take into account
1217         trailing bit fields when computing CLASSTYPE_SIZE_UNIT.
1218
1219 2003-02-18  Matt Austern <austern@apple.com>
1220
1221         * cp/cp-lang.c: Change lang hooks so that final_write_globals does
1222         nothing for C++.
1223         * cp/decl.c (wrapup_globals_for_namespace): Remove special
1224         handling of global namespace.
1225
1226 2003-02-18  Geoffrey Keating  <geoffk@apple.com>
1227
1228         * cp-tree.h (rid_to_yy): Delete.
1229         (C_RID_YYCODE): Delete.
1230         (finish_file): Delete redundant declaration.
1231
1232 2003-02-18  Jason Merrill  <jason@redhat.com>
1233
1234         PR c++/9623
1235         * decl.c (reshape_init): Don't mess with initializer labels.
1236
1237         PR c++/9485
1238         * parser.c (cp_parser_postfix_expression): Set idk properly for
1239         object->scope::member.
1240
1241 2003-02-18  Ben Elliston  <bje@redhat.com>
1242
1243         PR other/7350
1244         * decl.c (duplicate_decls): Fix typo in comment.
1245
1246 2003-02-17  Michael Elizabeth Chastain <mec@shout.net>
1247
1248         PR debug/9717
1249         * class.c (build_base_field): Mark fields for base classes with
1250         DECL_IGNORED_P.
1251
1252 2003-02-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1253
1254         PR c++/9457
1255         * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
1256         CONSTRUCTOR_ELTS only once.
1257
1258 2003-02-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1259
1260         PR c++/9459
1261         * error.c (dump_type_prefix): Handle TYPEOF_TYPE.
1262         (dump_type_suffix): Likewise.
1263
1264 2003-02-14  Nathan Sidwell  <nathan@codesourcery.com>
1265
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
1270         calls.
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.
1280
1281 2003-02-13  Gabriel Dos Reis <gdr@integrable-solutions.net>
1282
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.
1293
1294 2003-02-14   Andrew Pinski <pinskia@physics.uc.edu>
1295
1296         * decl.c: (define_label): Fix warning for return 0 instead of NULL.
1297
1298 2003-02-13  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1299
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.
1331
1332         * Make-lang.in (cp/decl.o): Add dependency on timevar.h
1333
1334 2003-02-12  Phil Edwards  <pme@gcc.gnu.org>
1335
1336         * decl.c (build_enumerator):  Remove unneeded test.
1337
1338 2003-02-09  Dan Nicolaescu  <dann@ics.uci.edu>
1339
1340         * cp-tree.h (struct lang_type_header): Make all fields unsigned
1341         char.
1342
1343 2003-02-03  Mark Mitchell  <mark@codesourcery.com>
1344
1345         PR c++/7129
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
1354         usage.
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 >?=.
1362
1363 2003-02-01  Richard Sandiford  <rsandifo@redhat.com>
1364
1365         * typeck.c (build_indirect_ref): Don't check flag_volatile.
1366
1367 2003-01-31  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1368
1369         PR c++/8849
1370         * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL.
1371
1372 2003-01-31  Nathan Sidwell  <nathan@codesourcery.com>
1373
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.
1378
1379 2003-01-30  Geoffrey Keating  <geoffk@apple.com>
1380
1381         * cp/Make-lang.in: Remove -Wno-error from cp/decl.o.
1382
1383 2003-01-30  Mark Mitchell  <mark@codesourcery.com>
1384
1385         * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY
1386         for class types.
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
1399         for class types.
1400
1401 2003-01-29  Mark Mitchell  <mark@codesourcery.com>
1402
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
1407         bool.
1408         (currently_open_class): Use same_type_p, not pointer equality.
1409         (push_nested_class): Adjust calls to pushclass, remove modify
1410         parameter.
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.
1420         (tsubst): 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
1428         duplicate_decls.
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
1437         build_opfncall.
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
1449         constant.
1450         (cp_parser_postfix_expression): Reject conversions to non-integral
1451         types in constant-expressions.  Neither are increments or
1452         decrements.
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
1475         push_nested_class.
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.
1484         Robustify.
1485         (resolve_typename_type): New function.
1486         * semantics.c (finish_call_expr): Use build_new_op, not
1487         build_opfncall.
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.
1497
1498 2003-01-29  Fariborz Jahanian  <fjahanian@apple.com>
1499
1500         * pt.c (last_pending_template) Declare GTY().
1501
1502 2003-01-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1503
1504         PR c++/8591
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.
1508
1509 2003-01-28  Nathan Sidwell  <nathan@codesourcery.com>
1510
1511         PR c++/9437
1512         * pt.c (unify): Don't unify '*T' with 'U C::*'.
1513
1514         PR c++/3902
1515         * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
1516         inside a declarator.
1517
1518 2003-01-27  Nathan Sidwell  <nathan@codesourcery.com>
1519
1520         * class.c (update_vtable_entry_for_fn): Add index parameter.
1521         Generate vcall thunk for covariant overriding from a virtual
1522         primary base.
1523         (dfs_modify_vtables): Adjust.
1524
1525 2003-01-25  Nathan Sidwell  <nathan@codesourcery.com>
1526
1527         PR c++/9403
1528         * parser.c (cp_parser_class_or_namespace_name): Reject duplicate
1529         template keyword.
1530         (cp_parser_base_specifier): Look for and consume a
1531         TEMPLATE keyword. Replace switch with array index.
1532
1533         PR c++/795
1534         * semantics.c (finish_non_static_data_member): Remember the
1535         field's type even in a template.
1536
1537         PR c++/9415
1538         * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are
1539         already scoped.
1540
1541         PR c++/8545
1542         * parser.c (cp_parser_cast_expression): Be more tentative.
1543
1544 2003-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1545
1546         * cp-tree.h (flagged_type_tree_s): Remove.
1547         (check_for_new_type): Likewise.
1548         * typeck2.c (check_for_new_type): Likewise.
1549
1550 2003-01-23  Nathanael Nerode  <neroden@gcc.gnu.org>
1551
1552         * dump.c: ANSIfy function declarations and definitions.
1553
1554         * cp-tree.h, decl.h: Get rid of PARAMS.  Again.
1555
1556 2003-01-22  Mark Mitchell  <mark@codesourcery.com>
1557
1558         PR c++/9354
1559         * init.c (build_new): Set the type of the new-expression, even
1560         when processing_templte_decl.
1561
1562         PR c++/9216
1563         * parser.c (cp_parser_primary_expression): Improve error message
1564         for templates used in an expression context.
1565
1566         PR c++/8696
1567         * parser.c (cp_parser_decl_specifier_seq): Commit to tentative
1568         parse when encountering "typedef".
1569
1570 2003-01-22  Nathanael Nerode  <neroden@gcc.gnu.org>
1571
1572         * class.c, parser.c: ANSIfy function definitions and declarations.
1573
1574 2003-01-22  Mark Mitchell  <mark@codesourcery.com>
1575
1576         PR c++/9328
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.
1580
1581         PR c++/9298
1582         * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New
1583         function.
1584         (cp_parser_expression_statement): Use it.
1585         (cp_parser_explicit_instantiation): Likewise.
1586         * pt.c (do_decl_instantiation): Improve error handling logic.
1587
1588 2003-01-22  Mark Mitchell  <mark@codesourcery.com>
1589
1590         PR c++/9384
1591         * parser.c (cp_parser_using_declaration): Issue error messages
1592         about name resolution failures here.
1593
1594         PR c++/9388
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.
1621
1622         PR c++/9285
1623         PR c++/9294
1624         * parser.c (cp_parser_simple_declaration): Return quickly when
1625         encountering errors.
1626
1627 2003-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1628
1629         Make-lang.in (cp/decl.o-warn): Add -Wno-error.
1630
1631 2003-01-17  Jason Merrill  <jason@redhat.com>
1632
1633         PR c++/9167, c++/9358
1634         * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
1635
1636 2003-01-17  Jason Merrill  <jason@redhat.com>
1637
1638         PR c++/9342
1639         * call.c (build_conditional_expr): Always do lvalue-rvalue
1640         conversion.
1641
1642 2003-01-17  Mark Mitchell  <mark@codesourcery.com>
1643
1644         PR c++/9294
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.
1656
1657         PR c++/9272
1658         * parser.c (cp_parser_constructor_declarator_p): Do not assume
1659         that a constructor cannot be declared outside of its own class.
1660
1661         * parser.c (cp_parser_resolve_typename_type): If the scope cannot
1662         be resolved, neither can the qualified name.
1663
1664         * rtti.c (get_pseudo_ti_desc): Fix thinko.
1665
1666 2003-01-16  Jason Merrill  <jason@redhat.com>
1667
1668         PR c++/8564
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.
1674
1675 2003-01-16  Jeffrey D. Oldham  <oldham@codesourcery.com>
1676
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.
1681
1682 2003-01-16  Mark Mitchell  <mark@codesourcery.com>
1683
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
1691         parameter.
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
1700         initializations.
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
1713         function scope.
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
1720         stuff.
1721
1722 2003-01-16  Nathan Sidwell  <nathan@codesourcery.com>
1723
1724         PR c++/9212
1725         * parser.c (cp_parser_direct_declarator): If accepting either
1726         abstract or named, the name must be an unqualified-id.
1727
1728 2003-01-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1729
1730         * class.c (layout_virtual_bases): Avoid signed/unsigned warning.
1731
1732 2003-01-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1733
1734         * decl2.c (check_classfn): Fix uninitialized warning.
1735         (build_anon_union_vars): Likewise.
1736         * pt.c (tsubst_copy): Likewise.
1737
1738 2003-01-14  Jeffrey D. Oldham  <oldham@codesourcery.com>
1739
1740         Further conform g++'s __vmi_class_type_info to the C++ ABI
1741         specification.
1742         * rtti.c (dfs_class_hint_mark): Do not set hints not specified by
1743         the specification.
1744         (class_hint_flags): Likewise.
1745
1746 2003-01-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1747
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
1777         functions.
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):
1791         Likewise.
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.
1818
1819 2003-01-13  Jason Merrill  <jason@redhat.com>
1820
1821         PR c++/8748
1822         * class.c (build_base_path): Take the address before calling save_expr.
1823
1824         * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
1825         all the ambiguous conversions are bad.
1826
1827         * class.c (maybe_warn_about_overly_private_class): Don't stop
1828         searching when we find a nonprivate method.
1829
1830         * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue.
1831
1832 2003-01-12  Mark Mitchell  <mark@codesourcery.com>
1833
1834         * cp-tree.h (get_arglist_len_in_bytes): Remove.
1835
1836         PR c++/9264
1837         * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
1838         typeame types more robustly.
1839
1840 2003-01-11  Phil Edwards  <pme@gcc.gnu.org>
1841
1842         * parser.c:  Fix comment typos.
1843
1844 2003-01-10  Mark Mitchell  <mark@codesourcery.com>
1845
1846         PR c++/9099
1847         * parser.c (cp_parser_scope_through_which_access_occurs): Handle
1848         an object_type which is not a class type.
1849
1850 2003-01-10  Geoffrey Keating  <geoffk@apple.com>
1851
1852         * parser.c (cp_parser_late_parsing_for_member): Don't cast to void.
1853         (cp_parser_late_parsing_default_args): Likewise.
1854
1855 2003-01-10  Nathanael Nerode  <neroden@gcc.gnu.org>
1856
1857         * cfns.gperf: ANSIfy function declarations.
1858         * cfns.h: Regenerate.
1859         * cp-tree.h: ANSIfy function declarations.
1860
1861 2003-01-10  Mark Mitchell  <mark@codesourcery.com>
1862
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.
1871
1872         PR c++/9128
1873         PR c++/9153
1874         PR c++/9171
1875         * parser.c (cp_parser_pre_parsed_nested_name_specifier): New
1876         function.
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
1883         possible.
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
1891         reference type.
1892         (build_typeid): Add comment.  Do not return an expression with
1893         reference type.
1894         * typeck.c (build_class_member_access_expr): Improve handling of
1895         conditionals and comma-expressions as objects.
1896
1897 2003-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
1898
1899         * cfns.gperf: ANSIfy function declarations.
1900         * cfns.h: Regenerate.
1901         * cp-tree.h: ANSIfy function declarations.
1902         * parser.c: ANSIfy function declarations & definitions.
1903
1904         * decl.c (bad_specifiers): Fix parameter order error I introduced.
1905
1906 2003-01-09  Geoffrey Keating  <geoffk@apple.com>
1907
1908         Merge from pch-branch:
1909
1910         2003-01-09  Geoffrey Keating  <geoffk@apple.com>
1911
1912         Merge to tag pch-merge-20030102:
1913
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
1918         token is read.
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.
1926
1927         2002-12-11  Geoffrey Keating  <geoffk@apple.com>
1928
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.
1947         * decl.c: Likewise.
1948         * decl2.c: Likewise.
1949         * init.c: Likewise.
1950         * lex.c: Likewise.
1951         * method.c: Likewise.
1952         * optimize.c: Likewise.
1953         * parse.y: Likewise.
1954         * pt.c: Likewise.
1955         * repo.c: Likewise.
1956         * search.c: Likewise.
1957         * semantics.c: Likewise.
1958         * spew.c: Likewise.
1959         * tree.c: Likewise.
1960
1961         * lang-specs.h: Remove comment.
1962
1963         2002-12-03  Geoffrey Keating  <geoffk@apple.com>
1964
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.
1968
1969         2002-11-19  Geoffrey Keating  <geoffk@apple.com>
1970
1971         * decl.c (anon_cnt): Mark to be saved for PCH.
1972
1973         2002-10-25  Geoffrey Keating  <geoffk@apple.com>
1974
1975         * lex.c  (init_reswords): Delete now-untrue comment.
1976         Allocate ridpointers using GGC.
1977
1978         2002-10-04  Geoffrey Keating  <geoffk@apple.com>
1979
1980         * cp-tree.h (union lang_decl_u2): Add tags to all fields.
1981
1982         * g++spec.c (lang_specific_driver): Don't include standard
1983         libraries in `added'.
1984
1985         2002-08-27  Geoffrey Keating  <geoffk@redhat.com>
1986
1987         * decl2.c (finish_file): Call c_common_write_pch.
1988         * Make-lang.in (CXX_C_OBJS): Add c-pch.o.
1989
1990         2002-08-17  Geoffrey Keating  <geoffk@redhat.com>
1991
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.
1995
1996 2003-01-09  Jakub Jelinek  <jakub@redhat.com>
1997
1998         * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs.
1999
2000 2003-01-09  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2001
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
2005         namespace scope.
2006
2007 2003-01-09  Jakub Jelinek  <jakub@redhat.com>
2008
2009         * decl.c (start_decl): Don't set DECL_COMMON for __thread variables.
2010
2011 2003-01-09  Christian Cornelssen  <ccorn@cs.tu-berlin.de>
2012
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".
2018
2019 2003-01-08  Jason Merrill  <jason@redhat.com>
2020
2021         * parser.c (cp_parser_primary_expression): See through explicitly
2022         scoped ALIAS_DECLs, too.
2023
2024 2003-01-08  Nathanael Nerode  <neroden@gcc.gnu.org>
2025
2026         * decl.c: Remove some #if 0 code.
2027
2028         * decl.c: ANSIfy function declarations.
2029
2030 2003-01-07  Mark Mitchell  <mark@codesourcery.com>
2031
2032         * parser.c (cp_parser_asm_definition): Correct handling of omitted
2033         operands.
2034
2035 2003-01-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2036
2037         PR c++/9030
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.
2049
2050 2003-01-07  Nathanael Nerode <neroden@gcc.gnu.org>
2051
2052         * tree.c: Delete bogus #if 0 code.
2053
2054 2003-01-07  Andreas Schwab  <schwab@suse.de>
2055
2056         * class.c (layout_class_type): Don't use
2057         PCC_BITFIELD_TYPE_MATTERS if not defined.
2058
2059 2003-01-06  Mark Mitchell  <mark@codesourcery.com>
2060
2061         PR c++/9165
2062         * decl2.c (build_cleanup): Mark the object as used.
2063
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.
2069
2070         * decl2.c (mark_used): Do not synthesize thunks.
2071
2072         * class.c (layout_class_type): Correct handling of unnamed
2073         bitfields wider than their types.
2074
2075         PR c++/9189
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
2079         parameter.
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
2089         arguments.
2090
2091 2003-01-06  Nathan Sidwell  <nathan@codesourcery.com>
2092
2093         PR c++/9109
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.
2108
2109 2003-01-05  Mark Mitchell  <mark@codesourcery.com>
2110
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.
2117
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.
2123
2124 2003-01-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2125
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.
2134
2135 2003-01-04  Mark Mitchell  <mark@codesourcery.com>
2136
2137         * method.c (use_thunk): Disable access control while building the
2138         body of the thunk.
2139
2140 2003-01-03  Nathanael Nerode  <neroden@gcc.gnu.org>
2141
2142         * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C
2143         front end.
2144
2145 2003-01-03  Matt Austern  <austern@apple.com>
2146
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
2159         we do the emission.
2160
2161 2003-01-02  Jason Merrill  <jason@redhat.com>
2162
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.
2167
2168         * call.c (convert_like_real): Call decl_constant_value for an
2169         IDENTITY_CONV even if there are no more conversions.
2170
2171         * cvt.c (build_up_reference): Don't push unnamed temps.
2172
2173         * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL.
2174
2175         * dump.c (cp_dump_tree): Don't try to dump class-specific fields
2176         for a backend struct.
2177
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.
2181
2182         * init.c (build_vec_delete_1): Pre-evaluate the base address.
2183
2184         * init.c (get_temp_regvar): Simplify logic.
2185
2186         * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if
2187         our replacement is a decl.
2188
2189         * decl.c (cp_make_fname_decl): Push the decls inside the
2190         outermost scope.
2191
2192 2003-01-03  Nathan Sidwell  <nathan@codesourcery.com>
2193
2194         PR c++/45, c++/3784
2195         * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be
2196         the same too.
2197
2198 2003-01-03  Graham Stott  <graham.stott@btinternet.com>
2199
2200         * parser.c (struct cp_parser): Add access_checks_lists field
2201         (cp_parser_simple_declaration): Use.
2202         (cp_parser_init_declarator): Likewise.
2203
2204 2003-01-02  Mark Mitchell  <mark@codesourcery.com>
2205
2206         * parser.c (cp_parser_declaration): Accept the __extension__
2207         keyword before the declaration.
2208
2209         PR c++/2843
2210         * parser.c (cp_parser_parameter_declaration): Allow attributes to
2211         appear after the declarator.
2212
2213         * call.c (build_new_method_call): Fix typo in message format
2214         string.
2215
2216 2003-01-02  Mark Mitchell  <mark@codesourcery.com>
2217
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.
2224
2225         * parser.c (cp_parser_sizeof_operand): Do not evaluate the
2226         expression.
2227
2228 2003-01-02  Steven Bosscher <s.bosscher@student.tudelft.nl>
2229
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.
2233
2234 2003-01-01  Neil Booth  <neil@daikokuya.co.uk>
2235
2236         * lex.c: Remove superfluous include of cpplib.h.
2237         (CONSTRAINT): Define without conditions.
2238         (init_cp_pragma): Use c_register_pragma.
2239
2240 2002-12-31  Neil Booth  <neil@daikokuya.co.uk>
2241
2242         * .cvsignore: Remove.
2243
2244 2002-12-31  Steven Bosscher  <s.bosscher@student.tudelft.nl>
2245
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
2251           copyright header.
2252         * lex.h: parse.y is dead, so don't mention it.  Also replace the
2253           copyright header with the default GNU copyright header.
2254
2255 2002-12-31  Mark Mitchell  <mark@codesourcery.com>
2256
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.
2277
2278         * parser.c (cp_parser_dependent_type_p): Fix thinko.
2279
2280 2002-12-31  Neil Booth  <neil@daikokuya.co.uk>
2281
2282         * .cvsignore: Update.
2283
2284 2002-12-31  Nathan Sidwell  <nathan@codesourcery.com>
2285
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.
2290
2291         * decl2.c (finish_file): Mark undefined inlines as extern.
2292
2293 2002-12-31  Mark Mitchell  <mark@codesourcery.com>
2294
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,
2305         sk_for.
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.
2325
2326 2002-12-31  Mark Mitchell  <mark@codesourcery.com>
2327
2328         PR c++/9112
2329         * parser.c (cp_parser_direct_declarator): Handle erroneous
2330         parenthesized declarators correctly.
2331
2332 2002-12-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2333
2334         * cp-tree.h (pending_lang_change): Declare.
2335
2336 2002-12-30  Mark Mitchell  <mark@codesourcery.com>
2337
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
2352         needed.
2353         (cp_parser_parse_definitely): Place free'd contexts on the free
2354         list.
2355
2356         * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change.
2357
2358 2002-12-30  David Edelsohn  <edelsohn@gnu.org>
2359
2360         * parser.c (cp_parser_parameter_declaration_clause): Treat system
2361         header as extern "C" if NO_IMPLICIT_EXTERN_C undefined.
2362
2363 2002-12-30  Nathanael Nerode  <neroden@gcc.gnu.org>
2364
2365         * config-lang.in, Make-lang.in, operators.def, cp-tree.def:
2366         GCC, not GNU CC.
2367
2368 2002-12-30  Mark Mitchell  <mark@codesourcery.com>
2369
2370         * parse.y: Remove.
2371         * spew.c: Likewise.
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.
2381         (yychar): Likewise.
2382         (lastiddecl): Likewise.
2383         (token_count): Likewise.
2384         (reduce_count): Likewise.
2385         (yyhook): 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.
2393         (yylex): Likewise.
2394         * semantics.c (finish_id_expr): Remove.
2395
2396         * decl.c (grokdeclarator): Diagnost "extern thread" and "static
2397         thread" correctly.
2398
2399 2002-12-30  Nathanael Nerode  <neroden@gcc.gnu.org>
2400
2401         * decl.c, decl2.c, decl.h:  GCC, not GNU CC.  This is the C++ front
2402         end, not the C front end.
2403
2404 2002-12-30  Nathan Sidwell  <nathan@codesourcery.com>
2405
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.
2421
2422         PR c++/9054
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.
2425
2426 2002-12-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2427
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):
2486         Likewise.
2487         (strip_underscore):  Change type from 'int' to 'bool'.
2488         (main): Use boolean constants.
2489
2490 2002-12-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2491
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.
2505
2506 2002-12-27  Mark Mitchell  <mark@codesourcery.com>
2507
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
2593         representations.
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
2603         here.
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.
2610         (yylval): Likewise.
2611         (make_reference_declarator): Remove error-generating code.
2612         (rid_to_yy): Remove.
2613         (cxx_init): Do not call init_spew.
2614         (yypring): Remove.
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
2628         test.
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
2644         specializations.
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
2651         context_class.
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.
2671
2672 2002-12-26  Nathan Sidwell  <nathan@codesourcery.com>
2673
2674         PR c++/4803
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.
2679
2680         PR c++/5116, c++/764
2681         * call.c (build_new_op): Make sure template class operands are
2682         instantiated.
2683
2684 2002-12-24  Nathan Sidwell  <nathan@codesourcery.com>
2685
2686         PR C++/7964
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.
2693
2694         PR c++/9053
2695         * decl.c (duplicate_decls): Templates may be disambiguated by
2696         return type.
2697
2698         PR c++/8702
2699         * decl2.c (check_classfn): Use lookup_fnfield_1. List all
2700         conversion operators on failure.
2701
2702 2002-12-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2703
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.
2728
2729 2002-12-22  Nathan Sidwell  <nathan@codesourcery.com>
2730
2731         PR c++/8572
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.
2737
2738 2002-12-22  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2739
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.
2743
2744 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
2745
2746         * ChangeLog: Fix a typo.
2747         * class.c: Fix comment typos.
2748         * cp-tree.h: Likewise.
2749
2750 2002-12-18  Jason Merrill  <jason@redhat.com>
2751
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.
2768
2769 2002-12-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2770
2771         PR c++/8099
2772         * friend.c (make_friend_class): Allow partial specialization
2773         when declaration is not a template friend.
2774
2775 2002-12-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2776
2777         PR c++/3663
2778         * pt.c (lookup_template_class): Copy TREE_PRIVATE and
2779         TREE_PROTECTED to created decl nodes.
2780
2781 2002-12-18  Mark Mitchell  <mark@codesourcery.com>
2782
2783         * class.c (build_base_field): Do not set DECL_PACKED on the
2784         FIELD_DECL.
2785
2786 2002-12-18  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2787
2788         * cp-tree.h (struct tree_srcloc): Use location_t.
2789         (SOURCE_LOCUS): New.
2790         (SRCLOC_FILE, SRCLOC_LINE): Adjust.
2791
2792 2002-12-17  Jason Merrill  <jason@redhat.com>
2793
2794         * decl.c (finish_function): Also complain about no return in
2795         templates.
2796         * semantics.c (finish_return_stmt): Also call check_return_expr in
2797         templates.
2798         * typeck.c (check_return_expr): In a template, just remember that we
2799         saw a return.
2800
2801 2002-12-16  Jason Merrill  <jason@redhat.com>
2802
2803         * semantics.c (simplify_aggr_init_exprs_r): Don't change the type
2804         of the CALL_EXPR.
2805
2806         * semantics.c (do_pushlevel): Call pushlevel after adding the
2807         SCOPE_STMT.
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.
2811
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
2814         function.
2815
2816 2002-12-14  Jason Merrill  <jason@redhat.com>
2817
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.
2825
2826 2002-12-13  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2827
2828         PR C++/8031
2829         * cvt.c (convert_to_pointer_force): Don't try comparing against
2830         erronous type.
2831
2832 2002-12-13  Geoffrey Keating  <geoffk@apple.com>
2833
2834         * cp-tree.h: Have the multiple-include guards around
2835         the entire file.
2836
2837 2002-12-10  David Edelsohn  <edelsohn@gnu.org>
2838
2839         * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos
2840         for SPEW_DEBUG.
2841         (snarf_method): Same.
2842         (snarf_defarg): Same.
2843
2844 2002-12-10  Mark Mitchell  <mark@codesourcery.com>
2845
2846         PR c++/8372
2847         * pt.c (tsubst_copy): Handle destructor names more correctly.
2848
2849 2002-12-10  Matt Austern   <austern@apple.com>
2850
2851         * cp-tree.h: get rid of needs_virtual_reinit bit.
2852
2853 2002-12-09  Mark Mitchell  <mark@codesourcery.com>
2854
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
2858         extension.
2859         * decl2.c (grokfield): Do not call digest_init when processing
2860         templates.
2861
2862 2002-12-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2863
2864         * error.c (dump_expr): Fix format specifier warning.
2865
2866 2002-12-04  Geoffrey Keating  <geoffk@apple.com>
2867
2868         * class.c (finish_struct_1): Correct comment.
2869         * cp-tree.c (DECL_SORTED_FIELDS): Likewise.
2870
2871 2002-12-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2872
2873         PR C++/8799
2874         * error.c (dump_expr): Don't ever try to dump a non-existent
2875         expression.
2876
2877 2002-12-03  Nathan Sidwell  <nathan@codesourcery.com>
2878
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.
2907
2908 2002-12-03  Jason Merrill  <jason@redhat.com>
2909
2910         PR c++/8674
2911         * call.c (build_over_call): Check specifically for TARGET_EXPR
2912         when eliding.
2913
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):
2918         Remove.
2919         * cp-tree.h (ADDR_IS_INVISIREF): Remove.
2920         * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code.
2921
2922         * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on
2923         an ambiguous conversion.
2924
2925 2002-12-03  Mark Mitchell  <mark@codesourcery.com>
2926
2927         PR c++/8688
2928         * decl.c (reshape_init): Handle erroneous initializers.
2929
2930 2002-12-02  Mark Mitchell  <mark@codesourcery.com>
2931
2932         PR c++/8720
2933         * spew.c (remove_last_token): Make sure that last_chunk is set
2934         correctly.
2935
2936         PR c++/8615
2937         * error.c (dump_expr): Handle character constants with
2938         TREE_OVERFLOW set.
2939
2940 2002-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2941
2942         DR 180
2943         * decl.c (grokdeclarator): Require class-key for all friend class.
2944         Output the correct type and context in the error message.
2945
2946 2002-12-01  Mark Mitchell  <mark@codesourcery.com>
2947
2948         PR c++/5919
2949         * pt.c (unify): Use variably_modified_type_p to test validity of
2950         template argument types.
2951
2952         PR c++/8727
2953         * cp-tree.h (lang_type_class): Add typeinfo_var.
2954         (CLASSTYPE_TYPEINFO_VAR): New macro.
2955         * rtti.c (get_tinfo_decl): Use it.
2956
2957         PR c++/8663
2958         * init.c (expand_member_init): Always get the main variant of a
2959         base class.
2960
2961 2002-12-01  Mark Mitchell  <mark@codesourcery.com>
2962
2963         PR c++/8332
2964         PR c++/8493
2965         * decl.c (cxx_init_decl_processing): Use size_type_node, not
2966         c_size_type_node.
2967         * decl2.c (coerce_new_type): Likewise.
2968         * except.c (do_allocate_exception): Likewise.
2969
2970 2002-11-30  Zack Weinberg  <zack@codesourcery.com>
2971
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.
2978
2979 2002-11-30  Mark Mitchell  <mark@codesourcery.com>
2980
2981         PR c++/8227
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.
2986
2987         PR c++/8214
2988         * typeck.c (convert_for_assignment): Do not use
2989         decl_constant_value on the operand.
2990
2991         PR c++/8511
2992         * pt.c (instantiate_decl): Handle template friends defined outside
2993         of the class correctly.
2994
2995 2002-11-29  Joe Buck <jbuck@synopsys.com>
2996
2997         * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
2998         anonymous structs.
2999
3000 2002-11-29  Mark Mitchell  <mark@codesourcery.com>
3001
3002         * class.c (walk_subobject_offsets): Recur on binfos as well as on
3003         types.
3004         (layout_nonempty_base_or_field): Pass it a binfo when processing a
3005         base class.
3006         (layout_empty_base): Likewise.
3007         (build_base_field): Likewise.
3008
3009 2002-11-27  Mark Mitchell  <mark@codesourcery.com>
3010
3011         * class.c (build_base_field): Make sure we get the canonical base
3012         when descending through primary bases.
3013
3014 2002-11-26  Geoffrey Keating  <geoffk@apple.com>
3015
3016         * decl.c (check_initializer): Don't error on initialisation of
3017         a scalar with a brace-enclosed expression.
3018
3019 2002-11-26  Nathan Sidwell  <nathan@codesourcery.com>
3020
3021         * cp-tree.h (DECL_LANG_FLAG_4): Document more uses.
3022         (template_parms_equal): Remove prototype.
3023         * typeck.c (buuld_indirect_ref): Reformat.
3024
3025 2002-11-25  Jason Merrill  <jason@redhat.com>
3026
3027         * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT
3028         and a DO_STMT.
3029
3030 2002-11-25  Mark Mitchell  <mark@codesourcery.com>
3031
3032         * tree.c (cp_build_qualified_type_real): Correct handling of
3033         array types.
3034         * class.c (walk_subobject_offsets): Fix thinko.
3035         (build_base_field): Record offsets of empty bases in primary
3036         virtual bases.
3037         (layout_class_type): Record offsets of empty bases in fields.
3038
3039         * search.c (is_subobject_of_p_1): Fix thinko.
3040         (lookup_field_queue_p): Likewise.
3041
3042 2002-11-24  Mark Mitchell  <mark@codesourcery.com>
3043
3044         * class.c (layout_class_type): Reuse tail padding when laying out
3045         virtual bases.
3046
3047 2002-11-22  Mark Mitchell  <mark@codesourcery.com>
3048
3049         * rtti.c (qualifier_flags): Fix thinko.
3050
3051 2002-11-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3052
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.
3059
3060         * method.c (do_build_assign_ref, do_build_copy_constructor,
3061         synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy):
3062         Likewise.
3063         (synthesize_method): Use 'bool' type and constants instead of
3064         'int'.
3065         (locate_copy): Likewise.
3066         (implicitly_declare_fn): Likewise.
3067
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.
3071
3072 2002-11-21  Glen Nakamura  <glen@imodulo.com>
3073
3074         PR c++/8342
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.
3078
3079 2002-11-19  Mark Mitchell  <mark@codesourcery.com>
3080
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.
3084
3085 2002-11-19  Jason Thorpe  <thorpej@wasabisystems.com>
3086
3087         * g++spec.c (lang_specific_spec_functions): New.
3088
3089 2002-11-15  Kazu Hirata  <kazu@cs.umass.edu>
3090
3091         * ChangeLog: Follow spelling conventions.
3092         * class.c: Likewise.
3093         * decl2.c: Likewise.
3094
3095 2002-11-14  Zack Weinberg  <zack@codesourcery.com>
3096
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
3100         memory.
3101
3102 2002-11-14  Mark Mitchell  <mark@codesourcery.com>
3103
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.
3109
3110 2002-11-09  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3111
3112         PR c++/8389
3113         * pt.c (instantiate_template): Push class scope for member
3114         functions.
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.
3119
3120 2002-11-07  Mark Mitchell  <mark@codesourcery.com>
3121
3122         * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of
3123         vcall offfsets.  Split out ...
3124         (add_vcall_offset): ... new function.
3125
3126         PR c++/8338
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
3132         once.
3133         (uses_template_parms): Adjust call to for_each_template_parm.
3134
3135 2002-11-07  Mark Mitchell  <mark@codesourcery.com>
3136
3137         * class.c (add_implicitly_declared_members): Put implicitly
3138         declared functions at the end of TYPE_METHODs when -fabi-version
3139         is at least 2.
3140
3141 2002-11-05  Geoffrey Keating  <geoffk@apple.com>
3142
3143         * decl2.c (finish_file): Correct spelling.
3144
3145 2002-11-03  Mark Mitchell  <mark@codesourcery.com>
3146
3147         * call.c (build_special_member_call): Do not try to lookup VTTs by
3148         name.
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
3166         the vtable.
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.
3181
3182 2002-11-01  Zack Weinberg  <zack@codesourcery.com>
3183
3184         PR c/7353 redux
3185         * decl2.c (grokfield): Reject TYPE_DECLs with initializers.
3186
3187 2002-10-30  Jason Merrill  <jason@redhat.com>
3188
3189         PR c++/8186
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.
3193
3194 2002-10-31  Mark Mitchell  <mark@codesourcery.com>
3195
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.
3202
3203 2002-10-30  Mark Mitchell  <mark@codesourcery.com>
3204
3205         PR c++/8160
3206         * typeck2.c (process_init_constructor): Call complete_array_type.
3207
3208         PR c++/8149
3209         * decl.c (make_typename_type): Issue errors about invalid results.
3210
3211 2002-10-30  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3212
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.
3229
3230 2002-10-29  Mark Mitchell  <mark@codesourcery.com>
3231
3232         PR c++/8287
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.
3236
3237 2002-10-25  Zack Weinberg  <zack@codesourcery.com>
3238
3239         PR c++/7266
3240         * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a
3241         SCOPE_REF is not null before dereferencing it.
3242
3243 2002-10-25  Mark Mitchell  <mark@codesourcery.com>
3244
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
3254         accordingly.
3255         (finish_struct_1): Adjust calls to modified functions.  Set
3256         DECL_VINDEX here.
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.
3266
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.
3275
3276 2002-10-24  David Edelsohn  <edelsohn@gnu.org>
3277
3278         PR c++/7228
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.
3287
3288 2002-10-24  Mark Mitchell  <mark@codesourcery.com>
3289
3290         * class.c (end_of_base): New method.
3291         (end_of_class): Use it.  Check indirect virtual bases.
3292
3293         * class.c (check_field_decls): Fix typo.
3294
3295 2002-10-23  Mark Mitchell  <mark@codesourcery.com>
3296
3297         PR c++/8067
3298         * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
3299         related variables.
3300
3301         PR c++/7679
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.
3307
3308 2002-10-23  Zack Weinberg  <zack@codesourcery.com>
3309
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.
3315
3316 2002-10-22  Mark Mitchell  <mark@codesourcery.com>
3317
3318         PR c++/6579
3319         * spew.c (snarf_parenthesized_expression): New function.
3320         (snarf_block): Use it.
3321
3322 2002-10-22  Richard Henderson  <rth@redhat.com>
3323
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.
3327
3328 2002-10-21  Mark Mitchell  <mark@codesourcery.com>
3329
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.
3335
3336         * class.c (include_empty_classes): Use normalize_rli.
3337         (layout_class_type): Likewise.
3338
3339         * decl.c (reshape_init): Tweak handling of character arrays.
3340
3341         PR c++/8218
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.
3349
3350 2002-10-20  Mark Mitchell  <mark@codesourcery.com>
3351
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.
3355
3356 2002-10-18  Zack Weinberg  <zack@codesourcery.com>
3357
3358         * decl.c (start_decl): Point users of the old initialized-
3359         typedef extension at __typeof__.
3360
3361 2002-10-18  Mark Mitchell  <mark@codesourcery.com>
3362
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.
3366
3367 2002-10-18  Mark Mitchell  <mark@codesourcery.com>
3368
3369         * class.c (base_derived_from): Make sure return value is a bool.
3370
3371 2002-10-18  Mark Mitchell  <mark@codesourcery.com>
3372
3373         * class.c (find_final_overrider_data_s): Remove overriding_fn and
3374         overriding_base.
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.
3379
3380 2002-10-18  Jason Merrill  <jason@redhat.com>
3381
3382         PR c++/8080
3383         * semantics.c (finish_for_cond, finish_while_cond): Don't mess
3384         with condition decls in a template.
3385
3386 2002-10-17  Nathan Sidwell  <nathan@codesourcery.com>
3387
3388         * class.c (add_method): Compare template parms too.
3389
3390 2002-10-17  Mark Mitchell  <mark@codesourcery.com>
3391
3392         PR c++/7584
3393         * class.c (handle_using_decl): Allow the declaration used to be
3394         from an ambiguous base.
3395
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.
3400
3401         * init.c (expand_default_init): Handle brace-enclosed initializers
3402         correctly.
3403
3404 2002-10-16  Mark Mitchell  <mark@codesourcery.com>
3405
3406         * mangle.c (write_expression): Correct handling of enumeration
3407         constants.
3408         (write_template_arg): Likewise.
3409         * pt.c (convert_template_argument): Do not fold non-type template
3410         arguments when inside a template.
3411
3412         PR c++/7478
3413         * cvt.c (convert_to_reference): Allow references as the incoming
3414         type.
3415
3416 2002-10-16  Mark Mitchell  <mark@codesourcery.com>
3417
3418         PR c++/7524
3419         * method.c (do_build_assign_ref): Use cp_build_qualified_type, not
3420         build_qualified_type.
3421
3422 2002-10-15  Richard Henderson  <rth@redhat.com>
3423
3424         * error.c (dump_expr): Use real_to_decimal directly, and with
3425         the new arguments.
3426
3427 2002-10-15  Mark Mitchell  <mark@codesourcery.com>
3428
3429         * decl.c (reshape_init): Fix typo.
3430
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
3437         specification.
3438
3439 2002-10-15  Jason Merrill  <jason@redhat.com>
3440
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
3444         a function.
3445
3446 2002-10-14  Mark Mitchell  <mark@codesourcery.com>
3447
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
3458         parameter.
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.
3462
3463 2002-10-12  Nathan Sidwell  <nathan@codesourcery.com>
3464
3465         * init.c (build_delete): Do not apply save_expr for arrays.
3466         (build_vec_delete): Likewise.
3467
3468 2002-10-14  Mark Mitchell  <mark@codesourcery.com>
3469
3470         * decl.c (layout_var_decl): Call layout_decl even for variables
3471         whose type is an array with unspecified bounds.
3472
3473         PR c++/7176
3474         * lex.c (do_identifier): Add another option for the parsing
3475         parameter.
3476         * parse.y (do_id): Use it.
3477
3478 2002-10-11  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3479
3480         PRs C++/6803, C++/7721 and C++/7803
3481         * decl.c (grokdeclarator): Gracefully handle template-name as
3482         decl-specifier.
3483
3484 2002-10-11  Jason Molenda  <jmolenda@apple.com>
3485
3486         * init.c (build_field_list): Provide uses_unions_p with a default
3487         value.
3488
3489 2002-10-11  Mark Mitchell  <mark@codesourcery.com>
3490
3491         PR c++/5661
3492         * cp-tree.h (variably_modified_type_p): New function.
3493         (grokdeclarator) Tighten check for variably modified types as
3494         fields.
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.
3498
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
3519         correctly.
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.
3529
3530 2002-10-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3531
3532         * decl.c (typename_hash): Use htab_hash_pointer.
3533
3534 2002-10-10  Jim Wilson  <wilson@redhat.com>
3535
3536         * decl.c (duplicate_decls): Don't call decl_attributes.
3537
3538 2002-10-09  Zack Weinberg  <zack@codesourcery.com>
3539
3540         PR c/7353
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'.
3545
3546 2002-10-09  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3547
3548         * decl2.c (prune_vtable_vardecl): Delete unused function.
3549
3550 2002-10-03  Mark Mitchell  <mark@codesourcery.com>
3551
3552         PR c++/7754
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.
3558
3559 2002-10-07  Richard Henderson  <rth@redhat.com>
3560
3561         * decl2.c, pt.c: Revert c++/7754 fix.
3562
3563 2002-10-05  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3564
3565         PR c++/7804
3566         * error.c (dump_expr) [REAL_CST]: Output in decimal format.
3567
3568 2002-10-03  Mark Mitchell  <mark@codesourcery.com>
3569
3570         PR c++/7931
3571         * pt.c (for_each_template_parm_r): Handle BASELINKs.
3572
3573         PR c++/7754
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.
3579
3580 2002-10-03  Mark Mitchell  <mark@codesourcery.com>
3581
3582         PR c++/8006
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
3589         TYPE_TI_TEMPLATE.
3590         (write_prefix): Handle typename types correctly.
3591         (write_template_prefix): Handle template template parameters
3592         correctly.
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.
3602
3603 2002-10-02  Mark Mitchell  <mark@codesourcery.com>
3604
3605         PR c++/7188.
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
3614         together.
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.
3628
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.
3632
3633 2002-10-02  Roger Sayle  <roger@eyesopen.com>
3634
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
3640         is atleast one.
3641
3642 2002-10-02  Matt Austern  <austern@apple.com>
3643
3644         * class.c (check_field_decls): Changed warning about const member
3645         variables so that it doesn't get issued for a class aggregate.
3646
3647 2002-10-01  Mark Mitchell  <mark@codesourcery.com>
3648
3649         * decl.c (cp_finish_decl): Make sure array types are laid out,
3650         even if the array bounds are unknown.
3651
3652 2002-10-01  Steve Ellcey  <sje@cup.hp.com>
3653
3654         * class.c (build_vtbl_initializer): Change build_c_cast
3655         to build1.
3656
3657 2002-10-01  Mark Mitchell  <mark@codesourcery.com>
3658
3659         * decl.c (cp_finish_decl): Make sure array types are laid out,
3660         even if the array bounds are unknown.
3661
3662         * decl.c (cp_finish_decl): Correct check for dynamic
3663         initialization of thread-local storage.
3664
3665 2002-09-30  Nathan Sidwell  <nathan@codesourcery.com>
3666
3667         * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
3668         overloaded.
3669
3670 2002-09-30  Steve Ellcey  <sje@cup.hp.com>
3671
3672         * class.c (build_vtbl_initializer): Add cast.
3673         (add_vcall_offset_vtbl_entries_1):
3674         Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.
3675
3676 2002-09-30  Mark Mitchell  <mark@codesourcery.com>
3677
3678         * class.c (walk_subobject_offsets): Correct the calculation of
3679         offsets for virtual bases.  Correct the counting of array
3680         elements.
3681         (layout_nonempty_base_or_field): Simplify.  Correct the
3682         calculation of offsets to be propagated through the binfo
3683         hierarchy.
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
3696         as_base.
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
3724         in that situation.
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
3730         subobjects.
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.
3734
3735 2002-09-29  Nathan Sidwell  <nathan@codesourcery.com>
3736
3737         PR c++/7788
3738         * rtti.c (unemitted_tinfo_decl_p): Check it has a field.
3739
3740 2002-09-29  Kazu Hirata  <kazu@cs.umass.edu>
3741
3742         * cp-tree.h: Fix comment typos.
3743         * decl.c: Likewise.
3744         * pt.c: Likewise.
3745
3746 2002-09-25  Mark Mitchell  <mark@codesourcery.com>
3747
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.
3752
3753 2002-09-23  Mark Mitchell  <mark@codesourcery.com>
3754
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
3760         bases.
3761         * cp/cp-tree.h (abi_version_at_least): New macro.
3762
3763 2002-09-21  Kazu Hirata  <kazu@cs.umass.edu>
3764
3765         * ChangeLog: Follow spelling conventions.
3766         * ChangeLog.2: Likewise.
3767         * call.c: Likewise.
3768         * class.c: Likewise.
3769         * cp-tree.h: Likewise.
3770         * cvt.c: Likewise.
3771         * decl.c: Likewise.
3772         * decl2.c: Likewise.
3773         * except.c: Likewise.
3774         * friend.c: Likewise.
3775         * g++spec.c: Likewise.
3776         * init.c: Likewise.
3777         * lex.c: Likewise.
3778         * mangle.c: Likewise.
3779         * method.c: Likewise.
3780         * operators.def: Likewise.
3781         * optimize.c: Likewise.
3782         * pt.c: Likewise.
3783         * rtti.c: Likewise.
3784         * search.c: Likewise.
3785         * semantics.c: Likewise.
3786         * spew.c: Likewise.
3787         * tree.c: Likewise.
3788         * typeck.c: Likewise.
3789
3790 2002-09-18  Devang Patel  <dpatel@apple.com>
3791
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
3802         of list_length().
3803         * cp/decl2.c (finish_file): Use walk_vtables() instead of
3804         walk_globals() to walk vtable decls.
3805
3806 2002-09-18  Nathan Sidwell  <nathan@codesourcery.com>
3807
3808         * decl.c (grokdeclarator): Use assert, not internal_error. Don't
3809         ICE with invalid pointers & references.
3810
3811 2002-09-17  Zack Weinberg  <zack@codesourcery.com>
3812
3813         * Make-lang.in: Remove all references to the demangler.
3814         * cxxfilt.c: Moved to binutils.
3815
3816 2002-09-16  Nathan Sidwell  <nathan@codesourcery.com>
3817
3818         PR c++/7718
3819         * pt.c (tsubst_decl): Remove assert.
3820
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.
3825
3826         * search.c (lookup_member): Correct documentation.
3827
3828 2002-09-16  Geoffrey Keating  <geoffk@apple.com>
3829
3830         * cp-tree.h (union lang_tree_node): Add chain_next option.
3831
3832 2002-09-16  Nathan Sidwell  <nathan@codesourcery.com>
3833
3834         * parse.y (parse_finish_call_expr): Check lookup_member result.
3835
3836         PR c++/7015
3837         * semantic.c (finish_asm_stmt): Fix operand/output_operands
3838         thinko.
3839         * typeck.c (c_expand_asm_operands): Protect from error_mark_node.
3840
3841 2002-09-15  Nathan Sidwell  <nathan@codesourcery.com>
3842
3843         PR c++/7919
3844         * call.c (build_over_call): Convert this pointer for fns found by
3845         using decls.
3846
3847 2002-09-15  Kazu Hirata  <kazu@cs.umass.edu>
3848
3849         * ChangeLog: Follow spelling conventions.
3850         * ChangeLog.1: Likewise.
3851
3852 2002-09-14  Nathan Sidwell  <nathan@codesourcery.com>
3853
3854         PR c++/7768
3855         * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
3856
3857 2002-09-14  Kazu Hirata  <kazu@cs.umass.edu>
3858
3859         * error.c: Fix comment formatting.
3860         * except.c: Likewise.
3861         * expr.c: Likewise.
3862         * friend.c: Likewise.
3863         * g++spec.c: Likewise.
3864         * init.c: Likewise.
3865         * lex.c: Likewise.
3866         * mangle.c: Likewise.
3867         * method.c: Likewise.
3868         * optimize.c: Likewise.
3869         * pt.c: Likewise.
3870         * rtti.c: Likewise.
3871         * search.c: Likewise.
3872         * semantics.c: Likewise.
3873         * spew.c: Likewise.
3874         * tree.c: Likewise.
3875         * typeck.c: Likewise.
3876         * typeck2.c: Likewise.
3877
3878 2002-09-13  Matt Austern  <austern@apple.com>
3879
3880         PR C++/7828
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.
3885
3886 2002-09-13  Nathan Sidwell  <nathan@codesourcery.com>
3887
3888         * pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
3889
3890 2002-09-13  Kazu Hirata  <kazu@cs.umass.edu>
3891
3892         * decl.c: Fix comment formatting.
3893         * decl2.c: Likewise.
3894
3895 2002-09-12  Kazu Hirata  <kazu@cs.umass.edu>
3896
3897         * call.c: Fix comment formatting.
3898         * class.c: Likewise.
3899         * cp-lang.c: Likewise.
3900         * cp-tree.h: Likewise.
3901         * cvt.c: Likewise.
3902
3903 2002-09-11  Zack Weinberg  <zack@codesourcery.com>
3904
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)
3910
3911 2002-09-08  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3912
3913         * cp-tree.h (require_complete_eh_spec_types): Add prototype.
3914
3915 2002-09-05  Jason Merrill  <jason@redhat.com>
3916
3917         * typeck2.c (add_exception_specifier): Only pedwarn for an
3918         incomplete type.
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.
3925
3926 2002-09-04  Jakub Jelinek  <jakub@redhat.com>
3927
3928         * decl.c (start_cleanup_fn): Clear interface_only before
3929         start_function, restore it afterwards.
3930
3931 2002-09-02  Nathan Sidwell  <nathan@codesourcery.com>
3932
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.
3938
3939 2002-08-31  Jason Merrill  <jason@redhat.com>
3940
3941         * cp-lang.c (cp_expr_size): Allow initialization from a
3942         CONSTRUCTOR.
3943
3944 2002-08-30  Richard Henderson  <rth@redhat.com>
3945
3946         PR opt/7515
3947         * tree.c: Include target.h.
3948         (cp_cannot_inline_tree_fn): Don't auto-inline functions that
3949         don't bind locally.
3950         * Makefile.in (tree.o): Update.
3951
3952 2002-08-27  Mark Mitchell  <mark@codesourcery.com>
3953
3954         * class.c (layout_virtual_bases): Warn about bugs in G++ that
3955         result in incorrect object layouts.
3956         (layout_class_type): Likewise.
3957
3958 2002-08-24  Matt Austern  <austern@apple.com>
3959
3960         * tree.c (lvalue_p_1): Add argument for whether casts of lvalues
3961         are allowable.
3962         (real_lvalue_p): Update caller.
3963         (lvalue_p): Ditto.
3964         (non_cast_lvalue_or_else): New.
3965         * tree.h: Declare it.
3966         * typeck.c (build_unary_op): Use non_cast_lvalue_or_else.
3967
3968 2002-08-22  Mark Mitchell  <mark@codesourcery.com>
3969
3970         * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR
3971         and COND_EXPR specially; fix error message output.
3972
3973 2002-08-22  Jason Merrill  <jason@redhat.com>
3974
3975         * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR.
3976         * semantics.c (nullify_returns_r): Likewise.
3977
3978 2002-08-17  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3979
3980         Fix PR/7621
3981         * typeck.c (finish_class_member_access_expr): Diagnose cases where
3982         name lookup finds nothing.
3983
3984 2002-08-15  Jason Merrill  <jason@redhat.com>
3985
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
3990         into the loop body.
3991
3992 2002-08-15  Alexandre Oliva  <aoliva@redhat.com>
3993
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.
3999
4000 2002-08-15  Gabriel Dos Reis  <gdr@nerim.net>
4001
4002         Fix PR/7504
4003         * parse.y (parse_finish_call_expr): Handle incomplete
4004         type used to name a scope.
4005
4006 2002-08-15  Nathan Sidwell  <nathan@codesourcery.com>
4007
4008         PR c++/7598
4009         * typeck.c (build_unary_op): Fold offsetof idiom. Fixes
4010         regression caused by my 2002-08-08 patch.
4011
4012 2002-08-13  Mark Mitchell  <mark@codesourcery.com>
4013
4014         * decl.c (pushdecl_class_level): Honor requests to bind names to
4015         OVERLOADs.
4016
4017 2002-08-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4018
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.
4022
4023 2002-08-11  Gabriel Dos Reis  <gdr@nerim.net>
4024
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.
4031
4032 2002-08-1