OSDN Git Service

PR c++/10549
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2003-04-29  Mark Mitchell  <mark@codesourcery.com>
2
3         PR c++/10549
4         * class.c (layout_class_type): Mark overlong bitfields as having
5         the maximum size permitted by their type, after layout.
6
7         PR c++/10527
8         * error.c (dump_expr): Correctly handling of NEW_EXPR.4
9
10 2003-04-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
11
12         * call.c (build_operator_new_call): Fix typo.
13         * lang-options.h: Likewise.
14
15 2003-04-29  Mark Mitchell  <mark@codesourcery.com>
16
17         PR c++/10515
18         * cp-tree.h (lookup_field_1): Declare it.
19         * search.c (lookup_field_1): Make it public.
20         * decl.c (reshape_init): Handle designated initializers.
21
22         * decl.c (maybe_commonize_var): Further tweak support for systems
23         without weak symbols.
24
25 2003-04-27  Mark Mitchell  <mark@codesourcery.com>
26
27         * decl.c (maybe_commonize_var): Fix thinko in last patch.
28
29 2003-04-27  Mark Mitchell  <mark@codesourcery.com>
30
31         PR c++/10506
32         * method.c (use_thunk): Decrement immediate_size_expand.
33
34         PR c++/10503
35         * cp-tree.h (DECL_VAR_MARKED_P): New macro.
36         (DECL_MAYBE_TEMPLATE): Remove.
37         * class.c (fixed_type_or_null): Avoid infinite recursion.
38
39         * decl.c (maybe_commonize_var): Make the code match the comments.
40         * pt.c (instantiate_decl): Move call to import_export_decl.
41
42 2003-04-26  Mark Mitchell  <mark@codesourcery.com>
43
44         * decl2.c (finish_file): Fix merge botch.
45
46 2003-04-25  Mark Mitchell  <mark@codesourcery.com>
47
48         * decl2.c (finish_file): Don't call import_export_decl for
49         functions that are not defined.
50         (handle_class_head): Robustify.
51         * pt.c (instantiate_decl): Do not call cp_finish_decl for
52         variables that are not defined.
53
54 2003-04-24  Sylvain Pion  <Sylvain.Pion@mpi-sb.mpg.de>
55
56         * call.c (print_z_candidates): Fix off by one error.
57
58 2003-04-24  Nathan Sidwell  <nathan@codesourcery.com>
59
60         PR c++/10337
61         * call.c (joust): Don't warn about conversion ops that are exact
62         or cv-conversions. Rearrange to avoid multiple type comparisons.
63
64 2003-04-23  Mark Mitchell  <mark@codesourcery.com>
65
66         PR c++/10471
67         * call.c (build_cxx_call): Robustify.
68
69 2003-04-23  Neil Booth  <neil@daikokuya.co.uk>
70
71         * Make-lang.in (lex.o): Remove mbchar.h.
72         * lex.c (MULTIBYTE_CHARS): Lose.
73         * parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled
74         in c-lex.c.
75
76 2003-04-23  Mark Mitchell  <mark@codesourcery.com>
77
78         PR c++/9847
79         * cp-tree.h (duplicate_tag_error): Remove.
80         * class.c (duplicate_tag_error): Remove.
81         * semantics.c (begin_class_definition): Return immediately for a
82         duplicate class definition.
83
84         PR c++/10451
85         * decl.c (grokdeclarator): Correct logic for "mutable" errors.
86
87 2003-04-22  Mark Mitchell  <mark@codesourcery.com>
88
89         PR c++/10446
90         * search.c (lookup_fnfields_1): Handle empty slots in the method
91         vector.
92         
93         PR c++/10428
94         * decl.c (check_elaborated_type_specifier): New function, split
95         out from ...
96         (xref_tag): ... here.  Use the new function in more places.
97
98         * rtti.c (throw_bad_typeid): Use build_cxx_call.
99
100 2003-04-21  Mark Mitchell  <mark@codesourcery.com>
101
102         * call.c (build_over_call): Use build_cxx_call.
103         (build_cxx_call): New method, split out of build_over_call.
104         * cp-tree.h (language_function): Add can_throw.
105         (build_cxx_call): Declare it.
106         * decl.c (finish_function): If a function does not contain any
107         calls to functions that can throw an exception, indicate that
108         fact.
109         * decl2.c (mark_used): Do not defer the instantiation of
110         functions, if the current function does not throw.
111         * optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones.
112         * pt.c (instantiate_decl): Make sure import_export_decl is called
113         before emitting things.
114         * rtti.c (throw_bad_cast): Use build_cxx_call.
115         (build_dynamic_cast_1): Likewise.
116         * typeck.c (build_function_call): Likewise.
117
118 2003-04-21  Nathan Sidwell  <nathan@codesourcery.com>
119
120         PR c++/9881
121         * typeck.c (build_unary_op): Fold all COMPONENT_REF addr
122         expressions. Reverts my 2002-08-08 patch.
123         
124         * typeck.c (comp_ptr_ttypes_real): Swap final && operands for
125         cheaper early exit.
126
127 2003-04-20  Nathan Sidwell  <nathan@codesourcery.com>
128
129         * cp/decl2.c (start_static_storage_duration_function): Take count
130         arg, don't check if it wraps round.
131         (generate_ctor_or_dtor_function): Add locus arg, use it.
132         (generate_ctor_and_dtor_functions_for_priority): Data arg is a
133         locus.
134         (finish_file): Set line numbers to past EOF for synthesized
135         functions.
136
137 2003-04-20  Nathan Sidwell  <nathan@codesourcery.com>
138
139         PR c++/10405
140         * search.c (lookup_field_1): Final scan goes backwards for
141         types, forwards for non-types.
142
143 2003-04-17  Roger Sayle  <roger@eyesopen.com>
144
145         PR c/10375
146         * decl.c (duplicate_decls): Preserve "const", "noreturn" and
147         "nothrow" function attributes.
148
149 2003-04-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
150
151         PR c++/10347
152         * pt.c (type_dependent_expression_p): Handle array new.
153
154 2003-04-15  Mark Mitchell  <mark@codesourcery.com>
155
156         PR c++/10381
157         * parser.c (cp_parser_primary_expression): Reorganize logic for
158         dealing with name lookup failures.
159
160 2003-04-15  Jason Merrill  <jason@redhat.com>
161
162         * decl2.c (mark_used): Don't instantiate anything if
163         skip_evaluation.
164
165 2003-04-14  Ziemowit Laski  <zlaski@apple.com>
166
167         * tree.c (build_cplus_array_type_1): Do not call
168         uses_template_parms() on a NULL index_type.
169
170 2003-04-13  Roger Sayle  <roger@eyesopen.com>
171
172         * decl.c (duplicate_decls): Preserve pure and malloc attributes.
173
174 2003-04-12  Mark Mitchell  <mark@codesourcery.com>
175
176         PR c++/10300
177         * init.c (build_new_1): Reorganize.
178
179 2003-04-12  Zack Weinberg  <zack@codesourcery.com>
180
181         * class.c (initialize_array)
182         * decl.c (reshape_init)
183         * decl2.c (build_expr_from_tree)
184         * init.c (build_zero_init)
185         * pt.c (tsubst_copy, tsubst_copy_and_build)
186         * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer)
187         (ptm_initializer, class_initializer, get_pseudo_ti_init)
188         * semantics.c (finish_compound_literal)
189         * typeck.c (build_ptrmemfunc1)
190         * typeck2.c (store_init_value, process_init_constructor)
191         (build_functional_cast): Use build_constructor.
192
193 2003-04-12  Zack Weinberg  <zack@codesourcery.com>
194
195         * call.c (print_z_candidates): Use gcc_gettext_width, not
196         strlen, to determine how much padding to use.
197
198 2003-04-10  Zack Weinberg  <zack@codesourcery.com>
199
200         * decl.c: Update all calls to shadow_warning.
201
202 2003-04-10  Mark Mitchell  <mark@codesourcery.com>
203
204         * class.c (layout_class_type): Correct handling for overlong
205         bit-fields whose width is the same as an integer type.
206
207 2003-04-06  Zack Weinberg   <zack@codesourcery.com>
208
209         * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero.
210         * cp-lang.c (cp_tree_size): New function.
211         (LANG_HOOKS_TREE_SIZE): Override.
212
213         * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct
214         tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill.
215         (union lang_tree_node): Remove common and srcloc members.
216         (build_srcloc_here): Don't prototype.
217         * decl.c (cp_tree_node_structure): Kill SRCLOC case.
218         * pt.c (pending_templates): Correct comment.
219         * tree.c (build_srcloc, build_srcloc_here): Kill.
220
221 2003-04-06  Zack Weinberg   <zack@codesourcery.com>
222
223         * call.c: Include intl.h.
224         (print_z_candidate): Always use inform; get rid of errfn
225         argument. Reorganize so that all the strings get picked up
226         by xgettext.  Note obligation of caller to pass first argument
227         through gettext.
228         (print_z_candidates): Update to match.  Indent second and
229         successive candidates by strlen() of translated message.
230         (joust): Restructure ambiguous-conversion pedwarn so that
231         translators see a complete sentence.  Update calls to
232         print_z_candidate.
233
234         * Make-lang.in (cp/call.o): Update dependencies.
235
236 2003-04-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
237
238         * decl.c (set_current_binding_level): Delete, revert last change.
239         (current_binding_level): Modify to allow it as as lvalue.
240
241 2003-04-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
242
243         * name-lookup.c (find_binding): Pass appropriate pointer type to
244         POP_TIMEVAR_AND_RETURN.
245
246 2003-04-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
247
248         * Make-lang.in (cp-warn): Add $(STRICT_WARN).
249         * cp-tree.h: Don't insist on having GNUC.
250
251 2003-04-03  Jason Merrill  <jason@redhat.com>
252
253         * cvt.c (ocp_convert): Only abort if we try to convert an object
254         of TREE_ADDRESSABLE type.
255
256         * class.c (build_vtable): Set DECL_ALIGN here.
257         (get_vtable_decl): Not here.
258         (layout_vtable_decl): Or here.
259         (create_vtable_ptr): Or here.
260         (layout_class_type): Or here.
261         (check_bitfield_decl): Don't mess with field alignment.
262
263 2003-04-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
264
265         * operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR,
266         DEF_ASSN_OPERATOR): Delete spurious semi-colon.
267         * rtti.c (dfs_class_hint_mark): Likewise.
268
269         * decl.c (push_local_name, push_class_level_binding,
270         maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in
271         functions returning void.
272         * decl2.c (add_using_namespace): Likewise.
273
274         * decl.c (print_binding_level, print_other_binding_stack,
275         print_binding_stack): Cast argument of %p specifier to void*.
276         * ptree.c (cxx_print_decl): Likewise.
277
278         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
279         VAR_FUNCTION_OR_PARM_DECL_CHECK,
280         VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
281         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK,
282         LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__.
283
284         * decl.c (set_current_binding_level): New macro.  Use throughout
285         when setting the current binding level.
286
287         * cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma
288         in enum.
289         * method.c (mangling_flags): Likewise.
290
291         * cp-tree.h (lang_type_header): Add __extension__ and use
292         CHAR_BITFIELD for members.
293
294 2003-04-02  Geoffrey Keating  <geoffk@apple.com>
295
296         PR other/9274
297         * mangle.c: Include gt-cp-mangle.h.
298         (subst_identifiers): Mark with GTY.
299         * config-lang.in (gtfiles): Add cp/mangle.c.
300         * Make-lang.in: (gt-cp-mangle.h): New rule.
301         (cp/mangle.o): Depends on gt-cp-mangle.h.
302
303 2003-04-01  Andrew Pinski  <pinskia@physics.uc.edu>
304
305         * config-lang.in (gtfiles): Add \$(srcdir)/cp/name-lookup.c
306         after \$(srcdir)/cp/name-lookup.h.
307         * name-lookup.c: (cxx_binding_make): Use ggc_alloc_clearedinstead
308         of ggc_alloc.  Include gt-cp-name-lookup.h at the end of the file.
309         * Make-lang.in: (gt-cp-name-lookup.h): Is generated by gengtype.
310         (cp/name-lookup.o): Depends on gt-cp-name-lookup.h.
311
312 2003-03-31  Jason Merrill  <jason@redhat.com>
313
314         PR java/10145
315         * class.c (check_field_decl): Don't set DECL_ALIGN.
316
317 2003-03-30  Mark Mitchell  <mark@codesourcery.com>
318
319         PR c++/7647
320         * decl.c (grokdeclarator): Tidy, slightly.
321         * search.c (lookup_field_1): Add want_type parameter.
322         (lookup_field_r): Adjust call to lookup_field_1.
323
324 2003-03-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
325
326         * Make-lang.in (cp/name-lookup.o): Add more dependencies.
327
328 2003-03-30  Gabriel Dos Reis <gdr@integrable-solutions.net>
329
330         * cp-tree.h (binding_for_name: Move to name-lookup.h  Adjust
331         prototype.
332         (cxx_scope_find_binding_for_name): Likewise.
333         * decl.c (find_binding: Move to name-lookup.c.
334         (binding_for_name): Likewise.
335         (cxx_scope_find_binding_for_name): Likewise.
336         (BINDING_LEVEL):  Remove.
337         (push_binding): Tidy.
338         (push_class_binding): Likewise.
339         (pop_binding): Likewise.
340         (poplevel): Likewise.
341         (poplevel_class): Likewise.
342         (set_identifier_type_value_with_scope): Likewise.
343         (push_overloaded_decl): Likewise.
344         (lookup_tag): Likewise.
345         (unqualified_namespace_lookup): Likewise.
346         (lookup_name_current_level): Likewise.
347         (maybe_inject_for_scope_var): Likewise.
348         (namespace_binding): Move to name-lookup.c.
349         (set_namespace_binding): Likewise.
350         * decl2.c (lookup_using_namespace): Tidy.
351         (qualified_lookup_using_namespace): Likewise.
352         (do_toplevel_using_decl): Likewise.
353         * name-lookup.c: Include "timevar.h"
354         * name-lookup.h (cxx_scope):  Declare.
355         (struct cxx_binding): Lose member "has_level".  Adjust "scope"
356         member declaration.
357         (BINDING_SCOPE): Adjust definition.
358         (BINDING_HAS_LEVEL_P): Remove.
359
360 2003-03-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
361
362         * name-lookup.c: New file.
363         * name-lookup.h: Likewise..
364         * decl.c (push_binding): Adjust use cxx_binding_make.
365         (free_bindings): Move to name-lookup.c
366         (pop_binding): Use cxx_binding_free.
367         (binding_for_name): Tidy.
368         * cp-tree.h: Include "name-lookup.h"
369         (cxx_binding_make): Move to name-lookup.h
370         (cxx_binding_clear): Likewise.
371         (struct cxx_binding): Likewise.
372         (LOCAL_BINDING_P): Likewise.
373         (INHERITED_VALUE_BINDING_P): Likewise.
374         (BINDING_SCOPE): Likewise.
375         (BINDING_HAS_LEVEL_P): Likewise.
376         (BINDING_VALUE): Likewise.
377         (BINDING_TYPE): Likewise.
378         * config-lang.in (gtfiles): Add cp/name-lookup.h
379         * Make-lang.in (cp/name-lookup.o): New rule.
380         (CXX_OBJS): Add cp/name-lookup.o
381         (CXX_TREE_H): Add cp/name-lookup.h
382
383 2003-03-28  Jason Merrill  <jason@redhat.com>
384
385         PR c++/10245
386         * cvt.c (force_rvalue): New fn.
387         * call.c (build_conditional_expr): Use it.
388         * cp-tree.h: Declare it.
389
390 2003-03-28  Mike Stump  <mrs@apple.com>
391
392         * error.c (dump_expr): Add 0x to printed hex numbers to make
393         output match source code better.
394
395 2003-03-28  Mark Mitchell  <mark@codesourcery.com>
396
397         PR c++/10218
398         * decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class
399         definitions.
400
401         * decl2.c (generate_ctor_or_dtor_function): Tolerate a
402         non-existant ssdf_decls array.
403         (finish_file): Call generator_ctor_or_dtor_function when there are
404         static constructors or destructors and no other static
405         initializations.
406
407 2003-03-28  Nathan Sidwell  <nathan@codesourcery.com>
408
409         PR c++/10047
410         * decl2.c (finish_file): Don't warn about explicitly instantiated
411         inline decls.
412
413 2003-03-27  Nathan Sidwell  <nathan@codesourcery.com>
414
415         PR c++/10224
416         * pt.c (lookup_template_class): Only check instantiated args if
417         they do not contain template parameters.
418
419 2003-03-27  Nathan Sidwell  <nathan@codesourcery.com>
420
421         PR c++/10158
422         * parser.c (cp_parser_function_definition): Set
423         DECL_INITIALIZED_IN_CLASS for members.
424         * pt.c (instantiate_decl): Only reduce the template args for
425         friends that are not defined in class.
426
427 2003-03-25  Jason Merrill  <jason@redhat.com>
428
429         * call.c (print_z_candidate): Change name of first arg to msgid.
430         (joust): Add comment for translators.
431
432 2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
433
434         PR c++/9898, PR c++/383, DR 322
435         * pt.c (maybe_adjust_types_for_deduction) <DEDUCE_CONV>: Look
436         through reference types on both PARM and ARG.
437
438 2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
439
440         PR c++/10119
441         * error.c (dump_expr) <BASELINK>: Use dump_expr.
442         * pt.c (maybe_fold_nontype_args): New function.
443         (tsubst_copy) <SCOPE_REF>: Subst any template_id args.
444         <TEMPLATE_ID_EXPR>: Break out folding code, call it.
445         (tsubst_copy_and_build) <TEMPLATE_ID_EXPR>: Call
446         maybe_fold_nontype_args.
447
448 2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
449
450         PR c++/10026
451         * decl2.c (arg_assoc_type) <ERROR_MARK>: Don't die.
452
453 2003-03-23  Mark Mitchell  <mark@codesourcery.com>
454
455         PR c++/7086
456         * typeck.c (cxx_mark_addressable):  Adjust call to
457         gen_mem_addressof or put_var_into_stack.
458
459 2003-03-22  Nathan Sidwell  <nathan@codesourcery.com>
460
461         PR c++/9978, c++/9708
462         * cp-tree.h (instantiate_template): Add tsubst_flags parameter.
463         * call.c (add_template_candidate_real): Adjust
464         instantiate_template call.
465         * class.c (resolve_address_of_overloaded_function): Likewise.
466         * decl.c (build_enumerator): Set TREE_CONSTANT.
467         * pt.c (check_instantiated_args): New.
468         (push_inline_template_parms_recursive): Set TREE_CONSTANT,
469         TREE_READONLY.
470         (build_template_parm_index): Copy TREE_CONSTANT, TREE_READONLY.
471         (reduce_template_parm_level): Likewise.
472         (process_template_parm): Likewise.
473         (check_explicit_specialization): Adjust instantiate_template call.
474         (convert_template_argument): Don't check non-type argument here.
475         (lookup_template_class): Check them here.
476         (tsubst_friend_function): Adjust instantiate_template call.
477         (instantiate_template): Add tsubst_flags parameter, use it. Check
478         instantiated args.
479
480 2003-03-21  Zack Weinberg  <zack@codesourcery.com>
481
482         * decl.c: Update calls to shadow_warning.
483
484 2003-03-21  Nathan Sidwell  <nathan@codesourcery.com>
485
486         PR c++/9898
487         * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'.
488         (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call.
489
490 2003-03-20  Mark Mitchell  <mark@codesourcery.com>
491
492         * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
493         friends.
494         * cp/pt.c (instantiate_class_template): Fix formatting.
495
496 2003-03-14  Matt Austern  <austern@apple.com>
497
498         * cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray.
499         (unemitted_tinfo_decl_p): Remove.
500         (emit_tinfo_decl): Change declaration to remove unused parameter.
501         * decl2.c (finish_file): Change tinfo emission to loop through
502         unemitted_tinfo_decls array instead of looping through all decls.
503         * rtti.c (unemitted_tinfo_decl_p): Declare as static, remove
504         unused second parameter.
505         (init_rtti_processing): initialize unemitted_tinfo_decls varray.
506         (get_tinfo_decls): push new tinfo decl on unemitted_tinfo_decls.
507         (emit_tinfo_decl): remove unused second parameter, add assertion
508         that decl hasn't already been emitted.
509
510 2003-03-19  Nathanael Nerode  <neroden@gcc.gnu.org>
511
512         * dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return
513         type from 'int' to 'bool'. Replace 0 and 1 with true and false in
514         return statements.
515
516 2003-03-19  Jason Merrill  <jason@redhat.com>
517
518         PR c++/8316, c++/9315, c++/10136
519         * call.c (print_z_candidate): Split out from...
520         (print_z_candidiates): ...here.
521         (joust): Use it.
522
523 2003-03-17  Roger Sayle  <roger@eyesopen.com>
524
525         PR c++/10031
526         * decl.c (duplicate_decls): Use the new type when prototyping
527         anticipated decls, even when the types match.  This defines the
528         exception list for the built-in function.
529
530 2003-03-17  Jason Merrill  <jason@redhat.com>
531
532         PR c++/10091
533         * typeck.c (build_class_member_access_expr): Compare
534         TYPE_MAIN_VARIANTs.
535
536 2003-03-17  Mark Mitchell  <mark@codesourcery.com>
537
538         PR c++/9639
539         * parser.c (cp_parser_declarator_id): Clear parser->scope.
540
541 2003-03-16  Jason Merrill  <jason@redhat.com>
542
543         PR c++/9993
544         * decl.c (finish_function): Only allow the NRVO to use variables
545         declared at function scope.
546
547 2003-03-17  Andreas Jaeger  <aj@suse.de>
548
549         * Make-lang.in (cp/TAGS): Remove.
550
551 2003-03-16  Nathan Sidwell  <nathan@codesourcery.com>
552
553         PR c++/9629
554         * cp-tree.h (struct language_function): Add in_base_initializer.
555         (in_base_initializer): define it.
556         (expand_member_init): Remove INIT param.
557         * init.c (expand_member_init): Remove INIT param, return the member.
558         (emit_mem_initializers): Set in_base_initializer.
559         * class.c (build_base_path): Check in_base_initializer.
560         * parser.c (cp_parser_mem_initializer): Set in_base_initializer.
561         * pt.c (tsubst_initializer_list): Likewise.
562
563 2003-03-16   Gabriel Dos Reis <gdr@integrable-solutions.net>
564
565         * decl.c (binding_for_name): Fix initialization thinko.
566
567 2003-03-15  Gabriel Dos Reis <gdr@integrable-solutions.net>
568
569         Compile-time improvement: 2/n.
570         * cp-tree.h (struct cxx_binding): New datatype;
571         (struct lang_identifier): Use it.
572         (LOCAL_BINDING_P): Adjust definition.
573         (INHERITED_VALUE_BINDING_P): Likewise.
574         (BINDING_SCOPE): Likewise.
575         (BINDING_HAS_LEVEL_P): Likewise.
576         (BINDING_VALUE): Likewise.
577         (BINDING_TYPE): Likewise.
578         (IDENTIFIER_VALUE): Likewise.
579         (struct tree_binding): Remove.
580         (TS_CP_BINDING): Likewise.
581         ((union lang_tree_node): Remove field "binding".
582         (cxx_binding_clear): New macro.
583         (binding_for_name): Adjust return type.
584         (qualified_lookup_using_namespace): Adjust prototype.
585         (lookup_using_namespace): Adjust prototype.
586         (cxx_scope_find_binding_for_name): Declare.
587         * cp-tree.def: Remove CPLUS_BINDING definition.
588         * decl.c (push_binding): Adjust local variable type.
589         (add_binding): Likewise.
590         (push_class_binding): Likewise.
591         (pop_binding): Likewise.
592         (poplevel): Likewise.
593         (poplevel_class): Likewise.
594         (free_bindings):  Adjust type.
595         (find_binding): Adjust return type, add a third parameter. Remove
596         non-useful assertion now that we use static typing.
597         (cxx_scope_find_binding_for_name): New function.
598         (binding_for_name): Use it.  Adjust local variable type. Simplify.
599         (namespace_binding):  Simplify.
600         (set_namespace_binding): Likewise.
601         (set_identifier_type_value_with_scope): Adjust local variable type.
602         (lookup_tag): Don't type-abuse of local variable 'old'.
603         (lookup_namespace_name): Likewise.  Allocate binding on stack.
604         (select_decl): Adjust prototype.
605         (unqualified_namespace_lookup):  Allocate binding on stack.
606         Don't type-abuse of local variable 'val'.
607         (lookup_name_real): Likewise.
608         (maybe_inject_for_scope_var): Adjust local variable type.
609         (cp_tree_node_structure): Remove CPLUS_BINDING case label.
610         (namespace_binding): Adjust logic, simplify.
611         (BINDING_LEVEL): Adjust definition.
612         (push_class_level_binding): Adjust local variable type.
613         (struct cxx_saved_binding): Adjust field 'binding' type.
614         * decl2.c (ambiguous_decl): Adjust prototype.
615         (lookup_using_namespace): Adjust local variable type.
616         (qualified_lookup_using_namespace): Catch type error and correct
617         ensueing logic error.
618         (do_nonmember_using_decl): Adjust local variable type.  Allocate
619         temporary cxx_binding on stack.
620         (do_toplevel_using_decl): Adjust local variable type.
621         * ptree.c (cxx_print_cxx_binding): New function.
622         (cxx_print_identifier): Use it.
623         (cxx_print_xnode): Delete CPLUS_BINDING case label.
624
625 2003-03-15  Roger Sayle  <roger@eyesopen.com>
626
627         * tree.c (count_functions): Fix whitespace.
628
629 2003-03-15  Neil Booth  <neil@daikokuya.co.uk>
630
631         * Make-lang.in: Update.
632
633 2003-03-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
634
635         PR c++/6440
636         * pt.c (maybe_process_partial_specialization): Handle
637         member class template when enclosing class template is
638         explicit specialized.
639         (most_general_template): Stop looking when DECL is already
640         specialized.
641
642 2003-03-13  Jason Merrill  <jason@redhat.com>
643
644         PR c++/9420
645         * search.c (lookup_conversions): Call complete_type here.
646         * call.c (implicit_conversion): Not here.
647
648 2003-03-13  Mark Mitchell  <mark@codesourcery.com>
649
650         * decl2.c (do_nonmember_using_decl): Correct handling of
651         simultaneous type/non-type bindings.
652
653         * call.c (initialize_reference): Remove bogus assertion.
654         * decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09.
655
656 2003-03-12  Andrew Lewycky  <andrew@mxc.ca>
657
658         PR c++/7050
659         * expr.c (cxx_expand_expr): Return const0_rtx for throw
660         expressions.
661
662 2003-03-11  Mark Mitchell  <mark@codesourcery.com>
663
664         PR c++/9474
665         * decl2.c (do_nonmember_using_decl): Do not call duplicate decls
666         to merge old and new declarations.
667
668 2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
669
670         * g++.1: Remove.
671         * Make-lang.in (c++.generated-manpages): Build cp/g++.1.
672         (cp/g++.1): Build it from scratch in the build tree.
673         (c++.install-man): Depend on it.  Install it from the build tree.
674         (c++.mostlyclean): Clean it.
675
676 2003-03-11  Mark Mitchell  <mark@codesourcery.com>
677
678         PR c++/9474
679         * decl2.c (do_nonmember_using_decl): Do not call duplicate decls
680         to merge old and new declarations.
681
682         PR c++/9924
683         * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins.
684
685 2003-03-11  Jason Merrill  <jason@redhat.com>
686
687         PR c++/9820
688         * search.c (lookup_member): Fix handling of functions in a class
689         being defined.
690
691 2003-03-11  Mark Mitchell  <mark@codesourcery.com>
692
693         PR c++/8700
694         * call.c (convert_class_to_reference): Adjust usage of
695         splice_viable.
696         (any_viable): Remove.
697         (splice_viable): Combine with any_viable.
698         (print_z_candidates): Avoid printing duplicates.
699         (build_user_type_conversion_1): Adjust usage of splice_viable.
700         (build_new_function_call): Likewise.
701         (build_operator_new_call): Likewise.
702         (build_object_call): Likewise.
703         (build_conditional_expr): Likewise.
704         (build_new_op): Likewise.
705         (build_new_method_call): Likewise.
706         (joust): Remove spurious comment.
707         * cp-tree.h (DECL_FRIENDLIST): Correct documentation.
708         * decl2.c (arg_assoc_class): Simplify.
709         * friend.c (add_friend): Likewise.
710
711 2003-03-11  Jason Merrill  <jason@redhat.com>
712
713         PR c++/8660
714         * decl2.c (check_classfn): A member template only matches a
715         member template.
716
717 2003-03-11  Neil Booth  <neil@daikokuya.co.uk>
718
719         * Make-lang.in (CXX_C_OBJS): Update.
720         * lang-specs.h: Don't define __GNUG__ here.
721
722 2003-03-10  Mark Mitchell  <mark@codesourcery.com>
723
724         * call.c (perform_overload_resolution): New function.
725         (build_new_function_call): Use it.
726         (build_operator_new_call): Likewise.
727         (add_candidates): Add explicit_targs and template_only parameters.
728         (build_new_op): Adjust accordingly.
729         * cp-tree.h (build_operator_new_call): New function.
730         (build_function_call_real): Remove.
731         (build_function_call_maybe): Likewise.
732         * init.c (build_new_1): Use build_operator_new_call.
733         * typeck.c (build_function_call_real): Rename to ...
734         (build_function_call): ... this.
735
736 2003-03-10  Devang Patel  <dpatel@apple.com>
737
738         PR c++/9394
739         * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG.
740
741 2003-03-10  Jason Merrill  <jason@redhat.com>
742
743         PR c++/9798
744         * decl.c (push_using_directive): Push before recursing.
745
746         PR c++/9868, c++/9524
747         * call.c (resolve_scoped_fn_name): Handle the case of a function
748         pointer member.
749
750         * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this'
751         argument in the pointer-to-member case.
752
753 2003-03-09  Mark Mitchell  <mark@codesourcery.com>
754
755         PR c++/9373
756         * cp-lang.c (cxx_get_alias_set): Use alias set zero for
757         pointers to member functions.
758
759         PR c++/8534
760         * decl.c (build_ptrmemfunc_type): Do not allow default arugments
761         in pointer-to-member-function types.
762
763 2003-03-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
764
765         * expr.c (cplus_expand_constant): Use C90 prototype style.
766         (cxx_expand_expr): Likewise.
767
768 2003-03-09  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
769
770         PR c++/9970
771         * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual
772         functions.
773
774 2003-03-08  Geoffrey Keating  <geoffk@apple.com>
775
776         * lang-specs.h (c++-header): Change .pch to .gch.
777
778 2003-03-08  Neil Booth  <neil@daikokuya.co.uk>
779
780         * cp-tree.h (cxx_init): Update prototype.
781         * lex.c (cxx_init): Similarly.
782
783 2003-03-08  Mark Mitchell  <mark@codesourcery.com>
784
785         PR c++/9823
786         * cp-tree.h (begin_mem_initializers): Remove.
787         * parser.c (cp_parser_mem_initializer_list): Inline it here.
788         Do not call finish_mem_initializers if not in a constructor.
789         (cp_parser_class_head): Fix typo in error message.
790         * semantics.c (begin_mem_initializers): Remove.
791         * testsuite/g++.dg/parser/constructor1.C: New test.
792
793         PR c++/9809
794         * call.c (add_function_candidate): Skip builtin fuctions that have
795         not yet been declared.
796
797         PR c++/9982
798         * init.c (build_new_1): Correct logic for determining whether or
799         not to use an array cookie.
800
801         PR c++/9524
802         * parser.c (cp_parser_postfix_expression): Call
803         finish_non_static_data_member, even when processing_template_decl.
804
805         PR c++/9912
806         * cp-tree.h (is_ancestor): New function.
807         (handle_class_head): Change prototype.
808         * decl2.c (is_namespace_ancestor): Rename to ...
809         (namespace_anecestor): ... this.
810         (set_decl_namespace): Adjust accordingly.
811         (handle_class_head): Remove unncessary parameters.
812         * parser.c (cp_parser_class_head): Check that
813         nested-name-specifiers are used appropriately.
814
815 2003-03-07  Mark Mitchell  <mark@codesourcery.com>
816
817         * call.c (reference_binding): Remove REF_IS_VAR parameter.
818         (implicit_conversion): Adjust call to reference_binding.
819         (make_temporary_var_for_ref_to_type): Add TYPE parameter.
820         (initialize_reference): Adjust handling for references bound to
821         rvalues.
822         * cp-tree.h (make_temporary_var_for_ref_to_temp): Change
823         prototype.
824         (real_non_cast_lvalue_p): New method.
825         * cvt.c (build_up_reference): Adjust use of
826         make_temporary_var_for_ref_to_temp.
827         * tree.c (real_non_cast_lvalue_p): New method.
828
829 2003-03-07  Gabriel Dos Reis  <gdr@integrable-solutions.net>
830
831         * except.c (init_exception_processing): Use C90 prototype style.
832         (cp_protect_cleanup_actions): Likewise.
833         (prepare_eh_type): Likewise.
834         (build_eh_type_type): Likewise.
835         (build_exc_ptr): Likewise.
836         (do_begin_catch): Likewise.
837         (dtor_nothrow): Likewise.
838         (do_end_catch): Likewise.
839         (push_eh_cleanup): Likewise.
840         (decl_is_java_type): Likewise.
841         (choose_personality_routine): Likewise.
842         (initialize_handler_parm): Likewise.
843         (expand_start_catch_block): Likewise.
844         (expand_end_catch_block): Likewise.
845         (begin_eh_spec_block): Likewise.
846         (finish_eh_spec_block): Likewise.
847         (do_allocate_exception): Likewise.
848         (do_free_exception): Likewise.
849         (wrap_cleanups_r): Likewise.
850         (stabilize_throw_expr): Likewise.
851         (build_throw): Likewise.
852         (complete_ptr_ref_or_void_ptr_p): Likewise.
853         (is_admissible_throw_operand): Likewise.
854         (nothrow_libfn_p): Likewise.
855         (can_convert_eh): Likewise.
856         (check_handlers_1): Likewise.
857         (check_handlers): Likewise.
858
859 2003-03-06  Mark Mitchell  <mark@codesourcery.com>
860
861         * call.c (merge_conversion_sequences): New function.
862         (build_conv): Set ICS_USER_FLAG for USER_CONVs.
863         (convert_class_to_reference): Correct handling of second
864         standard conversion sequence in a user-defined conversion
865         sequence.
866         (build_user_type_conversion_1): Use merge_conversion_sequences.
867         * cp-tree.def: Add comments for CONV nodes.
868         * rtti.c (get_tinfo_decl): Use build_address/build_nop.
869
870 2003-03-07  Gabriel Dos Reis  <gdr@integrable-solutions.net>
871
872         * error.c (init_error): Use C90 prototype style.
873         (dump_scope): Likewise.
874         (dump_qualifiers): Likewise.
875         (dump_template_argument): Likewise.
876         (dump_template_argument_list): Likewise.
877         (dump_template_parameter): Likewise.
878         (dump_template_bindings): Likewise.
879         (dump_type): Likewise.
880         (dump_typename): Likewise.
881         (class_key_or_enum): Likewise.
882         (dump_aggr_type): Likewise.
883         (dump_type_prefix): Likewise.
884         (dump_type_suffix): Likewise.
885         (dump_global_iord): Likewise.
886         (dump_simple_decl): Likewise.
887         (dump_decl): Likewise.
888         (dump_template_decl): Likewise.
889         (dump_function_decl): Likewise.
890         (dump_parameters): Likewise.
891         (dump_exception_spec): Likewise.
892         (dump_function_name): Likewise.
893         (dump_template_parms): Likewise.
894         (dump_char): Likewise.
895         (dump_expr_list): Likewise.
896         (dump_expr): Likewise.
897         (dump_binary_op): Likewise.
898         (dump_unary_op): Likewise.
899         (type_as_string): Likewise.
900         (expr_as_string): Likewise.
901         (decl_as_string): Likewise.
902         (context_as_string): Likewise.
903         (lang_decl_name): Likewise.
904         (cp_file_of): Likewise.
905         (cp_line_of): Likewise.
906         (decl_to_string): Likewise.
907         (expr_to_string): Likewise.
908         (fndecl_to_string): Likewise.
909         (code_to_string): Likewise.
910         (language_to_string): Likewise.
911         (parm_to_string): Likewise.
912         (op_to_string): Likewise.
913         (type_to_string): Likewise.
914         (assop_to_string): Likewise.
915         (args_to_string): Likewise.
916         (cv_to_string): Likewise.
917         (cxx_print_error_function): Likewise.
918         (cp_diagnostic_starter): Likewise.
919         (cp_diagnostic_finalizer): Likewise.
920         (cp_print_error_function): Likewise.
921         (function_category): Likewise.
922         (print_instantiation_full_context): Likewise.
923         (print_instantiation_partial_context): Likewise.
924         (maybe_print_instantiation_context): Likewise.
925         (print_instantiation_context): Likewise.
926         (cp_printer): Likewise.
927         (print_integer): Likewise.
928         (print_non_consecutive_character): Likewise.
929         (locate_error): Likewise.
930
931 2003-03-06  Mark Mitchell  <mark@codesourcery.com>
932
933         PR c++/9965
934         * call.c (reference_binding): Add ref_is_var parameter.
935         (implicit_conversion): Adjust call to reference_binding.
936         (initialize_reference): Likewise.
937
938         PR c++/9400
939         * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
940         PARM_DECLs.
941
942         PR c++/9791
943         * class.c (get_basefndecls): Use lookup_fnfields_1.
944
945 2003-03-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
946
947         PR c++/9188
948         * parser.c (cp_parser_type_parameter): Remove redundant `expect'
949         in error message.
950         (cp_parser_single_declaration): Likewise.
951
952 2003-03-05  Jason Merrill  <jason@redhat.com>
953
954         PR c++/9440
955         * call.c (build_conditional_expr): Use convert rather than an
956         explicit NOP_EXPR.
957
958 2003-03-02  Matt Austern  <austern@apple.com>
959
960         * decl.c (cp_binding_level): Add static_decls varray member.
961         (add_decl_to_level): Add static/inline namespace scope
962         declarations to static_decls array.
963         (wrapup_global_for_namespace): Pass static_decls only, instead of
964         all decls, to wrapup_global_declarations/check_global_declarations.
965         (push_namespace): Initialize static_decls for ordinary namespaces.
966         (cxx_init_decl_processing): Initialize static_decls for global
967         namespace.
968
969 2003-03-05  Mark Mitchell  <mark@codesourcery.com>
970
971         * class.c (end_of_class): Correct thinko.
972
973 2003-03-04  Nathanael Nerode  <neroden@gcc.gnu.org>
974
975         * config-lang.in: Replace ${libstdcxx_version} by its value.
976
977 2003-03-04  Gabriel Dos Reis <gdr@integrable-solutions.net>
978
979         * cp-tree.h (cxx_saved_binding): Declare.
980         (struct saved_scope): Adjust type of field 'old_binding'.
981         * decl.c (cxx_saved_binding_make): New macro.
982         (struct cxx_saved_binding): Define.
983         (store_bindings): Adjust prototype.  Use cxx_saved_binding to save
984         C++ bindings.
985         (maybe_push_to_top_level): Adjust local variable type.
986         (pop_from_top_level): Likewise.
987
988 2003-03-04  Tom Tromey  <tromey@redhat.com>
989
990         * Make-lang.in (c++.tags): New target.
991
992 2003-03-04  Neil Booth  <neil@daikokuya.co.uk>
993
994         * Make-lang.in: Update.
995
996 2003-03-03  Jason Merrill  <jason@redhat.com>
997
998         * decl.c (finish_enum): Do set the type in a template. Simplify.
999         * pt.c (tsubst_enum, tsubst_copy): Revert last patch.
1000
1001 2003-03-03  Mark Mitchell  <mark@codesourcery.com>
1002
1003         PR c++/9878
1004         * call.c (convert_class_to_reference): Correct conversion
1005         sequences.
1006         (reference_binding): Add ref_bound_directly_to_rvalue_p parameter.
1007         (implicit_conversion): Adjust call to reference_binding.
1008         (add_candidate): Change type of candidates parameter.
1009         (add_function_candidate): Likewise.
1010         (add_conv_candidate): Likewise.
1011         (build_builtin_candidate): Likewise.
1012         (add_builtin_candidate): Likewise.
1013         (add_builtin_candidates): Likewise.
1014         (add_template_candidate_real): Likewise.
1015         (add_template_candidate): Likewise.
1016         (add_template_conv_candidate): Likewise.
1017         (build_user_type_conversion_1): Adjust accordingly.
1018         (build_object_call): Likewise.
1019         (build_conditional_expr): Likewise.
1020         (add_candidates): Likewise.
1021         (build_new_op): Likewise.
1022         (convert_like_real): Use USER_CONV_CAND.  Use build_nop.
1023         (build_new_method_call): Adjust calls to add_function_candidate.
1024         (make_temporary_var_for_ref_to_temp): New function.
1025         (initialize_reference): Add decl parameter.
1026         * class.c (build_rtti_vtbl_entries): Use build_address and
1027         build_nop.
1028         * cp-tree.h (initialize_reference): Change prototype.
1029         (make_temporary_var_for_ref_to_temp): New function.
1030         (build_type_conversion): Change prototype.
1031         (build_address): New function.
1032         (build_nop): Likewise.
1033         * cvt.c (cp_convert_to_pointer): Adjust call to
1034         build_type_conversion.  Avoid indicating redundant NOP_EXPRs.
1035         Use build_nop.
1036         (convert_to_pointer_force): Use build_nop.
1037         (build_up_reference): Use make_temporary_var_for_ref_to_temp.
1038         (convert_to_reference): Adjust call to build_type_conversion.
1039         (ocp_convert): Likewise.
1040         (build_type_conversion): Remove for_sure parameter.
1041         * decl.c (grok_reference_init): Use initialize_reference.
1042         * typeck.c (build_address): New function.
1043         (build_nop): Likewise.
1044         (build_unary_op): Use them.
1045         (build_ptrmemfunc): Tidy slightly.
1046         (convert_for_initialization): Adjust call to
1047         initialize_reference.
1048         * typeck2.c (store_init_value): Remove #if 0'd code.
1049
1050 2003-03-03  Jason Merrill  <jason@redhat.com>
1051
1052         * decl.c (start_function): Clear DECL_NUM_STMTS.
1053
1054         * class.c (get_vtable_decl): Use vtbl_type_node.
1055         (build_primary_vtable): Check for it.
1056
1057 2003-03-02  Aldy Hernandez  <aldyh@redhat.com>
1058
1059         * decl.c (check_initializer): Check for vector_opaque_p.
1060
1061 2003-03-02  Ashif Harji  <asharji@uwaterloo.ca>
1062
1063         * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to
1064           invoke an external cpp during compilation.
1065
1066 2003-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1067
1068         * decl.c (duplicate_decls): Convert use of warning_with_decl() to
1069         that of warning().
1070         (start_decl): Likewise.
1071         (start_function): Likewise.
1072
1073 2003-03-01  Neil Booth  <neil@daikokuya.co.uk>
1074
1075         * Make-lang.in (CXX_C_OBJS): Update.
1076
1077 2003-02-28  Mark Mitchell  <mark@codesourcery.com>
1078
1079         PR c++/9892
1080         * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when
1081         instantiating it.
1082
1083 2003-02-28  Aldy Hernandez  <aldyh@redhat.com>
1084
1085         * parser.c (cp_parser_init_declarator): Revert opaque
1086         vector_opaque_p change.
1087         Do not include target.h.
1088
1089 2003-02-28  Mark Mitchell  <mark@codesourcery.com>
1090
1091         PR c++/9879
1092         * cp-tree.h (build_zero_init): Add parameter.
1093         * decl.c (cp_finish_decl): Adjust call.
1094         * init.c (build_zero_init): Add nelts parameter.  Adjust recursive
1095         calls.
1096         (build_default_init): Add nelts parameter.  Adjust calls to
1097         build_zero_init.
1098         (build_new_1): Adjust call to build_default_init.
1099         * typeck2.c (process_init_constructor): Adjust call to build_zero_init.
1100
1101 2003-02-26  Devang Patel  <dpatel@apple.com>
1102
1103         * decl.c (finish_enum): Merge two 'for' loops. Copy value node if
1104         required.  Postpone enum setting for template decls.
1105         (build_enumerator): Delay copying value node until finish_enum
1106         (). Remove #if 0'ed code.
1107         * pt.c (tsubst_enum): Set TREE_TYPE and copy value node.
1108         (tsubst_copy): Add check for enum type.
1109
1110 2003-02-25  Mark Mitchell  <mark@codesourcery.com>
1111
1112         PR c++/9683
1113         * decl2.c (prune_vars_needing_no_initialization): Do not throw
1114         away initializations for DECL_EXTERNAL VAR_DECLs.
1115         (finish_file): Adjust accordingly.
1116         * pt.c (instantiate_decl): Do not defer VAR_DECLs.
1117
1118 2003-02-24 Gabriel Dos Reis  <gdr@integrable-solutions.net>
1119
1120         * decl.c (add_binding): Time TV_NAME_LOOKUP.
1121         (push_class_binding): Likewise.
1122         (set_namespace_binding): Likewise.
1123
1124 2003-02-24  Mark Mitchell  <mark@codesourcery.com>
1125
1126         PR c++/9836
1127         * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from
1128         specializations back to the main template.
1129         * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use.
1130         * pt.c (resolve_typename_type): Likewise.
1131
1132 2003-02-24  Jeffrey D. Oldham  <oldham@codesourcery.com>
1133
1134         PR c++/9778
1135         * pt.c (tsubst_copy_and_build): For a templated function inside a
1136         scope, process template arguments.
1137
1138 2003-02-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1139
1140         PR c++/9602
1141         * typeck2.c (abstract_virtuals_error): Don't check when
1142         TYPE is still template parameter dependent.
1143
1144 2003-02-23  Mark Mitchell  <mark@codesourcery.com>
1145
1146         PR c++/5333
1147         * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro.
1148         * parser.c (cp_parser_diagnose_invalid_type_name): Use it.
1149         * pt.c (instantiate_class_template): Don't try to instantiate
1150         dependent types.
1151         (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE.
1152
1153 2003-02-21  Mark Mitchell  <mark@codesourcery.com>
1154
1155         PR c++/9749
1156         * decl.c (grokdeclarator): Do not allow parameters with variably
1157         modified types.
1158
1159 2003-02-21  Nathan Sidwell  <nathan@codesourcery.com>
1160
1161         * search.c (grow_bfs_bases): Remove. Fold into ...
1162         (bfs_walk): ... here, fix fencepost error. Fix merge lossage
1163         in previous patch.
1164
1165 2003-02-20  Mark Mitchell  <mark@codesourcery.com>
1166
1167         PR c++/9729
1168         * mangle.c (mangle_conv_op_name_for_type): Issue an error message
1169         when the G++ 3.2 ABI prevents correct compilation.
1170
1171 2003-02-20  Nathan Sidwell  <nathan@codesourcery.com>
1172
1173         Change base class access representation. Share virtual base
1174         binfos.
1175         * cp/call.c (build_special_member_call): Remove binfo_for_vbase
1176         call.
1177         * cp/class.c (build_base_path): Likewise.
1178         (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use.
1179         (build_secondary_vtable): Remove FOR_TYPE arg. Adjust.
1180         (make_new_vtable): Adjust.
1181         (force_canonical_binfo_r): Delete.
1182         (force_canonical_binfo): Delete.
1183         (mark_primary_virtual_base): Delete.
1184         (dfs_unshared_virtual_bases): Delete.
1185         (mark_primary_bases): Adjust.
1186         (maybe_warn_about_overly_private_class): Adjust.
1187         (dfs_base_derived_from): Delete.
1188         (base_derived_from): Follow the inheritance chain.
1189         (struct find_final_overrider_data): Add vpath member.
1190         (dfs_find_final_overrider): Adjust.
1191         (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New.
1192         (find_final_overrider): Adjust.
1193         (update_vtable_entry_for_fn): Adjust.
1194         (modify_all_vtables): Adjust.
1195         (walk_subobject_offsets): Adjust.
1196         (layout_nonempty_base_or_field): Adjust.
1197         (layout_empty_base): Remove last parameter. Adjust.
1198         (build_base_field): Adjust.
1199         (build_base_fields): Adjust.
1200         (propagate_binfo_offsets): Remove last parameter. Adjust.
1201         (dfs_set_offset_for_unshared_vbases): Delete.
1202         (layout_virtual_bases): Adjust.
1203         (finish_struct_1): Adjust.
1204         (init_class_processing): Don't init access nodes.
1205         (dfs_get_primary_binfo): Delete.
1206         (get_primary_binfo): Adjust.
1207         (dump_class_hierarchy_r): Remove most derived arg, add IGO
1208         parameter. Adjust.
1209         (dump_class_hierarchy): Adjust.
1210         (finish_vtbls): Adjust.
1211         (get_original_base): Delete.
1212         (build_vtt_inits): Adjust.
1213         (dfs_build_secondary_vptr_vtt_inits): Adjust.
1214         (dfs_ctor_vtable_bases_queue_p): Adjust.
1215         (build_ctor_vtbl_group): Adjust.
1216         (dfs_accumulate_vtbl_inits): Adjust.
1217         (build_vtbl_initializer): Adjust.
1218         (build_vbase_offset_vtbl_entries): Adjust.
1219         (add_vcall_offset_vtbl_entries_1): Adjust.
1220         * cp/cp-tree.h (CPTI_ACCESS_*): Remove.
1221         (access_*_node): Remove.
1222         (CANONICAL_BINFO): Delete.
1223         (BINFO_UNSHARED_MARKED): Remove.
1224         (BINFO_MARKED): Set LANG_FLAG_0 directly.
1225         (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete.
1226         (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly.
1227         (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED):
1228         Delete.
1229         (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly.
1230         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
1231         (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED):
1232         Delete.
1233         (BINFO_DEPENDENT_BASE_P): New.
1234         (dfs_walk, dfs_walk_real): Queue function takes derived binfo and
1235         index.
1236         (markedp, unmarkedp): Adjust.
1237         (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p,
1238         dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp,
1239         find_vbase_instance, binfo_for_vbase): Delete.
1240         (copied_binfo, original_binfo): Declare.
1241         (finish_base_specifier): Add virtual_p arg.
1242         (unshare_base_binfos): Delete.
1243         (copy_base_binfos): Declare.
1244         (reverse_path): Delete.
1245         * cp/decl.c (xref_basetypes): Access and virtuality passed
1246         differently. Don't copy direct base binfos here. Call
1247         copy_base_binfos.
1248         * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust.
1249         (initialize_vtbl_ptrs): Adjust.
1250         (expand_member_init): Adjust.
1251         * cp/parser.c (cp_parser_base_specifier): Adjust.
1252         * cp/pt.c (instantiate_class_template): Adjust.
1253         (get_template_base_recursive): Adjust.
1254         * cp/rtti.c (get_pseudo_ti_init): Adjust.
1255         (get_pseudo_ti_desc): Adjust.
1256         * cp/tree.c (unshare_base_binfos): Rename to ...
1257         (copy_base_binfos): ... here, reimplement.
1258         (make_binfo): Set BINFO_DEPENDENT_BASE_P.
1259         (reverse_path): Remove.
1260         * cp/typeck.c (get_delta_difference): Adjust error messages.
1261         * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust.
1262         * cp/search.c (lookup_base_r): Adjust.
1263         (dynamic_cast_base_recurse): Adjust.
1264         (canonical_binfo): Remove.
1265         (dfs_canonical_queue): Remove.
1266         (dfs_assert_unmarked_p): Remove.
1267         (assert_canonical_unmarked): Remove.
1268         (shared_marked_p, shared_unmarked_p): Remove.
1269         (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE.
1270         (dfs_access_in_type): Adjust.
1271         (access_in_type): Adjust.
1272         (dfs_accessible_queue_p): Adjust.
1273         (dfs_accessible_p): Adjust.
1274         (is_subobject_of_p_1, is_subobject_of_p): Remove.
1275         (struct lookup_field_info): Remove from_dep_base_p field.
1276         (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P.
1277         (lookup_field_r): Remove dependent base code.
1278         (lookup_member): Likewise.
1279         (dfs_walk, dfs_walk_real): Add access arg to queue fn.
1280         (dfs_unmarked_real_bases_queue_p): Remove.
1281         (dfs_marked_real_bases_queue_p): Remove.
1282         (dfs_skip_vbases): Remove.
1283         (dfs_get_pure_virtuals): Adjust.
1284         (markedp, unmarkedp): Adjust.
1285         (marked_vtable_pathp, unmarked_vtable_pathp): Remove.
1286         (marked_pushdecls_p, unmarked_pushdecls_p): Adjust.
1287         (dfs_unmark): Adjust.
1288         (dfs_get_vbase_types):Remove.
1289         (dfs_build_inheritance_graph_order): Remove.
1290         (get_vbase_types): Remove
1291         (dfs_find_vbase_instance): Remove.
1292         (find_vbase_instance): Remove.
1293         (dfs_debug_unmarkedp): Adjust.
1294         (dependent_base_p): Remove.
1295         (dfs_push_type_decls): Adjust.
1296         (dfs_push_decls): Adjust.
1297         (dfs_no_overlap_yet): Adjust.
1298         (copied_binfo): New function.
1299         (original_binfo): New function.
1300         (binfo_for_vbase): Remove.
1301
1302 2003-02-18  Zack Weinberg  <zack@codesourcery.com>
1303
1304         * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk.
1305         (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES
1306         vectors, for speed.
1307
1308 2003-02-18  Mark Mitchell  <mark@codesourcery.com>
1309
1310         PR c++/9704
1311         * class.c (layout_class_type): In the 3.2 ABI, take into account
1312         trailing bit fields when computing CLASSTYPE_SIZE_UNIT.
1313
1314 2003-02-18  Matt Austern <austern@apple.com>
1315
1316         * cp/cp-lang.c: Change lang hooks so that final_write_globals does
1317         nothing for C++.
1318         * cp/decl.c (wrapup_globals_for_namespace): Remove special
1319         handling of global namespace.
1320
1321 2003-02-18  Geoffrey Keating  <geoffk@apple.com>
1322
1323         * cp-tree.h (rid_to_yy): Delete.
1324         (C_RID_YYCODE): Delete.
1325         (finish_file): Delete redundant declaration.
1326
1327 2003-02-18  Jason Merrill  <jason@redhat.com>
1328
1329         PR c++/9623
1330         * decl.c (reshape_init): Don't mess with initializer labels.
1331
1332         PR c++/9485
1333         * parser.c (cp_parser_postfix_expression): Set idk properly for
1334         object->scope::member.
1335
1336 2003-02-18  Ben Elliston  <bje@redhat.com>
1337
1338         PR other/7350
1339         * decl.c (duplicate_decls): Fix typo in comment.
1340
1341 2003-02-17  Michael Elizabeth Chastain <mec@shout.net>
1342
1343         PR debug/9717
1344         * class.c (build_base_field): Mark fields for base classes with
1345         DECL_IGNORED_P.
1346
1347 2003-02-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1348
1349         PR c++/9457
1350         * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
1351         CONSTRUCTOR_ELTS only once.
1352
1353 2003-02-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1354
1355         PR c++/9459
1356         * error.c (dump_type_prefix): Handle TYPEOF_TYPE.
1357         (dump_type_suffix): Likewise.
1358
1359 2003-02-14  Nathan Sidwell  <nathan@codesourcery.com>
1360
1361         * search.c: ANSIfy function declarations and definitions.
1362         * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool.
1363         * call.c (build_method_call, resolve_scoped_fn_name,
1364         build_java_interface_fn_ref): Adjust lookup_field, lookup_member
1365         calls.
1366         * class.c (handle_using_decl): Likewise.
1367         * decl.c (make_typename_type, make_unmound_class_template,
1368         start_decl, compute_array_index_type): Likewise.
1369         * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise.
1370         * init.c (expand_member_init, build_member_call): Likewise.
1371         * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation,
1372         resolve_typename_type): Likewise.
1373         * typeck.c (lookup_destructor, finish_class_member_access_exprm
1374         build_prememfunc_access_expr): Likewise.
1375
1376 2003-02-13  Gabriel Dos Reis <gdr@integrable-solutions.net>
1377
1378         * decl2.c: Include "timevar.h".
1379         (namespace_ancestor): Time name lookup.
1380         (add_using_namespace): Likewise.
1381         (lookup_using_namespace): Likewise.
1382         (qualified_lookup_using_namespace): Likewise.
1383         (decl_namespace): Likewise.
1384         (lookup_arg_dependent): Likewise.
1385         * lex.c (do_identifier): Likewise.
1386         (do_scoped_id): Likewise.
1387         * pt.c (lookup_template_class): Likewise.
1388
1389 2003-02-14   Andrew Pinski <pinskia@physics.uc.edu>
1390
1391         * decl.c: (define_label): Fix warning for return 0 instead of NULL.
1392
1393 2003-02-13  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1394
1395         * decl.c: Include "timevar.h".
1396         (poplevel): Time name lookup.
1397         (find_binding): Likewise.
1398         (push_namespace): Likewise.
1399         (pop_nested_namespace): Likewise.
1400         (store_bindings): Likewise.
1401         (maybe_push_to_top_level): Likewise.
1402         (pop_from_top_level): Likewise.
1403         (push_local_name): Likewise.
1404         (pushtag): Likewise.
1405         (pushdecl): Likewise.
1406         (pushdecl_with_scope): Likewise.
1407         (pushdecl_namespace_level): Likewise.
1408         (pushdecl_top_level): Likewise.
1409         (pushdecl_class_level): Likewise.
1410         (push_class_level_binding): Likewise.
1411         (push_using_decl): Likewise.
1412         (push_using_directive): Likewise.
1413         (push_overloaded_decl): Likewise.
1414         (lookup_label): Likewise.
1415         (define_label): Likewise.
1416         (lookup_tag): Likewise.
1417         (lookup_tag_reverse): Likewise.
1418         (lookup_namespace_name): Likewise.
1419         (select_decl): Likewise.
1420         (unqualified_namespace_lookup): Likewise.
1421         (lookup_name_real): Likewise.
1422         (lookup_name_current_level): Likewise.
1423         (lookup_type_current_level): Likewise.
1424         (maybe_inject_for_scope_var): Likewise.
1425         (xref_tag): Likewise.
1426
1427         * Make-lang.in (cp/decl.o): Add dependency on timevar.h
1428
1429 2003-02-12  Phil Edwards  <pme@gcc.gnu.org>
1430
1431         * decl.c (build_enumerator):  Remove unneeded test.
1432
1433 2003-02-09  Dan Nicolaescu  <dann@ics.uci.edu>
1434
1435         * cp-tree.h (struct lang_type_header): Make all fields unsigned
1436         char.
1437
1438 2003-02-03  Mark Mitchell  <mark@codesourcery.com>
1439
1440         PR c++/7129
1441         * call.c (z_candidate): Add args.
1442         (convert_class_to_reference): Set it.
1443         (implicit_conversion): Tidy.
1444         (add_candidate): Add args parameter.
1445         (add_function_candidate): Adjust call to add_candidate.
1446         (add_conv_candidate): Likewise.
1447         (build_builtin_candidate): Likewise.
1448         (build_user_type_conversion_1): Eliminate wasteful tree_cons
1449         usage.
1450         (build_new_function_call): Likewise.
1451         (build_object_call): Likewise.
1452         (add_candidates): New function.
1453         (build_new_op): Use it.
1454         (covert_like_real): Adjust call to build_over_call.
1455         (build_over_call): Remove args parameter.
1456         * operators.def: Add <?= and >?=.
1457
1458 2003-02-01  Richard Sandiford  <rsandifo@redhat.com>
1459
1460         * typeck.c (build_indirect_ref): Don't check flag_volatile.
1461
1462 2003-01-31  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1463
1464         PR c++/8849
1465         * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL.
1466
1467 2003-01-31  Nathan Sidwell  <nathan@codesourcery.com>
1468
1469         * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX,
1470         BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS.
1471         (BINFO_LANG_ELTS): New #define.
1472         * tree.c (make_binfo): Use BINFO_LANG_ELTS.
1473
1474 2003-01-30  Geoffrey Keating  <geoffk@apple.com>
1475
1476         * cp/Make-lang.in: Remove -Wno-error from cp/decl.o.
1477
1478 2003-01-30  Mark Mitchell  <mark@codesourcery.com>
1479
1480         * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY
1481         for class types.
1482         * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit
1483         rather than TYPE_LANG_FLAG_0.
1484         (TYPE_BUILT_IN): Remove.
1485         (TYPE_DEPENDENT_P): New macro.
1486         (TYPE_DEPENDENT_P_VALID): Likewise.
1487         (lang_type_class): Add fields_readonly.
1488         * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN.
1489         * pt.c (dependent_type_p_r): New function, split out from ...
1490         (dependent_type_p): ... here.  Memoize results.
1491         * search.c (dependent_base_p): Use dependent_type_p, not
1492         uses_template_parms.
1493         * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY
1494         for class types.
1495
1496 2003-01-29  Mark Mitchell  <mark@codesourcery.com>
1497
1498         * call.c (build_field_call): Use build_new_op, not build_opfncall.
1499         (prep_operand): New function.
1500         (build_new_op): Use it.  Remove dead code.
1501         * class.c (pushclass): Change "modify" parameter type from int to
1502         bool.
1503         (currently_open_class): Use same_type_p, not pointer equality.
1504         (push_nested_class): Adjust calls to pushclass, remove modify
1505         parameter.
1506         * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro.
1507         (pushclass): Change prototype.
1508         (push_nested_class): Likewise.
1509         (grokoptypename): Remove.
1510         (build_opfncall): Remove.
1511         (value_dependent_expression_p): Declare.
1512         (resolve_typename_type): Likewise.
1513         (resolve_typename_type_in_current_instantiation): Likewise.
1514         (enter_scope_of): Remove.
1515         (tsubst): Remove.
1516         (tsubst_expr): Likewise.
1517         (tsubst_copy): Likewise.
1518         (tsubst_copy_and_build): Likewise.
1519         * decl.c (warn_about_implicit_typename_lookup): Remove.
1520         (finish_case_label): Return error_mark_node for erroneous labels.
1521         (start_decl): Adjust calls to push_nested_class.
1522         (grokfndecl): Call push_scope/pop_scope around call to
1523         duplicate_decls.
1524         (grokdeclarator): Do not call tsubst.
1525         (start_function): Adjust calls to push_nested_class.
1526         * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall.
1527         (check_classfn): Use push_scope/pop_scope around type comparisions.
1528         (grokoptypename): Remove.
1529         (push_sscope): Adjust call to push_nested_class.
1530         * error.c (dump_type): Show cv-qualification of typename types.
1531         * init.c (build_member_call): Use build_new_op, not
1532         build_opfncall.
1533         * method.c (build_opfncall): Remove.
1534         * parser.c (cp_parser): Add allow_non_constant_expression_p and
1535         non_constant_expression_p.
1536         (cp_parser_constant_expression): Adjust prototype.
1537         (cp_parser_resolve_typename_type): Remove.
1538         (cp_parser_non_constant_expression): New function.
1539         (cp_parser_non_constant_id_expression): Likewise.
1540         (cp_parser_new): Set allow_non_constant_expression_p and
1541         non_constant_expression_p.
1542         (cp_parser_primary_expression): Reject `this' and `va_arg' in
1543         constant-expressions.  Note that dependent names aren't really
1544         constant.
1545         (cp_parser_postfix_expression): Reject conversions to non-integral
1546         types in constant-expressions.  Neither are increments or
1547         decrements.
1548         (cp_parser_unary_expression): Reject increments and decrements in
1549         constant-expressions.
1550         (cp_parser_direct_new_declarator): Adjust call to
1551         cp_parser_constant_expression.
1552         (cp_parser_cast_expression): Reject conversions to non-integral
1553         types in constant-expressions.
1554         (cp_parser_assignment_expression): Rejects assignments in
1555         constant-expressions.
1556         (cp_parser_expression): Reject commas in constant-expressions.
1557         (cp_parser_labeled_statement): Adjust call to
1558         cp_parser_constant_expression.
1559         (cp_parser_direct_declarator): Simplify array bounds, even in
1560         templates, when they are non-dependent.  Use
1561         resolve_typename_type, not cp_parser_resolve_typename_type.
1562         (cp_parser_class_head): Use resolve_typename_type, not
1563         cp_parser_resolve_typename_type.
1564         (cp_parser_member_declaration): Adjust call to
1565         cp_parser_constant_expression.
1566         (cp_parser_constant_initializer): Likewise.
1567         (cp_parser_constructor_declarator): Use resolve_typename_type, not
1568         cp_parser_resolve_typename_type.
1569         (cp_parser_late_parsing_default_args): Adjust call to
1570         push_nested_class.
1571         * pt.c (tsubst): Give it internal linkage.
1572         (tsubst_expr): Likewise.
1573         (tsubst_copy): Likewise.
1574         (tsubst_copy_and_build): Likewise.
1575         (push_access_scope_real): Likewise.
1576         (tsubst_friend_class): Likewise.
1577         (instantiate_class_template): Adjust call to pushclass.
1578         (value_dependent_expression_p): Give it external linkage.
1579         Robustify.
1580         (resolve_typename_type): New function.
1581         * semantics.c (finish_call_expr): Use build_new_op, not
1582         build_opfncall.
1583         (begin_constructor_declarator): Remove.
1584         (begin_class_definition): Adjust call to pushclass.
1585         (enter_scope_of): Remove.
1586         * typeck.c (comptypes): Resolve typename types as appropriate.
1587         (build_x_indirect_ref): Use build_new_op, not build_opfncall.
1588         (build_x_compound_expr): Likewise.
1589         (build_modify_expr): Likewise.
1590         (build_x_modify_expr): Likewise.
1591         * typeck2.c (build_x_arrow): Likewise.
1592
1593 2003-01-29  Fariborz Jahanian  <fjahanian@apple.com>
1594
1595         * pt.c (last_pending_template) Declare GTY().
1596
1597 2003-01-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1598
1599         PR c++/8591
1600         * parser.c (cp_parser_elaborated_type_specifier): Convert
1601         TEMPLATE_DECL to TYPE_DECL only when processing template friends.
1602         (cp_parser_maybe_treat_template_as_class): Remove redundant tests.
1603
1604 2003-01-28  Nathan Sidwell  <nathan@codesourcery.com>
1605
1606         PR c++/9437
1607         * pt.c (unify): Don't unify '*T' with 'U C::*'.
1608
1609         PR c++/3902
1610         * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
1611         inside a declarator.
1612
1613 2003-01-27  Nathan Sidwell  <nathan@codesourcery.com>
1614
1615         * class.c (update_vtable_entry_for_fn): Add index parameter.
1616         Generate vcall thunk for covariant overriding from a virtual
1617         primary base.
1618         (dfs_modify_vtables): Adjust.
1619
1620 2003-01-25  Nathan Sidwell  <nathan@codesourcery.com>
1621
1622         PR c++/9403
1623         * parser.c (cp_parser_class_or_namespace_name): Reject duplicate
1624         template keyword.
1625         (cp_parser_base_specifier): Look for and consume a
1626         TEMPLATE keyword. Replace switch with array index.
1627
1628         PR c++/795
1629         * semantics.c (finish_non_static_data_member): Remember the
1630         field's type even in a template.
1631
1632         PR c++/9415
1633         * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are
1634         already scoped.
1635
1636         PR c++/8545
1637         * parser.c (cp_parser_cast_expression): Be more tentative.
1638
1639 2003-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1640
1641         * cp-tree.h (flagged_type_tree_s): Remove.
1642         (check_for_new_type): Likewise.
1643         * typeck2.c (check_for_new_type): Likewise.
1644
1645 2003-01-23  Nathanael Nerode  <neroden@gcc.gnu.org>
1646
1647         * dump.c: ANSIfy function declarations and definitions.
1648
1649         * cp-tree.h, decl.h: Get rid of PARAMS.  Again.
1650
1651 2003-01-22  Mark Mitchell  <mark@codesourcery.com>
1652
1653         PR c++/9354
1654         * init.c (build_new): Set the type of the new-expression, even
1655         when processing_templte_decl.
1656
1657         PR c++/9216
1658         * parser.c (cp_parser_primary_expression): Improve error message
1659         for templates used in an expression context.
1660
1661         PR c++/8696
1662         * parser.c (cp_parser_decl_specifier_seq): Commit to tentative
1663         parse when encountering "typedef".
1664
1665 2003-01-22  Nathanael Nerode  <neroden@gcc.gnu.org>
1666
1667         * class.c, parser.c: ANSIfy function definitions and declarations.
1668
1669 2003-01-22  Mark Mitchell  <mark@codesourcery.com>
1670
1671         PR c++/9328
1672         * error.c (dump_decl): For an OVERLOAD, just print the name of the
1673         function; it doesn't make sense to try to print its type.
1674         * semantics.c (finish_typeof): Issue errors about invalid uses.
1675
1676         PR c++/9298
1677         * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New
1678         function.
1679         (cp_parser_expression_statement): Use it.
1680         (cp_parser_explicit_instantiation): Likewise.
1681         * pt.c (do_decl_instantiation): Improve error handling logic.
1682
1683 2003-01-22  Mark Mitchell  <mark@codesourcery.com>
1684
1685         PR c++/9384
1686         * parser.c (cp_parser_using_declaration): Issue error messages
1687         about name resolution failures here.
1688
1689         PR c++/9388
1690         * class.c (currently_open_derived_class): Use dependent_type_p.
1691         * cp-tree.h (dependent_type_p): New function.
1692         (dependent_template_arg_p): Likewise.
1693         (dependent_template_p): Likewise.
1694         (type_dependent_expression_p): Likewise.
1695         * parser.c (cp_parser_dependent_type_p): Remove.
1696         (cp_parser_value_dependent_type_p): Likewise.
1697         (cp_parser_type_dependent_expression_p): Likewise.
1698         (cp_parser_dependent_template_arg_p): Likewise.
1699         (cp_parser_dependent_template_id_p): Likewise.
1700         (cp_parser_dependent_template_p): Likewise.
1701         (cp_parser_diagnose_invalid_type_name): Replace
1702         cp_parser_dependent_type_p with dependent_type_p, etc.
1703         (cp_parser_primary_expresion): Likewise.
1704         (cp_parser_nested_name_specifier_opt): Likewise.
1705         (cp_parser_postfix_expression): Likewise.
1706         (cp_parser_unary_expression): Likewise.
1707         (cp_parser_template_name): Likewise.
1708         (cp_parser_class_name): Likewise.
1709         (cp_parser_lookup_name): Likewise.
1710         * pt.c (dependent_type_p): New function.
1711         (value_dependent_expression_p): Likewise.
1712         (type_dependent_expression_p): Likewise.
1713         (dependent_template_arg_p): Likewise.
1714         (dependent_template_id_p): Likewise.
1715         (dependent_template_p): Likewise.
1716
1717         PR c++/9285
1718         PR c++/9294
1719         * parser.c (cp_parser_simple_declaration): Return quickly when
1720         encountering errors.
1721
1722 2003-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1723
1724         Make-lang.in (cp/decl.o-warn): Add -Wno-error.
1725
1726 2003-01-17  Jason Merrill  <jason@redhat.com>
1727
1728         PR c++/9167, c++/9358
1729         * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE.
1730
1731 2003-01-17  Jason Merrill  <jason@redhat.com>
1732
1733         PR c++/9342
1734         * call.c (build_conditional_expr): Always do lvalue-rvalue
1735         conversion.
1736
1737 2003-01-17  Mark Mitchell  <mark@codesourcery.com>
1738
1739         PR c++/9294
1740         * cp-tree.def (BASELINK): Make it class 'x', not class 'e'.
1741         * cp-tree.h (BASELINK_BINFO): Adjust.
1742         (BASELINK_FUNCTIONS): Likewise.
1743         (BASELINK_ACCESS_BINFO): Likewise.
1744         (tree_baselink): New structure.
1745         (cp_tree_node_structure_enum): Add TS_CP_BASELINK.
1746         (lang_tree_node): Add baselink.
1747         * decl.c (cp_tree_node_structure): Add BASELINK case.
1748         * search.c (build_baselink): Adjust.
1749         * tree.c (cp_walk_subtrees): Add BASELINK case.  Remove BASELINK_P
1750         test from TREE_LIST case.
1751
1752         PR c++/9272
1753         * parser.c (cp_parser_constructor_declarator_p): Do not assume
1754         that a constructor cannot be declared outside of its own class.
1755
1756         * parser.c (cp_parser_resolve_typename_type): If the scope cannot
1757         be resolved, neither can the qualified name.
1758
1759         * rtti.c (get_pseudo_ti_desc): Fix thinko.
1760
1761 2003-01-16  Jason Merrill  <jason@redhat.com>
1762
1763         PR c++/8564
1764         * init.c (build_vec_init): Re-add maxindex parm.
1765         (perform_member_init, build_aggr_init): Pass it.
1766         (build_new_1): Pass it. Use an incomplete array type for full_type.
1767         * typeck.c (build_modify_expr): Pass it.
1768         * cp-tree.h: Adjust.
1769
1770 2003-01-16  Jeffrey D. Oldham  <oldham@codesourcery.com>
1771
1772         * cp-tree.h (tsubst_copy_and_build): New declaration.
1773         * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment.
1774         (tsubst_expr): Use 'tsubst_copy_and_build'.  Update initial comment.
1775         (tsubst_copy_and_build): New function.
1776
1777 2003-01-16  Mark Mitchell  <mark@codesourcery.com>
1778
1779         * cp-tree.h (lang_type_class): Remove is_partial_instantiation.
1780         (PARTIAL_INSTANTIATION_P): Remove.
1781         (IMPLICIT_TYPENAME_P): Likewise.
1782         (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise.
1783         (build_typename_type): Remove declaration.
1784         (parmlist_is_exprlist): Likewise.
1785         * decl.c (build_typename_type): Make it static, remove third
1786         parameter.
1787         (push_class_binding): Don't do implicit typename stuff.
1788         (make_typename_type): Likewise.
1789         (lookup_name_real): Likewise.
1790         (grokdeclarator): Don't try to convert declarations into
1791         initializations.  Don't do implicit typename stuff.
1792         (parmlist_is_exprlist): Remove.
1793         (xref_basetypes): Simplify.
1794         * decl2.c (grokfield): Don't try to convert declarations into
1795         initializations.
1796         (build_anon_union_vars): Do this while processing templates, too.
1797         (finish_anon_union): Likewise.
1798         * error.c (dump_type): Remove implicit typename handling.
1799         * parser.c (cp_parser_diagnose_invalid_type_name): New method.
1800         (cp_parser_primary_expression): Correct handling of names not
1801         found by unqualified name lookup in templates.
1802         (cp_parser_nested_name_specifier_opt): Avoid checking dependency
1803         of types when possible.
1804         (cp_parser_simple_declaration): Complain intelligently about some
1805         invalid declarations.
1806         (cp_parser_member_declaration): Likewise.
1807         (cp_parser_constructor_declarator_p): Don't check when we're in a
1808         function scope.
1809         * pt.c (instantiate_class_template): Remove
1810         PARTIAL_INSTANTIATION_P gunk.
1811         * search.c (lookup_field_r): Don't build implicit typenames.
1812         (marked_pushdecls_p): Don't enter dependent base types.
1813         (unmarked_pushdecls_p): Likewise.
1814         * semantics.c (begin_class_definition): Remove implicit typename
1815         stuff.
1816
1817 2003-01-16  Nathan Sidwell  <nathan@codesourcery.com>
1818
1819         PR c++/9212
1820         * parser.c (cp_parser_direct_declarator): If accepting either
1821         abstract or named, the name must be an unqualified-id.
1822
1823 2003-01-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1824
1825         * class.c (layout_virtual_bases): Avoid signed/unsigned warning.
1826
1827 2003-01-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1828
1829         * decl2.c (check_classfn): Fix uninitialized warning.
1830         (build_anon_union_vars): Likewise.
1831         * pt.c (tsubst_copy): Likewise.
1832
1833 2003-01-14  Jeffrey D. Oldham  <oldham@codesourcery.com>
1834
1835         Further conform g++'s __vmi_class_type_info to the C++ ABI
1836         specification.
1837         * rtti.c (dfs_class_hint_mark): Do not set hints not specified by
1838         the specification.
1839         (class_hint_flags): Likewise.
1840
1841 2003-01-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1842
1843         * config-lang.in: Add semantics.c to gtfiles.
1844         * cp-tree.h (flagged_type_tree_s): Remove lookups field.
1845         (saved_scope): Likewise.
1846         (type_lookups): Remove.
1847         (deferred_access): New structure.
1848         (type_access_control): Remove.
1849         (save_type_access_control): Likewise.
1850         (reset_type_access_control): Likewise.
1851         (decl_type_access_control): Likewise.
1852         (push_deferring_access_checks): Declare.
1853         (resume_deferring_access_checks): Likewise.
1854         (stop_deferring_access_checks): Likewise.
1855         (pop_deferring_access_checks): Likewise.
1856         (get_deferred_access_checks): Likewise.
1857         (pop_to_parent_deferring_access_checks): Likewise.
1858         (perform_deferred_access_checks): Likewise.
1859         (perform_or_defer_access_check): Likewise.
1860         * decl.c (make_typename_type): Use perform_or_defer_access_check.
1861         (make_unbound_class_template): Likewise.
1862         (grokdeclarator): Don't call decl_type_access_control.
1863         * parser.c (cp_parser_context): Remove deferred_access_checks
1864         and deferring_access_checks_p fields.
1865         (cp_parser_context_new): Adjust.
1866         (cp_parser): Remove access_checks_lists.
1867         (cp_parser_defer_access_check): Remove.
1868         (cp_parser_start_deferring_access_checks): Remove.
1869         (cp_parser_stop_deferring_access_checks): Remove.
1870         (cp_parser_perform_deferred_access_checks): Remove.
1871         (cp_parser_nested_name_specifier_opt): Use new deferred access
1872         functions.
1873         (cp_parser_simple_declaration): Likewise.
1874         (cp_parser_template_id): Likewise.
1875         (cp_parser_function_definition): Likewise.
1876         (cp_parser_class_specifier): Likewise.
1877         (cp_parser_lookup_name): Likewise.
1878         (cp_parser_single_declaration): Likewise.
1879         (cp_parser_pre_parsed_nested_name_specifier): Likewise.
1880         (cp_parser_parse_tentatively): Likewise.
1881         (cp_parser_parse_definitely): Likewise.
1882         (yyparse): Likewise.
1883         (cp_parser_init_declarator): Remove access_checks parameter.
1884         Use new deferred access functions.
1885         (cp_parser_function_definition_from_specifiers_and_declarator):
1886         Likewise.
1887         (cp_parser_class_head): Remove deferring_access_checks_p and
1888         saved_access_checks parameters.  Use new deferred access functions.
1889         (cp_parser_member_specification_opt): Don't call
1890         reset_type_access_control.
1891         * search.c (type_access_control): Remove.
1892         * semantics.c: Include "gt-cp-semantics.h".
1893         (deferred_type_access_control): Remove.
1894         (deferred_access_stack): New variable.
1895         (deferred_access_free_list): Likewise.
1896         (push_deferring_access_checks): New function.
1897         (resume_deferring_access_checks): Likewise.
1898         (stop_deferring_access_checks): Likewise.
1899         (pop_deferring_access_checks): Likewise.
1900         (get_deferred_access_checks): Likewise.
1901         (pop_to_parent_deferring_access_checks): Likewise.
1902         (perform_deferred_access_checks): New function, adapted from
1903         cp_parser_perform_deferred_access_checks.
1904         (perform_or_defer_access_check): New function, adapted from
1905         cp_parser_defer_access_check.
1906         (current_type_lookups): Remove.
1907         (deferred_type_access_control): Likewise.
1908         (decl_type_access_control): Likewise.
1909         (save_type_access_control): Likewise.
1910         (reset_type_access_control): Likewise.
1911         (begin_function_definition): Adjust.
1912         (begin_class_definiton): Likewise.
1913
1914 2003-01-13  Jason Merrill  <jason@redhat.com>
1915
1916         PR c++/8748
1917         * class.c (build_base_path): Take the address before calling save_expr.
1918
1919         * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
1920         all the ambiguous conversions are bad.
1921
1922         * class.c (maybe_warn_about_overly_private_class): Don't stop
1923         searching when we find a nonprivate method.
1924
1925         * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue.
1926
1927 2003-01-12  Mark Mitchell  <mark@codesourcery.com>
1928
1929         * cp-tree.h (get_arglist_len_in_bytes): Remove.
1930
1931         PR c++/9264
1932         * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous
1933         typeame types more robustly.
1934
1935 2003-01-11  Phil Edwards  <pme@gcc.gnu.org>
1936
1937         * parser.c:  Fix comment typos.
1938
1939 2003-01-10  Mark Mitchell  <mark@codesourcery.com>
1940
1941         PR c++/9099
1942         * parser.c (cp_parser_scope_through_which_access_occurs): Handle
1943         an object_type which is not a class type.
1944
1945 2003-01-10  Geoffrey Keating  <geoffk@apple.com>
1946
1947         * parser.c (cp_parser_late_parsing_for_member): Don't cast to void.
1948         (cp_parser_late_parsing_default_args): Likewise.
1949
1950 2003-01-10  Nathanael Nerode  <neroden@gcc.gnu.org>
1951
1952         * cfns.gperf: ANSIfy function declarations.
1953         * cfns.h: Regenerate.
1954         * cp-tree.h: ANSIfy function declarations.
1955
1956 2003-01-10  Mark Mitchell  <mark@codesourcery.com>
1957
1958         * cp-tree.h (reparse_absdcl_as_expr): Remove.
1959         (reparse_absdcl_as_casts): Likewise.
1960         (reparse_decl_as_expr): Likewise.
1961         (finish_decl_parsing): Likewise.
1962         * decl2.c (reparse_absdcl_as_expr): Remove.
1963         (reparse_absdcl_as_casts): Likewise.
1964         (repase_decl_as_expr): Likewise.
1965         (finish_decl_parsing): Likewise.
1966
1967         PR c++/9128
1968         PR c++/9153
1969         PR c++/9171
1970         * parser.c (cp_parser_pre_parsed_nested_name_specifier): New
1971         function.
1972         (cp_parser_nested_name_specifier_opt): Correct the
1973         check_dependency_p false.
1974         (cp_parser_postfix_expression): Fix formatting.
1975         (cp_parser_decl_specifier_seq): Avoid looking for constructor
1976         declarators when possible.
1977         (cp_parser_template_id): Avoid performing name-lookup when
1978         possible.
1979         (cp_parser_class_head): Do not count specializations when counting
1980         levels of templates.
1981         (cp_parser_constructor_declarator_p): Return immediately if
1982         there's no chance that the tokens form a constructor declarator.
1983         * rtti.c (throw_bad_typeid): Add comment.  Do not return an
1984         expression with reference type.
1985         (get_tinfo_decl_dynamic): Do not return an expression with
1986         reference type.
1987         (build_typeid): Add comment.  Do not return an expression with
1988         reference type.
1989         * typeck.c (build_class_member_access_expr): Improve handling of
1990         conditionals and comma-expressions as objects.
1991
1992 2003-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
1993
1994         * cfns.gperf: ANSIfy function declarations.
1995         * cfns.h: Regenerate.
1996         * cp-tree.h: ANSIfy function declarations.
1997         * parser.c: ANSIfy function declarations & definitions.
1998
1999         * decl.c (bad_specifiers): Fix parameter order error I introduced.
2000
2001 2003-01-09  Geoffrey Keating  <geoffk@apple.com>
2002
2003         Merge from pch-branch:
2004
2005         2003-01-09  Geoffrey Keating  <geoffk@apple.com>
2006
2007         Merge to tag pch-merge-20030102:
2008
2009         * semantics.c (finish_translation_unit): Don't call finish_file.
2010         * parser.c: Don't include ggc.h.
2011         (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer,
2012         read first token here.  Don't allow PCH files after the first
2013         token is read.
2014         (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new.
2015         (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL.
2016         (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory.
2017         (cp_parser_late_parsing_for_member): Don't duplicate call to
2018         cp_lexer_set_source_position_from_token.
2019         (cp_parser_late_parsing_default_args): Likewise.
2020         (yyparse): Call finish_file after clearing the_parser.
2021
2022         2002-12-11  Geoffrey Keating  <geoffk@apple.com>
2023
2024         * Make-lang.in: Remove $(GGC_H) from all dependencies.
2025         (CXX_TREE_H): Add $(GGC_H).
2026         * class.c: Don't include ggc.h.
2027         (field_decl_cmp): Make parameters be 'const void *' to match qsort.
2028         (method_name_cmp): Likewise.
2029         (resort_data): New variable.
2030         (resort_field_decl_cmp): New.
2031         (resort_method_name_cmp): New.
2032         (resort_sorted_fields): New.
2033         (resort_type_method_vec): New.
2034         (finish_struct_methods): Delete cast.
2035         (finish_struct_1): Delete cast.
2036         * cp-tree.h: Include ggc.h.
2037         (struct lang_type_class): Add reorder attribute to field `methods'.
2038         (union lang_decl_u3): Add reorder attribute to field `sorted_fields'.
2039         (resort_sorted_fields): New prototype.
2040         (resort_type_method_vec): New prototype.
2041         * call.c: Don't include ggc.h.
2042         * decl.c: Likewise.
2043         * decl2.c: Likewise.
2044         * init.c: Likewise.
2045         * lex.c: Likewise.
2046         * method.c: Likewise.
2047         * optimize.c: Likewise.
2048         * parse.y: Likewise.
2049         * pt.c: Likewise.
2050         * repo.c: Likewise.
2051         * search.c: Likewise.
2052         * semantics.c: Likewise.
2053         * spew.c: Likewise.
2054         * tree.c: Likewise.
2055
2056         * lang-specs.h: Remove comment.
2057
2058         2002-12-03  Geoffrey Keating  <geoffk@apple.com>
2059
2060         * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery.
2061         (operator_name_info): Mark to be saved for PCH, specify size.
2062         (assignment_operator_name_info): Likewise.
2063
2064         2002-11-19  Geoffrey Keating  <geoffk@apple.com>
2065
2066         * decl.c (anon_cnt): Mark to be saved for PCH.
2067
2068         2002-10-25  Geoffrey Keating  <geoffk@apple.com>
2069
2070         * lex.c  (init_reswords): Delete now-untrue comment.
2071         Allocate ridpointers using GGC.
2072
2073         2002-10-04  Geoffrey Keating  <geoffk@apple.com>
2074
2075         * cp-tree.h (union lang_decl_u2): Add tags to all fields.
2076
2077         * g++spec.c (lang_specific_driver): Don't include standard
2078         libraries in `added'.
2079
2080         2002-08-27  Geoffrey Keating  <geoffk@redhat.com>
2081
2082         * decl2.c (finish_file): Call c_common_write_pch.
2083         * Make-lang.in (CXX_C_OBJS): Add c-pch.o.
2084
2085         2002-08-17  Geoffrey Keating  <geoffk@redhat.com>
2086
2087         * g++spec.c (lang_specific_driver): Treat .h files as C++ header
2088         files when using g++.
2089         * lang-specs.h: Handle compiling C++ header files.
2090
2091 2003-01-09  Jakub Jelinek  <jakub@redhat.com>
2092
2093         * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs.
2094
2095 2003-01-09  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2096
2097         * pt.c (push_access_scope_real): Call push_to_top_level for
2098         function in namespace scope.
2099         (pop_access_scope): Call pop_from_top_level for function in
2100         namespace scope.
2101
2102 2003-01-09  Jakub Jelinek  <jakub@redhat.com>
2103
2104         * decl.c (start_decl): Don't set DECL_COMMON for __thread variables.
2105
2106 2003-01-09  Christian Cornelssen  <ccorn@cs.tu-berlin.de>
2107
2108         * Make-lang.in (c++.install-common, c++.install-man,
2109         c++.uninstall): Prepend $(DESTDIR) to destination paths in
2110         all (un)installation commands.
2111         (c++.install-common): Rewrite $(LN) commands to support
2112         DESTDIR with "ln" as well as with "ln -s".
2113
2114 2003-01-08  Jason Merrill  <jason@redhat.com>
2115
2116         * parser.c (cp_parser_primary_expression): See through explicitly
2117         scoped ALIAS_DECLs, too.
2118
2119 2003-01-08  Nathanael Nerode  <neroden@gcc.gnu.org>
2120
2121         * decl.c: Remove some #if 0 code.
2122
2123         * decl.c: ANSIfy function declarations.
2124
2125 2003-01-07  Mark Mitchell  <mark@codesourcery.com>
2126
2127         * parser.c (cp_parser_asm_definition): Correct handling of omitted
2128         operands.
2129
2130 2003-01-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2131
2132         PR c++/9030
2133         * decl.c (make_typename_type): Check access only when tf_error.
2134         (make_unbound_class_template): Likewise.
2135         * pt.c (saved_access_scope): New variable.
2136         (push_access_scope_real): New function.
2137         (push_access_scope): Likewise.
2138         (pop_access_scope): Likewise.
2139         (tsubst_default_argument): Use them.
2140         (instantiate_template): Likewise.
2141         (regenerate_decl_from_template): Likewise.
2142         (instantiate_decl): Likewise.
2143         (get_mostly_instantiated_function_type): Likewise.
2144
2145 2003-01-07  Nathanael Nerode <neroden@gcc.gnu.org>
2146
2147         * tree.c: Delete bogus #if 0 code.
2148
2149 2003-01-07  Andreas Schwab  <schwab@suse.de>
2150
2151         * class.c (layout_class_type): Don't use
2152         PCC_BITFIELD_TYPE_MATTERS if not defined.
2153
2154 2003-01-06  Mark Mitchell  <mark@codesourcery.com>
2155
2156         PR c++/9165
2157         * decl2.c (build_cleanup): Mark the object as used.
2158
2159         * pt.c (retrieve_local_specialization): Revert 2003-01-05 change.
2160         (hash_local_specialization): New function.
2161         (register_local_specialization): Revert 2003-01-05 change.
2162         (instantiate_decl): Use hash_local_specialization when creating
2163         the local_specializations table.
2164
2165         * decl2.c (mark_used): Do not synthesize thunks.
2166
2167         * class.c (layout_class_type): Correct handling of unnamed
2168         bitfields wider than their types.
2169
2170         PR c++/9189
2171         * parser.c (cp_parser): Remove default_arg_types.  Update
2172         documentation for unparsed_functions_queues.
2173         (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the
2174         parameter.
2175         (cp_parser_new): Don't set parser->default_arg_types.
2176         (cp_parser_function_definition): Adjust usage of
2177         unparsed_funtions_queues.
2178         (cp_parser_class_specifier): Don't mess with
2179         parser->default_arg_types.  Handle default argument processing in
2180         a separate phase from function body processing.
2181         (cp_parser_template_declaration_after_export): Adjust usage of
2182         unparsed_functions_queues.
2183         (cp_parser_late_parsing_for_member): Do not handle default
2184         arguments.
2185
2186 2003-01-06  Nathan Sidwell  <nathan@codesourcery.com>
2187
2188         PR c++/9109
2189         * parser.c (cp_parser_declarator_kind): New enum.
2190         (cp_parser_declarator): Adjust.
2191         (cp_parser_direct_declarator): Adjust. Allow for either named or
2192         abstract declarator. Prefer abstract, if possible. Allow
2193         parenthesized function name.
2194         (cp_parser_condition): Adjust cp_parser_declarator call.
2195         (cp_parser_explicit_instantiation): Likewise.
2196         (cp_parser_init_declarator): Likewise.
2197         (cp_parser_type_id): Likewise.
2198         (cp_parser_function_definition): Likewise.
2199         (cp_parser_member_declaration): Likewise.
2200         (cp_parser_parameter_declaration): Use cp_parser_declarator to do
2201         the tentative parsing.
2202         (cp_parser_exception_declaration): Likewise.
2203
2204 2003-01-05  Mark Mitchell  <mark@codesourcery.com>
2205
2206         * parser.c (cp_parser_template_parameter): Adjust call to
2207         cp_parser_parameter_declaration.
2208         (cp_parser_parameter_declaration_list): Likewise.
2209         (cp_parser_parameter_declaration): Replace
2210         greater_than_is_operator_p with template_parm_p parameter.  Do not
2211         cache tokens for template default arguments.
2212
2213         * pt.c (retrieve_local_specialization): Use htab_find, not
2214         htab_find_with_hash.
2215         (register_local_specialization): Use htab_find_slot, not
2216         htab_find_slot_with_hash.
2217         (instantiate_decl): Pass a hash function to htab_create.
2218
2219 2003-01-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2220
2221         * parser.c (cp_parser_binary_expression,
2222         cp_parser_multiplicative_expression,
2223         cp_parser_additive_expression, cp_parser_shift_expression,
2224         cp_parser_relational_expression, cp_parser_equality_expression,
2225         cp_parser_and_expression, cp_parser_exclusive_or_expression,
2226         cp_parser_inclusive_or_expression,
2227         cp_parser_logical_and_expression, cp_parser_logical_or_expression,
2228         cp_parser_binary_expression): Const-ify.
2229
2230 2003-01-04  Mark Mitchell  <mark@codesourcery.com>
2231
2232         * method.c (use_thunk): Disable access control while building the
2233         body of the thunk.
2234
2235 2003-01-03  Nathanael Nerode  <neroden@gcc.gnu.org>
2236
2237         * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C
2238         front end.
2239
2240 2003-01-03  Matt Austern  <austern@apple.com>
2241
2242         * cp-tree.h (struct lang_type_class): add field for key method
2243         (cp_global_trees): rename dynamic_classes to keyed_classes
2244         (key_method): add definition
2245         * class.c (finish_struct_1): compute class's key method, and add
2246         the class to keyed_classes list if there is no key method.
2247         * decl.c (finish_function): add class to keyed_classes list if we
2248         see a definition of the class's key method.
2249         * pt.c (instantiate_class_template): add template specialization
2250         of a dynamic class to keyed_classes list.
2251         * decl2.c (key_method): remove
2252         (finish_file): iterate only through keyed_classes list when
2253         deciding whether to emit vtables, remove class from its list after
2254         we do the emission.
2255
2256 2003-01-02  Jason Merrill  <jason@redhat.com>
2257
2258         * call.c (build_conditional_expr): Stabilize lvalues properly.
2259         * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type.
2260         * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues.
2261         Don't allow CALL_EXPR or VA_ARG_EXPR, either.
2262
2263         * call.c (convert_like_real): Call decl_constant_value for an
2264         IDENTITY_CONV even if there are no more conversions.
2265
2266         * cvt.c (build_up_reference): Don't push unnamed temps.
2267
2268         * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL.
2269
2270         * dump.c (cp_dump_tree): Don't try to dump class-specific fields
2271         for a backend struct.
2272
2273         * except.c (wrap_cleanups_r, build_throw): Make
2274         MUST_NOT_THROW_EXPRs void.
2275         * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR.
2276
2277         * init.c (build_vec_delete_1): Pre-evaluate the base address.
2278
2279         * init.c (get_temp_regvar): Simplify logic.
2280
2281         * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if
2282         our replacement is a decl.
2283
2284         * decl.c (cp_make_fname_decl): Push the decls inside the
2285         outermost scope.
2286
2287 2003-01-03  Nathan Sidwell  <nathan@codesourcery.com>
2288
2289         PR c++/45, c++/3784
2290         * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be
2291         the same too.
2292
2293 2003-01-03  Graham Stott  <graham.stott@btinternet.com>
2294
2295         * parser.c (struct cp_parser): Add access_checks_lists field
2296         (cp_parser_simple_declaration): Use.
2297         (cp_parser_init_declarator): Likewise.
2298
2299 2003-01-02  Mark Mitchell  <mark@codesourcery.com>
2300
2301         * parser.c (cp_parser_declaration): Accept the __extension__
2302         keyword before the declaration.
2303
2304         PR c++/2843
2305         * parser.c (cp_parser_parameter_declaration): Allow attributes to
2306         appear after the declarator.
2307
2308         * call.c (build_new_method_call): Fix typo in message format
2309         string.
2310
2311 2003-01-02  Mark Mitchell  <mark@codesourcery.com>
2312
2313         * parser.c (cp_lexer_next_token_is): Declare it inline.
2314         (cp_lexer_set_source_position_from_token): Likewise.
2315         (cp_lexer_debugging_p): Likewise.
2316         (cp_parser_parsing_tentatively): Likewise.
2317         (cp_parser_nested_name_specifier_opt): Reduce the number of calls
2318         to the cp_lexer_peek_token.
2319
2320         * parser.c (cp_parser_sizeof_operand): Do not evaluate the
2321         expression.
2322
2323 2003-01-02  Steven Bosscher <s.bosscher@student.tudelft.nl>
2324
2325         * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c,
2326         cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c,
2327         cp/repo.c: Fix copyright years.
2328
2329 2003-01-01  Neil Booth  <neil@daikokuya.co.uk>
2330
2331         * lex.c: Remove superfluous include of cpplib.h.
2332         (CONSTRAINT): Define without conditions.
2333         (init_cp_pragma): Use c_register_pragma.
2334
2335 2002-12-31  Neil Booth  <neil@daikokuya.co.uk>
2336
2337         * .cvsignore: Remove.
2338
2339 2002-12-31  Steven Bosscher  <s.bosscher@student.tudelft.nl>
2340
2341         * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c,
2342           except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h,
2343           lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c,
2344           pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c,
2345           typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the
2346           copyright header.
2347         * lex.h: parse.y is dead, so don't mention it.  Also replace the
2348           copyright header with the default GNU copyright header.
2349
2350 2002-12-31  Mark Mitchell  <mark@codesourcery.com>
2351
2352         * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove.
2353         (lookup_name_namespace_only): Likewise.
2354         (begin_only_namespace_names): Likewise.
2355         (end_only_namespace_names): Likewise.
2356         * decl.c (only_namespace_names): Remove.
2357         (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED.
2358         (lookup_name_real): Do not check only_namespace_names.
2359         (lookup_name_namespace_only): Remove.
2360         (begin_only_namespace_names): Likewise.
2361         (end_only_namespace_names): Likewise.
2362         * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous
2363         nested-name-specifiers more gracefully.
2364         (cp_parser_class_or_namespace_name): Avoid looking up namespace
2365         names when they cannot possibly appear.
2366         (cp_parser_template_name): Adjust call to cp_parser_lookup_name.
2367         (cp_parser_elaborated_type_specifier): Likewise.
2368         (cp_parser_namespace_name): Only look for namespace names.
2369         (cp_parser_lookup_name): Add is_namespace parameter.
2370         (cp_parser_lookup_name_simple): Adjust call to
2371         cp_parser_lookup_name.
2372
2373         * parser.c (cp_parser_dependent_type_p): Fix thinko.
2374
2375 2002-12-31  Neil Booth  <neil@daikokuya.co.uk>
2376
2377         * .cvsignore: Update.
2378
2379 2002-12-31  Nathan Sidwell  <nathan@codesourcery.com>
2380
2381         * class.c (modify_vtable_entry): Remove unused variable.
2382         (get_vcall_index): Always expect a non-thunk.
2383         (update_vtable_entry_for_fn): Combine covariant adjustments, when
2384         overriding a thunk. Pass get_vcall_index a non-thunk.
2385
2386         * decl2.c (finish_file): Mark undefined inlines as extern.
2387
2388 2002-12-31  Mark Mitchell  <mark@codesourcery.com>
2389
2390         * cp-tree.def (RETURN_INIT): Remove.
2391         * cp-tree.h (DECL_IN_MEMORY_P): Remove.
2392         (scope_kind): Add sk_block, sk_try, sk_catch, sk_for.
2393         (note_level_for_for): Remove.
2394         (note_level_for_try): Likewise.
2395         (note_level_for_catch): Likewise.
2396         (finish_named_return_value): Likewise.
2397         (do_pushlevel): Change prototype.
2398         (pending_lang_change): Remove.
2399         * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch,
2400         sk_for.
2401         (note_level_for_for): Remove.
2402         (note_level_for_try): Likewise.
2403         (note_level_for_catch): Likewise.
2404         (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P.
2405         * parser.c (cp_parser_context_free_list): Make it "deletable".
2406         (cp_parser_template_argument): Remove misleading comment.
2407         * pt.c (tsubst_expr): Remove RETURN_INIT code.
2408         * semantics.c (genrtl_named_return_value): Remove.
2409         (do_pushlevel): Take a scope kind as an argument.
2410         (begin_if_stmt): Adjust.
2411         (begin_while_stmt): Likewise.
2412         (begin_for_stmt): Likewise.
2413         (finish_for_init_stmt): Likewise.
2414         (begin_switch_stmt): Likewise.
2415         (begin_handler): Likewise.
2416         (begin_compound_stmt): Likewise.
2417         (finish_named_return_value): Remove.
2418         (cp_expand_stmt): Remove RETURN_INIT case.
2419         * tree.c (cp_statement_code_p): Remove RETURN_INIT case.
2420
2421 2002-12-31  Mark Mitchell  <mark@codesourcery.com>
2422
2423         PR c++/9112
2424         * parser.c (cp_parser_direct_declarator): Handle erroneous
2425         parenthesized declarators correctly.
2426
2427 2002-12-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2428
2429         * cp-tree.h (pending_lang_change): Declare.
2430
2431 2002-12-30  Mark Mitchell  <mark@codesourcery.com>
2432
2433         * parser.c (cp_parser_context_free_list): New variable.
2434         (cp_parser_context_new): Use it.
2435         (cp_parser_error): Check return code from
2436         cp_parser_simulate_error.
2437         (cp_parser_simulate_error): Return a value.
2438         (cp_parser_id_expression): Optimize common case.
2439         (cp_parser_class_name): Likewise.
2440         (cp_parser_class_specifier): Adjust call to
2441         cp_parser_late_parsing_default_args.
2442         (cp_parser_lookup_name): Optimize common case.
2443         (cp_parser_late_parsing_for_member): Adjust call to
2444         cp_parser_late_parsing_default_args.
2445         (cp_parser_late_parsing_default_args): Add scope parameter.
2446         (cp_parser_require): Avoid creating the error message unless it's
2447         needed.
2448         (cp_parser_parse_definitely): Place free'd contexts on the free
2449         list.
2450
2451         * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change.
2452
2453 2002-12-30  David Edelsohn  <edelsohn@gnu.org>
2454
2455         * parser.c (cp_parser_parameter_declaration_clause): Treat system
2456         header as extern "C" if NO_IMPLICIT_EXTERN_C undefined.
2457
2458 2002-12-30  Nathanael Nerode  <neroden@gcc.gnu.org>
2459
2460         * config-lang.in, Make-lang.in, operators.def, cp-tree.def:
2461         GCC, not GNU CC.
2462
2463 2002-12-30  Mark Mitchell  <mark@codesourcery.com>
2464
2465         * parse.y: Remove.
2466         * spew.c: Likewise.
2467         * Make-lang.in (gt-cp-spew.h): Remove.
2468         * cp-tree.h (do_pending_lang_change): Remove.
2469         (do_identifier): Change prototype.
2470         (finish_id_expr): Remove.
2471         * decl.c (lookup_name_real): Remove yylex variable.
2472         * decl2.c (build_expr_from_tree): Adjust call to do_identifier.
2473         * lex.c (init_cpp_parse): Remove.
2474         (reduce_cmp): Likewise.
2475         (token_cmp): Likewise.
2476         (yychar): Likewise.
2477         (lastiddecl): Likewise.
2478         (token_count): Likewise.
2479         (reduce_count): Likewise.
2480         (yyhook): Likewise.
2481         (print_parse_statistics): Likewise.
2482         (do_pending_lang_change): Likewise.
2483         (do_identifier): Remove parsing parameter.
2484         * lex.h (lastiddecl): Remove.
2485         (looking_for_typename): Remove.
2486         (looking_for_template): Likewise.
2487         (pending_lang_change): Likewise.
2488         (yylex): Likewise.
2489         * semantics.c (finish_id_expr): Remove.
2490
2491         * decl.c (grokdeclarator): Diagnost "extern thread" and "static
2492         thread" correctly.
2493
2494 2002-12-30  Nathanael Nerode  <neroden@gcc.gnu.org>
2495
2496         * decl.c, decl2.c, decl.h:  GCC, not GNU CC.  This is the C++ front
2497         end, not the C front end.
2498
2499 2002-12-30  Nathan Sidwell  <nathan@codesourcery.com>
2500
2501         * cp-tree.h (THUNK_TARGET): New macro.
2502         (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo.
2503         (finish_thunk): Remove offset parms.
2504         * class.c (find_final_overrider): Look through thunks.
2505         (get_vcall_index): Use THUNK_TARGET.
2506         (update_vtable_entry_for_fn): Look through thunks. Set covariant
2507         fixed offset here. Adjust finish_thunk call.
2508         (build_vtbl_initializer): Adjust finish_thunk calls.
2509         * mangle.c (mangle_call_offset): Remove superfluous if.
2510         (mangle_thunk): Adjust.
2511         * method.c (make_thunk): Adjust.
2512         (finish_thunk): Adjust.
2513         (thunk_adjust): Remove assert.
2514         (use_thunk): Use THUNK_TARGET
2515         * dump1.c (cp_dump_tree): Adjust thunk dumping.
2516
2517         PR c++/9054
2518         * class.c (layout_class_type): Set TYPE_CONTEXT of type for base.
2519         * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types.
2520
2521 2002-12-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2522
2523         Remove traditional C constructs 4/n.
2524         * decl2.c (grok_method_quals, warn_if_unknown_interface,
2525         grok_x_components, cp_build_parm_decl, build_artificial_parm,
2526         maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
2527         delete_sanity, check_member_template, check_java_method,
2528         check_classfn, finish_static_data_member_decl, grokfield,
2529         grokbitfield, grokoptypename, grok_function_init,
2530         cplus_decl_attributes, constructor_name, defer_fn,
2531         build_anon_union_vars, finish_anon_union, coerce_new_type,
2532         coerce_delete_type, comdat_linkage, maybe_make_one_only,
2533         key_method, import_export_vtable, import_export_class,
2534         output_vtable_inherit, import_export_decl, import_export_tinfo,
2535         build_cleanup, get_guard, get_guard_bits, get_guard_cond,
2536         set_guard, start_objects, finish_objects,
2537         start_static_storage_duration_function,
2538         finish_static_storage_duration_function, get_priority_info,
2539         start_static_initialization_or_destruction,
2540         finish_static_initialization_or_destruction,
2541         do_static_initialization, do_static_destruction,
2542         prune_vars_needing_no_initialization, write_out_vars,
2543         reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
2544         add_using_namespace, merge_functions, ambiguous_decl,
2545         lookup_using_namespace, lookup_using_namespace,
2546         qualified_lookup_using_namespace, set_decl_namespace,
2547         decl_namespace, current_decl_namespace, push_decl_namespace,
2548         pop_decl_namespace, push_scope, pop_scope, add_function,
2549         arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
2550         lookup_arg_dependent, do_namespace_alias,
2551         validate_nonmember_using_decl, do_nonmember_using_decl,
2552         do_toplevel_using_decl, do_local_using_decl,
2553         do_class_using_decl, do_using_directive, check_default_args,
2554         mark_used, handle_class_head): Use C90 prototypings.  Use booleans.
2555         * parser.c (cp_parser_class_head): Use booleanss.
2556         * decl.c (walk_globals, walk_vtables): Likewise.
2557         * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
2558         walk_globals): Change return type from 'int' to 'bool'.
2559         * rtti.c (init_rtti_processing, build_headof, throw_bad_cast
2560         throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
2561         build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
2562         get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
2563         qualifier_flags, tinfo_base_init, generic_initializer,
2564         ptr_initializer, dfs_class_hint_mark, ptm_initializer,
2565         dfs_class_hint_unmark, class_hint_flags, class_initializer,
2566         typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
2567         get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
2568         unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
2569         * repo.c (repo_compile_flags, repo_template_declared,
2570         repo_template_defined, repo_class_defined, repo_get_id,
2571         repo_template_used, repo_vtable_used, repo_inline_used,
2572         repo_tinfo_used, repo_template_instantiated, extract_string,
2573         open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
2574         finish_repo): Likewise.
2575         * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
2576         cxx_print_xnode): Likewise..
2577         * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
2578         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
2579         * cxxfilt.c (demangle_it, print_demangler_list, usage,
2580         standard_symbol_characters, hp_symbol_characters, main, fatal):
2581         Likewise.
2582         (strip_underscore):  Change type from 'int' to 'bool'.
2583         (main): Use boolean constants.
2584
2585 2002-12-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2586
2587         Remove traditional C constructs 3/n.
2588         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2589         build_up_reference, warn_ref_binding, convert_to_reference,
2590         convert_from_reference, convert_lvalue, cp_convert, ocp_convert,
2591         convert_to_void, convert, convert_force, build_type_conversion,
2592         build_expr_type_conversion, type_promotes_to,
2593         perform_qualification_conversions): Use C90 prototyping style.
2594         * decl2.c (grok_array_decl): Use boolean constant.
2595         (delete_sanity): Likewise.
2596         * typeck.c (build_unary_op): Likewise.
2597         * semantics.c (finish_switch_cond): Likewise.
2598         * parser.c (cp_parser_direct_new_declarator): Likewise.
2599         * init.c (build_new): Likewise.
2600
2601 2002-12-27  Mark Mitchell  <mark@codesourcery.com>
2602
2603         * Make-lang.in (po-generated): Remove parse.c.
2604         (CXX_OBJS): Remove parse.o and spew.o.  Add parser.o.
2605         ($(srcdir)/cp/parse.h): Remove target.
2606         ($(srcdir)/cp/parse.c): Likewise.
2607         (gt-cp-parse.h): Likewise.
2608         (gt-cp-parser.h): New target.
2609         (c++.distclean): Do not remove parse.output.
2610         (c++.maintainer-clean): Do not remove parse.c or parse.h.
2611         (cp/spew.o): Remove target.
2612         (cp/lex.o): Adjust dependencies.
2613         (cp/pt.o): Likewise.
2614         (cp/parse.o): Likewise.
2615         (cp/TAGS): Do not mention parse.c.
2616         (cp/parser.o): New target.
2617         * NEWS: Mention the new parser.
2618         * call.c (build_scoped_method_call): Simplify.
2619         (build_method_call): Likewise.
2620         (build_new_function_call): Adjust calls to add_function_candidate
2621         and add_template_candidate.
2622         (build_new_op): Improve handling of erroroneous operands.
2623         (convert_default_arg): Remove circular argument processing.
2624         (name_as_c_string): New function.
2625         (build_new_method_call): Use it.
2626         (perform_implicit_conversion): Use error_operand_p.
2627         * class.c (finish_struct_anon): Use constructor_name_p.
2628         (check_field_decls): Likewise.
2629         (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN.
2630         (resolve_address_of_overloaded_function): Likewise.
2631         (instantiate_type): Tweak pointer-to-member handling.
2632         (get_primary_binfo): Remove incorrect assertion.
2633         * config-lang.in (gtfiles): Add parser.c, remove parse.c.
2634         * cp-tree.h (DEFARG_TOKENS): New macro.
2635         (default_arg): New structure.
2636         (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG.
2637         (lang_tree_node): Add default_arg.
2638         (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE.
2639         (type_info_ref_type): New macro.
2640         (saved_scope): Make processing_explicit_instantiation a boolean.
2641         (check_access): New field.
2642         (unparsed_text): Remove.
2643         (language_function): Remove unparsed_inlines.
2644         (error_operand_p): New macro.
2645         (lang_decl): Adjust pending_inline_info.
2646         (DEFARG_POINTER): Remove.
2647         (tag_types): Add typenames.
2648         (lookup_ualified_name): Declare.
2649         (lookup_name_real): Likewise.
2650         (shadow_tag): Adjust prototype.
2651         (get_scope_of_declarator): Declare it.
2652         (process_next_inline): Remove it.
2653         (check_for_missing_semicolon): Likewise.
2654         (maybe_get_template_decl_from_type_decl): Declare it.
2655         (finish_label_stmt): Adjust prototype.
2656         (finish_non_static_data_meber): Declare it.
2657         (finish_pseudo_destructor_call_expr): Rename to ...
2658         (finish_pseudo_destructor_expr): ... this.
2659         (finish_compound_literal): Declare it.
2660         (begin_inline_definitions): Remove it.
2661         (init_spew): Remove.
2662         (peekyylex): Likewise.
2663         (arbitrate_lookup): Likewise.
2664         (frob_opname): Likewise.
2665         (maybe_snarf_defarg): Likewise.
2666         (add_defarg_fn): Likewise.
2667         (do_pending_defargs): Likewise.
2668         (done_pending_defargs): Likewise.
2669         (unprocessed_defarg_fn): Likewise.
2670         (replace_defarg): Likewise.
2671         (end_input): Likewise.
2672         (get_overloaded_fn): Likewise.
2673         * cvt.c (convert_to_reference): Improve error handling.
2674         * decl.c (lookup_name_real): Do not declare it static.
2675         (maybe_push_to_top_level): Set check_access.
2676         (identifier_type_value): Adjust call to lookup_name_real.
2677         (lookup_qualified_name): New method.
2678         (lookup_name_real): Remove special-case parsing code.
2679         (lookup_name-nonclass): Adjust call to lookup_name_real.
2680         (lookup_name_namespace_only): Likewise.
2681         (lookup_name): Likewise.
2682         (check_tag_decl): Return the type declared.
2683         (shadow_tag): Likewise.
2684         (register_dtor_fn): Tweak check_access.
2685         (grokfndecl): Use constructor_name_p.
2686         (get_scope_of_declarator): New function.
2687         (grokdeclarator): Obscure tweaks for slightly different declarator
2688         representations.
2689         (start_method): Return error_mark_node to indicate failure.
2690         (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs.
2691         * decl2.c (constructor_name_full): Simplify.
2692         (constructor_name): Use it.
2693         (build_expr_from_tree): Adjust for changes to do new parser.
2694         (push_scope): Improve robustness.
2695         (validate_nonmember_using_decl): Process declarations, not names.
2696         (do_class_using_decl): Likewise.
2697         (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS
2698         here.
2699         * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs.
2700         * expr.c (cxx_expand_expr): Handle BASELINKs.
2701         * init.c (member_init_ok_or_else): Issue more errors.
2702         (build_offset_ref): Tweak handling of FUNCTION_DECLs.
2703         * lex.c: Do not include parse.h.
2704         (yypring): Do not declare.
2705         (yylval): Likewise.
2706         (make_reference_declarator): Remove error-generating code.
2707         (rid_to_yy): Remove.
2708         (cxx_init): Do not call init_spew.
2709         (yypring): Remove.
2710         (check_for_missing_semicolon): Remove.
2711         * lex.h (got_scope): Remove.
2712         (got_object): Remove.
2713         * method.c (hack_identifier): Use finish_non_static_data_member.
2714         (implicitly_declare_fn): Adjust use of constructor_name.
2715         * parser.c: New file.
2716         * pt.c (parse.h): Do not include it.
2717         (maybe_get_template_decl_from_template): Do not declare it.
2718         (finish_member_template_decl): Tweak.
2719         (begin_explicit_instantiation): Adjust for
2720         processing_explicit_instantiation being boolean.
2721         (end_explicit_instantiation): Likewise.
2722         (maybe_process_partial_specialization): Tighten specialization
2723         test.
2724         (retrieve_local_specialization): Adjust ue of hash table.
2725         (eq_local_specializations): New function.
2726         (register_local_specialization): Likewise.
2727         (push_template_decl_real): Remove unnecessary test.
2728         (maybe_get_template_decl_from_type_decl): Don't make it static.
2729         (for_each_template_parm_r): Handle TYPEOF_TYPE.
2730         (tsubst_copy): Use retrieive_local_specialization to handle
2731         PARM_DECL.  Adjust handling of CONST_DECLs.  Handle BASELINKs.
2732         Handle COMPONENT_REFs with pseudo-destructor-expressions.
2733         Simplify handling of CALL_EXPR and METHOD_CALL_EXPR.
2734         (tsubst_expr): Pass decls, not names, to do_local_using_decl.
2735         (unify): Tweak handling of CONST_DECLs.
2736         (regenerate_decl_from_template): Use push_nested_class.
2737         (template_for_substitution): New funciton.
2738         (instantiate_decl): Use it.  Register parameters as local
2739         specializations.
2740         * rtti.c (init_rtti_processing): Set type_info_ref_type.
2741         (build_typeid): Use it.
2742         (get_typeid): Likeise.
2743         * search.c (accessible_p): Use check_access, not
2744         flag_access_control.
2745         (adjust_result_of_qualified_name_lookup): Pay attention to the
2746         context_class.
2747         * semantics.c (finish_asm_stmt): Adjust error handling.
2748         (finish_label_stmt): Return the statement.
2749         (finish_non_static_data_member): New function.
2750         (finish_class_expr): Handle BASELINKs.
2751         (finish_call_expr): Handle PSEUDO_DTOR_EXPR.
2752         (finish_object_call_expr): Simplify handling during templates.
2753         (finish_pseudo_destructor_call_expr): Rename to ...
2754         (finish_pseudo_dtor_expr): ... this.
2755         (finish_compound_literal): New function.
2756         (begin_inline_definitions): Remove.
2757         (finish_sizeof): Remove special template handling.
2758         * spew.c: Do not include parse.h.
2759         * tree.c (get_overloaded_fn): Remove.
2760         * typeck.c (build_class_member_access_expr): Handle
2761         PSEUDO_DTOR_EXPR.  Adjust handling of static member functions.
2762         (lookup_destructor): New function.
2763         (finish_class_member_access_expr): Use it.
2764         (convert_arguments): Simplify.
2765         (build_unary_op): Handle BASELINKs.
2766
2767 2002-12-26  Nathan Sidwell  <nathan@codesourcery.com>
2768
2769         PR c++/4803
2770         * decl2.c (mark_used): Defer inline functions.
2771         (finish_file): Merge deferred_fns loops. Check all used
2772         inline functions have a definition.
2773         * method.c (make_thunk): Thunks are not inline.
2774
2775         PR c++/5116, c++/764
2776         * call.c (build_new_op): Make sure template class operands are
2777         instantiated.
2778
2779 2002-12-24  Nathan Sidwell  <nathan@codesourcery.com>
2780
2781         PR C++/7964
2782         * cp-tree.h (resolve_scoped_fn_name): Prototype.
2783         * call.c (resolve_scoped_fn_name): New function. Deal with
2784         more template expansion. Broken out of ...
2785         * parse.y (parse_finish_call_expr): ... here. Call it.
2786         * decl2.c (build_expr_from_tree, CALL_EXPR): Use
2787         resolve_scoped_fn_name and build_call_from_tree.
2788
2789         PR c++/9053
2790         * decl.c (duplicate_decls): Templates may be disambiguated by
2791         return type.
2792
2793         PR c++/8702
2794         * decl2.c (check_classfn): Use lookup_fnfield_1. List all
2795         conversion operators on failure.
2796
2797 2002-12-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2798
2799         Remove traditional C constructs 2/n.
2800         * call.c (tourney, build_field_call, equal_functions, joust,
2801         compare_ics, build_over_call, build_java_interface_fn_ref,
2802         convert_like_real, op_error, build_object_call, resolve_args,
2803         build_vfield_ref, check_dtor_name, build_scoped_method_call,
2804         build_addr_func, build_call, build_method_call, null_ptr_cst_p,
2805         sufficient_parms_p, build_conv, non_reference, strip_top_quals,
2806         standard_conversion, reference_related_p,
2807         reference_compatible_p, convert_class_to_reference,
2808         direct_reference_binding, reference_binding,
2809         ,implicit_conversion, is_complete, promoted_arithmetic_type_p,
2810         add_template_conv_candidate, any_viable, any_strictly_viable,
2811         build_this, splice_viable, print_z_candidates,
2812         build_user_type_conversion, build_new_function_call,
2813         conditional_conversion, build_conditional_expr, build_new_op,
2814         build_op_delete_call, enforce_access, call_builtin_trap,
2815         convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to,
2816         convert_default_arg, type_passed_as, convert_for_arg_passing,
2817         in_charge_arg_for_name, is_properly_derived_from,
2818         maybe_handle_implicit_object, maybe_handle_ref_bind,
2819         source_type, add_warning, can_convert, can_convert_arg,
2820         perform_implicit_conversion, can_convert_arg_bad,
2821         initialize_reference, add_conv_candidate,
2822         add_template_candidate_real, add_template_candidate): Ansify.
2823
2824 2002-12-22  Nathan Sidwell  <nathan@codesourcery.com>
2825
2826         PR c++/8572
2827         * cp-tree.h (grokoptypename): Add SCOPE parameter.
2828         * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type
2829         if in a template scope.
2830         * parse.y (unoperator): Return the scope.
2831         (operator_name): Adjust grokoptypename call.
2832
2833 2002-12-22  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2834
2835         * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t.
2836         * decl.c (make_unbound_class_template): Adjust.  Check for tf_error.
2837         * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error.
2838
2839 2002-12-20  Kazu Hirata  <kazu@cs.umass.edu>
2840
2841         * ChangeLog: Fix a typo.
2842         * class.c: Fix comment typos.
2843         * cp-tree.h: Likewise.
2844
2845 2002-12-18  Jason Merrill  <jason@redhat.com>
2846
2847         Handle anonymous unions at the tree level.
2848         C++ ABI change: Mangle anonymous unions using the name of their
2849         first named field (by depth-first search).  Should not cause
2850         binary compatibility problems, though, as the compiler previously
2851         didn't emit anything for affected unions.
2852         * cp-tree.def (ALIAS_DECL): New tree code.
2853         * decl2.c (build_anon_union_vars): Build ALIAS_DECLs.  Return the
2854         first field, not the largest.
2855         (finish_anon_union): Don't mess with RTL.  Do set DECL_ASSEMBLER_NAME,
2856         push the decl, and write it out at namespace scope.
2857         * decl.c (lookup_name_real): See through an ALIAS_DECL.
2858         (pushdecl): Add namespace bindings for ALIAS_DECLs.
2859         * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
2860         of a decl which doesn't have one.
2861         * typeck.c (build_class_member_access_expr): Don't recurse if
2862         we already have the type we want.
2863
2864 2002-12-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2865
2866         PR c++/8099
2867         * friend.c (make_friend_class): Allow partial specialization
2868         when declaration is not a template friend.
2869
2870 2002-12-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2871
2872         PR c++/3663
2873         * pt.c (lookup_template_class): Copy TREE_PRIVATE and
2874         TREE_PROTECTED to created decl nodes.
2875
2876 2002-12-18  Mark Mitchell  <mark@codesourcery.com>
2877
2878         * class.c (build_base_field): Do not set DECL_PACKED on the
2879         FIELD_DECL.
2880
2881 2002-12-18  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2882
2883         * cp-tree.h (struct tree_srcloc): Use location_t.
2884         (SOURCE_LOCUS): New.
2885         (SRCLOC_FILE, SRCLOC_LINE): Adjust.
2886
2887 2002-12-17  Jason Merrill  <jason@redhat.com>
2888
2889         * decl.c (finish_function): Also complain about no return in
2890         templates.
2891         * semantics.c (finish_return_stmt): Also call check_return_expr in
2892         templates.
2893         * typeck.c (check_return_expr): In a template, just remember that we
2894         saw a return.
2895
2896 2002-12-16  Jason Merrill  <jason@redhat.com>
2897
2898         * semantics.c (simplify_aggr_init_exprs_r): Don't change the type
2899         of the CALL_EXPR.
2900
2901         * semantics.c (do_pushlevel): Call pushlevel after adding the
2902         SCOPE_STMT.
2903         (do_poplevel): Call poplevel before adding the SCOPE_STMT.
2904         * parse.y (function_body): Go back to using compstmt.
2905         * decl.c (pushdecl): Skip another level to get to the parms level.
2906
2907         * call.c (build_new_method_call): Use is_dummy_object to determine
2908         whether or not to evaluate the object parameter to a static member
2909         function.
2910
2911 2002-12-14  Jason Merrill  <jason@redhat.com>
2912
2913         * semantics.c (simplify_aggr_init_exprs_r): Also prepend the
2914         return slot for normal functions.  Set CALL_EXPR_HAS_RETURN_SLOT_ADDR.
2915         * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE,
2916         don't bother with an AGGR_INIT_EXPR.
2917         (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE,
2918         just generate a new decl normally.  Take return slot parm.
2919         * cp-tree.h: Adjust prototype.
2920
2921 2002-12-13  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2922
2923         PR C++/8031
2924         * cvt.c (convert_to_pointer_force): Don't try comparing against
2925         erronous type.
2926
2927 2002-12-13  Geoffrey Keating  <geoffk@apple.com>
2928
2929         * cp-tree.h: Have the multiple-include guards around
2930         the entire file.
2931
2932 2002-12-10  David Edelsohn  <edelsohn@gnu.org>
2933
2934         * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos
2935         for SPEW_DEBUG.
2936         (snarf_method): Same.
2937         (snarf_defarg): Same.
2938
2939 2002-12-10  Mark Mitchell  <mark@codesourcery.com>
2940
2941         PR c++/8372
2942         * pt.c (tsubst_copy): Handle destructor names more correctly.
2943
2944 2002-12-10  Matt Austern   <austern@apple.com>
2945
2946         * cp-tree.h: get rid of needs_virtual_reinit bit.
2947
2948 2002-12-09  Mark Mitchell  <mark@codesourcery.com>
2949
2950         * NEWS: Document removal of in-class initialization extension for
2951         static data members of non-arithmetic, non-enumeration type.
2952         * decl.c (check_static_variable_definition): Do not allow that
2953         extension.
2954         * decl2.c (grokfield): Do not call digest_init when processing
2955         templates.
2956
2957 2002-12-05  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2958
2959         * error.c (dump_expr): Fix format specifier warning.
2960
2961 2002-12-04  Geoffrey Keating  <geoffk@apple.com>
2962
2963         * class.c (finish_struct_1): Correct comment.
2964         * cp-tree.c (DECL_SORTED_FIELDS): Likewise.
2965
2966 2002-12-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2967
2968         PR C++/8799
2969         * error.c (dump_expr): Don't ever try to dump a non-existent
2970         expression.
2971
2972 2002-12-03  Nathan Sidwell  <nathan@codesourcery.com>
2973
2974         Implement covariant returns.
2975         * cp-tree.h (IS_AGGR_TYPE_2): Remove.
2976         (struct lang_decl_flags): Add this_thunk_p flag.
2977         Rename vcall_offset to virtual_offset.
2978         (struct lang_decl): Rename delta to fixed_offset.
2979         (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines.
2980         (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg.
2981         (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ...
2982         (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here.
2983         (make_thunk): Add this_adjusting arg.
2984         (finish_thunk): Declare.
2985         (mangle_thunk): Add this_adjusting arg.
2986         * class.c (get_vcall_index): Use base function for lookup.
2987         (update_vtable_entry_for_fn): Generate covariant thunk.
2988         (finish_struct_1): Set DECL_VINDEX to NULL for thunks.
2989         (build_vtbl_initializer): Use base function for lookup.
2990         Finish covariant thunk here. Adjust thunk generation.
2991         * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling.
2992         Adjust thunk dumping.
2993         * mangle.c (mangle_call_offset): New function.
2994         (mangle_thunk): Adjust for covariant thunks.
2995         * method.c (make_thunk): Adjust. Do not set name here.
2996         (finish_thunk): New function. Set name here.
2997         (use_thunk): Generate covariant thunks too.
2998         (thunk_adjust): New function.
2999         * search.c (covariant_return_p): Remove. Fold into ...
3000         (check_final_overrider): ... here. Simplify.
3001         * semantics.c (emit_associated_thunks): Walk covariant thunk lists.
3002
3003 2002-12-03  Jason Merrill  <jason@redhat.com>
3004
3005         PR c++/8674
3006         * call.c (build_over_call): Check specifically for TARGET_EXPR
3007         when eliding.
3008
3009         PR c++/8461, c++/8625
3010         * call.c (convert_for_arg_passing): Don't mess with error_mark_node.
3011         (cp_convert_parm_for_inlining): Remove.
3012         * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
3013         Remove.
3014         * cp-tree.h (ADDR_IS_INVISIREF): Remove.
3015         * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code.
3016
3017         * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on
3018         an ambiguous conversion.
3019
3020 2002-12-03  Mark Mitchell  <mark@codesourcery.com>
3021
3022         PR c++/8688
3023         * decl.c (reshape_init): Handle erroneous initializers.
3024
3025 2002-12-02  Mark Mitchell  <mark@codesourcery.com>
3026
3027         PR c++/8720
3028         * spew.c (remove_last_token): Make sure that last_chunk is set
3029         correctly.
3030
3031         PR c++/8615
3032         * error.c (dump_expr): Handle character constants with
3033         TREE_OVERFLOW set.
3034
3035 2002-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3036
3037         DR 180
3038         * decl.c (grokdeclarator): Require class-key for all friend class.
3039         Output the correct type and context in the error message.
3040
3041 2002-12-01  Mark Mitchell  <mark@codesourcery.com>
3042
3043         PR c++/5919
3044         * pt.c (unify): Use variably_modified_type_p to test validity of
3045         template argument types.
3046
3047         PR c++/8727
3048         * cp-tree.h (lang_type_class): Add typeinfo_var.
3049         (CLASSTYPE_TYPEINFO_VAR): New macro.
3050         * rtti.c (get_tinfo_decl): Use it.
3051
3052         PR c++/8663
3053         * init.c (expand_member_init): Always get the main variant of a
3054         base class.
3055
3056 2002-12-01  Mark Mitchell  <mark@codesourcery.com>
3057
3058         PR c++/8332
3059         PR c++/8493
3060         * decl.c (cxx_init_decl_processing): Use size_type_node, not
3061         c_size_type_node.
3062         * decl2.c (coerce_new_type): Likewise.
3063         * except.c (do_allocate_exception): Likewise.
3064
3065 2002-11-30  Zack Weinberg  <zack@codesourcery.com>
3066
3067         * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c,
3068         dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c,
3069         lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c,
3070         repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c,
3071         typeck2.c: Include coretypes.h and tm.h.
3072         * Make-lang.in: Update dependencies.
3073
3074 2002-11-30  Mark Mitchell  <mark@codesourcery.com>
3075
3076         PR c++/8227
3077         * decl.c (layout_var_decl): Deal gracefully with erroneous types.
3078         (check_initializer): Validate the type of the initialized
3079         variable, even if the initializer is absent.
3080         * typeck.c (cp_type_quals): Deal gracefully with erroneous types.
3081
3082         PR c++/8214
3083         * typeck.c (convert_for_assignment): Do not use
3084         decl_constant_value on the operand.
3085
3086         PR c++/8511
3087         * pt.c (instantiate_decl): Handle template friends defined outside
3088         of the class correctly.
3089
3090 2002-11-29  Joe Buck <jbuck@synopsys.com>
3091
3092         * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
3093         anonymous structs.
3094
3095 2002-11-29  Mark Mitchell  <mark@codesourcery.com>
3096
3097         * class.c (walk_subobject_offsets): Recur on binfos as well as on
3098         types.
3099         (layout_nonempty_base_or_field): Pass it a binfo when processing a
3100         base class.
3101         (layout_empty_base): Likewise.
3102         (build_base_field): Likewise.
3103
3104 2002-11-27  Mark Mitchell  <mark@codesourcery.com>
3105
3106         * class.c (build_base_field): Make sure we get the canonical base
3107         when descending through primary bases.
3108
3109 2002-11-26  Geoffrey Keating  <geoffk@apple.com>
3110
3111         * decl.c (check_initializer): Don't error on initialisation of
3112         a scalar with a brace-enclosed expression.
3113
3114 2002-11-26  Nathan Sidwell  <nathan@codesourcery.com>
3115
3116         * cp-tree.h (DECL_LANG_FLAG_4): Document more uses.
3117         (template_parms_equal): Remove prototype.
3118         * typeck.c (buuld_indirect_ref): Reformat.
3119
3120 2002-11-25  Jason Merrill  <jason@redhat.com>
3121
3122         * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT
3123         and a DO_STMT.
3124
3125 2002-11-25  Mark Mitchell  <mark@codesourcery.com>
3126
3127         * tree.c (cp_build_qualified_type_real): Correct handling of
3128         array types.
3129         * class.c (walk_subobject_offsets): Fix thinko.
3130         (build_base_field): Record offsets of empty bases in primary
3131         virtual bases.
3132         (layout_class_type): Record offsets of empty bases in fields.
3133
3134         * search.c (is_subobject_of_p_1): Fix thinko.
3135         (lookup_field_queue_p): Likewise.
3136
3137 2002-11-24  Mark Mitchell  <mark@codesourcery.com>
3138
3139         * class.c (layout_class_type): Reuse tail padding when laying out
3140         virtual bases.
3141
3142 2002-11-22  Mark Mitchell  <mark@codesourcery.com>
3143
3144         * rtti.c (qualifier_flags): Fix thinko.
3145
3146 2002-11-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3147
3148         Remove traditional C constructs 1/n.
3149         * cp-tree.h (init_method, set_mangled_name_for_decl,
3150         build_opfncall, hack_identifier, make_thunk, use_thunk,
3151         synthesize_method, implicitly_declare_fn,
3152         skip_artificial_parms_for, optimize_function, calls_setjmp_p,
3153         maybe_clone_body): Remove use of PARAMS.
3154
3155         * method.c (do_build_assign_ref, do_build_copy_constructor,
3156         synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy):
3157         Likewise.
3158         (synthesize_method): Use 'bool' type and constants instead of
3159         'int'.
3160         (locate_copy): Likewise.
3161         (implicitly_declare_fn): Likewise.
3162
3163         * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function):
3164         Remove old-style declaration.
3165         (maybe_clone_body): Use 'bool' type and constants.
3166
3167 2002-11-21  Glen Nakamura  <glen@imodulo.com>
3168
3169         PR c++/8342
3170         * typeck.c (get_member_function_from_ptrfunc): Make sure that a
3171         SAVE_EXPR for instance_ptr doesn't get evaluated first inside one
3172         of the branches of a COND_EXPR.
3173
3174 2002-11-19  Mark Mitchell  <mark@codesourcery.com>
3175
3176         * pt.c (for_each_template_parm): Free allocated memory.
3177         * search.c (is_subobject_of_p_1): New function.
3178         (is_subobject_of_p): Avoid walking virtual bases multiple times.
3179
3180 2002-11-19  Jason Thorpe  <thorpej@wasabisystems.com>
3181
3182         * g++spec.c (lang_specific_spec_functions): New.
3183
3184 2002-11-15  Kazu Hirata  <kazu@cs.umass.edu>
3185
3186         * ChangeLog: Follow spelling conventions.
3187         * class.c: Likewise.
3188         * decl2.c: Likewise.
3189
3190 2002-11-14  Zack Weinberg  <zack@codesourcery.com>
3191
3192         * search.c (dfs_push_decls): Do not try to reorder elements
3193         3..n of method_vec if method_vec has only two elements.
3194         Reverse order of two tests to avoid accessing unallocated
3195         memory.
3196
3197 2002-11-14  Mark Mitchell  <mark@codesourcery.com>
3198
3199         * class.c (dfs_find_final_overrider): Adjust so that the most
3200         derived object is a binfo, rather than a class type.
3201         (find_final_overrider): Likewise.
3202         (add_vcall_offset_vtbl_entries_1): Simplify accordingly.
3203         (add_vcall_offset): Likewise.
3204
3205 2002-11-09  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3206
3207         PR c++/8389
3208         * pt.c (instantiate_template): Push class scope for member
3209         functions.
3210         (get_mostly_instantiated_function_type): Likewise.  Don't call
3211         tsubst on context.  Remove CONTEXTP and TPARMSP parameters.
3212         * cp-tree.h (get_mostly_instantiated_function_type): Adjust.
3213         * mangle.c (write_encoding, write_unqualified_name): Adjust.
3214
3215 2002-11-07  Mark Mitchell  <mark@codesourcery.com>
3216
3217         * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of
3218         vcall offfsets.  Split out ...
3219         (add_vcall_offset): ... new function.
3220
3221         PR c++/8338
3222         * pt.c (for_each_template_parm): Add htab parameter.
3223         (process_partial_specialization): Adjust call.
3224         (push_template_decl_real): Likewise.
3225         (pair_fn_data): Add visited.
3226         (for_each_template_parm_r): Avoid walking duplicates more than
3227         once.
3228         (uses_template_parms): Adjust call to for_each_template_parm.
3229
3230 2002-11-07  Mark Mitchell  <mark@codesourcery.com>
3231
3232         * class.c (add_implicitly_declared_members): Put implicitly
3233         declared functions at the end of TYPE_METHODs when -fabi-version
3234         is at least 2.
3235
3236 2002-11-05  Geoffrey Keating  <geoffk@apple.com>
3237
3238         * decl2.c (finish_file): Correct spelling.
3239
3240 2002-11-03  Mark Mitchell  <mark@codesourcery.com>
3241
3242         * call.c (build_special_member_call): Do not try to lookup VTTs by
3243         name.
3244         * class.c (vtbl_init_data): Add generate_vcall_entries.
3245         (get_vtable_decl): Do not look up virtual tables by name.
3246         (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P.
3247         (set_primary_base): Do not set CLASSTYPE_RTTI.
3248         (determine_primary_base): Likewise.
3249         (get_matching_virtual): Remove.
3250         (get_vcall_index): New function.
3251         (update_vtable_entry_for_fn): Do not try to use virtual thunks
3252         when they are not required.  Assign vcall indices at this point.
3253         (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT.
3254         Do update dynamic_classes.
3255         (build_vtt): Do not add VTTs to the symbol table.
3256         (build_ctor_vtbl_group): Likewise.
3257         (build_vtbl_initializer): Simplify handling of vcall indices.
3258         (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets
3259         for the most derived class.
3260         (add_vcall_offset_vtbl_entries_1): But do not actually add them to
3261         the vtable.
3262         * cp-tree.h (dynamic_classes): New macro.
3263         (lang_type_class): Remove rtti.  Add vtables.  Add vcall_indices.
3264         (CLASSTYPE_RTTI): Remove.
3265         (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove.
3266         (CLASSTYPE_VCALL_INDICES): New macro.
3267         (CLASSTYPE_VTABLES): Likewise.
3268         (BV_USE_VCALL_INDEX_P): Remove.
3269         (build_vtable_path): Remove.
3270         * decl2.c (finish_vtable_vardecl): Remove.
3271         (key_method): Remove #if 0'd code.
3272         (finish_vtable_vardecl): Rename to ...
3273         (maybe_emit_vtables): ... this.
3274         (finish_file): Use it.
3275         * search.c (look_for_overrides_here): Update comment.
3276
3277 2002-11-01  Zack Weinberg  <zack@codesourcery.com>
3278
3279         PR c/7353 redux
3280         * decl2.c (grokfield): Reject TYPE_DECLs with initializers.
3281
3282 2002-10-30  Jason Merrill  <jason@redhat.com>
3283
3284         PR c++/8186
3285         * cp-tree.h (ADDR_IS_INVISIREF): New macro.
3286         * call.c (convert_for_arg_passing): Set it.
3287         * except.c (stabilize_throw_expr): Recurse for such an arg.
3288
3289 2002-10-31  Mark Mitchell  <mark@codesourcery.com>
3290
3291         * cp-tree.h (lang_decl_flags): Remove init_priority.
3292         (lang_decl): Add delta.
3293         (GLOBAL_INIT_PRIORITY): Remove.
3294         (THUNK_DELTA): Revise definition.
3295         * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY.
3296         * dump.c (cp_dump_tree): Don't dump it.
3297
3298 2002-10-30  Mark Mitchell  <mark@codesourcery.com>
3299
3300         PR c++/8160
3301         * typeck2.c (process_init_constructor): Call complete_array_type.
3302
3303         PR c++/8149
3304         * decl.c (make_typename_type): Issue errors about invalid results.
3305
3306 2002-10-30  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3307
3308         Core issue 287, PR c++/7639
3309         * cp-tree.h (lang_type_class): Add decl_list field.
3310         (CLASSTYPE_DECL_LIST): New macro.
3311         (maybe_add_class_template_decl_list): Add declaration.
3312         * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST.
3313         (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST.
3314         (maybe_add_class_template_decl_list): New function.
3315         (add_implicitly_declared_members): Use it.
3316         * decl.c (maybe_process_template_type_declaration): Likewise.
3317         (pushtag): Likewise.
3318         * friend.c (add_friend): Likewise.
3319         (make_friend_class): Likewise.
3320         * semantics.c (finish_member_declaration): Likewise.
3321         (begin_class_definition): Initialize CLASSTYPE_DECL_LIST.
3322         * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST
3323         to process members and friends in the order of declaration.
3324
3325 2002-10-29  Mark Mitchell  <mark@codesourcery.com>
3326
3327         PR c++/8287
3328         * decl.c (finish_destructor_body): Create the label to jump to
3329         when returning from a destructor here.
3330         (finish_function_body): Rather than here.
3331
3332 2002-10-25  Zack Weinberg  <zack@codesourcery.com>
3333
3334         PR c++/7266
3335         * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a
3336         SCOPE_REF is not null before dereferencing it.
3337
3338 2002-10-25  Mark Mitchell  <mark@codesourcery.com>
3339
3340         * call.c (build_over_call): Use DECL_CONTEXT, not
3341         DECL_VIRTUAL_CONTEXT.
3342         * class.c (modify_vtable_entry): Don't mess with
3343         DECL_VIRTUAL_CONTEXT.
3344         (set_vindex): Remove.
3345         (set_primary_base): Remove vfuns_p parameter.
3346         (determine_primary_base): Likewise.
3347         (modify_all_vtables): Likewise.
3348         (layout_class_type): Likewise.  Adjust calls to other functions
3349         accordingly.
3350         (finish_struct_1): Adjust calls to modified functions.  Set
3351         DECL_VINDEX here.
3352         * cp-tree.h (lang_type_class): Remove vsize.
3353         (CLASSTYPE_VSIZE): Remove.
3354         (lang_decl): Remove thunks.
3355         (DECL_THUNKS): Adjust.
3356         (DECL_VIRTUAL_CONTEXT): Remove.
3357         (duplicate_decls): Don't copy it.
3358         * pt.c (build_template_decl): Don't set it.
3359         (tsubst_decl): Likewise.
3360         * typeck.c (expand_ptrmemfunc_cst): Don't use it.
3361
3362         * class.c (build_vtbl_initializer): Don't use build_vtable_entry.
3363         (build_vtable_entry): Remove.
3364         * cp-tree.h (BINFO_VIRTUALS): Expand documentation.
3365         (lang_decl): Add thunks.
3366         (DECL_THUNKS): New macro.
3367         * decl.c (duplicate_decls): Copy it.
3368         * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS.
3369         * semantics.c (emit_associated_thunks): Simplify.
3370
3371 2002-10-24  David Edelsohn  <edelsohn@gnu.org>
3372
3373         PR c++/7228
3374         * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that
3375         lang_type structure exists before accessing field.
3376         (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro.
3377         (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar.
3378         (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro.
3379         * class.c (check_field_decls): Use new macros.
3380         * typeck2.c (process_init_constructor): Remove redundant check for
3381         existence of lang_type structure.
3382
3383 2002-10-24  Mark Mitchell  <mark@codesourcery.com>
3384
3385         * class.c (end_of_base): New method.
3386         (end_of_class): Use it.  Check indirect virtual bases.
3387
3388         * class.c (check_field_decls): Fix typo.
3389
3390 2002-10-23  Mark Mitchell  <mark@codesourcery.com>
3391
3392         PR c++/8067
3393         * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
3394         related variables.
3395
3396         PR c++/7679
3397         * spew.c (next_token): Do not return an endless stream of
3398         END_OF_SAVED_INPUT tokens.
3399         (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of
3400         the cached token stream.
3401         (snarf_defarg): Likewise.
3402
3403 2002-10-23  Zack Weinberg  <zack@codesourcery.com>
3404
3405         * cp-lang.c (cp_var_mod_type_p): New: C++ hook for
3406         variably_modified_type_p.
3407         * cp-tree.h: Remove prototype of variably_modified_type_p.
3408         * tree.c (variably_modified_type_p): Remove; now implemented
3409         in language-independent code.
3410
3411 2002-10-22  Mark Mitchell  <mark@codesourcery.com>
3412
3413         PR c++/6579
3414         * spew.c (snarf_parenthesized_expression): New function.
3415         (snarf_block): Use it.
3416
3417 2002-10-22  Richard Henderson  <rth@redhat.com>
3418
3419         * method.c (use_thunk): Always compute vcall_value; assert that
3420         it is not zero.  Use can_output_mi_thunk; use output_mi_thunk
3421         for vcall thunks as well.
3422
3423 2002-10-21  Mark Mitchell  <mark@codesourcery.com>
3424
3425         * class.c (empty_base_at_nonzero_offset_p): New function.
3426         (layout_nonempty_base_or_field): Do not check for conflicts when
3427         laying out a virtual base using the GCC 3.2 ABI.
3428         (build_base_field): Correct checking for presence of empty classes
3429         at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P.
3430
3431         * class.c (include_empty_classes): Use normalize_rli.
3432         (layout_class_type): Likewise.
3433
3434         * decl.c (reshape_init): Tweak handling of character arrays.
3435
3436         PR c++/8218
3437         * cp-tree.h (lang_type_class): Add contains_empty_class_p.
3438         (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro.
3439         * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P.