OSDN Git Service

Fix email
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-10-05  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2
3         Convert diagnostics to use quoting flag q 6/n
4         * pt.c (finish_member_template_decl, check_specialization_scope, 
5         maybe_process_partial_specialization, determine_specialization, 
6         check_explicit_specialization, maybe_check_template_type, 
7         process_partial_specialization, check_default_tmpl_args, 
8         push_template_decl_real, redeclare_class_template, 
9         convert_nontype_argument, coerce_template_parms, 
10         lookup_template_class, push_tinst_level, 
11         instantiate_class_template, tsubst_arg_types, 
12         tsubst_function_type, tsubst, tsubst_qualified_id, 
13         tsubst_copy_and_build, check_instantiated_args, 
14         do_decl_instantiation, do_type_instantiation, 
15         invalid_nontype_parm_type_p, check_specialization_namespace, 
16         convert_template_argument, determine_specialization, 
17         check_template_shadow, tsubst_decl 
18         instantiate_pending_templates): Use quoting marks.
19
20 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
21
22         PR c++/17829
23         * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
24         unqualified lookup finds a member function.
25
26 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
27
28         Convert diagnostics to use quoting flag q 5/n
29         * parser.c (cp_parser_name_lookup_error, 
30         cp_parser_diagnose_invalid_type_name, 
31         cp_parser_primary_expression, cp_parser_unqualified_id, 
32         cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement, 
33         cp_parser_jump_statement, cp_parser_simple_declaration, 
34         cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id, 
35         cp_parser_type_parameter, cp_parser_template_id, 
36         cp_parser_template_name, cp_parser_direct_declarator, 
37         cp_parser_parameter_declaration_list, cp_parser_class_head, 
38         cp_parser_base_specifier, cp_parser_lookup_name, 
39         cp_parser_late_parsing_default_args, 
40         cp_parser_optional_template_keyword 
41         cp_parser_elaborated_type_specifier, cp_parser_check_class_key, 
42         cp_parser_check_access_in_redeclaration): Use quoting marks.
43
44         * name-lookup.c (supplement_binding, pushdecl, 
45         check_for_out_of_scope_variable, validate_nonmember_using_decl, 
46         do_nonmember_using_decl, lookup_tag, set_decl_namespace, 
47         push_namespace, do_namespace_alias, do_using_directive, 
48         ambiguous_decl, lookup_namespace_name, add_function): Likewise.
49
50         * method.c (use_thunk): Likewise.
51
52         * lex.c (unqualified_name_lookup_error, 
53         unqualified_fn_lookup_error): Likewise.
54
55 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
56
57         Convert diagnostics to use quoting flag q 4/n
58         * except.c (decl_is_java_type, build_throw, 
59         is_admissible_throw_operand, check_handlers_1, check_handlers): 
60         Use quoting formats.
61         * friend.c (add_friend, make_friend_class, do_friend): Likewise.
62         * init.c (sort_mem_initializers, emit_mem_initializers, 
63         member_init_ok_or_else, expand_member_init, is_aggr_type, 
64         build_offset_ref, build_java_class_ref): Likewise.
65
66 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
67
68         Convert diagnostics to use quoting flag q 3/n
69         * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
70         redeclaration_error_message, lookup_label, check_goto,
71         make_typename_type, make_unbound_class_template,
72         fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1, 
73         grok_reference_init, layout_var_decl, maybe_commonize_var, 
74         check_for_uninitialized_const_var, reshape_init_array, 
75         reshape_init, check_initializer, cp_finish_decl,
76         member_function_or_else, bad_specifiers, grokfndecl, grokvardecl, 
77         check_static_variable_definition, compute_array_index_type, 
78         create_array_type_for_decl, check_special_function_return_type, 
79         grokdeclarator, check_default_argument, grokparms, 
80         grok_ctor_properties, grok_op_properties, 
81         check_elaborated_type_specifier, xref_tag, finish_enum, 
82         build_enumerator, check_function_type, start_preparsed_function, 
83         store_parm_decls): Use quoting formats.
84         * decl2.c (grok_array_decl, delete_sanity, check_member_template, 
85         check_java_method, check_classfn, finish_static_data_member_decl, 
86         grokfield, grokbitfield, grok_function_init,
87         build_anon_union_vars, coerce_new_type, coerce_delete_type,
88         check_default_args): Likewise.
89         * parser.c (cp_parser_decl_specifier_seq): Likewise.
90
91 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
92
93         Convert diagnostics to use quoting flag q 2/n
94         * class.c (build_base_path, add_method, alter_access,
95         handle_using_decl, check_bases,
96         maybe_warn_about_overly_private_class, find_final_overrider,
97         warn_hidden, finish_struct_anon, add_implicitly_declared_members,
98         check_bitfield_decl, check_field_decls, layout_empty_base,
99         build_base_field, check_methods, layout_virtual_bases,
100         warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
101         resolve_address_of_overloaded_function, instantiate_type,
102         note_name_declared_in_class): Use format flag "q" for quoting.
103
104 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
105
106         Convert diagnostics to use quoting flag q 1/n
107         * error.c (locate_error): Ignore quoting flag q.
108         * call.c (build_user_type_conversion_1, build_operator_new_call,
109         build_object_call, op_error, build_conditional_expr,
110         build_new_op, build_op_delete_call, enforce_access,
111         convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
112         convert_default_arg, build_over_call, build_new_method_call,
113         joust, perform_implicit_conversion, initialize_reference): Use the
114         quoting flag q.
115
116 2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>
117
118         PR c++/17797
119         * typeck.c (build_reinterpret_cast): Return if the inner type
120         is error_mark_node.
121
122 2004-10-01  Jan Hubicka  <jh@suse.cz>
123
124         * semantics.c (expand_body): Update call of tree_rest_of_compilation.
125
126 2004-09-30  Nathan Sidwell  <nathan@codesourcery.com>
127
128         * cp-tree.h (struct lang_decl): Shrink by reordering fields and
129         turning operator_code and fixed_offset into bitfields.
130
131 2004-09-29  Joseph S. Myers  <jsm@polyomino.org.uk>
132
133         * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
134
135 2004-09-29  Jason Merrill  <jason@redhat.com>
136
137         PR tree-optimization/17697
138         * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
139
140 2004-09-28  Jason Merrill  <jason@redhat.com>
141
142         PR middle-end/17525
143         * class.c (build_base_field): Set TYPE_MODE.
144
145 2004-09-28  Roger Sayle  <roger@eyesopen.com>
146
147         PR driver/17537
148         * g++spec.c (lang_specific_driver): Unrecognized libraries, other
149         than -lc and -lm, may require linking against libstc++.
150
151 2004-09-28  Kazu Hirata  <kazu@cs.umass.edu>
152
153         * tree.c: Fix a comment typo.
154
155 2004-09-28  Nathan Sidwell  <nathan@codesourcery.com>
156
157         * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
158         (struct secondary_vptr_vtt_init_data_s): New.
159         (build_vtt_inits): Adjust dfs_walkers.
160         (dfs_build_secondary_vptr_vtt_inits): Caller data is a
161         secondary_vptr_vtt_init_data_s structure. Adjust.
162         (dfs_ctor_vtable_bases_queue_p): Remove.
163         (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
164
165         * pt.c (struct get_template_base_data_s): Remove.
166         (get_template_base_r): Fold into get_template_base.
167         (get_template_base): Walk base binfos directly in inheritance
168         graph order.
169
170 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
171
172         PR c++/17642
173         * cp-tree.h (fold_if_not_in_template): New function.
174         * call.c (build_conditional_expr): Use fold_if_not_in_template.
175         (build_cxx_call): Likewise.
176         * cvt.c (convert_to_complex): Likewise.
177         (ocp_convert): Likewise.
178         (convert): Likewise.
179         (convert_force): Likewise.
180         * decl.c (compute_array_index_type): Clear
181         processing_template_decl while folding array bounds.
182         * pt.c (convert_nontype_argument): Clear
183         processing_template_decl while processing non-type argument
184         initialization.
185         * tree.c (fold_if_not_in_template): New function.
186         * typeck.c (build_class_member_access_expr): Use
187         fold_if_not_in_template.
188         (build_array_ref): Likewise.
189         (build_binary_op): Likewise.  Do not try to optimize computations
190         when processing templates.
191         (cp_pointer_int_sum): Use fold_if_not_in_template.
192         (pointer_diff): Likewise.
193         (build_unary_op): Likewise.
194         (build_reinterpret_cast): Likewise.
195         (get_delta_difference): Likewise.
196         (expand_ptrmemfunc_cst): Likewise.
197         (dubious_conversion_warnings): Likewise.
198
199 2004-09-27  Matt Austern  <austern@apple.com>
200
201         * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
202         (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
203         tokens that come from headers that are implicitly extern "C".
204         (struct cp_parser): new one-bit field, implicit_extern_c.
205         (cp_parser_new): Set parser's implicit_extern_c to false.
206         (cp_parser_translation_unit): Pop lang context if we were in a
207         header that was implicitly extern "C".
208         (cp_parser_declaration_seq_opt): Push/pop lang context as
209         required by the token's and parser's implicit_extern_c.
210         
211 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
212
213         PR c++/17585
214         * cp-tree.h (shared_member_p): Declare.
215         * search.c (shared_member_p): Give it external linkage.
216         * semantics.c (finish_qualified_id_expr): Use it.
217         (finish_id_expression): Likewise.
218
219         PR c++/17585
220         * semantics.c (finish_id_expression): Do not add "this->" to
221         static member functions.
222
223 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
224
225         PR c++/17681
226         * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
227
228         * class.c (struct count_depth_data): Remove.
229         (dfs_depth_post, dfs_depth_q): Remove.
230         (find_final_overrider): Use number of vbase classes as depth
231         bound.
232         
233         * cp-tree.h (types_overlap_p): Remove.
234         * search.c (struct overlap_info): Remove.
235         (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
236         
237         * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
238         (get_template_base_recursive): Remove. Replace with ...
239         (get_template_base_r): ... this.
240         (struct get_template_base_data_s): New.
241         (get_template_base): Use get_template_base_r via dfs_walk.  Always
242         return NULL on failure.
243         (unify): Remove error_mark_node check from get_template_base result.
244
245 2004-09-24  Paolo Bonzini  <bonzini@gnu.org>
246
247         * parser.c (cp_parser_expression_stack): Clarify why it is
248         an array of NUM_PREC_VALUES elements.
249         (cp_parser_binary_expression): Clarify why we do not need to
250         handle stack overflow.
251
252 2004-09-24  Nathan Sidwell  <nathan@codesourcery.com>
253
254         PR c++/16889
255         * search.c (lookup_field_queue_p): Correct check for hidden base.
256
257         * search.c (bfs_walk): Remove.
258         (lookup_member): Use dfs_walk_real.
259         (dfs_walk_real): Move and adjust documentation from bfs_walk.
260
261 2004-09-23  Zack Weinberg  <zack@codesourcery.com>
262
263         * decl.c (grokfndecl): If ::main is found not to return int,
264         correct it after issuing a diagnostic.
265         (grokdeclarator): If the incoming type was error_mark_node, do
266         not complain about declaring something with no type.
267         (start_function): Change check for ::main not returning int to
268         an assertion, as grokfndecl now catches this when the user did it.
269         * init.c (perform_member_init, sort_mem_initializers)
270         (emit_mem_initializers): Make most diagnostics be issued on
271         the line of current_function_decl, not whatever the current
272         input line is.
273         * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
274         definition and declaration with #ifdef ENABLE_CHECKING.
275         Avoid unnecessary use of fprintf.
276         (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
277         definitions to avoid warnings.
278         (cp_lexer_new_main): Add assertion that first token is not a
279         padding token.
280         (cp_lexer_new_from_token_array): Fold into ...
281         (cp_lexer_new_from_tokens): ... here.  Add assertion that
282         first token is not a padding token.
283         (cp_lexer_set_source_position_from_token): Move nearer to callers.
284         Remove unused lexer argument.
285         (cp_lexer_peek_token): Just print debugging report (if enabled)
286         and return lexer->next_token.
287         (cp_lexer_skip_purged_tokens): Delete.
288         (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
289         inline, simplify bodies.
290         (cp_lexer_peek_nth_token): Add debugging report a la
291         cp_lexer_peek_token.
292         (cp_lexer_consume_token): Correct commentary.  Advance over
293         purged tokens here.  Set current source position here, from
294         token to be returned.  Avoid unnecessary use of fprintf.
295         (cp_lexer_purge_token): Advance next_token pointer over this and
296         subsequent purged tokens.
297         (cp_parser_error): Adjust source position to that of the
298         peeked token.
299         (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
300         (cp_parser_string_literal): Remove some excessive cleverness.
301         (cp_parser_enum_specifier): Call start_enum before consuming
302         the opening brace.
303         (cp_parser_member_declaration): Make the "extra semicolon"
304         diagnostic consistently-worded with the other place this is
305         diagnosed.  Explicitly set the diagnostic location to the
306         location of the offending semicolon.
307         (cp_parser_enclosed_template_argument_list): Use %</%> quoting
308         in diagnostics.  Do not use cp_parser_require.  Set location
309         of diagnostics about improper use of '>>' to location of
310         offending token.
311         (cp_parser_late_parsing_for_member):
312         Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
313         (cp_parser_late_parsing_default_args): Likewise.  Manually
314         move some logic outside the loop.
315
316 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
317
318         PR c++/17618
319         * cvt.c (cp_convert_to_pointer): Return early when the type is
320         an error_mark_node.
321
322 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
323
324         PR c++/13989
325         PR c++/9844
326         * decl.c (grokfndecl): Add new argument "attrlist", use it
327         to call cplus_decl_attributes.
328         (start_function): Remove call to cplus_decl_attributes.
329         * cvt.c (ocp_convert): Add support to use type conversion
330         function to vector type.
331         * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
332         to the parsed type.
333
334 2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
335
336         PR c++/17596
337
338         * parser.c (cp_parser_token_tree_map_node,
339         cp_parser_pm_expression, cp_parser_additive_expression,
340         cp_parser_multiplicative_expression, cp_parser_shift_expression,
341         cp_parser_relational_expression, cp_parser_equality_expression,
342         cp_parser_and_expression, cp_parser_exclusive_or_expression,
343         cp_parser_inclusive_or_expression,
344         cp_parser_logical_and_expression,
345         cp_parser_logical_or_expression): Removed.
346         (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
347         binops, binops_by_token): New.
348         (cp_parser_assignment_expression): Use cp_parser_binary_expression.
349         (cp_parser_new): Initialize binops_by_token.
350         (cp_parser_binary_expression): Rewritten.
351         (N_CP_TTYPES): New.
352
353 2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
354
355         * parser.c: Fix a comment typo.
356
357 2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
358
359         PR c++/17620
360         * decl.c (xref_basetypes): Look through typedefs before checking
361         for duplicate base.
362
363 2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
364
365         * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
366         * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
367         * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
368         (init_rtti_processing): Initialize it to something realistic.
369         (get_tinfo_decl): Adjust pushing the new decl.
370
371         * cp-tree.h (struct lang_type_class): Remove marked flags, add
372         diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
373         (TYPE_MARKED_P): New.
374         (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
375         (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
376         CLEAR_CLASSTYPE_MARKED_N): Remove.
377         (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
378         CLEAR_CLASSTYPE_MARKED_*): Remove.
379         * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
380         shaped and repeated base properties.
381         * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
382         * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
383         class_hint_flags): Remove.
384         (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
385         CLASSTYPE_DIAMOND_SHAPED_P.
386
387 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
388
389         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
390         cp-objcp-common.h.
391         (objcp_tsubst_copy_and_build): Reformat function signature.
392         * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
393         (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
394
395 2004-09-21  Zack Weinberg  <zack@codesourcery.com>
396
397         * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
398         Don't handle CPP_PRAGMA tokens specially.
399         (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
400         purge the token; do clear token->value after processing.  Add
401         assertion at beginning that token->value is nonzero.
402         (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
403         CPP_PRAGMA as a full statement or declaration in its own right.
404
405 2004-09-21  Matt Austern  <austern@apple.com>
406
407         PR c++/15049
408         * decl.c (grokvardecl): Accept declarations of global variables
409         using anonymous types.
410
411 2004-09-21  Roger Sayle  <roger@eyesopen.com>
412
413         PR c++/7503
414         * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
415         if either operand has side-effects.
416         * typeck.c (rationalize_conditional_expr): Assert that neither
417         operand of MIN_EXPR or MAX_EXPR has side-effects.
418         (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
419         Check that the "lhs" is a valid lvalue, i.e. that neither operand
420         of a MIN_EXPR or MAX_EXPR has a side-effect.
421
422 2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
423
424         * cp-tree.h (struct lang_type_header): Remove
425         uses_multiple_inheritance field.
426         (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
427         (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
428         (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
429         (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
430         (TYPE_CONTAINS_VPTR_P): Likewise.
431         * call.c (add_template_candidate_real): Use
432         CLASSTYPE_VBASECLASSES.
433         (build_special_member_call): Likewise.
434         * class.c (finish_struct_bits): Remove
435         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
436         bookkeeping.
437         (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
438         (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
439         bookkeeping.
440         (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
441         (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
442         Likewise.
443         * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
444         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
445         bookkeeping.
446         (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
447         * decl2.c (maybe_retrofit_in_chrg): Likewise.
448         * init.c (expand_member, push_base_cleanups): Likewise.
449         * pt.c (instantiate_class_template): Remove
450         TYPE_USES_MULTIPLE_INHERITANCE,
451         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
452         bookkeeping.
453         * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
454         check.
455         * typeck2.c (process_init_constructor): Replace some sorrys with
456         asserts.
457
458 2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
459
460         * decl.c (reshape_init_array): Initialize max_index_cst to fix
461         bootstrap failure.
462
463 2004-09-20  Mark Mitchell  <mark@codesourcery.com>
464
465         PR c++/17530
466         * pt.c (tsubst): Fix parentheses to accomodate emacs.
467         (tsubst_baselink): If we get a single function, mark it as used.
468
469 2004-09-20  Matt Austern <austern@apple.com>
470             Zack Weinberg  <zack@codesourcery.com>
471
472         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
473         Apply lbasename to input_filename before passing to get_fileinfo.
474         * semantics.c (begin_class_definition): Likewise.
475         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
476         correct filename.  Rename variables to be less confusing.
477         (handle_pragma_implementation): Likewise.  Disable "appears
478         after file is included" diagnostic.
479
480         * parser.c (struct cp_token): Add in_system_header fiag.
481         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
482         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
483         (CPP_NONE, cp_lexer_read_token): Delete.
484         (struct cp_lexer): Remove first_token, string_tokens,
485         main_lexer_p fields.  Clarify comments.
486         (struct cp_token_cache): Now just a pair of pointers.
487         (CP_LEXER_BUFFER_SIZE): New #define.
488         (CPP_PURGED): New fake token type.
489         (cp_lexer_new_from_token_array, cp_lexer_destroy)
490         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
491         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
492         New functions.
493         (cp_lexer_new_from_tokens): Now a simple wrapper around
494         cp_lexer_new_from_token_array.
495         (cp_lexer_set_source_position_from_token): Also update
496         in_system_header.
497         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
498         Don't wrap round.
499         (cp_lexer_token_difference): Dont handle wrapping round.
500         (cp_lexer_new_main): Enable pragma deferral and raw strings,
501         read the entire translation unit through c_lex_with_flags into
502         this lexer's buffer, then turn raw strings back off again.
503         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
504         (cp_lexer_get_preprocessor_token): No need to handle not being
505         the main lexer.  Set token->in_system_header too.
506         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
507         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
508         (cp_lexer_peek_nth_token): Likewise.
509         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
510         the other tokens down.
511         (cp_lexer_purge_tokens_after): Likewise.
512         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
513         about there being no tokens.
514         (cp_lexer_print_token): Revise to give useful information on
515         all tokens.
516         (struct cp_parser): Add field translate_strings_p.
517         (cp_parser_new): Initialize it.
518         (cp_parser_translation_unit): Destroy the lexer when done.
519         (cp_parser_parameter_declaration): Restructure saving of
520         default arguments.
521         (cp_parser_save_member_function_body): Likewise.
522         (cp_parser_check_for_invalid_template_id)
523         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
524         Adjust calls to cp_lexer_advance_token.
525         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
526         No need to fiddle c_lex_string_translate.
527         (cp_parser_primary_expression, cp_parser_linkage_specification)
528         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
529         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
530         Use cp_parser_string_literal.
531         (cp_parser_attribute_list): Save and restore
532         parser->translate_strings_p, not c_lex_string_translate.
533         (cp_parser_cache_group): Delete.
534         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
535         not take a cache argument.
536
537 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
538
539         PR c++/14179
540         * decl.c (reshape_init): Extract array handling into...
541         (reshape_init_array): New function. Use integers instead of trees
542         for indices. Handle out-of-range designated initializers.
543
544 2004-09-20  Steven Bosscher  <stevenb@suse.de>
545
546         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
547         to null_node.
548
549 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
550
551         * decl2.c (determine_visibility): Allow class visibility
552         directives to override targetm.cxx.export_class_data.
553
554 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
555
556         * call.c, semantics.c: Follow spelling conventions.
557         * class.c: Fix a comment typo.
558
559 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
560
561         PR pch/13361
562         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
563         (handle_pragma_implementation): Likewise.
564
565 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
566             Zack Weinberg  <zack@codesourcery.com>
567
568         * cp-tree.def: Use tree_code_class enumeration constants
569         instead of code letters.
570         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
571         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
572         Update for new tree-class enumeration constants.
573
574 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
575
576         PR c++/16002
577         * parser.c (cp_parser_simple_declaration): Commit to tentative
578         parses after seeing a decl-specifier.
579         (cp_parser_simple_declaration): Eliminate spurious message.
580         (cp_parser_init_declarator): Adjust error message.
581
582         PR c++/16029
583         * lex.c (unqualified_name_lookup_error): Mark the dummy
584         declaration as used.
585
586         PR c++/17501
587         * parser.c (cp_parser_nested_name_specifier): Do not resolve
588         typename types if the user explicitly said "typename".
589
590 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
591
592         * error.c (dump_decl): Make sure there is lang_specific info before
593         checking for DTOR and CTOR decls.
594
595 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
596
597         * class.c (copy_virtuals): Remove.
598         (build_primary_vtable): Use copy_list directly.
599         (build_secondary_vtable): Likewise.
600         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
601         (create_vtable_ptr): Likewise.
602
603 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
604
605         * search.c: Follow spelling conventions.
606
607 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
608
609         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
610         VEC(tree).
611         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
612         comments.
613         * call.c (build_new_method_call): Don't confirm a pure virtual is
614         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
615         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
616         (fixup_inline_methods, finish_struct): Likewise.
617         * decl.c (finish_method): Likewise.
618         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
619         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
620         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
621         vector to avoid repeating the list in error messages.
622
623 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
624
625         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
626         * cp-tree.h (cxx_comdat_group): Declare.
627         * decl.c (cxx_comdat_group): New function.
628
629 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
630
631         * search.c (get_pure_virtuals): Remove unused variables.
632
633         * cp-tree.h (struct lang_decl_flags): Remove
634         needs_final_overrider.
635         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
636         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
637         * class.c (finish_struct_bits): Correct comment about
638         CLASSTYPE_PURE_VIRTUALS.
639         * search.c (get_pure_virtuals): Remove useless loop.
640
641 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
642
643         PR c++/17324
644         * mangle.c (partially_mangled_name): New variable.
645         (partially_mangled_name_len): Likewise.
646         (save_partially_mangled_name): New function.
647         (restore_partially_mangled_name): Likewise.
648         (write_encoding): Save and restore partially mangled names around
649         calls to get_mostly_instantiated_function_type.
650         (write_unqualified_name): Likewise.
651
652 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
653
654         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
655
656 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
657
658         PR c++/16162
659         * parser.c (cp_parser_id_expression): Correct value for
660         is_declarator.
661         (cp_parser_nested_name_specifier_opt): Look through typenames as
662         necessary.
663         (cp_parser_template_name): Honor check_dependency_p.
664
665         PR c++/16716
666         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
667         Robustify.
668
669         PR c++/17327
670         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
671         gcc_unreacable.
672
673 2004-09-12  Richard Henderson  <rth@redhat.com>
674
675         PR c++/16254
676         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
677         * typeck.c (condition_conversion): Likewise.
678
679 2004-09-11  Richard Henderson  <rth@redhat.com>
680
681         PR c++/17404
682         * pt.c (cur_stmt_expr): Move from tsubst_expr.
683         (tsubst_expr) <case STMT_EXPR>: Move ...
684         (tsubst_copy_and_build): ... here.
685
686 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
687
688         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
689         comment explaining them moved to c-common.h.
690         * lex.c (interface_only, interface_unknown, extract_interface_info):
691         Delete definitions.
692         (cxx_finish): Don't reset interface_unknown.
693         (handle_pragma_interface): Don't set interface_only and
694         interface_unknown; just the like-named fields in finfo.
695         (handle_pragma_implementation): Adjust comment.
696         * decl2.c (cp_finish_file): Don't reset interface_only and
697         interface_unknown.
698         * method.c (synthesize_method): Don't reset interface_unknown or
699         call extract_interface_info.
700         * pt.c (pop_tinst_level): Don't call extract_interface_info.
701         * decl.c (start_cleanup_fn): Don't save or restore interface_only
702         and interface_unknown.
703         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
704         and use the result instead of the interface_only/interface_unknown
705         globals.
706         (start_preparsed_function): Likewise.
707         * lex.c (cxx_make_type): Likewise.
708         * semantics.c (begin_class_definition): Likewise.
709         (expand_body): Don't call extract_interface_info.
710
711 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
712
713         * decl.c (objc_mark_locals_volatile): Make description of
714         routine more descriptive; only mark VAR_DECLs at each
715         binding level.
716
717 2004-09-10  Richard Henderson  <rth@redhat.com>
718
719         PR c++/17386
720         * call.c (build_vfield_ref): Move...
721         * class.c (build_vfield_ref): ... here.  Convert datum to the
722         primary base containing the vptr.
723         (make_new_vtable): Simplify build_primary_vtable arguments.
724         (finish_struct_1): Do not duplicate TYPE_VFIELD.
725         * typeck.c (build_class_member_access_expr): Don't warn for
726         null object access to base fields.
727
728 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
729
730         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
731         New functions, to be called from ObjC++.
732
733 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
734
735         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
736         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
737         comment typos.
738
739 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
740
741         * typeck.c (build_c_cast): Preserve the cast if casting
742         to and from an Objective-C type.
743
744 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
745
746         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
747         * typeck.c: Include c-common.h.
748         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
749         return the result if nonnegative.
750
751 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
752
753         * decl2.c (import_export_class)
754         * lex.c (handle_pragma_interface):
755         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
756
757 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
758
759         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
760         * semantics.c: Include c-common.h.
761         (finish_compound_stmt): Call objc_clear_super_receiver().
762
763 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
764
765         * cp-tree.h (do_poplevel): New prototype.
766         * semantics.c (do_poplevel): Make externally visible.
767
768 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
769
770         * cp-tree.h (tree_pair_s): Define a GC'd vector.
771         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
772         * semantics.c (deferred_access): Likewise.
773
774 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
775
776         * semantics.c (expand_body): Assert that we are not nested.
777
778 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
779
780         * decl.c (build_enumerator): Use add_double and int_fits_type_p
781         instead of cp_build_binary_op, to avoid creating short-lived trees.
782         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
783         lookahead instead of backtracking.  Move some code to avoid a
784         conditional branch.
785         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
786         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
787         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
788         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
789
790 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
791
792         * decl.c (grok_declarator): Remove a redundant semicolon.
793
794         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
795         Correct comments describing function parameters.
796
797 2004-09-03  Matt Austern  <austern@apple.com>
798         Compile speed improvement.
799         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
800         Otherwise define a stub macro that expands to nothing.
801         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
802         define a stub macro that expands to 0.
803         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
804         (cp_lexer_stop_debugging): Likewise.
805         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
806         define a stub macro that expands to NULL.
807         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
808         (cp_lexer_new_from_tokens): Likewise.
809
810 2004-09-03  Jan Hubicka  <jh@suse.cz>
811
812         * decl.c (finish_function): Clean out pointers we no longer need.
813
814 2004-09-03  Jan Beulich  <jbeulich@novell.com>
815
816         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
817         than "-lm".
818
819 2004-09-02  Paul Brook  <paul@codesourcery.com>
820
821         * decl2.c (determine_visibility): Only check data visibility
822         for VAR_DECLS.
823
824 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
825
826         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
827         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
828         * decl2.c (determine_visibility): Honor
829         TARGET_CXX_EXPORT_CLASS_DATA.
830
831         * class.c (key_method): Rename to ...
832         (determine_key_method): ... this.
833         (finish_struct_1): Adjust accordingly.
834         * cp-tree.h (key_method): Declare.
835         * decl2.c (maybe_emit_vtables): Determine the key method here if
836         it has not already been done.
837
838 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
839
840         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
841         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
842         (cp/cp-decl.c): Do not depend on gtype-cp.h.
843         (cp/cp-objcp-common.o): New target.
844         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
845         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
846         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
847         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
848         respectively.
849         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
850         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
851         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
852         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
853         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
854         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
855         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
856         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
857         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
858         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
859         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
860         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
861         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
862         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
863         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
864         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
865         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
866         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
867         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
868         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
869         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
870         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
871         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
872         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
873         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
874         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
875         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
876         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
877         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
878         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
879         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
880         hooks to cp-objcp-common.h.
881         (finish_file): New function.
882         * cp-objcp-common.c: New file.
883         * cp-objcp-common.h: New file.
884         * cp-tree.h (cp_finish_file): New prototype.
885         * decl.c: Do not include gtype-cp.h.
886         * decl2.c (finish_file): Rename to cp_finish_file.
887
888 2004-08-31  Richard Henderson  <rth@redhat.com>
889
890         PR c++/17221
891         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
892         (tsubst_copy_and_build): ... here.
893
894 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
895
896         * cp-tree.h (initialize_artificial_var): Declare.
897         * decl.c (initialize_artifical_var): New function.
898         * class.c (initialize_array): Remove.
899         (initialize_vtable): Use initialize_artificial_var.
900         (build_vtt): Likewise.
901         (build_ctor_vtbl_group): Likewise.
902
903 2004-08-30  Richard Henderson  <rth@redhat.com>
904
905         * class.c (build_base_path): Use build_address directly.
906         * typeck.c (build_unary_op): Don't lower &a.b to pointer
907         arithmetic directly.
908         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
909         means !initializer_constant_valid_p.
910
911 2004-08-30  Richard Henderson  <rth@redhat.com>
912
913         * class.c (fixed_type_or_null): Use get_base_address before
914         assuming an ADDR_EXPR is non-null.
915
916 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
917
918         * name-lookup.c (pop_binding, pushdecl,
919         set_identifier_type_value_with_scope, push_overloaded_decl,
920         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
921         * parser.c (cp_parser_diagnose_invalid_type_name,
922         cp_parser_postfix_expression, cp_parser_unary_expression,
923         cp_parser_check_declarator_template_para): Likewise.
924         * pt.c (push_inline_template_parms_recursive,
925         check_explicit_specialization, convert_nontype_argument,
926         coerce_template_template_parms, uses_template_parms,
927         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
928         tsubst_expr, instantiate_template,
929         maybe_adjust_types_for_deduction, type_unification_real,
930         resolve_overloaded_unification, template_decl_level,
931         type_dependent_expression_p): Likewise.
932         * search.c (lookup_base_r): Likewise.
933         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
934         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
935         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
936         * typeck.c (common_type, get_member_function_from_ptrfunc,
937         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
938         * typeck2.c (cxx_incomplete_type_diagnostic,
939         split_nonconstant_init_1, store_init_value,
940         process_init_constructor): Likewise.
941
942 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
943
944         * call.c (check_dtor_name): Replace abort with gcc_assert or
945         gcc_unreachable.
946         (build_call, add_builtin_candidate, build_new_op,
947         convert_like_real, build_over_call, in_charge_arg_for_name,
948         source_type, joust): Likewise.
949         * class.c (build_simple_base_path, get_vcall_index,
950         finish_struct_1, instantiate_type, get_enclosing_class,
951         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
952         * cp-gimplify.c (cp_genericize): Likewise.
953         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
954         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
955         * decl.c (poplevel, make_unbound_class_template, reshape_init,
956         check_special_function_return_type, grokdeclarator,
957         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
958         finish_function): Likewise.
959         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
960         * error.c (dump_global_iord, dump_decl, dump_template_decl,
961         language_to_string): Likewise.
962         * except.c (choose_personality_routine): Likewise.
963         * friend.c (do_friend): Likewise.
964         * g++spec.c (lang_specific_driver): Likewise.
965         * init.c (build_zero_init, expand_default_init, build_new_1,
966         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
967         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
968         * mangle.c (add_substitution, write_unscoped_name,
969         write_template_prefix, write_identifier,
970         write_special_name_destructor, write_type, write_builtin_type,
971         write_expression, write_template_param,
972         write_java_integer_type_codes): Likewise.
973         * method.c (implicitly_declare_fn): Likewise.
974
975 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
976
977         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
978         (BINFO_INDIRECT_PRIMARY_P): Remove.
979         * class.c (determine_primary_base): Rename to ...
980         (determine_primary_bases): ... here.  Set all primary bases.
981         (set_primary_base): Remove.
982         (mark_primary_bases): Remove.
983         (build_simple_base_path, walk_subobject_offsets,
984         propagate_binfo_offsets, end_of_class): Adjust.
985         (layout_class_type): Rename determine_primary_base call.
986         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
987         to type_as_string.
988         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
989         build_rtti_vtbl_entries): Adjust.
990         * init.c (build_vtbl_address): Adjust.
991
992         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
993
994 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
995
996         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
997         CXX_AND_OBJCXX_OBJS.
998         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
999         separately on the link line.
1000
1001 2004-08-28  Jason Merrill  <jason@redhat.com>
1002
1003         * decl.c (expand_static_init): Avoid bogus warnings.
1004
1005 2004-08-27  Jason Merrill  <jason@redhat.com>
1006
1007         PR c++/16851
1008         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
1009
1010         PR c++/13684
1011         * decl.c (expand_static_init): Use thread-safety API.
1012         (register_dtor_fn): Return the call, don't expand it.
1013         * tree.c (add_stmt_to_compound): New fn.
1014         (stabilize_call): Use it.
1015
1016 2004-08-27  Richard Henderson  <rth@redhat.com>
1017
1018         * cp-tree.def (OFFSETOF_EXPR): New.
1019         * parser.c (cp_parser_builtin_offsetof): Either built an
1020         OFFSETOF_EXPR, or call fold_offsetof immediately.
1021         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
1022
1023 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
1024
1025         * call.c (validate_conversion_obstack): Replace
1026         my_friendly_assert with gcc_assert or gcc_unreachable.
1027         (direct_reference_binding, merge_conversion_sequences,
1028         build_user_type_conversion_1, perform_overload_resolution,
1029         build_op_delete_call, enforce_access, call_builtin_trap,
1030         build_over_call, build_special_member_call, build_new_method_call,
1031         initialize_reference): Likewise.
1032         * class.c (build_base_path, build_primary_vtable, alter_access,
1033         check_bases, update_vtable_entry_for_fn, layout_empty_base,
1034         clone_function_decl, adjust_clone_args,
1035         type_requires_array_cookie, include_empty_classes,
1036         finish_struct_1, resolve_address_of_overloaded_function,
1037         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
1038         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
1039         accumulate_vtbl_inits, build_vtbl_initializer,
1040         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
1041         * cvt.c (build_up_reference, convert_to_reference): Likewise.
1042         * decl.c (poplevel, duplicate_decls, make_typename_type,
1043         cxx_init_decl_processing, reshape_init, check_initializer,
1044         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
1045         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
1046         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
1047         xref_basetypes, start_preparsed_function, save_function_data,
1048         finish_function, finish_method, maybe_register_incomplete_var,
1049         complete_vars): Likewise.
1050         * decl2.c (grok_array_decl, check_member_template,
1051         check_classfn, finish_static_data_member_decl, coerce_new_type,
1052         coerce_delete_type, import_export_class, decl_needed_p,
1053         determine_visibility, import_export_decl, build_cleanup,
1054         start_static_initialization_or_destructi, do_static_destruction,
1055         prune_vars_needing_no_initialization,
1056         build_offset_ref_call_from_tree): Likewise.
1057         * error.c (dump_decl, dump_expr): Likewise.
1058         * init.c (finish_init_stmts, build_zero_init,
1059         expand_virtual_init, expand_default_init, expand_aggr_init_1,
1060         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
1061         Likewise.
1062         * mangle.c (write_method_parms, write_template_args,
1063         write_expression, write_template_arg): Likewise.
1064         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
1065         * name-lookup.c (pop_binding, begin_scope, leave_scope,
1066         resume_scope, push_using_decl, validate_nonmember_using_decl,
1067         is_ancestor, poplevel_class, set_inherited_value_binding_p,
1068         push_class_level_binding, do_class_using_decl, push_namespace,
1069         pop_namespace, add_using_namespace, ambiguous_decl,
1070         lookup_namespace_name, lookup_type_current_level,
1071         maybe_process_template_type_declaration): Likewise.
1072         * parser.c (cp_lexer_peek_nth_token,
1073         cp_parser_parse_and_diagnose_invalid_typ,
1074         cp_parser_translation_unit, cp_parser_template_id,
1075         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
1076         * pt.c (push_access_scope, finish_member_template_decl,
1077         push_inline_template_parms_recursive, add_outermost_template_args,
1078         get_innermost_template_args, begin_explicit_instantiation,
1079         end_explicit_instantiation, retrieve_specialization,
1080         is_specialization_of, is_specialization_of_friend,
1081         register_specialization, check_explicit_specialization,
1082         comp_template_parms, process_template_parm,
1083         process_partial_specialization, convert_nontype_argument,
1084         coerce_template_template_parms, coerce_template_parms,
1085         mangle_class_name_for_template, lookup_template_function,
1086         lookup_template_class, instantiate_class_template, tsubst_decl,
1087         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
1088         instantiate_template, fn_type_unification, type_unification_real,
1089         get_template_base, regenerate_decl_from_template,
1090         template_for_substitution, instantiate_decl,
1091         get_mostly_instantiated_function_type, dependent_scope_ref_p,
1092         value_dependent_expression_p, resolve_typename_type): Likewise.
1093         * repo.c (repo_emit_p): Likewise.
1094         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
1095         create_tinfo_types, emit_tinfo_decl): Likewise.
1096         * search.c (lookup_base_r, lookup_base, lookup_field_1,
1097         dfs_access_in_type, build_baselink, lookup_member,
1098         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
1099         * semantics.c (perform_or_defer_access_check,
1100         finish_non_static_data_member, finish_stmt_expr_expr,
1101         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
1102         finish_template_template_parm, finish_member_declaration,
1103         emit_associated_thunks): Likewise.
1104         * tree.c (build_target_expr_with_type, force_target_expr,
1105         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
1106         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
1107         cxx_sizeof_or_alignof_type, perform_integral_promotions,
1108         build_class_member_access_expr, finish_class_member_access_expr,
1109         build_ptrmemfunc_access_expr, build_unary_op,
1110         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
1111         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
1112         * typeck2.c (complete_type_check_abstract,
1113         abstract_virtuals_error, process_init_constructor,
1114         add_exception_specifier): Likewise.
1115
1116 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
1117
1118         * class.c (build_vtbl_initializer): Use ssize_int.
1119         * decl.c (complete_array_type): Likewise.
1120         * method.c (finish_thunk): Likewise.
1121         * search.c (get_dynamic_base_type): Likewise.
1122
1123 2004-08-26  Richard Henderson  <rth@redhat.com>
1124
1125         * cp-tree.h (DECL_FIELD_IS_BASE): New.
1126         * class.c (build_base_field): Set it.
1127         (build_simple_base_path): Use it.
1128         (fixed_type_or_null): Don't consider base fields definitive.
1129
1130 2004-08-25  Roger Sayle  <roger@eyesopen.com>
1131
1132         PR middle-end/16693
1133         PR tree-optimization/16372
1134         * decl.c (finish_enum): Make the precision of the enumerated type
1135         the same width as the underlying integer type.
1136
1137 2004-08-25  Mark Mitchell  <mark@codesourcery.com>
1138
1139         PR c++/17155
1140         * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
1141         functions.
1142
1143         * mangle.c (get_identifier_nocopy): Add cast.
1144
1145         * cp-tree.h (mangle_type): Remove.
1146         * mangle.c (globals): GTY it.
1147         (mangle_obstack): New variable.
1148         (name_obstack): Likewise.
1149         (name_base): Likewise.
1150         (write_char): Adjust accordingly.
1151         (write_chars): Likewise.
1152         (write_string): Likewise.
1153         (start_mangling): Initialize G.substitutions only one.  Add
1154         ident_p parameter.
1155         (finish_mangling): Use VARRAY_CLEAR to reclaim
1156         storage in G.substitutions.  Use obstack_finish.
1157         (init_mangle): Adjust for changes to variable names above.
1158         Initialize G.substitutions.
1159         (mangle_decl_string): Adjust call to start_mangling.
1160         (get_identifier_nocopy): New function.
1161         (mangle_decl): Use it.
1162         (mangle_type_string): Adjust call to start_mangling.
1163         (mangle_special_for_type): Likewise.
1164         (mangle_vtt_for_type): Likewise.
1165         (mangle_ctor_vtbl_for_type): Likewise.
1166         (mangle_thunk): Likewise.
1167         (mangle_guard_variable): Likewise.
1168         (mangle_ref_init_variable): Likewise.
1169
1170 2004-08-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1171
1172         PR c++/14428
1173         * pt.c (redeclare_class_template): Check the type of non-type and
1174         template template parameter.
1175
1176 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
1177
1178         * call.c (convert_class_to_reference): Adjust build_int_cst calls.
1179         (build_user_type_conversion_1, convert_like_real,
1180         build_java_interface_fn_ref, build_special_member_call): Likewise.
1181         * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
1182         * cp-gimplify.c (cp_gimplify_expr): Likewise.
1183         * cvt.c (cp_convert_to_pointer): Likewise.
1184         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
1185         * decl2.c (start_static_initialization_or_destruction,
1186         generate_ctor_or_dtor_function): Likewise.
1187         * except.c (build_throw): Likewise.
1188         * mangle.c (write_integer_cst): Likewise.
1189         * method.c (finish_thunk): Likewise.
1190         * rtti.c (build_headof, get_tinfo_decl_dynamic,
1191         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
1192         get_pseudo_ti_init): Likewise.
1193         * search.c (get_dynamic_cast_base_type): Likewise.
1194
1195 2004-08-25  Zack Weinberg  <zack@codesourcery.com>
1196
1197         * class.c, search.c: Remove references to DWARF_DEBUG.
1198
1199 2004-08-25  Adam Nemet  <anemet@lnxw.com>
1200
1201         * repo.c (extract_string): Reset backquote after one character.
1202         (get_base_filename): Fix indentation.
1203
1204 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
1205
1206         * decl.c (cxx_init_decl_processing): Adjust
1207         build_common_tree_nodes call.
1208
1209 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
1210
1211         PR c++/16889
1212         * (is_subobject_of_p): Resurrect & optimize.
1213         (lookup_field_r): Use it.
1214
1215 2004-08-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1216
1217         PR c++/16706
1218         * search.c (friend_accessible_p): Increment processing_template_decl
1219         when deal with TEMPLATE_DECL of SCOPE.
1220
1221 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
1222
1223         PR c++/17149
1224         * semantics.c (check_accessibility_of_qualified_id): Defer check
1225         if qualifying_type is a template parameter.
1226
1227 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
1228
1229         PR c++/17163
1230         * pt.c (instantiate_decl): Do not try to apply
1231         DECL_DECLARED_INLINED_P to a VAR_DECL.
1232
1233         * search.c (build_baselink): Fix typo in comment.
1234
1235 2004-08-22 Andrew Pinski  <apinski@apple.com>
1236
1237         Revert:
1238         2004-08-22  Andrew Pinski  <apinski@apple.com>
1239         PR c++/14029
1240         * typeck.c (build_unary_op): Use &a.b if the folded lowered
1241         expression is not constant.
1242
1243 2004-08-23  Nathan Sidwell  <nathan@codesourcery.com>
1244
1245         * name-lookup.c (pushdecl): Rename build_type_copy call.
1246         * tree.c (cp_build_qualified_type_real,
1247         build_exception_variant, handle_java_interface_attribute): Likewise.
1248
1249 2004-08-22  Andrew Pinski  <apinski@apple.com>
1250
1251         PR c++/14029
1252         * typeck.c (build_unary_op): Use &a.b if the folded lowered
1253         expression is not constant.
1254
1255 2004-08-20  Mark Mitchell  <mark@codesourcery.com>
1256
1257         PR c++/17121
1258         * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
1259
1260 2004-08-21  Joseph S. Myers  <jsm@polyomino.org.uk>
1261
1262         PR c++/17120
1263         * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
1264         MODOP_EXPR.
1265
1266 2004-08-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1267
1268         * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
1269         before calling comp_template_args.
1270
1271 2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
1272
1273         * class.c (build_vtbl_initializer): Use build_int_cst for
1274         negative size types.
1275         * decl.c (complete_array_type): Likewise.
1276         * method.c (finish_thunk): Likewise.
1277
1278 2004-08-20  Andreas Tobler  <a.tobler@schweiz.ch>
1279
1280         * tree.c: Remove unused mark_local_for_remap_r.
1281
1282 2004-08-19  Eric Christopher  <echristo@redhat.com>
1283
1284         * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
1285         * tree.c (cxx_unsave_expr_now): Delete.
1286         (cp_unsave_r): Ditto.
1287
1288 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
1289
1290         PR c++/15890
1291         * pt.c (push_template_decl_real): Disallow template allocation
1292         functions with fewer than two parameters.
1293
1294 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
1295
1296         * cp-tree.h (build_shared_int_cst): Remove.
1297         * tree.c (shared_int_cache): Remove.
1298         (build_shared_int_cst): Remove.
1299         * class.c (finish_struct_1): Use build_int_cst.
1300
1301 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
1302
1303         * decl.c (finish_enum): Do not copy value node early, copy
1304         later.
1305         * lex.c (cxx_init): Force null_node to be unique.
1306
1307 2004-08-19  Joseph S. Myers  <jsm@polyomino.org.uk>
1308
1309         PR c++/17041
1310         * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
1311         from input for MODOP_EXPR.
1312
1313 2004-08-18  Mark Mitchell  <mark@codesourcery.com>
1314
1315         * pt.c (dependent_template_p): Fix typo in commment.
1316
1317         PR c++/17068
1318         * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
1319         dependent.
1320
1321 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
1322
1323         PR c++/16246
1324         * pt.c (unify): Tidy ARRAY_TYPE handling.  Make sure that non-type
1325         arguments have the same type as the corresponding parameter.
1326
1327         PR c++/16215
1328         * parser.c (cp_parser_name_lookup_error): If parser->object_scope
1329         is set use it for diagnostic purposes.
1330         (cp_parser_pseudo_destructor_name): Remove special-case error
1331         message.
1332
1333         PR c++/15871
1334         * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
1335
1336         PR c++/16965
1337         * cp-tree.h (qualified_name_lookup_error): Add parameter.
1338         * name-lookup.c (do_class_using_decl): Restrict set of entities
1339         passed to cp_emit_debug_info_for_using more carefully.
1340         (lookup_qualified_name): Allow lookup_member to return sets of
1341         ambiguous entries.
1342         * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
1343         (cp_parser_primary_expression): Handle ambiguous lookups.
1344         (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
1345         (cp_parser_template_argument): Likewise.
1346         (cp_parser_elaborate_type_specifier): Likewise.
1347         (cp_parser_namespace_name): Likewise.
1348         (cp_parser_class_name): Likewise.
1349         (cp_parser_lookup_name_simple): Likewise.
1350         * pt.c (tsubst_qualified_id): Handle ambiguous results.
1351         (tsubst_expr): Likewise.
1352         * semantics.c (qualified_name_lookup_error): Add decl paramter.
1353         For ambiguous lookups, print candidates.
1354
1355 2004-08-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1356
1357         PR c++/6749
1358         * pt.c (instantiate_pending_templates): Add int parameter.  Don't
1359         return anything.
1360         * cp-tree.h (instantiate_pending_templates): Adjust prototype.
1361         * decl2.c (finish_file): Adjust call to
1362         instantiate_pending_templates.
1363
1364 2004-08-15  Roger Sayle  <roger@eyesopen.com>
1365
1366         * call.c (build_vfield_ref, build_call, build_conditional_expr,
1367         convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
1368         build_java_interface_fn_ref, build_special_member_call,
1369         build_new_method_call, initialize_reference): Replace calls to
1370         build with calls to buildN.
1371         * class.c (build_base_path, convert_to_base_statically,
1372         build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
1373         build_vtbl_initializer): Likewise.
1374         * cp-gimplify.c (genericize_try_block, genericize_catch_block,
1375         gimplify_if_stmt, cp_genericize_r): Likewise.
1376         * cvt.c (convert_to_void): Likewise.
1377         * decl.c (check_initializer, finish_constructor_body,
1378         finish_destructor_body): Likewise.
1379         * error.c (dump_expr): Likewise.
1380         * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
1381         Likewise.
1382         * init.c (perform_member_init, expand_virtual_init,
1383         expand_cleanup_for_base, build_init, expand_default_init,
1384         build_offset_ref, decl_constant_value, build_new, build_new_1,
1385         build_vec_delete_1, build_vec_init, build_delete,
1386         push_base_cleanups, build_vec_delete): Likewise.
1387         * mangle.c (write_integer_cst): Likewise.
1388         * method.c (thunk_adjust, do_build_copy_constructor,
1389         do_build_assign_ref): Likewise.
1390         * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
1391         unify, build_non_dependent_expr): Likewise.
1392         * rtti.c (build_headof, build_typeid, ifnonnull,
1393         build_dyanmic_cast_1, tinfo_base_init): Likewise.
1394         * semantics.c (begin_compound_stmt, finish_call_expr,
1395         finish_pseudo_destructor_expr, finish_id_expression,
1396         simplify_aggr_init_expr, finalize_nrv_r): Likewise.
1397         * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
1398         array_type_nelts_total, stabilize_call): Likewise.
1399         * typeck.c (decay_conversion, build_class_member_access_expr,
1400         lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
1401         get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
1402         build_x_unary_op, build_unary_op, unary_complex_lvalue,
1403         build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
1404         check_return_expr): Likewise.
1405         * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
1406         split_nonconstant_init, store_init_value, build_m_component_ref):
1407         Likewise.
1408
1409 2004-08-15  Nathan Sidwell  <nathan@codesourcery.com>
1410
1411         * call.c (convert_class_to_reference,
1412         build_user_type_conversion_1, convert_like_real,
1413         build_java_interface_fn_ref, build_special_member_call): Use
1414         build_int_cst.
1415         * class.c (build_vtbl_initializer): Likewise.
1416         * cp-gimplify.c (cp_gimplify_expr): Likewise.
1417         * cvt.c (cp_convert_to_pointer): Likewise.
1418         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
1419         * decl2.c (start_static_initialization_or_destruction,
1420         generate_ctor_or_dtor_function): Likewise.
1421         * except.c (build_throw): Likewise.
1422         * lex.c (cxx_init): Likewise.
1423         * mangle.c (write_integer_cst): Likewise.
1424         * rtti.c (build_headof, get_tinfo_decl_dynamic,
1425         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
1426         get_pseudo_ti_init): Likewise.
1427         * search.c (get_dynamic_cast_base_type): Likewise.
1428         * tree.c (build_shared_int_cst): Likewise.
1429
1430 2004-08-12  Mark Mitchell  <mark@codesourcery.com>
1431
1432         PR c++/16273
1433         * class.c (count_depth_data): New type.
1434         (dfs_depth_post): New function.
1435         (dfs_depth_q): Likewise.
1436         (find_final_overrider_data_s): Change type of vpath.
1437         Add vpath_list.
1438         (dfs_find_final_overrider_1): New function.
1439         (dfs_find_final_overrider): Use it.
1440         (dfs_find_final_overrider_q): Adjust use of vpath.
1441         (dfs_find_final_overrider_post): Likewise.
1442         (find_final_overrider): Use dfs_depth.  Allocate and deallocate
1443         vpath_list.
1444
1445 2004-08-12 Jan Beulich <jbeulich@novell.com>
1446
1447         * parser.c (cp_parser_asm_definition): Properly consume scope operator
1448         tokens preceding the clobbers. Don't check for scope operator
1449         following inputs. Simplify inputs handling to match that now used for
1450         clobbers.
1451
1452 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
1453
1454         PR c++/16698
1455         * except.c (build_throw): Allocate cleanup_type and the function
1456         for __cxa_throw separately.
1457
1458         PR c++/16853
1459         * call.c (standard_conversion): Do not accept conversions between
1460         pointers to members if the class types are unrelated.
1461
1462         PR c++/16618
1463         * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
1464         char &" instead of just "char &".
1465
1466         PR c++/16870
1467         * pt.c (tsubst): Just return the unknown_type_node.
1468
1469 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
1470
1471         PR c++/16964
1472         * parser.c (cp_parser_class_specifier): Robustify.
1473
1474         PR c++/16904
1475         * pt.c (tsubst_copy_and_build): Complain about invalid
1476         qualification.
1477
1478         PR c++/16929
1479         * pt.c (tsubst_default_argument): Clear out current_class_ptr and
1480         current_class_ref while tsubsting.
1481
1482 2004-08-10  Mark Mitchell  <mark@codesourcery.com>
1483
1484         PR c++/16971
1485         * parser.c (cp_parser_init_declarator): Robustify.
1486
1487 2004-08-06  Richard Sandiford  <rsandifo@redhat.com>
1488
1489         * typeck2.c (process_init_constructor): Guard the missing field warning
1490         with warn_missing_field_initializers rather than extra_warnings.
1491
1492 2004-08-06  Paolo Bonzini  <bonzini@gnu.org>
1493
1494         * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
1495
1496 2004-08-05  Mark Mitchell  <mark@codesourcery.com>
1497
1498         * decl.c (start_preparsed_function): Move determine_visibility
1499         call.
1500         * decl2.c (determine_visibility): Incorporate dllexport testing.
1501
1502 2004-08-05  Geoffrey Keating  <geoffk@apple.com>
1503
1504         * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
1505         means that libstdc++ is needed.
1506
1507 2004-08-05  Nathan Sidwell  <nathan@codesourcery.com>
1508
1509         * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
1510
1511 2004-08-04  Geoffrey Keating  <geoffk@apple.com>
1512
1513         * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
1514         than passing it as a parameter to rest_of_decl_compilation.
1515         * decl2.c (grokfield): Use set_user_assembler_name.
1516
1517 2004-08-04  Nathan Sidwell  <nathan@codesourcery.com>
1518
1519         * decl.c (complete_array_type): Don't gratuitously copy
1520         maxindex. Its type is always set.
1521
1522 2004-08-04  Paul Brook  <paul@codesourcery.com>
1523
1524         * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
1525         * cp-tree.h (struct language_function): Rename x_dtor_label to
1526         x_cdtor_label.
1527         (dtor_label): Rename ...
1528         (cdtor_label): ... to this.
1529         * decl.c (begin_constructor_body): Remove.
1530         (check_special_function_return_type): Maybe change the return type.
1531         (grokdeclarator): Pass the class type.
1532         (start_preparsed_function): Constructors may need a return label.
1533         (finish_constructor_body, finish_destructor_body): Set the return
1534         value.
1535         (begin_function_body): Don't call begin_constructor_body.
1536         (finish_function): Don't warn for constructors or destructors.
1537         (implicitly_declare_fn): Maybe change the return type.
1538         * optimize.c: Include target.h.
1539         (maybe_clone_body): Remap the function result.
1540         * semantics.c: Include target.h.
1541         (finish_return_stmt): Maybe jump to return label for constructors.
1542
1543 2004-08-03  Mark Mitchell  <mark@codesourcery.com>
1544
1545         * class.c (build_vtable): Do not set DECL_VISIBILITY here.
1546         (check_field_decls): Or here.
1547         (check_methods): Or here.
1548         (initialize_array): Don't mess with DECL_CONTEXT.
1549         * cp-tree.h (start_decl): Adjust prototype.
1550         (determine_visibility): New function.
1551         * decl.c (duplicate_decls): Remove checks for hidden "operator
1552         new".
1553         (build_library_fn_1): Give all library functions default
1554         visibility.
1555         (start_decl): Add pop_scope_p parameter.  Tidy.
1556         (cp_finish_decl): Do not pop scopes here.  Call
1557         determine_visibility for variable definitions.
1558         (start_preparsed_function): Call determine_visibility.
1559         * decl2.c (determine_visibility): New function.
1560         * method.c (use_thunk): Fix formatting.
1561         * parser.c (cp_parser_condition): Adjust calls to start_decl.
1562         (cp_parser_init_declarator): Likewise.
1563         * pt.c (instantiate_decl): Always call pop_nested_class.
1564         * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
1565         (tinfo_base_init): Likewise.
1566
1567 2004-08-02  Mark Mitchell  <mark@codesourcery.com>
1568
1569         PR c++/16707
1570         * name-lookup.c (validate_nonmember_using_decl): Robustify.
1571
1572 2004-08-01  Mark Mitchell  <mark@codesourcery.com>
1573
1574         PR c++/16224
1575         * name-lookup.c (decl_namespace): Remove.
1576         (current_decl_namespace): Use decl_namespace_context instead of
1577         decl_namespace.
1578         (push_decl_namespace): Likewise.
1579         (arg_assoc_class): Likewise.
1580         (arg_assoc_type): Likewise.
1581         * pt.c (check_specialization_namespace): New function.
1582         (maybe_process_partial_specialization): Use it.
1583         (register_specialization): Likewise.
1584
1585         PR c++/16489
1586         * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
1587         * call.c (null_ptr_cst_p): Handle variables with constant
1588         initializers.
1589         * pt.c (convert_nontype_argument): Use
1590         DECL_INTEGRAL_CONSTANT_VAR_P.
1591         * semantics.c (finish_id_expression): Likewise.
1592
1593         PR c++/16529
1594         * decl.c (duplicate_decls): Reject duplicate namespace
1595         declarations.
1596
1597         PR c++/16810
1598         * typeck.c (build_ptrmemfunc): Loosen assertion.
1599
1600 2004-08-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1601
1602         * call.c (z_candidate::template_decl): Rename from template.
1603         (add_template_candidate_real): Adjust member reference.
1604         (joust): Likewise.
1605
1606 2004-07-29  Mark Mitchell  <mark@codesourcery.com>
1607
1608         * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
1609         (lang_decl_flags): Narrow the width of "languages".  Add
1610         repo_available_p.
1611         (DECL_NEEDED_P): Remove.
1612         (FOR_EACH_CLONE): New macro.
1613         (DECL_REPO_AVAILABLE_P): Likewise.
1614         (DECL_TINFO_P): Likewise.
1615         (set_linkage_according_to_type): Declare.
1616         (import_export_vtable): Remove.
1617         (import_export_tinfo): Likewise.
1618         (mark_needed): New function.
1619         (decl_needed_p): Likewise.
1620         (note_vauge_linkage_fn): Likewise.
1621         (init_repo): Change prototype.
1622         (repo_template_used): Remove.
1623         (repo_template_instantiated): Likewise.
1624         (repo_emit_p): New function.
1625         (repo_export_class_p): Likewise.
1626         (no_linkage_check): Change prototype.
1627         * class.c (set_linkage_according_to_type): New function.
1628         (build_vtable): Use it.  Do not call import_export_vtable.  Set
1629         DECL_IGNORED_P if appropriate.
1630         * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
1631         (make_rtL_for_nonlocal_decls): Check for template instantiations
1632         explicitly.
1633         (grokfndecl): Adjust call to no_linkage_check.
1634         (set_linkage_for_static_data_member): New function.
1635         (grokvardecl): Use it.  Adjust call to no_linkage_check.
1636         (grokdeclarator): Use set_linkage_for_static_data_member.
1637         * decl2.c (note_vague_linkage_fn): New function.
1638         (note_vague_linkage_var): Likewise.
1639         (finish_static_data_member_decl): Use it.
1640         (import_export_vtable): Remove.
1641         (import_export_class): Use repo_export_class_p.
1642         (var_finalized_p): Simplify.
1643         (maybe_emit_vtables): Simplify.
1644         (mark_needed): New function.
1645         (decl_needed_p): Likewise.
1646         (import_export_decl): Add documentation and consistency checks.
1647         Use repo_emit_p.  Handle virtual tables and RTTI information
1648         here.
1649         (import_export_tinfo): Remove.
1650         (write_out_vars): Call import_export_decl.
1651         (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
1652         whenever one is.
1653         (finish_file): Use decl_needed_p.  Do not call import_export_decl
1654         for undefined static data members.  Do not warn about undefined
1655         inlines when using a repository.
1656         (mark_used): Use note_vague_linkage_fn.  Always defer template
1657         instantiations.
1658         * lex.c (cxx_init): Adjust call to init_repo.  Always set
1659         flag_unit_at_a-time.
1660         * method.c (synthesize_method): Remove unncessary
1661         import_export_decl call.
1662         (implicitly_declare_fn): Use set_linkage_according_to_type.
1663         * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
1664         * pt.c (instantiate_class_template): Don't redundantly add classes
1665         to keyed_classes.  Don't call repo_template_used.
1666         (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
1667         templates with internal linkage.
1668         (check_instantiated_args): Adjust call to no_linkage_check.
1669         (instantiate_template): Use FOR_EACH_CLONE.
1670         (mark_definable): New function.
1671         (mark_decl_instantiated): Use it.
1672         (do_decl_instantiation): Adjust tests for explicit instantiation
1673         after "extern template".
1674         (instantiate_class_member): Do not use repo_template_instantiated.
1675         (do_type_instantiation): Simplify.
1676         (instantiate_decl): Use mark_definable.  Check repo_emit_p.
1677         Simplify.
1678         * repo.c (repo_get_id): Remove.
1679         (original_repo): Remove.
1680         (IDENTIFIER_REPO_USED): Remove.
1681         (IDENTIFIER_REPO_CHOSEN): Remove.
1682         Remove all #if 0'd code.
1683         (repo_template_used): Remove.
1684         (repo_template_instantiated): Remove.
1685         (temporary_obstack_initialized_p): New variable.
1686         (init_repo): Register with lang_post_pch_load.  Avoid creating
1687         identifiers unnecessarily.  Don't use original_repo.  Close the
1688         file here.
1689         (reopen_repo_file_for_write): Not here.
1690         (finish_repo): Always write out a new repository file.
1691         (repo_emit_p): New function.
1692         (repo_export_class_p): Likewise.
1693         * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
1694         (involves_incomplete_p): New function.
1695         (tinfo_base_init): Use it.
1696         (ptr_initializer): Remove non_public_ptr parameter.
1697         (ptm_initializer): Likewise.
1698         (get_pseudo_ti_init): Likewise.
1699         (unemitted_tinfo_decl_p): Remove.
1700         (emit_tinfo_decl): Use import_export_decl.
1701         * semantics.c (expand_body): Move updates of static_ctors and
1702         static_dtors to ...
1703         (expand_or_defer_fn): ... here.
1704         * tree.c (no_linkage_check): Add relaxed_p parameter.
1705
1706 2004-07-28  Eric Christopher  <echristo@redhat.com>
1707
1708         * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
1709
1710 2004-07-28  Nathan Sidwell  <nathan@codesourcery.com>
1711
1712         * cp-tree.h (struct tree_pair_s): New.
1713         (typedef tree_pair_p): New.
1714         (DEF_VEC_O(tree_pair_s)): New.
1715         (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
1716         (CLASSTYPE_VCALL_INDICES): Update documentation.
1717         * class.c (get_vcall_index): Adjust.
1718         (add_vcall_offset): Adjust.
1719
1720 2004-07-27  Kelley Cook  <kcook@gcc.gnu.org>
1721
1722         * pt.c, typeck.c: Remove spurious carriage returns.
1723
1724 2004-07-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1725
1726         PR c++/14429
1727         * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
1728         when the type of ARG is not dependent.
1729
1730 2004-07-26  Geoffrey Keating  <geoffk@apple.com>
1731
1732         * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
1733         (lang_specific_driver): If the C++ or math library options don't
1734         start with '-l', don't count them as added libraries.
1735
1736 2004-07-26  Nathan Sidwell  <nathan@codesourcery.com>
1737
1738         * decl.c (xref_basetypes): Adjust base access vector creation.
1739         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
1740         access accesses.
1741         * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
1742
1743 2004-07-26  Niall Douglas  <s_fsfeurope2@nedprod.com>
1744             Brian Ryner  <bryner@brianryner.com>
1745
1746         PR c++/15000
1747         PR c++/9283
1748         * class.c (check_field_decls): Apply hidden visibility if
1749         -fvisibility-inlines-hidden and inlined unless otherwise specified
1750         (build_vtable): Set vtable visibility to class visibility.
1751         (check_field_decls): Default static member visibility to class
1752         visibility.
1753         (check_methods): Default method visibility to class visibility.
1754         * cp-tree.h: Added CLASSTYPE_VISIBILITY and
1755         CLASSTYPE_VISIBILITY_SPECIFIED macro.
1756         * decl.c (duplicate_decls): New logic for merging definition decls
1757         with declaration decls. Added ignore & warning when non default
1758         applied to global operator new or delete.
1759         * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
1760         wherever VISIBILITY was changed
1761         * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
1762         visibility.
1763         (tinfo_base_init): Set typeinfo name visibility to class visibility.
1764
1765 2004-07-25  Bernardo Innocenti  <bernie@develer.com>
1766
1767         * decl.c: Rename all identifiers named `class' to `cl'.
1768         * cp-tree.h: Likewise.
1769
1770 2004-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1771
1772         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
1773         * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
1774         * name-lookup.c (binding_entry_make): Use GGC_NEW.
1775         (binding_table_construct): Use GGC_CNEWVEC.
1776         (binding_table_new): Use GGC_NEW.
1777         (cxx_binding_make): Likewise.
1778         (begin_scope): Likewise.
1779         (push_to_top_level): Use GCC_CNEW.
1780         * parser.c (cp_token_cache_new): Likewise.
1781         (cp_token_cache_push_token): Likewise.
1782         (cp_lexer_new_main): Likewise.
1783         (cp_lexer_new_from_tokens): Likewise.
1784         (cp_parser_context_new): Likewise.
1785         (cp_parser_new): Likewise.
1786         (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
1787         * lex.c (cxx_make_type): Use GGC_CNEW.
1788         (retrofit_lang_decl): Use GGC_NEWVAR.
1789         (cxx_dup_lang_specific_decl): Likewise.
1790         (copy_lang_type): Likewise.
1791         * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
1792         (save_function_data): Likewise.
1793         (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
1794         (cxx_push_function_context): Likewise.
1795
1796 2004-07-25  Richard Henderson  <rth@redhat.com>
1797
1798         * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
1799         DECL_IGNORED_P on RESULT_DECL.
1800         * semantics.c (finalize_nrv): Copy them too.
1801
1802 2004-07-23  Nathan Sidwell  <nathan@codesourcery.com>
1803
1804         * search.c (lookup_conversion_operator): Avoid two loops.
1805         (add_conversions): Remove.
1806         (check_hidden_convs, split_conversions,
1807         lookup_conversions_r):  New.
1808         (lookup_conversions): Use lookup_conversions_r.
1809
1810 2004-07-22  Nathan Sidwell  <nathan@codesourcery.com>
1811
1812         * pt.c (get_template_base): Check type is completable.
1813
1814 2004-07-21  Eric Christopher  <echristo@redhat.com>
1815
1816         * decl.c (poplevel): Inline unused variable checking.
1817         Change formatting.
1818
1819 2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
1820
1821         * typeck.c (build_binary_op): Do not use RDIV_EXPR for
1822         integer vectors.
1823
1824 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1825
1826         PR c++/14497
1827         * pt.c (check_explicit_specialization): Remove extension to accept
1828         specializations without template headers. Fall-through to normal
1829         processing.
1830
1831 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1832
1833         PR c++/509
1834         * pt.c (determine_specialization): New parameter template_count.
1835         Disambiguate between member templates and member functions counting
1836         the template headers.
1837         (check_explicit_specialization): Update caller.
1838         (tsubst_friend_function): Likewise.
1839
1840 2004-07-20  Steven Bosscher  <stevenb@suse.de>
1841
1842         * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
1843         * cp-tree.h (tinst_level_t): New tree type.
1844         (union lang_tree_node): Handle it.
1845         (TINST_LOCATION): New accessor macro.
1846         (make_tinst_level): New prototype.
1847         * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
1848         * decl.c (cp_tree_node_structure): Likewise.
1849         * error.c (print_instantiation_full_context): Use TINST_LOCATION.
1850         (print_instantiation_partial_context): Likewise.
1851         * pt.c (pop_tinst_level): Likewise.
1852          (push_tinst_level): Use make_tinst_level.
1853         * tree.c (make_tinst_level): New function.
1854         (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
1855
1856 2004-07-20  Mark Mitchell  <mark@codesourcery.com>
1857
1858         * parser.c (cp_parser_simple_type_specifier): Fix typo.
1859
1860         PR c++/16637
1861         * parser.c (cp_parser_simple_type_specifier): Do not record usage
1862         of globally-qualified names.
1863
1864 2004-07-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1865
1866         PR c++/16175
1867         * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
1868         cv qualifier.
1869
1870 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
1871
1872         PR c++/16623
1873         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
1874         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
1875         * class.c (add_implicitly_declared_members): Use
1876         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1877         * method.c (lazily_declare_fn): Clear
1878         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1879         * search.c (lookup_fnfields_1): Check it.
1880
1881 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
1882
1883         * cp-tree.h (vec_binfo_member): Remove.
1884         * tree.c (vec_binfo_member): Remove.
1885
1886         * cp-tree.h (struct lang_type_class): Remove vfields field.
1887         (CLASSTYPE_VFIELDS): Remove.
1888         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
1889         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
1890         handling.
1891         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
1892         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
1893         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
1894
1895 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
1896
1897         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
1898         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
1899         Moved to common.
1900         (BINFO_LANG_SLOTS): Remove.
1901         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
1902         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
1903         * class.c (check_bases): Adjust BINFO accessors.
1904         (determine_primary_base, finish_struct_bits,
1905         maybe_warn_about_overly_private_class, warn_hidden,
1906         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
1907         warn_about_ambiguous_bases, get_vfield_name,
1908         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
1909         add_vcall_offset_vtbl_entries_r): Likewise.
1910         * dump.c (cp_dump_tree): Likewise.
1911         * init.c (sort_mem_initializers, expand_member_init, build_delete,
1912         push_base_cleanups): Likewise.
1913         * method.c (do_build_copy_constructor, do_build_assign_ref,
1914         synthesize_exception_spec): Likewise.
1915         name-lookup.c (arg_assoc_class): Likewise.
1916         * pt.c (instantiate_class_template,
1917         get_template_base_recursive): Likewise.
1918         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
1919         * typeck2.c (process_init_constructor): Likewise.
1920         * search.c (lookup_base_r, dynamic_cast_base_recurse,
1921         dfs_access_in_type, dfs_walk_real, look_for_overrides,
1922         types_overlap_p, copied_binfo, original_binfo): Likewise.
1923         (binfo_for_vtable): Remove
1924
1925 2004-07-20  Steven Bosscher  <stevenb@suse.de>
1926
1927         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
1928         thunk_alias, and the access and virtual_offset fields.
1929         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
1930         * decl.c (finish_case_label): Update c_add_case_node call.
1931
1932 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
1933
1934         Revert patch for PR c++/16623.
1935
1936 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
1937
1938         * except.c: Remove two spurious carriage returns.
1939
1940 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
1941
1942         PR c++/16623
1943         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
1944         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
1945         * class.c (add_implicitly_declared_members): Use
1946         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1947         * method.c (lazily_declare_fn): Clear
1948         CLASSTYPE_LAZY_ASSIGNMENT_OP.
1949         * search.c (lookup_fnfields_1): Check it.
1950
1951 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
1952
1953         * class.c (add_method): Delay adding the slot until the end.
1954         (determine_primary_base): Adjust VEC_iterate invokation.
1955         (resort_type_method_vec, finish_struct_methods, warn_hidden,
1956         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
1957         build_vtbl_initializer): Likewise.
1958         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
1959         build_vbase_delete): Likewise.
1960         * method.c (do_build_copy_constructor): Likewise.
1961         * name-lookup.c (new_class_binding, print_binding_level,
1962         poplevel_class, store_class_bindings, push_to_top_level,
1963         pop_from_top_level): Likewise.
1964         * pt.c (check_explicit_specialization): Likewise.
1965         * search.c (lookup_conversion_operator, lookup_fnfields_1,
1966         get_pure_virtuals, add_conversions, dfs_check_overlap,
1967         binfo_for_vbase): Likewise.
1968
1969 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1970
1971         PR c++/12170
1972         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
1973         innermost set of template arguments during deduction.  Simplify.
1974
1975 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
1976
1977         * typeck.c (build_modify_expr, build_x_modify_expr): Set
1978         TREE_NO_WARNING on assignments with an operator other than '='.
1979
1980 2004-07-10  Steven Bosscher  <stevenb@suse.de>
1981             Joseph S. Myers  <jsm@polyomino.org.uk>
1982
1983         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
1984         * decl2.c (grokfield): Don't check current_class_depth via
1985         unused TREE_COMPLEXITY.
1986         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
1987         to avoid the missing parentheses warning.
1988         Don't set C_SET_EXP_ORIGINAL_CODE.
1989
1990 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
1991
1992         * tree.c (no_linkage_helper): Remove.
1993         (no_linkage_check): Don't use walk_tree_without_duplicates.
1994
1995         * mangle.c (write_expression): Issue a sorry for zero-operand
1996         functional casts.
1997
1998 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1999
2000         PR c++/13092
2001         * init.c (build_offset_ref): Build SCOPE_REF with non-null
2002         TREE_TYPE for non-dependent names.
2003         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
2004         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
2005         unknown_type_node as its TREE_TYPE.
2006         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
2007         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
2008         (dump_expr) <SCOPE_REF case>: Likewise.
2009
2010 2004-07-17  Jason Merrill  <jason@redhat.com>
2011
2012         PR c++/16115
2013         * call.c (type_passed_as): Make the invisible reference type
2014         __restrict.
2015         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
2016         cp_genericize_r.  Handle invisible reference lowering.
2017         (is_invisiref_parm): New fn.
2018         (cp_genericize): Adjust the types of invisible reference parms.
2019         Don't repeat the walk for clones.
2020         * decl.c (store_parm_decls): Don't generate any code for clones.
2021
2022 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
2023
2024         * cp-tree.h (builtin_function): Declare.
2025
2026 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
2027
2028         * class.c (finish_struct_methods): Remove unncessary code.
2029         (add_implicitly_declared_members): Create declarations for default
2030         constructors and copy constructors lazily.
2031         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
2032         lazy_copy_ctor.
2033         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
2034         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
2035         * decl2.c (check_classfn): Robustify.
2036         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
2037         (locate_ctor): Handle lazy default constructors.
2038         (locate_copy): Handle lazy copy constructors.
2039         (implicitly_declare_fn): Make sure we're looking at the
2040         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
2041         set TYPE_HAS_CONSTRUCTOR.
2042         (lazily_declare_fn): New function.
2043         * name-lookup.c (constructor_name_full): Simplify.
2044         * search.c (lookup_fnfields_1): Lazily create methods, as
2045         necessary.
2046         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
2047
2048 2004-07-16  Steven Bosscher  <stevenb@suse.de>
2049
2050         * cp-tree.h (struct lang_type): Don't have three GTY options on a
2051         single bit GTY desc.
2052
2053 2004-07-16  Richard Henderson  <rth@redhat.com>
2054
2055         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
2056         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
2057         * tree.c (cp_copy_res_decl_for_inlining): Remove.
2058
2059 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
2060
2061         * class.c (finish_struct_bits): Use for loop.
2062         (propagate_binfo_offsets): Do primary binfo outside of loop.
2063
2064         PR c++/16583
2065         * dump.c (cp_dump_tree): Don't dump the bases if there's no
2066         binfo.
2067
2068         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
2069
2070 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
2071
2072         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
2073         has_abstract_assign_ref.  Make methods a VEC(tree) *.
2074         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
2075         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
2076         (CLASSTYPE_DESTRUCTORS): Likewise.
2077         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
2078         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
2079         (add_method): Change prototoype.
2080         * class.c (add_method): Remove error_p parameter.  Adjust for
2081         changes to CLASSTYPE_METHOD_VEC.
2082         (handle_using_decl): Adjust call to add_method.
2083         (maybe_warn_about_overly_private_class): Adjust for
2084         changes to CLASSTYPE_METHOD_VEC.
2085         (resort_type_method_vec): Likewise.
2086         (finish_struct_methods): Likewise.
2087         (check_for_override): Likewise.
2088         (warn_hidden): Likewise.
2089         (add_implicitly_declared_members): Defer creation of assignment
2090         operators.  Adjust call to add_method.
2091         (clone_function_decl): Adjust call to add_method.
2092         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
2093         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
2094         * decl.c (grok_special_member_properties): Don't set
2095         TYPE_HAS_ABSTRACT_ASSIGN_REF.
2096         * decl2.c (check_classfn): Adjust for
2097         changes to CLASSTYPE_METHOD_VEC.
2098         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
2099         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
2100         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
2101         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
2102         cp_finish_decl.
2103         * pt.c (check_explicit_specialization): Adjust for
2104         changes to CLASSTYPE_METHOD_VEC.
2105         (instantiate_class_template): Do not set
2106         TYPE_HAS_ABSTRACT_ASSIGN_REF.
2107         * ptree.c (cxx_print_type): Don't try to print
2108         CLASSTYPE_METHOD_VEC.
2109         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
2110         * search.c (lookup_field_r): Adjust for
2111         changes to CLASSTYPE_METHOD_VEC.
2112         (lookup_fnfields): Likewise.
2113         (lookup_conversion_operator): Likewise.
2114         (lookup_fnfields_1): Likewise.  Create assignment operators
2115         lazily.
2116         (look_for_overrides_here): Adjust for
2117         changes to CLASSTYPE_METHOD_VEC.
2118         (add_conversions): Likewise.
2119         * semantics.c (finish_member_declaration): Adjust call to add_method.
2120
2121 2004-07-15  Jason Merrill  <jason@redhat.com>
2122
2123         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
2124         references and pointers are compatible.
2125
2126 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
2127
2128         * decl.c (xref_basetypes): Refactor.
2129         * tree.c (copy_base_binfos): Replace with ...
2130         (copy_binfo): ... this. Deep copy the given binfo, (not the just
2131         bases of the given base).
2132         * cp-tree.h (copy_base_binfo): Remove.
2133         (copy_binfo): Declare.
2134
2135 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
2136
2137         * name-lookup.c (set_inherited_value_binding_p): Add class_type
2138         parameter.
2139         (get_class_binding): Adjust.
2140         (push_class_level_binding): Don't use set_inherited_value_binding_p.
2141
2142 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
2143
2144         * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
2145         * decl.c (xref_basetypes): Set it here.
2146
2147         * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
2148         Don't check for incomplete base.
2149         (get_vfield_name): Simplify while loop.
2150         * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
2151
2152 2004-07-14  Mark Mitchell  <mark@codesourcery.com>
2153
2154         * lex.c (cxx_make_type): Remove call to get_pointer_type.
2155
2156         * cp-tree.h (IDENTIFIER_VALUE): Remove.
2157         (BINFO_PUSHDECLS_MARKED): Likewise.
2158         (maybe_inject_for_scope_var): Likewise.
2159         (push_class_decls): Likewise.
2160         * name-lookup.h (push_class_binding): Remove.
2161         (innermost_non_namespace_value): New function.
2162         (outer_binding): Likewise.
2163         * class.c (add_method): Push bindings before adding to
2164         TYPE_METHODS.
2165         (restore_class_cache): Do not restore class_shadowed.
2166         (pushclass): Do not add USING_DECLs.  Do not call
2167         push_class_decls.
2168         * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
2169         * decl.c (pushdecl): Use outer_binding.
2170         (poplevel): Set the scope for an out-of-scope for-loop declaration
2171         appropriately.
2172         (cp_finish_decl): Don't call maybe_inject_for_scope_var.
2173         * name-lookup.c (new_class_binding): New function.
2174         (push_binding): Use it.
2175         (pushdecl): Use innermost_non_namespace_value.
2176         (maybe_inject_for_scope_var): Remove.
2177         (push_class_binding): Remove.
2178         (set_inherited_value_binding_p): New function.
2179         (get_class_binding): New function.
2180         (push_class_level_binding): Assert that the current_class_type is
2181         being defined.
2182         (outer_binding): New function.
2183         (innermost_non_namespace_value): Likewise.
2184         (lookup_name_real): Use outer_binding.
2185         (lookup_name_current_level): Ignore out-of-scope variables.
2186         * pt.c (check_template_shadow): Use innermost_non_namespace_value.
2187         (lookup_template_class): Likewise.
2188         * search.c (dfs_push_type_decls): Remove.
2189         (dfs_push_decls): Likewise.
2190         (setup_class_bindings): Likewise.
2191         (lookup_field_1): Handle USING_DECLs from dependent scopes.
2192         (marked_pushdecls_p): Remove.
2193         (unmarked_pushdecls_p): Remove.
2194         (marked_identifiers): Remove.
2195         (setup_class_bindings): Remove.
2196         (dfs_push_type_decls): Remove.
2197         (dfs_push_decls): Remove.
2198         (push_class_decls): Remove.
2199
2200 2004-07-13  Mark Mitchell  <mark@codesourcery.com>
2201
2202         PR c++/16518
2203         PR c++/16337
2204         * decl.c (grokvardecl): Make declspecs parameter const.
2205         (grokdeclarator): Likewise.  Adjust accordingly.
2206         * decl.h (grokdeclarator): Adjust declaration.
2207         * parser.c (cp_parser_init_declarator): Do not clear
2208         decl_specifiers->attributes.
2209
2210         * cp-tree.h (lang_identifier): Remove class_value.
2211         (IDENTIFIER_CLASS_VALUE): Remove.
2212         (pop_class_decls): Likewise.
2213         (init_search_processing): Likewise.
2214         * class.c (handle_using_decl): Use lookup_member, not
2215         IDENTIFIER_CLASS_VALUE.
2216         (restore_class_cache): New function, split out from ...
2217         (pushclass): ... here.  Do not call clear_identifier_class_values.
2218         (invalidate_class_lookup_cache): Do not clear
2219         IDENTIFIER_CLASS_VALUE.
2220         (popclass): Do not call pop_class_decls.
2221         (maybe_note_name_used_in_class): Do not save names looked up after
2222         the class is complete.  Use lookup_member, not
2223         IDENTIFIER_CLASS_VALUE.
2224         * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
2225         * decl.c (cxx_init_decl_processing): Do not call
2226         init_search_processing.
2227         * method.c (do_build_copy_constructor): Remove unnecessary code.
2228         (do_build_assign_ref): Likewise.
2229         * name-lookup.c (pushdecl): Use lookup_member, not
2230         IDENTIFIER_CLASS_VALUE.
2231         (set_identifier_type_value_with_scope): Set TREE_TYPE on the
2232         type_shadowed list.
2233         (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
2234         (push_class_binding): Do not set it.
2235         (clear_identifier_class_values): Remove.
2236         (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
2237         (store_binding): Do not save it.
2238         (pop_from_top_level): Do not restore it.
2239         * name-lookup.h (cxx_saved_binding): Remove class_value.
2240         (clear_identifier_class_values): Remove.
2241         * ptree.c (cxx_print_identifier): Do not print
2242         IDENTIFIER_CLASS_VALUE.
2243         * search.c (search_obstack): Remove.
2244         (push_stack_level): Remove.
2245         (pop_stack_level): Remove.
2246         (search_level): Remove.
2247         (search_stack): Remove.
2248         (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
2249         (setup_class_bindings): Use IDENTIFIER_MARKED, not
2250         IDENTIFIER_CLASS_VALUE.
2251         (marked_identifiers): New variable.
2252         (push_class_decls): Clear IDENTIFIER_MARKED.
2253         (pop_class_decls): Don't call pop_search_level.
2254         (init_search_processing): Remove.
2255
2256 2004-07-12  Mark Mitchell  <mark@codesourcery.com>
2257
2258         * cp-tree.h (get_aggr_typedef): Remove.
2259         * init.c (get_aggr_typedef): Likewise.
2260
2261         * name-lookup.c (push_class_level_binding): Simplify.
2262
2263 2004-07-12  Andrew Pinski  <apinski@apple.com>
2264
2265         PR c++/16475
2266         Revert:
2267         2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
2268                 PR c++/16276
2269                 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
2270                 is not public.
2271
2272 2004-07-12  Eric Christopher  <echristo@redhat.com>
2273
2274         * parser.c (cp_parser_class_head): Remove unused variable.
2275
2276 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2277
2278         * decl.c (grok_op_properties): Reject [de-]allocation functions
2279         declared in a namespace, or declared as static.
2280
2281 2004-07-12  Nathan Sidwell  <nathan@codesourcery.com>
2282
2283         * cp-tree.h (make_binfo): Remove.
2284         * decl.c (xref_basetypes): Use make_tree_binfo directly.
2285         * tree.h (copy_base_binfos): Likewise.
2286         (make_binfo): Remove.
2287
2288         * call.c (build_user_type_conversion_1, build_new_op,
2289         check_constructor_callable, build_temp,
2290         perform_direct_initialization_of_possible): Pass type directly to
2291         lookup_fnfields & build_special_member_call.
2292         (build_special_member_call): Accept a type, and complete it.
2293         * class.c (finish_stuct_bits): Copy the BINFOs here.
2294         * cvt.c (ocp_convert): Pass type directly to
2295         build_special_member_call.
2296         * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
2297         (xref_basetypes): Allocate the binfo here. Adjust.
2298         * init.c (build_init, build_new_1): Pass type directly to
2299         build_special_member_call.
2300         * lex.c (cxx_make_type): Do not allocate binfo here.
2301         * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
2302         * parser.c (cp_parser_class_head): Always call xref_basetypes.
2303         * pt.c (instantiate_class_template): Likewise. Inhibit access
2304         checking for template friends.
2305         * ptree.c (cxx_print_type): Adjust record printing.
2306         * search.c (lookup_base): When taking a type, complete it before
2307         looking for a binfo.
2308         (lookup_member): Delay completing a type.
2309         (push_class_decls): Don't walk an incomplete type.
2310         (lookup_conversions): Likewise.
2311         * semantics.c (finish_stmt_expr_expr): Pass type directly to
2312         build_special_member_call.
2313         * tree.c (copy_base_binfos): Adjust.
2314         (make_binfo): Likewise.
2315         * typeck.c (build_modify_expr): Pass type directly to
2316         build_special_member_call.
2317         * typeck2.c (process_init_constructor): Check a binfo exists.
2318         (build_m_component_ref): Allow accessing an incomplete type.
2319         (build_functional_cast): Pass type directly to
2320         build_special_member_call.
2321
2322 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2323
2324         PR c++/2204
2325         * config-lang.in (gtfiles): Add typeck2.c.
2326         * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
2327         gt-cp-typeck2.h.
2328         * cp-tree.h: Declare complete_type_check_abstract.
2329         * typeck2.c (pat_calc_hash, pat_compare,
2330         complete_type_check_abstract): New functions.
2331         (abstract_virtuals_error): If the type is abstract, register the
2332         declaration within abstract_pending_vars for further checks.
2333         Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
2334         * decl.c (cp_finish_decl): Do not strip array types.
2335         (create_array_type_for_decl): Check for abstractness of the element
2336         type.
2337         (complete_vars): Call complete_type_check_abstract.
2338         * class.c (finish_struct): Prepare a list of virtual functions for
2339         template types, and call complete_vars on it to check for abstractness.
2340
2341 2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
2342
2343         PR tree-optimization/14107
2344         * decl.c (finish_function): Remove temporary band-aid.
2345
2346 2004-07-11  Mark Mitchell  <mark@codesourcery.com>
2347
2348         * call.c (build_operator_new_call): Avoid using push_to_top_level.
2349         (build_new_op): Adjust call to lookup_function_nonclass.
2350         * name-lookup.c (identifier_type_value): Adjust call to
2351         lookup_name_real.
2352         (lookup_name_real): Add block_p parameter.
2353         (lookup_name_nonclass): Adjust call to lookup_name_real.
2354         (lookup_function_nonclass): Likewise.
2355         (lookup_name): Likewise.
2356         * name-lookup.h (lookup_name_real): Change prototype.
2357         (lookup_name_nonclass): Likewise.
2358         * parser.c (cp_parser_lookup_name): Likewise.
2359
2360         * cp-tree.h (saved_scope): Make old_bindings a vector.
2361         (unuse_fields): Remove.
2362         * name-lookup.h (cxx_saved_binding): Define it.
2363         * class.c (pushclass): Don't use unuse_fields.
2364         * name-lookup.c (cxx_saved_binding_make): Remove.
2365         (store_binding): Add new bindings to a vector, using an
2366         accumulator style, rather than adding them to a list.
2367         (store_bindings): Adjust accordingly.
2368         (store_class_bindings): Likewise.
2369         (push_to_top_level): Likewise.
2370         (pop_from_top_level): Likewise.
2371         * optimize.c (maybe_clone_body): Must push_to_top_level and
2372         pop_from_top_level calls outside of loop.
2373         * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
2374         calls here from cp_parser_late_parsing_default_args.
2375         (cp_parser_save_default_args): Record the class type in which the
2376         function is declared.
2377         (cp_parser_late_parsing_default_args): Do not call
2378         push_nested_class/pop_nested_class.
2379         * search.c (dfs_unuse_fields): Remove.
2380         (unuse_fields): Remove.
2381
2382 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
2383
2384         * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
2385         LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
2386         * cp-tree.h (poplevel): Declare.
2387         (set_block): Remove.
2388         * decl.c (set_block): Remove.
2389
2390 2004-07-10  Mike Stump  <mrs@apple.com>
2391
2392         * decl2.c (import_export_class): Never export/import vtables
2393         with inline key functions.
2394
2395 2004-07-09  Steven Bosscher  <stevenb@suse.de>
2396
2397         * typeck.c (c_expand_asm_operands): Remove.
2398
2399 2004-07-09  Mike Stump  <mrs@apple.com>
2400
2401         * typeck.c (build_class_member_access_expr): Skip null deref
2402         warning when we don't dereference it.
2403
2404 2004-07-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2405
2406         PR c++/8211
2407         PR c++/16165
2408         * class.c (check_field_decls): Improve -Weffc++ warning: do not
2409         warn for pointers to functions/members, or for classes without
2410         destructors.
2411
2412 2004-07-08  Mark Mitchell  <mark@codesourcery.com>
2413
2414         * name-lookup.h (struct cp_binding_level): Update documentation
2415         for class_shadowed.
2416
2417 2004-07-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2418
2419         PR c++/16169
2420         * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
2421         returning CALL_EXPR, and non-reference return type.
2422
2423 2004-07-08  Nathan Sidwell  <nathan@codesourcery.com>
2424
2425         * name-lookup.c (push_binding): Use VEC_reserve.
2426
2427 2004-07-08  Richard Henderson  <rth@redhat.com>
2428
2429         * cp-tree.h (expand_eh_spec_block): Remove.
2430
2431 2004-07-07  Mark Mitchell  <mark@codesourcery.com>
2432
2433         * cp-tree.h (saved_scope): Remove x_previous_class_type and
2434         x_previous_class_values; add x_previous_class_level.
2435         (previous_class_type): Remove.
2436         (previous_class_values): Remove.
2437         (previous_class_level): New macro.
2438         * class.c (pushclass): Restore the identifier cache more
2439         expeditiously.
2440         (invalidate_class_lookup_cache): Use vector for class_shadowed and
2441         previous_class_values.
2442         * decl.c (poplevel): Likewise.
2443         * name-lookup.c (cxx_binding_init): New function.
2444         (cxx_binding_make): Use it.
2445         (push_binding): For a binding in a class level, use a vector of
2446         cp_class_binding nodes.
2447         (push_binding_level): New function.
2448         (begin_scope): Use it.
2449         (leave_scope): Do not put class binding levels on the free list.
2450         (print_binding_level): Adjust for the fact that class_shadowed is
2451         a vector.
2452         (poplevel_class): Likewise.
2453         (clear_identifier_class_values): Likewise.
2454         (push_class_level_binding): Likewise.
2455         (set_class_shadows): Remove.
2456         (store_binding): New function.
2457         (store_class_bindings): New function.
2458         (push_to_top_level): Use store_class_bindings as appropriate.
2459         (pop_from_top_level): Use previous_class_level, not
2460         previous_class_type.
2461         * name-lookup.h (cp_class_binding): New type.
2462         (cp_binding_level): Use a vector object for class_shadowed.
2463         (push_binding_level): Declare.
2464         (set_class_shadows): Remove.
2465
2466 2004-07-07  Andrew Pinski  <apinski@apple.com>
2467
2468         * class.c (instantiate_type): BUFFER_REF is dead.
2469         * lex.c (init_operators): IN_EXPR is dead.
2470
2471 2004-07-07  Jason Merrill  <jason@redhat.com>
2472
2473         PR c++/16334
2474         * call.c (build_new_op): Give overload warnings for built-in
2475         candidates.
2476
2477 2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
2478
2479         PR c++/16276
2480         * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
2481         is not public.
2482
2483 2004-07-07  Nathan Sidwell  <nathan@codesourcery.com>
2484
2485         * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
2486         * class.c (build_primary_vtable, check_bases,
2487         determine_primary_base, finish_struct_bits,
2488         maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
2489         get_basefndecls, warn_hidden, walk_subobject_offsets,
2490         build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
2491         layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
2492         finish_struct_1, get_vfield_name, contains_empty_class_p,
2493         dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
2494         dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
2495         add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
2496         BINFO macros.
2497         * decl.c (xref_basetypes): Likewise.
2498         * dump.c (cp_dump_tree): Likewise.
2499         * error.c (dump_expr): Likewise.
2500         * init.c (sort_mem_initializers, expand_member_init,
2501         push_base_cleanups): Likewise.
2502         * method.c (do_build_copy_constructor, do_build_assign_reg,
2503         synthesize_exception_spec): Likewise.
2504         * name-lookup.c (arg_assoc_class): Likewise.
2505         * pt.c (instantiate_class_template, tsubst,
2506         get_template_base_recursive): Likewise.
2507         * ptree.c (cxx_print_type): Likewise.
2508         * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
2509         * search.c (lookup_base_r, dynamic_cast_base_recurse,
2510         dfs_access_in_type, access_in_type, lookup_field_queue_p,
2511         bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
2512         marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
2513         dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
2514         binfo_for_vtable, copied_binfo, original_binfo): Likewise
2515         * tree.c (copy_base_binfos, make_binfo): Likewise.
2516         * typeck.c (commmon_base_type): Likewise
2517         * typeck2.c (process_init_constructor): Likewise
2518
2519 2004-07-06  Joseph S. Myers  <jsm@polyomino.org.uk>
2520
2521         * decl.c (check_tag_decl): Name redeclared type in diagnostic.
2522
2523 2004-07-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2524
2525         PR c++/3671
2526         * pt.c (convert_nontype_argument): Disallow conversions between
2527         different enumeration types.
2528
2529 2004-07-06  Nathan Sidwell  <nathan@codesourcery.com>
2530
2531         * cp-tree.h (BINFO_MARKED): Remove.
2532         (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
2533         BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
2534         BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
2535         (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
2536         * class.c (build_base_path): Use BINFO_VIRTUAL_P.
2537         (mark_primary_bases, determine_primary_base, base_derived_from,
2538         dfs_find_final_overrider, dfs_find_final_overrider_q,
2539         dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
2540         dfs_modify_vtables, walk_subobject_offsets,
2541         layout_nonempty_base_or_field, build_base_field,
2542         build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
2543         end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
2544         finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
2545         build_ctor_vtbl_group, accumulate_vtble_inits,
2546         dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
2547         build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
2548         add_vcall_offset_vtbl_entries_1): Likewise.
2549         * decl.c (xref_basetypes): Incomming virtual base indicated by
2550         TREE_TYPE. Adjust.
2551         * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
2552         * init.c (finish_init_stmts, sort_mem_initializers,
2553         emit_mem_initializers, build_vtble_address, expand_member_init,
2554         push_base_cleanups): Likewise.
2555         * method.c (do_build_copy_constructor): Likewise.
2556         * pt.c (instantiate_class_template,
2557         get_template_base_recursive): Likewise.
2558         * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
2559         get_pseudo_ti_desc): Likewise.
2560         * search.c (lookup_base_r, dynamic_cast_base_recurse,
2561         binfo_from_vbase, binfo_via_virtual, copied_binfo,
2562         original_binfo): Likewise.
2563         * semantics.c (finish_base_specifier): Virtualness is indicated
2564         by TREE_TYPE.
2565         * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
2566
2567 2004-07-06  Mark Mitchell  <mark@codesourcery.com>
2568
2569         Revert:
2570         2004-06-24  Jason Merrill  <jason@redhat.com>
2571         PR c++/16115
2572         * decl.c (grokparms): Give the PARM_DECL reference type if the
2573         parameter is passed by invisible reference.
2574
2575 2004-07-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2576
2577         * cp-lang.c (cp_var_mod_type_p): Add extra arg.
2578         * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
2579         * pt.c (check_instantiated_args, unify): Likewise.
2580
2581 2004-07-05  Phil Edwards  <phil@codesourcery.com>
2582
2583         * Make-lang.in (check-c++, lang_checks):  Add some comments.
2584
2585 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
2586
2587         * cp-mudflap.c: Delete file.
2588         * Makefile.in: Remove all references to cp-mudflap.o.
2589
2590 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
2591
2592         * decl.c (cxx_init_decl_processing): Call
2593         build_common_tree_nodes before creating the global NAMESPACE_DECL.
2594
2595 2004-07-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2596
2597         PR c++/2518
2598         * call.c (build_operator_new_call): Look only at global scope.
2599
2600 2004-07-05  Nathan Sidwell  <nathan@codesourcery.com>
2601
2602         * call.c (enforce_access): Expect TREE_BINFO.
2603         * class.c (binfo_ctor_vtable): Check TREE_BINFO.
2604         * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
2605         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
2606         Adjust.
2607         (BINFO_LANG_ELTS): Remove.
2608         (BINFO_LANG_SLOTS): New.
2609         (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
2610         (CLASSTYPE_TEMPLATE_INFO): Adjust.
2611         * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
2612         * search.c (lookup_member): Check TREE_BINFO.
2613         * semantics.c (perform_or_defer_access_check): Likewise.
2614         (check_accessibility_of_qualified_id): Check
2615         deferred_access_no_check.
2616         * tree.c (make_binfo): Use make_tree_binfo.
2617
2618 2004-07-04  Mark Mitchell  <mark@codesourcery.com>
2619
2620         * method.c (implicitly_declare_fn): Set linkage of generated
2621         functions.
2622
2623 2004-07-04  Richard Henderson  <rth@redhat.com>
2624
2625         * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
2626
2627 2004-07-03  Scott Brumbaugh  <scottb.lists@verizon.net>
2628
2629         PR c++/3761
2630         * name-lookup.c (push_class_level_binding): Don't pass a
2631         TREE_LIST of ambiguous names to check_template_shadow as it
2632         only handles declarations. Instead, pull the declaration
2633         out and pass that.
2634
2635 2004-07-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2636
2637         PR c++/14971
2638         * pt.c (check_explicit_specialization): Clarify error message.
2639
2640 2004-07-02  Richard Henderson  <rth@redhat.com>
2641
2642         * tree.c (cp_unsave_r): Update remap_save_expr call.
2643
2644 2004-07-02  Mark Mitchell  <mark@codesourcery.com>
2645
2646         PR c++/16240
2647         * mangle.c (write_template_arg): Correct mangling.
2648
2649         PR c++/16297
2650         * decl.c (grokdeclarator): Robustify.
2651
2652 2004-07-01  Richard Henderson  <rth@redhat.com>
2653
2654         * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
2655         * method.c (synthesize_method): Don't clear_last_expr.
2656         * name-lookup.c (maybe_push_cleanup_level): Likewise.
2657
2658 2004-07-01  Nick Clifton  <nickc@redhat.com>
2659
2660         * decl2.c (import_export_class): Invoke the
2661         import_export_class field in the gcc_target structure if it is not
2662         empty.
2663
2664 2004-06-30  Richard Henderson  (rth@redhat.com>
2665
2666         * decl.c (start_preparsed_function): Don't set immediate_size_expand.
2667         * method.c (use_thunk): Likewise.
2668
2669 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
2670
2671         * call.c (build_over_call), typeck.c (build_function_call): Call
2672         check_function_arguments instead of check_function_format.
2673
2674 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
2675
2676         * call.c (build_over_call), typeck.c (build_function_call): Update
2677         calls to check_function_format.
2678
2679 2004-06-30  Richard Henderson  <rth@redhat.com>
2680
2681         * call.c (build_over_call): Use __builtin_memcpy for copying
2682         CLASS_AS_BASE rather than funny casting.
2683
2684 2004-06-30  Richard Henderson  <rth@redhat.com>
2685
2686         * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
2687         TYPE_SIZE_UNIT of full_type.
2688
2689 2004-06-30  Per Bothner  <per@bothner.com>
2690
2691         Conditionally compile support for --enable-mapped_location.
2692         * decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
2693         * decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
2694         adjustments - which I don't understand.
2695         * error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
2696         * error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
2697         (print_instantiation_partial_context):  Use expand_location.
2698         * decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
2699         * name-lookup.c:  Likewise.
2700         * lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
2701         * name-lookup.c:  Use input_line macro.
2702         * parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
2703         (cp_parser_statement):  Rename locaal variable statement_locus to
2704         statement_location and use SET_EXPR_LOCATION macro.
2705         * pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
2706         * tree.c (cp_walk_subtrees):  Likewise.
2707
2708 2004-06-29  Per Bothner  <per@bothner.com>
2709
2710         * tree.c (build_min_nt, build_min, build_min_non_dep):
2711         Don't set TREE_COMPLEXITY from input_line.
2712
2713 2004-06-29  Paul Brook  <paul@codesourcery.com>
2714
2715         * init.c: Include target.h.
2716         (get_cookie_size): Remove and replace with target hook.
2717         Update callers.
2718         (build_new_1): Store the element size in the cookie.
2719
2720 2004-06-29  Nathan Sidwell  <nathan@codesourcery.com>
2721
2722         PR c++/16260
2723         * parser.c (cp_parser_template_declaration_after_export): Disable
2724         access checks here ...
2725         (cp_parser_class_specifier): ... not here.
2726
2727 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2728
2729         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
2730         VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
2731         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
2732         TREE_CHECK macro.
2733
2734 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2735
2736         * cp-tree.h (struct deferred_access): Move to ...
2737         * semantics.c (struct deferred_access): ... here. Adjust.
2738         (deferred_access_stack): Make a VEC(deferred_access),
2739         (deferred_access_free_list): Remove.
2740         (deferred_access_no_check): New.
2741         (push_deferring_access_checks, resume_deferring_access_checks,
2742         stop_deferring_access_checks, pop_deferring_access_checks,
2743         get_deferred_access_checks, pop_to_parent_deferring_access_checks,
2744         perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
2745
2746 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2747
2748         PR c++/16174
2749         * call.c (build_temp): Declare.
2750         (check_constructor_callable): New.
2751         (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
2752         CONSTRUCTOR_CALLABLE.
2753         (convert_like_real, initialize_reference): Use
2754         check_constructor_callable.
2755         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
2756         (LOOKUP_*): Renumber.
2757
2758 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2759
2760         * friend.c (add_friend): Only perform access checks when context
2761         is a class.
2762         * lex.c (cxx_make_type): Only create a binfo for aggregate types.
2763         * parser.c (cp_parser_class_specifier): Disable access checks here
2764         when parsing the body of a templated class.
2765         * semantics.c (perform_or_defer_access_checks): Reorder to allow
2766         NULL binfos when not checking access.
2767
2768 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
2769
2770         Use vector API for vbase list.
2771         * cp-tree.h: Include vec.h
2772         (DEF_VEC_P (tree)): New type.
2773         (struct lang_type_class): Change vbase's member type.
2774         (binfo_for_vbase): Declare.
2775         * class.c (determine_primary_base, base_derived_from,
2776         update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
2777         warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
2778         build_vtbl_initializer): Adjust.
2779         * decl.c (xref_basetypes): Adjust, accumulate upper bound of
2780         vbases.
2781         * init.c (sort_mem_initializers, expand_member_init,
2782         push_base_cleanups): Adjust.
2783         * method.c (do_build_copy_constructor): Adjust.
2784         * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
2785         (binfo_for_vbase): New.
2786         * tree.c (copy_base_binfos): Adjust.
2787
2788 2004-06-28  Mark Mitchell  <mark@codesourcery.com>
2789
2790         * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
2791
2792 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2793
2794         PR c++/14123
2795         * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
2796         paranthesis in case of pointers to array members.
2797         * error.c (dump_type_prefix): Likewise.
2798         (dump_type_suffix): Maybe issue a whitespace when printing
2799         ARRAY_TYPE.
2800
2801 2004-06-27  Mark Mitchell  <mark@codesourcery.com>
2802
2803         PR c++/16193
2804         * parser.c (cp_parser_set_decl_spec_type): Refine test for
2805         redefinition of built-in types.
2806
2807 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2808
2809         * error.c (pp_template_argument_list_start): Remove.
2810         (pp_template_argument_list_end): Likewise.
2811         (pp_separate_with_comma): Use pp_cxx_separate_with.
2812         (reinit_global_formatting_buffer): Remove.
2813         (pp_non_consecutive_character): Likewise.
2814         (dump_scope): Use pp_cxx_colon_colon.
2815         (dump_template_parameter): Use pp_cxx_identifier,
2816         pp_cxx_tree_identifier and pp_cxx_whitespace.
2817         (dump_templat_bindings): Replace use of pp_string with sequence
2818         of pp_cxx_whitespace and pp_equal.
2819         (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
2820         pp_cxx_colon_colon, pp_cxx_whitespace throughout.  Don't set
2821         padding here.
2822         (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
2823         (dump_type_prefix): Don't set padding.  Use pp_cxx_whitespace,
2824         pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
2825         (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
2826         pp_cxx_right_bracket, pp_cxx_identifier throughout,
2827         (dump_decl): Likewise.
2828         (dump_template_decl): Likewise.
2829         (dump_function_decl): Likewise.  Set padding as appropriate.
2830         (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
2831         pp_cxx_right_paren.
2832         (dump_exception_spec): Likewise.
2833         (dump_function_name): Use pp_cxx_tree_identifier and
2834         pp_cxx_identifier.
2835         (dump_template_parms): Use pp_cxx_begin_template_argument_list and
2836         pp_cxx_end_template_argument_list.
2837         (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
2838         pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
2839         pp_cxx_whitespace throughout.
2840         (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
2841         pp_cxx_right_paren.
2842         (dump_unary_op): Likewise.
2843         (reinit_cxx_pp): New function.
2844         (type_as_string); Use it.
2845         (expr_as_string): Likewise.
2846         (decl_as_string); Likewise.
2847         (context_as_string): Likewise.
2848         (lang_decl_name): Likewise.
2849         (decl_to_string): Likewise.
2850         (expr_to_string): Likewise.
2851         (parm_to_string): Likewise.
2852         (type_to_string): Likewise.
2853         (args_to_string): Likewise.
2854         (cv_to_string): Likewise.
2855
2856 2004-06-26  Mark Mitchell  <mark@codesourcery.com>
2857
2858         * cp-tree.h (cp_cv_quals): New type.
2859         (cp_declarator): Use it instead of "tree" as appropriate.
2860         (grok_method_quals): Adjust prototype.
2861         (grokclassfn): Likewise.
2862         (do_friend): Likewise.
2863         * decl.c (grokfndecl): Use cp_cv_quals, not tree.
2864         (grokdeclarator): Likewise.
2865         * decl2.c (grok_method_quals): Likewise.
2866         (grokclassfn): Likewise.
2867         * friend.c (do_friend): Likewise.
2868         * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
2869         * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
2870         (make_pointer_declarator): Likewise.
2871         (make_reference_declarator): Likewise.
2872         (make_ptrmem_declarator): Likewise.
2873         (cp_parser_ptr_operator): Likewise.
2874         (cp_parser_cv_qualifier_seq_opt): Likewise.
2875         (cp_parser_cv_qualifier_opt): Remove.
2876         (cp_parser_new_declarator_opt): Adjust call to
2877         cp_parser_ptr_operator.
2878         (cp_parser_conversion_declaration_opt): Likewise.
2879         (cp_parser_declarator): Use cp_cv_quals, not tree.
2880         (cp_parser_direct_declarator): Likewise.
2881
2882 2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2883
2884         * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
2885         Rename DECL_STMT to DECL_EXPR.
2886         * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
2887         * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
2888         * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
2889
2890 2004-06-26  Jan Hubicka  <jh@suse.cz>
2891
2892         PR C++/14865
2893         * decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
2894         reachability analysis.
2895
2896 2004-06-25  Mark Mitchell  <mark@codesourcery.com>
2897
2898         * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
2899         2004-06-23 change.
2900
2901 2004-06-25  Paul Brook  <paul@codesourcery.com>
2902
2903         * decl2.c (get_guard): Call targetm.cxx.guard_type.
2904         (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
2905
2906 2004-06-24  Mark Mitchell  <mark@codesourcery.com>
2907
2908         * decl.c (grokdeclarator): Restore error messages about __thread.
2909         * parser.c (cp_parser_decl_specifier_seq): Likewise.
2910
2911 2004-06-24  Jason Merrill  <jason@redhat.com>
2912
2913         PR c++/16115
2914         * decl.c (grokparms): Give the PARM_DECL reference type if the
2915         parameter is passed by invisible reference.
2916
2917 2004-06-24  Andreas Schwab  <schwab@suse.de>
2918
2919         * cp-tree.h (enum cp_storage_class): Remove trailing comma.
2920
2921 2004-06-23  Mark Mitchell  <mark@codesourcery.com>
2922
2923         * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
2924         (cp/decl.o): Likewise.
2925         (cp/decl2.o): Likewise.
2926         (cp/pt.o): Likewise.
2927         (cp/semantics.o): Likewise.
2928         * config-lang.in (gtfiles): Do not reference cp/lex.h.
2929         * class.c: Do not include lex.h.
2930         (add_implicitly_declared_members): Do not use
2931         adding_implicit_members.
2932         (check_bases_and_members): Do not talk about grok_x_components.
2933         * cp/cp-tree.h (adding_implicit_members): Remove.
2934         (cp_storage_class): New type.
2935         (cp_decl_spec): Likewise.
2936         (cp_decl_specifier_seq): Likewise.
2937         (cp_parameter_declarator): Use it for the decl_specifiers field.
2938         (check_tag_decl): Adjust prototype.
2939         (shadow_tag): Likewise.
2940         (groktypename): Likewise.
2941         (start_decl): Likewise.
2942         (start_function): Likewise.
2943         (start_method): Likewise.
2944         (grok_x_components): Remove.
2945         (grokfield): Adjust prototype.
2946         (grokbitfield): Likewise.
2947         (finish_member_class_template): Remove.
2948         * decl.c: Do not include lex.h.
2949         (adding_implicit_members): Do not define.
2950         (check_tag_decl): Do not use trees to represent decl-specifiers.
2951         (shadow_tag): Likewise.
2952         (groktypename): Likewise.
2953         (start_decl): Likewise.
2954         (grokvardecl): Likewise.
2955         (grokdeclarator): Likewise.
2956         (grokparms): Likewise.
2957         (start_function): Likewise.
2958         (start_method): Likewise.
2959         * decl.h (grokdeclarator): Adjust prototype.
2960         * decl2.c: Do not include lex.h.
2961         (grok_x_components): Remove.
2962         (grokfield): Do not use trees to represent decl-specifiers.
2963         (grokbitfield): Likewise.
2964         * lex.c: Do not include lex.h.
2965         * lex.h: Remove.
2966         * parser.c: Include target.h.
2967         (clear_decl_specs): New function.
2968         (cp_parser_translation_unit): Do not use trees to represent
2969         decl-specifiers.
2970         (cp_parser_postfix_expression): Likewise.
2971         (cp_parser_new_type_id): Likewise.
2972         (cp_parser_condition): Likewise.
2973         (cp_parser_simple_declaration): Likewise.
2974         (cp_parser_decl_specifier_seq): Likewise.
2975         (cp_parser_function_specifier_opt): Likewise.
2976         (cp_parser_conversion_type_id): Likewise.
2977         (cp_parser_template_parameter): Likewise.
2978         (cp_parser_explicit_instantiation): Likewise.
2979         (cp_parser_type_specifier): Likewise.
2980         (cp_parser_simple_type_specifier): Likewise.
2981         (cp_parser_init_declarator): Likewise.
2982         (cp_parser_type_id): Likewise.
2983         (cp_parser_type_specifier_seq): Likewise.
2984         (cp_parser_parameter_declaration): Likewise.
2985         (cp_parser_member_declaration): Likewise.
2986         (cp_parser_exception_declaration): Likewise.
2987         (cp_parser_function_definition_from_specifiers_and_declarator):
2988         Likewise.
2989         (cp_parser_single_declaration): Likewise.
2990         (cp_parser_save_member_function_body): Likewise.
2991         (cp_parser_friend_p): Likewise.
2992         (cp_parser_set_storage_class): New function.
2993         (cp_parser_set_decl_spec_type): Likewise.
2994         * pt.c: Do not include lex.h.
2995         * semantics.c: Likewise.
2996         (finish_member_class_template): Remove.
2997
2998 2004-06-23  Roger Sayle  <roger@eyesopen.com>
2999
3000         * call.c (build_cxx_call): Don't call expand_tree_builtin.  No
3001         longer take both "args" and "convert_args" as arguments.
3002         (build_op_delete_call): Update call to build_cxx_call.
3003         (build_over_call): Likewise, update call to build_cxx_call.
3004         * cp-tree.h (build_cxx_call): Update funtion prototype.
3005         * typeck.c (build_function_call): Don't call expand_tree_builtin.
3006         * rtti.c (throw_bad_cast): Update call to build_cxx_call.
3007         (throw_bad_typeid): Likewise.
3008         (build_dynamic_cast_1): Likewise.
3009
3010 2004-06-22  Richard Henderson  <rth@redhat.com>
3011
3012         * class.c (build_vfn_ref): Take a pointer not object.  Build
3013         an OBJ_TYPE_REF.
3014         (cp_fold_obj_type_ref): New.
3015         * call.c (build_over_call): Update build_vfn_ref call.
3016         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
3017         * cp-tree.h (cp_fold_obj_type_ref): Declare.
3018
3019 2004-06-21  Jason Merrill  <jason@redhat.com>
3020
3021         PR c++/16112
3022         * cp-gimplify.c (cp_gimplify_init_expr): Look through
3023         CLEANUP_POINT_EXPR.
3024
3025 2004-06-21  Mark Mitchell  <mark@codesourcery.com>
3026
3027         * cp-tree.def (NEW_EXPR): Add a fourth slot.
3028         * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
3029         (TREE_PARMLIST): Likewise.
3030         (CALL_DECLARATOR_PARMS): Likewise.
3031         (CALL_DECLARATOR_QUALS): Likewise.
3032         (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
3033         (cp_declarator_kind): New type.
3034         (cp_parameter_declarator): Likewise.
3035         (cp_declarator): Likewise.
3036         (cp_error_declarator): Likewise.
3037         (no_parameters): Likewise.
3038         (groktypename): Change prototype.
3039         (start_decl): Likewise.
3040         (start_handler_parms): Likewise.
3041         (get_scope_of_declarator): Likewise.
3042         (start_function): Likewise.
3043         (start_preparsed_function): New function.
3044         (start_function): Change prototype.
3045         (start_method): Likewise.
3046         (grokfield): Likewise.
3047         (grokbitfield): Likewise.
3048         (build_new): Likewise.
3049         (make_pointer_declarator): Remove.
3050         (make_reference_declarator): Likewise.
3051         (make_call_declarator): Likewise.
3052         (set_quals_and_spec): Likewise.
3053         (process_template_parm): Change prototype.
3054         (begin_function_definition): Remove.
3055         (finish_parmlist): Remove.
3056         * decl.c (groktypename): Do not use trees to represent
3057         declarators.
3058         (start_decl): Likewise.
3059         (start_handler_parms): Remove.
3060         (get_scope_of_declarator): Reimplement.
3061         (grokdeclarator): Do not use trees to represent declarators.
3062         (grokparms): Likewise.
3063         (start_function): Likewise.
3064         (start_method): Likewise.
3065         (build_void_list_mode): Do not use TREE_PARMLIST.
3066         * decl.h (grokdeclarator): Change prototype.
3067         * decl2.c (grok_method_quals): Robustify.
3068         (grok_x_components): Do not use trees to represent declarators.
3069         (grokfield): Likewise.
3070         (grokbitfield): Likewise.
3071         (start_objects): Build FUNCTION_DECLs, not declarators.
3072         (start_static_storage_duration_function): Likewise.
3073         * init.c (build_new): Simplify.
3074         * lex.c (make_pointer_declarator): Remove.
3075         (make_reference_declarator): Likewise.
3076         (make_call_declarator): Likewise.
3077         (set_quals_and_spec): Likewise.
3078         * method.c (use_thunk): Use start_preparsed_function.
3079         (synthesize_method): Likewise.
3080         (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
3081         * optimize.c (maybe_clone_body): Use start_preparsed_function.
3082         * parser.c (cp_error_declarator): New variable.
3083         (declarator_obstack): Likewise.
3084         (alloc_declarator): New function.
3085         (make_declarator): Likewise.
3086         (make_id_declarator): Likewise.
3087         (make_pointer_declarator): Likewise.
3088         (make_reference_declarator): Likewise.
3089         (make_ptrmem_declarator): Likewise.
3090         (make_call_declarator): Likewise.
3091         (make_array_declarator): Likewise.
3092         (no_parameters): New variable.
3093         (make_parameter_declarator): Likewise.
3094         (cp_parser_check_for_definition_in_return_type): Do not use trees
3095         to represent declarators.
3096         (cp_parser_translation_unit): Likewise.
3097         (cp_parser_new_expression): Likewise.
3098         (cp_parser_new_type_id): Likewise.
3099         (cp_parser_new_declarator_opt): Likewise.
3100         (cp_parser_direct_new_declarator): Likewise.
3101         (cp_parser_condition): Likewise.
3102         (cp_parser_declaration_statement): Likewise.
3103         (cp_parser_declaration): Likewise.
3104         (cp_parser_conversion_type_id): Likewise.
3105         (cp_parser_conversion_declarator_opt): Likewise.
3106         (cp_parser_template_parameter_list): Likewise.
3107         (cp_parser_template_parameter): Likewise.
3108         (cp_parser_explicit_instantiation): Likewise.
3109         (cp_parser_init_declarator): Likewise.
3110         (cp_parser_declarator): Likewise.
3111         (cp_parser_direct_declarator): Likewise.
3112         (cp_parser_type_id): Likewise.
3113         (cp_parser_parameter_declaration_clause): Likewise.
3114         (cp_parser_parameter_declaration_list): Likewise.
3115         (cp_parser_parameter_declaration): Likewise.
3116         (cp_parser_member_declaration): Likewise.
3117         (cp_parser_exception_declaration): Likewise.
3118         (cp_parser_check_declarator_template_parameters): Likewise.
3119         (cp_parser_function_definition_from_specifiers_and_declarator):
3120         Likewise.
3121         (cp_parser_save_member_function_body): Likewise.
3122         * pt.c (process_template_parm): Add is_non_type parameter.
3123         (convert_template_argument): Adjust call to groktypename.
3124         (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
3125         (tsubst): Do not expect declarators.
3126         (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
3127         argument.
3128         (instantiate_decl): Use start_preparsed_function.
3129         * semantics.c (begin_function_definition): Remove.
3130         (finish_parmlist): Remove.
3131         * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
3132         declarators.
3133
3134 2004-06-21  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3135
3136         * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
3137         (build_new_method_call): Likewise.
3138         * decl.c (local_variable_p_walkfn): Don't walk into types.
3139         * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
3140         (build_anon_union_vars): Add new operand for COMPONENT_REF.
3141         * init.c (buld_new): Add new operand for ARRAY_REF.
3142         * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
3143         (do_build_assign_ref): Likewise.
3144         * parser.c (cp_parser_direct_new_declarator): Add new operands
3145         for ARRAY_REF.
3146         (cp_parser_direct_declarator): Likewise.
3147         * pt.c (tsubst): Likewise.
3148         (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
3149         for COMPONENT_REF.
3150         * semantics.c (finish_non_static_data_member): Add new operand
3151         for COMPONENT_REF.
3152         * typeck.c (build_class_member_access_expr): Likewise.
3153         (build_class_member_access_expr, finish_class_member_access_expr):
3154         Likewise.
3155         (build_ptrmemfunc_access_expr): Likewise.
3156         (build_array_ref): Add new operands for ARRAY_REF.
3157         * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
3158         * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
3159
3160 2004-06-21  Richard Henderson  <rth@redhat.com>
3161
3162         * dump.c (cp_dump_tree): Don't use dump_next_stmt.
3163         * parser.c (cp_parser_jump_statement): Update commentary.
3164         * pt.c (tsubst_expr): Use RETURN_EXPR.
3165         * semantics.c (finish_return_stmt): Likewise.
3166         (finalize_nrv_r): Likewise.
3167         * typeck.c, typeck2.c: Update file start commentary.
3168
3169 2004-06-21  Richard Henderson  <rth@redhat.com>
3170
3171         * semantics.c (finish_expr_stmt): Call verify_sequence_points.
3172
3173 2004-06-20  Richard Henderson  <rth@redhat.com>
3174
3175         * cp-tree.h (add_decl_stmt): Declare.
3176         * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
3177         * semantics.c (maybe_cleanup_point_expr): New.
3178         (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
3179         finish_for_expr, finish_switch_cond): Use it.
3180         (finalize_nrv_r): Don't build an EXPR_STMT.  Don't frob TREE_CHAIN.
3181
3182 2004-06-20  Richard Henderson  <rth@redhat.com>
3183
3184         * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
3185         * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
3186         (cp_gimplify_expr): Call it.
3187         (gimplify_cleanup_stmt): Move from c-gimplify.c.
3188         (cp_genericize): New.
3189         * decl.c (finish_function): Call it.
3190         * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
3191         (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
3192         (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
3193         (cp_genericize): Declare.
3194         * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
3195         * dump.c (cp_dump_tree): Likewise.
3196         * semantics.c (push_cleanup): Move from c-semantics.c.
3197
3198 2004-06-20  Zack Weinberg  <zack@codesourcery.com>
3199
3200         * cp-lang.c (has_c_linkage): Implement.
3201
3202         * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
3203         * decl.c (duplicate_decls): Use COPY_DECL_RTL.
3204         (builtin_function_1): Don't call make_decl_rtl.
3205         (build_cp_library_fn): Don't call set_mangled_name_for_decl.
3206         (grokvardecl): Don't call mangle_decl.
3207         * except.c (nothrow_libfn_p): Look at DECL_NAME, not
3208         DECL_ASSEMBLER_NAME.
3209         * method.c (set_mangled_name_for_decl): Delete.
3210         * name-lookup.c (pushdecl): When a local extern shadows a
3211         file-scope declaration of the same object, give both DECLs the
3212         same DECL_UID.
3213         * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
3214         on DECL_ASSEMBLER_NAME.
3215
3216 2004-06-19  Richard Henderson  <rth@redhat.com>
3217
3218         * cp-gimplify.c: Remove unnecessary prototypes.
3219         (cp_gimplify_stmt): Merge into ...
3220         (cp_gimplify_expr): ... here.  Move to end of file.  Handle
3221         stmts_are_full_exprs_p frobbing.
3222         * cp-tree.h (cp_gimplify_stmt): Remove.
3223         * pt.c (tsubst_expr): Merge prep_stmt and unify.
3224         * tree.c (init_tree): Don't set lang_gimplify_stmt.
3225
3226 2004-06-18  Richard Henderson  <rth@redhat.com>
3227
3228         PR c++/16034
3229         * semantics.c (begin_cond): New.
3230         (finish_cond): Rewrite to handle template DECL_STMTs specially.
3231         Assume that non-template decls go land before the conditional.
3232         (simplify_loop_decl_cond): Likewise.
3233         (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
3234         finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
3235         begin_switch_stmt, finish_switch_cond): Update to match.
3236
3237 2004-06-17  Jason Merrill  <jason@redhat.com>
3238
3239         PR c++/16015
3240         * semantics.c (simplify_aggr_init_expr): Don't return the slot.
3241         (finish_stmt_expr_expr): Update type after conversions.
3242         (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
3243         Handle void initializer.
3244         * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
3245
3246 2004-06-17  Geoffrey Keating  <geoffk@apple.com>
3247
3248         * class.c (build_clone): Don't call defer_fn, let mark_used do it.
3249         * cp-tree.h (defer_fn): Delete.
3250         * decl2.c (defer_fn): Delete.
3251         (finish_file): Simplify deferred_fns loops; check that
3252         only used inline functions get into deferred_fns.
3253         (mark_used): Inline previous contents of defer_fn.
3254
3255 2004-06-16  Richard Henderson  <rth@redhat.com>
3256
3257         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
3258         (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
3259         * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
3260         of CTOR_INITIALIZER ...
3261         (pp_cxx_statement): ... here.
3262         * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
3263         (finish_function): Use alloc_stmt_list to zap entire function.
3264         * parser.c (cp_parser_compound_statement): Update commentary.
3265         * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
3266         * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
3267         (finish_stmt_expr): Don't look through COMPOUND_STMT.
3268
3269 2004-06-16  Geoffrey Keating  <geoffk@apple.com>
3270
3271         * pt.c (mark_decl_instantiated): Don't call defer_fn.
3272
3273 2004-06-16  Richard Henderson  <rth@redhat.com>
3274
3275         * parser.c (cp_parser_labeled_statement): Update commentary.
3276         * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
3277         * tree.c (mark_local_for_remap_r): Likewise.
3278
3279 2004-06-16  Richard Henderson  <rth@redhat.com>
3280
3281         * parser.c (cp_parser_asm_definition): Update commentary.
3282         * pt.c (tsubst_expr): Use ASM_EXPR.
3283         * semantics.c (finish_asm_stmt): Likewise.
3284
3285 2004-06-16  Richard Henderson  <rth@redhat.com>
3286
3287         * decl.c (finish_destructor_body): Use LABEL_EXPR.
3288         * parser.c (cp_parser_statement): Update commentary.
3289         * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
3290         * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
3291         * tree.c (mark_local_for_remap_r): Likewise.
3292
3293 2004-06-16  Richard Henderson  <rth@redhat.com>
3294
3295         PR c++/16012
3296         * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
3297         statement in FOR_INIT_STMT for templates.
3298
3299 2004-06-15  Richard Henderson  <rth@redhat.com>
3300
3301         * call.c (initialize_reference): Don't build CLEANUP_STMT here.
3302         * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
3303         (genericize_try_block): Use gimplify_stmt.
3304         (genericize_catch_block, genericize_eh_spec_block): Likewise.
3305         (cp_gimplify_init_expr): Remove STMT_EXPR special case.
3306         (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
3307         * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
3308         (cp_tree_chain_matters_p): Remove.
3309         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
3310         (COMPOUND_STMT_BODY_BLOCK): New.
3311         (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
3312         (EXPR_STMT_STMT_EXPR_RESULT): New.
3313         (building_stmt_tree): Check cur_stmt_list.
3314         (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
3315         (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
3316         * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
3317         (cp_finish_decl): Use push_cleanup.
3318         (start_function, finish_function): Use statement lists.
3319         (finish_stmt): Do nothing.
3320         * except.c (begin_eh_spec_block): Use statement lists.
3321         (check_handlers_1, check_handlers): Likewise.
3322         * init.c (construct_virtual_base): Don't add extra compound stmts.
3323         (build_vec_init): Likewise.
3324         * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
3325         * name-lookup.h (struct cp_binding_level): Add statement_list.
3326         * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
3327         (cp_parser_labeled_statement, cp_parser_expression_statement,
3328         cp_parser_statement_seq_opt): Likewise.
3329         (cp_parser_compound_statement): Likewise.  Take bool for try block.
3330         (cp_parser_selection_statement): Tidy if processing.
3331         (cp_parser_already_scoped_statement): Rewrite to do what it says.
3332         * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
3333         (tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
3334         Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
3335         * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
3336         (finish_cond): New, rewritten from FINISH_COND.
3337         (simplify_loop_decl_cond): New.
3338         (finish_expr_stmt): Avoid nested EXPR_STMTs.
3339         (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
3340         begin_else_clause, finish_else_clause, finish_if_stmt,
3341         begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
3342         begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
3343         finish_for_cond, finish_for_stmt, begin_switch_stmt,
3344         finish_switch_cond, finish_switch_stmt, begin_try_block,
3345         finish_try_block, finish_cleanup_try_block, finish_function_try_block,
3346         finish_handler_sequence, finish_function_handler_sequence,
3347         begin_handler, finish_handler_parms, finish_handler,
3348         begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
3349         using statement lists.
3350         (begin_compound_stmt): Replace has_no_scope argument with flags.
3351         Update all callers.  Use statement lists.
3352         (finish_compound_stmt): Likewise.
3353         (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
3354         (current_scope_stmt_stack): Remove.
3355         (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
3356         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
3357         Rewrite with statement lists.
3358
3359 2004-06-15  Alexandre Oliva  <aoliva@redhat.com>
3360
3361         * parser.c: Change all assignments of c_lex_string_translate
3362         to true and false to 1 and 0.
3363         (cp_lexer_read_token): Convert type of the translated string.
3364         (cp_parser_skip_to_closing_parentheses): Preserve original
3365         value of c_lex_string_translate, and set it to -1 while
3366         running.
3367         (cp_parser_cache_group): Likewise.
3368         (cp_parser_cache_group_1): Renamed.
3369         (cp_parser_asm_operand_list): Remove redundant setting of
3370         c_lex_string_translate.
3371         (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
3372         Handle chained strings.
3373
3374 2004-06-12  Andrew Pinski  <apinski@apple.com>
3375
3376         PR c++/14639
3377         Revert:
3378         2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
3379
3380                 * cp-tree.h: Fix typo.
3381
3382                 * cp-tree.h: Include cgraph.h
3383                 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
3384                 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
3385
3386 2004-06-12  Jason Merrill  <jason@redhat.com>
3387
3388         PR tree-optimization/14107
3389         * decl.c (finish_function): Warn about no return in all functions.
3390
3391 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
3392
3393         * cp-tree.h (struct language_function): Remove cannot_inline.
3394         * decl.c (save_function_data): cannot_inline is no more.
3395         (cxx_push_function_context): Likewise.
3396         * decl2.c (start_objects, start_static_storage_duration_function):
3397         Reset DECL_INLINE, set DECL_UNINLINABLE.
3398
3399 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3400
3401         PR c++/15967
3402         * search.c (lookup_field): Propagate the ambiguity list.
3403         (lookup_fnfields): Likewise.
3404
3405 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3406
3407         PR c++/15947
3408         * parser.c (cp_parser_template_name): Ctors/dtors never need a
3409         template keyword to disambiguate.
3410
3411 2004-06-14  Mark Mitchell  <mark@codesourcery.com>
3412
3413         PR c++/15096
3414         * decl.c (grokdeclarator): Ignore pointer-to-members when
3415         computing template depth.
3416
3417         PR c++/14930
3418         * name-lookup.c (pushtag): Do not try to put class declarations in
3419         explicit specialization scopes.
3420
3421 2004-06-11  Andrew Pinski  <pinskia@physics.uc.edu>
3422
3423         * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
3424
3425 2004-06-11  Mark Mitchell  <mark@codesourcery.com>
3426
3427         PR c++/15862
3428         * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
3429         bindings for undeclared built-ins.
3430
3431 2004-06-11  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3432
3433         * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
3434         appear at the correct location.
3435
3436 2004-06-10  Jason Merrill  <jason@redhat.com>
3437
3438         PR c++/15875
3439         Revert:
3440         2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3441         * init.c (build_offset_ref): Build SCOPE_REF with non-null
3442         TREE_TYPE for non-dependent names.
3443         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3444         unknown_type_node as its TREE_TYPE.
3445         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3446         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3447         (dump_expr) <SCOPE_REF case>: Likewise.
3448
3449 2004-06-10  Mark Mitchell  <mark@codesourcery.com>
3450
3451         PR c++/15227
3452         * parser.c (cp_parser_direct_declarator): Robustify.
3453
3454         PR c++/15877
3455         * pt.c (tsubst_copy): Use decl_constant_value on enumeration
3456         constants in non-dependent contexts.
3457
3458         PR c++/14211
3459         PR c++/15076
3460         * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
3461         necessary.
3462
3463 2004-06-10  Jakub Jelinek  <jakub@redhat.com>
3464
3465         PR c++/14791
3466         * decl.c (duplicate_decls): Handle fileptr_type_node arguments
3467         specially.
3468
3469 2004-06-09  Mark Mitchell  <mark@codesourcery.com>
3470
3471         Revert:
3472         PR c++/15815
3473         2004-06-07  Mark Mitchell  <mark@codesourcery.com>
3474         * lex.c (handle_pragma_interface): Deprecate.
3475         (handle_pragma_implementation): Likewise.
3476
3477 2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>
3478
3479         * g++spec.c (lang_specific_driver): Remove check for -lm
3480         and -lmath when check it see if it was the math library.
3481
3482 2004-06-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3483
3484         PR c++/7841
3485         * parser.c (cp_parser_direct_declarator): Reject constructor named
3486         as qualified template-id.
3487
3488 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
3489
3490         PR c++/15815
3491         * lex.c (handle_pragma_interface): Deprecate.
3492         (handle_pragma_implementation): Likewise.
3493
3494 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
3495
3496         PR c++/15766
3497         * parser.c (cp_parser_iteration_statement): Fix typo in error
3498         message.
3499
3500         PR c++/14777
3501         * pt.c (tsubst_default_argument): Do not defer access checks
3502         while substituting into the default argument.
3503
3504         PR c++/15554
3505         * pt.c (tsubst_copy): Do not try to substitute for an enumeration
3506         constant in a non-dependent context.
3507
3508         PR c++/15057
3509         * except.c (build_throw): Ensure that temp_expr has been
3510         initialized.
3511
3512 2004-06-06  Roger Sayle  <roger@eyesopen.com>
3513
3514         * cp/cp-tree.h (lvalue_or_else): Add function prototype.
3515
3516 2004-06-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3517
3518         PR c++/15503
3519         * parser.c (cp_parser_mem_initializer_id): Gracefully reject
3520         'typename', and accept 'template'.
3521
3522 2004-06-03  Andrew Pinski  <pinskia@physics.uc.edu>
3523             Jan Hubicka  <jh@suse.cz>
3524
3525         PR c++/14639
3526         * method.c (use_think): Do not mark thunk as referenced.
3527
3528 2004-06-03  Matt Austern  <austern@apple.com>
3529
3530         PR c++/15428
3531         * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
3532         is nonzero, and if we see a noninline definition of a key method,
3533         make the vtables nonweak.
3534
3535 2004-06-02  Matt Austern  <austern@apple.com>
3536
3537         * cp-tree.h (instantiate_decl): new boolean parameter,
3538         undefined_ok. Current behavior is equivalent to its being 0.
3539         * decl2.c (mark_used): Add new argument when calling instantiate_decl
3540         * pt.c (mark_decl_instantiated): Unconditionally make
3541         instantiations explicit unconditionally
3542         (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
3543         since mark_decl_instantiated now does it.
3544         (instantiate_class_member): New.  Instantiate a member of an
3545         explicitly instantiated class template.
3546         (do_type_instantiation): Explicitly instantiate members of an
3547         explicitly instantiated class template.
3548         (instantiate_decl): if undefined_ok is nonzero, and if we're
3549         trying to explicitly instantiated a template with no definition,
3550         change it to an implicit instantiation.
3551         (instantiate_pending_templates): Add new argument to instantiate_decl.
3552         * tree.c (cp_cannot_inline_tree_fn): Likewise.
3553
3554 2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
3555
3556         * cp-tree.h: Fix typo.
3557
3558         * cp-tree.h: Include cgraph.h
3559         (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
3560         TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
3561
3562 2004-06-01  Jason Merrill  <jason@redhat.com>
3563
3564         PR c++/15142
3565         * call.c (call_builtin_trap): Remove type parm.
3566         (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
3567         (build_x_va_arg): Dereference a null pointer for a non-POD argument.
3568
3569 2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3570
3571         PR c++/13092
3572         * init.c (build_offset_ref): Build SCOPE_REF with non-null
3573         TREE_TYPE for non-dependent names.
3574         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
3575         unknown_type_node as its TREE_TYPE.
3576         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
3577         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
3578         (dump_expr) <SCOPE_REF case>: Likewise.
3579
3580 2004-06-01  Richard Henderson  <rth@redhat.com>
3581             Andrew Pinski  <pinskia@physics.uc.edu>
3582
3583         * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
3584         * parser.c (struct cp_parser): Remove in_offsetof.
3585         (cp_parser_new): Don't set it.
3586         (cp_parser_unary_expression): Don't check it.
3587         (cp_parser_postfix_open_square_expression): Split out from ...
3588         (cp_parser_postfix_expression): ... here.
3589         (cp_parser_postfix_dot_deref_expression): Likewise.
3590         (cp_parser_builtin_offsetof): New.
3591         (cp_parser_primary_expression): Use it.
3592
3593 2004-06-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3594
3595         PR c++/14932
3596         * parser.c (cp_parser_postfix_expression): Allow subscript
3597         operator in offsetof.
3598
3599 2004-05-31  Mark Mitchell  <mark@codesourcery.com>
3600
3601         PR c++/15701
3602         * friend.c (add_friend): Do not try to perform access checks for
3603         functions from dependent classes.
3604
3605 2004-05-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3606
3607         * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
3608         (pp_cxx_begin_template_argument_list): Turn into a function.
3609         (pp_cxx_end_template_argument_list): Likewise.
3610         (pp_cxx_separate_with): Define.
3611         (pp_cxx_unqualified_id): Tidy.
3612         (pp_cxx_primary_expression): Likewise.
3613         (pp_cxx_postfix_expression): Likewise.
3614         (pp_cxx_expression): Likewise.
3615         (pp_cxx_simple_type_specifier): Likewise.
3616         (pp_cxx_type_specifier_seq): Likewise.
3617         (pp_cxx_parameter_declaration_clause): Likewise.
3618         (pp_cxx_exception_specification): Likewise.
3619         (pp_cxx_direct_declarator): Likewise.
3620         (pp_cxx_type_id): Likewise.
3621         * cxx-pretty-print.h (pp_cxx_whitespace): Export from
3622         cxx-pretty-print.c.
3623         (pp_cxx_left_paren): Likewise.
3624         (pp_cxx_right_paren): Likewise.
3625         (pp_cxx_left_brace): Likewise.
3626         (pp_cxx_right_brace): Likewise.
3627         (pp_cxx_left_bracket): Likewise.
3628         (pp_cxx_right_bracket): Likewise.
3629         (pp_cxx_dot): Likewise.
3630         (pp_cxx_identifier): Likewise.
3631         (pp_cxx_tree_identifier): Likewise.
3632         (pp_cxx_ampersand): New macro.
3633         (pp_cxx_star): Likewise.
3634         (pp_cxx_arrow): Likewise.
3635         (pp_cxx_semicolon): Likewise.
3636         (pp_cxx_complement): Likewise.
3637         (pp_cxx_begin_template_argument_list): Declaree.
3638         (pp_cxx_end_template_argument_list): Likewise.
3639         (pp_cxx_colon_colon): likewise.
3640
3641 2004-05-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
3642
3643         * parser.c (cp_parser_simple_type_specifier): Explicitly test
3644         against NULL_TREE.
3645
3646 2004-05-31  Kazu Hirata  <kazu@cs.umass.edu>
3647
3648         * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
3649         typeck.c: Fix comment formatting.
3650
3651 2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>
3652
3653         * cp-lang.c (cp_expand_decl): Remove.
3654         (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
3655
3656 2004-05-30  Andreas Jaeger  <aj@suse.de>
3657
3658         * lang-specs.h: Add missing initializers for .ii.
3659
3660 2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
3661
3662         * decl.c (cp_make_fname_decl): Free return value from
3663         fname_as_string.
3664
3665 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
3666
3667         PR c++/15083
3668         * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
3669         even in a templat.e
3670         * init.c (build_new): Likewise.
3671
3672         PR c++/15640
3673         * name-lookup.c (arg_assoc): Robustify.
3674
3675         PR c++/15471
3676         * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
3677         when determining the scope to use for a pointer to member.
3678         (lookup_anon_field): Give it external linkage.
3679         * cp-tree.h (lookup_anon_field): Declare it.
3680         * expr.c (cplus_expand_constant): Use it.
3681
3682 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
3683
3684         PR c++/14668
3685         * parser.c (cp_parser_simple_type_specifier): Call
3686         maybe_note_name_used_in_class.
3687
3688 2004-05-28  Tom Marshall  <tmarshall@real.com>
3689
3690         PR c++/15214
3691         * class.c (finish_struct_1): Warn only if the dtor is non-private or
3692         the class has friends.
3693
3694 2004-05-27  Adam Nemet  <anemet@lnxw.com>
3695
3696         PR c++/12883
3697         * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
3698         TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
3699
3700 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
3701
3702         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
3703         if it might be needed.
3704         * pt.c (mark_decl_instantiated): Only call defer_fn if
3705         the function actually needs processing in finish_file.
3706         * decl2.c (finish_file): Add check that elements in
3707         deferred_fns_used are really needed there.  Remove unnecessary
3708         test of DECL_SAVED_TREE.
3709
3710 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
3711
3712         * Make-lang.in: No need to specify $(LIBCPP).
3713
3714 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3715
3716         PR c++/15044
3717         * parser.c (cp_parser_class_head): Robustify.
3718
3719         PR c++/15317
3720         * parser.c (cp_parser_decl_specifier_seq): Correct error in
3721         comment.
3722         (cp_parser_constructor_declarator_p): Treat attributes
3723         as decl-specifiers.
3724
3725         PR c++/15329
3726         * typeck.c (build_unary_op): Do not attempt to resolve casts to
3727         base classes in templates.
3728
3729 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3730
3731         PR c++/15165
3732         * pt.c (instantiate_template): Robustify.
3733
3734 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3735
3736         PR c++/15025
3737         * decl.c (xref_tag): Issue errors about redeclaring template
3738         classes as non-template classes.
3739
3740 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
3741
3742         PR c++/14821
3743         * name-lookup.c (supplement_binding): Allow redefinitions of
3744         namespace aliases.
3745
3746         PR c++/14883
3747         * parser.c (cp_parser_template_argument): Robustify.
3748
3749 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3750
3751         * class.c (alter_access): Use %E format specifier to print an
3752         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
3753         (push_lang_context): Likewise.
3754         * decl.c (lookup_label): Likewise.
3755         (grokdeclarator): Likewise.
3756         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
3757         * pt.c (do_type_instantiation): Likewise.
3758         * tree.c (handle_java_interface_attribute): Likewise.
3759         (handle_com_interface_attribute): Likewise.
3760         (handle_init_priority_attribute): Likewise.
3761
3762 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
3763
3764         PR c++/15285
3765         PR c++/15299
3766         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
3767         recognized as overloaded functions.
3768
3769 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
3770
3771         PR c++/15507
3772         * class.c (layout_nonempty_base_or_field): Do not try to avoid
3773         layout conflicts for unions.
3774
3775         PR c++/15542
3776         * typeck.c (build_x_unary_op): Instantiate template class
3777         specializations before looking for "operator &".
3778
3779         PR c++/15427
3780         * typeck.c (complete_type): Layout non-dependent array types, even
3781         in templates.
3782
3783         PR c++/15287
3784         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
3785         template.
3786
3787 2004-05-22  Roger Sayle  <roger@eyesopen.com>
3788
3789         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
3790         returning when TREE_TYPE is error_mark_node.
3791         * typeck.c (require_complete_type): Return error_mark_node if
3792         value's type is an error_mark_node.
3793
3794 2004-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
3795
3796         * optimize.c (calls_setjmp_r): Remove.
3797         (calls_setjmp_p): Remove.
3798         * cp-tree.c (calls_setjmp_p): Remove.
3799         * decl.c (finish_function): Do not call calls_setjmp_p.
3800
3801 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
3802
3803         * decl.c (cp_finish_decl): Use mark_decl_referenced.
3804         * decl2.c (maybe_make_one_only): Likewise.
3805         * method.c (use_thunk): Likewise.
3806
3807 2004-05-18  Jason Merrill  <jason@redhat.com>
3808
3809         * class.c (build_base_path): Tidy a bit.
3810
3811 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
3812
3813         * name-lookup.c (struct scope_binding): New.
3814         (EMPTY_SCOPE_BINDING): New.
3815         (lookup_using_namespace): Take a scope_binding instead of a
3816         cxx_binding.
3817         (qualified_lookup_using_namespace): Likewise.
3818         (cxx_binding_clear): Delete.
3819         (do_nonmember_using_decl): Use a scope_binding instead of a
3820         cxx_binding.
3821         (lookup_tag): Don't call select_decl.
3822         (ambiguous_decl): Don't return anything (and change callers to match).
3823         Take a scope_binding as the second parameter.
3824         (lookup_namespace_name): Use a scope_binding instead of a
3825         cxx_binding.
3826         (unqualified_namespace_lookup): Likewise.
3827         (lookup_qualified_name): Likewise.
3828         (select_decl): Take a scope_binding instead of a cxx_binding.
3829         Use macros rather than hand-coding tests for type-ness.
3830
3831 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
3832
3833         * cp-gimplify.c: Rename from cp-simplify.c.
3834         * Make-lang.in, optimize.c: Update.
3835
3836 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
3837
3838         Merge from tree-ssa-20020619-branch.  See
3839         ChangeLog.tree-ssa for details.
3840
3841         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
3842         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
3843         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
3844         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
3845         Merged.
3846         * cp-mudflap.c: New file.
3847         * cp-simplify.c:: New file.
3848
3849 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3850
3851         PR c++/14389
3852         * decl2.c (check_classfn): For member templates, compare also the
3853         template parameters to match the declaration.
3854         * cp-tree.h: Adjust declaration of check_classfn.
3855         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
3856         * friend.c (do_friend): Likewise.
3857         * pt.c (tsubst_friend_function): Likewise.
3858
3859 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
3860
3861         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
3862         Instead, dig into the representation type to find the array bound.
3863
3864 2004-04-30  Jason Merrill  <jason@redhat.com>
3865
3866         Refer to base members using COMPONENT_REFs where possible.
3867         * class.c (build_simple_base_path): New fn.
3868         (build_base_path): Use it for non-virtual base references.
3869         (layout_class_type): Change base fields to their real type
3870         after layout is done.
3871         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
3872         * cp-lang.c (cxx_get_alias_set): Use it.
3873
3874 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
3875
3876         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
3877         comment typos.
3878
3879 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3880
3881         PR c++/15064
3882         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
3883         used in integral constant expressions.
3884
3885 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
3886
3887         * init.c (build_aggr_init): Fix accidental use of C99 construct in
3888         previous change.
3889
3890         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
3891         braced initializer.
3892         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
3893         * decl.c (reshape_init): Use it.
3894         * init.c (perform_member_init): Remove redundant condition.
3895         (build_aggr_init): Adjust to handle brace-enclosed initializers
3896         correctly.
3897         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
3898
3899         * parser.c (cp_parser_initializer_clause): Do not set
3900         TREE_HAS_CONSTRUCTOR on the initializer.
3901         * rtti.c (tinfo_base_init): Likewise.
3902         (generic_initializer): Likewise.
3903         (ptr_initializer): Likewise.
3904         (ptm_initializer): Likewise.
3905         (class_initializer): Likewise.
3906         (get_pseudo_ti_init): Likewise.
3907         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
3908
3909 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
3910
3911         * name-lookup.c (anonymous_namespace_name): Make static.
3912
3913 2004-04-19  Roger Sayle  <roger@eyesopen.com>
3914
3915         PR middle-end/14531
3916         * class.c (build_base_path): Call fold whilst building the NULL
3917         pointer check expression trees.
3918
3919 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
3920
3921         * init.c (build_new_1): Don't use type size argument for Java
3922         _Jv_AllocObject call.
3923
3924 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
3925
3926         * method.c (make_alias_for_thunk): Remove preprocessor guard on
3927         declaration and definition.
3928
3929 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
3930
3931         PR c++/14808
3932         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
3933         than ASM_OUTPUT_DEF.
3934
3935 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
3936
3937         * decl2.c (mark_used): Don't segfault if cfun != NULL but
3938         current_function_decl == NULL.
3939
3940 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
3941
3942         PR c++/3518
3943         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
3944         level.
3945
3946 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3947
3948         * init.c (decl_constant_value): Don't look at DECL_INITIAL
3949         of PARM_DECL.
3950         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
3951         or TREE_SIDE_EFFECTS of a type.
3952
3953 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
3954
3955         PR c++/14007
3956         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
3957         cv-qualifier unification.
3958         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
3959
3960 2004-04-02  Jan Hubicka  <jh@suse.cz>
3961
3962         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
3963         * cp-tree.h (cp_update_decl_after_saving): Declare.
3964         * tree.c (cp_update_decl_after_saving): Define.
3965
3966 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
3967
3968         PR c++/14803
3969         * typeck.c (get_delta_difference): Call fold before returning the
3970         value.
3971
3972 2004-04-01  Richard Henderson  <rth@redhat.com>
3973
3974         PR c++/14804
3975         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
3976         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
3977
3978 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
3979
3980         PR c++/14810
3981         * name-lookup.c (maybe_push_cleanup_level): Robustify.
3982
3983 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3984
3985         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
3986
3987 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
3988
3989         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
3990         * class.c (check_bitfield_decl): Likewise.
3991         * cvt.c (type_promotes_to): Likewise.
3992         * decl.c (finish_enum): Likewise.
3993         * mangle.c (write_builtin_type): Likewise.
3994         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
3995         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
3996         (build_binary_op): Likewise.
3997
3998 2004-03-31  Jan Hubicka  <jh@suse.cz>
3999
4000         * tree.h (optimize_function): Kill prototype.
4001         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
4002         * semantics.c (expand_body): Kill.
4003
4004 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
4005
4006         PR c++/14724
4007         * decl.c (start_decl_1): Do not decide whether or not to create a
4008         new cleanup level until after the type has been completed.
4009
4010         PR c++/14763
4011         * pt.c (tsubst_default_argument): Clear current_function_decl.
4012
4013 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
4014
4015         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
4016
4017 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
4018
4019         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
4020         is null, just print the literal name and return.
4021
4022 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
4023
4024         * cxx-pretty-print.c: Fix comment typos.
4025
4026 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
4027
4028         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
4029         Update copyright.
4030
4031 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
4032
4033         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
4034         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
4035         target hook.
4036
4037 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
4038
4039         PR 12267, 12391, 12560, 13129, 14114, 14133
4040         * cp-lang.c (c_reset_state): Delete.
4041         (push_file_scope, pop_file_scope): New stubs.
4042         * parser.c (c_parse_file): Call sorry() here if called more than once.
4043
4044 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4045
4046         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
4047         for INTEGER_CST.
4048
4049 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4050
4051         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
4052
4053 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4054
4055         * error.c (enum pad): Remove.
4056         (dump_qualifiers): Likewise.
4057         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
4058         (dump_aggr_type): Likewise.
4059         (dump_type_suffix): Likewise.
4060         (dump_simple_decl): Likewise.
4061         (dump_function_decl): Likewise.
4062         (cv_to_string): Likewise.
4063         (dump_type_prefix): Likewise.  Adjust return void.
4064         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
4065         cxx_pretty_print.h.
4066         (pp_cxx_template_keyword_if_needed): Document.
4067         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
4068         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
4069         MUST_NOT_THROW_EXPR.
4070
4071 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
4072
4073         PR c++/14616
4074         * decl.c (cp_finish_decl): Compute the size of arrays declared in
4075         templates, if their type is non-dependent.
4076
4077 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
4078
4079         * call.c (build_op_delete_call): Do not forget the placement
4080         arguments when iterating through mutiple delete operators.
4081
4082         * cp-tree.h (svaed_scope): Remove last_parms.
4083         (NEW_DELETE_OPNAME_P): New macro.
4084         (last_function_parms): Remove.
4085         (do_friend): Adjust prototype.
4086         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
4087         using last_function_parms.
4088         (grokfndecl): Take the PARM_DECLs as an argument, rather than
4089         using last_function_parms.
4090         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
4091         for class-specific operator new and operator delete.
4092         (grok_op_properties): Do not look for allocation functions with
4093         METHOD_TYPEs.
4094         (start_function): Use DECL_ARGUMENTS instead of
4095         last_function_parms.
4096         * decl.h (last_function_parms): Do not declare.
4097         * decl2.c (grokclassfn): Do not use last_function_parms.
4098         * friend.c (do_friend): Remove parmdecls parameter.
4099         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
4100         (pop_from_top_level): Do not restore it.
4101         * pt.c (check_explicit_specialization): Do not adjust
4102         last_function_parms.
4103
4104         * name-lookup.c (do_local_using_decl): Create a local binding for
4105         types brought in via using declarations.
4106
4107         * name-lookup.c (lookup_arg_dependent): Handle block-scope
4108         function declarations correctly.
4109
4110         * semantics.c (finish_id_expression): Correct handling of
4111         conversion operators to dependent types.
4112
4113         * typeck.c (lookup_destructor): Allow the use of destructors from
4114         base classes.
4115
4116 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4117
4118         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
4119         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
4120         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
4121         the field is named TEMPLATE_TYPE_PARM_INDEX.
4122
4123 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4124
4125         PR c++/14545
4126         * parser.c (cp_parser_functional_cast): A cast to anything
4127         but integral or enumaration type is not an integral constant
4128         expression.
4129         * pt.c (value_dependent_expression_p): Handle cast expressions
4130         without operands (such as "int()").
4131
4132 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
4133
4134         * semantics.c (finish_pseudo_destructor_expr): Allow differing
4135         cv-qualification between the type named by the
4136         pseudo-destructor-name and the object-type.
4137
4138         * search.c (accessible_base_p): Handle non-proper bases.
4139
4140         * name-lookup.c (do_nonmember_using_decl): If a using declaration
4141         refers to a single overloaded function, set the type of the
4142         function.
4143         * tree.c (lvalue_type): Simplify.
4144         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
4145         unknown type.
4146         (build_unary_op): Handle OVERLOADs with known types.
4147
4148         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
4149         function templates.
4150
4151         * parser.c (cp_parser_postfix_expression): Handle the use of
4152         "typename" in non-dependent contexts.  Convert appropriately when
4153         when using a qualified name after "->" or ".".
4154
4155         * call.c (conditional_conversion): Honor the requirement that some
4156         conversions refer to the original object.
4157
4158 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
4159
4160         * call.c (build_conditional_expr): Do not call force_rvalue for
4161         operands of void_type when the conditional expression itself has
4162         void type.
4163         * name-lookup.c (pushdecl): Don't consider a declaration of a
4164         function named "main" to be an overload of a type named "main".
4165         * parser.c (cp_parser_template_name): Perform name lookup when the
4166         template name is proceeded by "template" if the qualifying scope
4167         is non-dependent.
4168         * typeck.c (composite_pointer_type_r): Correctly handle
4169         pointer-to-member types.
4170         (build_const_cast): Likewise.
4171
4172 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
4173
4174         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
4175         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
4176         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
4177         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
4178         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
4179         (TYPEOF_TYPE_EXPR): New macro.
4180         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
4181         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
4182         * pt.c (tsubst): Likewise.
4183         * semantics.c (finish_typeof): Likewise.
4184         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
4185         and TEMPLATE_TYPE_PARM.
4186         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
4187         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
4188
4189 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
4190
4191         PR c++/14586
4192         * cp-tree.h (build_new_op): Change prototype.
4193         (build_x_binary_op): Likewise.
4194         * call.c (build_new_op): Add overloaded_p parameter.
4195         * decl2.c (grok_array_decl): Adjust call to build_new_op.
4196         * parser.c (cp_parser_binary_expression): Note that uses of
4197         overloaded operators prevents an expression from being considered
4198         an integral constant.
4199         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
4200         build_x_binary_op.
4201         * semantics.c (finish_call_expr): Likewise.
4202         * typeck.c (rationalize_conditional_expr): Likewise.
4203         (build_x_indirect_ref): Likewise.
4204         (build_x_binary_op): Likewise.
4205         (build_x_unary_op): Likewise.
4206         (build_x_compound_expr): Likewise.
4207         (build_modify_expr): Likewise.
4208         * typeck2.c (build_x_arrow): Likewise.
4209
4210 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
4211
4212         * cp-lang.c, ptree.c: Update copyright.
4213
4214 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
4215
4216         PR c++/14550
4217         * parser.c (cp_parser_non_integral_constant_expression): Encode
4218         more of the idiom that surrounded calls to this function within
4219         the function itself
4220         (cp_parser_primary_expression): Adjust accordingly.
4221         (cp_parser_postfix_expression): Likewise.
4222         (cp_parser_unary_expression): Likewise.
4223         (cp_parser_cast_expression): Likewise.
4224         (cp_parser_assignment_expression): Likewise.
4225         (cp_parser_expression): Likewise.
4226         (cp_parser_new_expression): Note that new-expressions are not
4227         allowed in integral constant expressions.
4228         (cp_parser_delete_expression): Likewise.
4229
4230 2004-03-12  Matt Austern  <austern@apple.com>
4231
4232         * decl2.c (maybe_make_one_only): Look at
4233         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
4234         to make an explicit instantiation weak.
4235         * method.c (use_thunk): Make sure we call comdat_linkage
4236         when appropriate.
4237         * pt.c (do_type_instantiation): On systems where weak symbols
4238         don't go in a static archive's TOC, explicit instantiation of a
4239         class must imply *explicit* instantiation of its memeber.
4240
4241 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
4242
4243         * call.c, cp-tree.h, pt.c: Fix comment typos.
4244
4245 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
4246
4247         PR c++/14510
4248         * decl.c (xref_tag): Disregard non-type declarations when
4249         looking up a tagged type.
4250
4251 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
4252
4253         PR c++/14397
4254         * call.c (convert_like_real): Build a const qualified temporary,
4255         when testing ctor access.
4256
4257 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
4258
4259         * call.c (initialize_reference): Fix typo.
4260
4261 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4262
4263         PR c++/14409
4264         * pt.c (determine_specialization): For member templates, match also
4265         constness.
4266
4267         PR c++/14448
4268         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
4269         non-dependent.
4270         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
4271
4272 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
4273
4274         PR c++/14230
4275         * call.c (initialize_reference): Handle initializers that are
4276         class-member access expressions applies to rvalues.
4277
4278 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
4279
4280         PR c++/14432
4281         * name-lookup.c (supplement_binding): Ignore functions that are
4282         marked DECL_ANTICIPATED.
4283
4284 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
4285
4286         PR c++/14401
4287         * class.c (check_field_decls): Complain about non-static data
4288         members of reference type in unions.  Propagate
4289         CLASSTYPE_REF_FIELDS_NEED_INIT and
4290         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
4291         data members.
4292         * init.c (perform_member_init): Complain about mbmers with const
4293         type that are not explicitly initialized.
4294
4295 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
4296
4297         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
4298         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
4299         (lang_identifier): Remove implicit_decl and error_locus.
4300         (IDENTIFIER_IMPLICIT_DECL): Remove.
4301         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
4302         (IDENTIFIER_ERROR_LOCUS): Likewise.
4303         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
4304         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
4305         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
4306         (implicitly_declare): Remove.
4307         * decl.c (warn_extern_redeclared_static): Remove check of
4308         IDENTIFIER_IMPLICIT_DECL.
4309         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
4310         (implicitly_declare): Remove.
4311         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
4312         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
4313         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
4314         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
4315         in the innermost scope, rather than at namespace scope.
4316         * name-lookup.c (push_local_binding): Give it external linkage.
4317         (pushdecl): Remove dead code.
4318         * name-lookup.h (push_local_binding): Declare it.
4319         * ptree.c (cxx_print_identifier): Don't print
4320         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
4321         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
4322         not IDENTIFIER_ERROR_LOCUS.
4323         * typeck.c (build_function_call): Remove dead code.
4324
4325 2004-03-08  Jason Merrill  <jason@redhat.com>
4326
4327         PR c++/13170
4328         * decl.c (xref_tag): Remove attribute handling.
4329         * cp-tree.h: Adjust prototype.
4330         * decl.c, parser.c, rtti.c: Adjust callers.
4331         * parser.c (cp_parser_class_head): Pass back attributes in the
4332         class head.
4333         (cp_parser_class_specifier): Adjust.
4334
4335 2004-03-08  Matt Austern  <austern@apple.com>
4336
4337         PR debug/14079
4338         * name-lookup.c (add_decl_to_level): Add extern variables, as well
4339         as static, to static_decls array.
4340
4341 2004-03-05  Jason Merrill  <jason@redhat.com>
4342
4343         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
4344
4345 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
4346
4347         * decl.c (grokfndecl): Update old incorrect comment.
4348         (grokvardecl): Diagnose C++ variables of type with no linkage.
4349
4350 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
4351
4352         PR c++/14369
4353         * pt.c (build_non_dependent_expr): Do not create a
4354         NON_DEPENDENT_EXPR for a THROW_EXPR.
4355
4356 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4357
4358         PR c++/14369
4359         * error.c (dump_expr): Handle THROW_EXPR.
4360
4361 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
4362
4363         PR c++/14360
4364         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
4365         lookup if ordinary name-lookup finds a non-function.
4366         * pt.c (tsubst_copy_and_build): Likewise.
4367
4368         PR c++/14361
4369         * parser.c (cp_parser_late_parsing_default_args): Check that there
4370         are no extra tokens after the end of the default-argument
4371         expression.
4372
4373 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
4374
4375         PR c++/14324
4376         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
4377         having C++ linkage for name-mangling purposes.
4378
4379         PR c++/14260
4380         * parser.c (cp_parser_direct_declarator): Recognize constructor
4381         declarators that use a template-id to name the class being
4382         constructed.
4383
4384         PR c++/14337
4385         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
4386         (tsubst_expr): Do not call tsubst_copy, even when
4387         processing_template_decl.
4388
4389 2004-03-01  Jeff Law  <law@redhat.com>
4390
4391         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
4392         the proper type.
4393
4394 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
4395
4396         PR c++/14138
4397         * name-lookup.h (push_scope): Change prototype.
4398         * name-lookup.c (push_scope): Do not reenter the current class
4399         scope.
4400         * decl.c (grokfndecl): Check return code from push_scope before
4401         calling pop_scope.
4402         * decl2.c (check_classfn): Likewise.
4403         * parser.c (cp_parser_conversion_function_id): Likewise.
4404         (cp_parser_init_declarator): Likewise.
4405         (cp_parser_direct_declarator): Likewise.
4406         (cp_parser_class_specifier): Likewise.
4407         (cp_parser_class_head): Likewise.
4408         (cp_parser_lookup_name): Likewise.
4409         (cp_parser_constructor_declarator_p): Likewise.
4410         * pt.c (instantiate_class_template): Likewise.
4411         (resolve_typename_type): Likewise.
4412
4413 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
4414
4415         PR c++/14267
4416         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
4417         extension.
4418
4419         PR debug/12103
4420         * class.c (update_vtable_entry_for_fn): Do not go through
4421         covariance machinery if the type returned by an overrider is the
4422         same as the original.
4423
4424 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
4425
4426         * call.c: Fix a comment typo.
4427
4428 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
4429
4430         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
4431
4432 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
4433
4434         PR c++/14278
4435         * parser.c (cp_parser_parameter_declaration_list): Commit
4436         to fewer tentative parses.
4437
4438 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4439
4440         PR c++/14284
4441         * pt.c (dependent_type_p_r): A template template parameter is a
4442         dependent type.
4443
4444 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4445
4446         PR c++/14246
4447         * mangle.c (write_template_arg_literal): Don't rely on identity for
4448         boolean constants.
4449
4450 2004-02-24  Jason Merrill  <jason@redhat.com>
4451
4452         * tree.c (build_exception_variant): Use check_qualified_type.
4453
4454 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
4455             Kazu Hirata  <kazu@cs.umass.edu>
4456
4457         * decl.c (cxx_init_decl_processing): Don't check
4458         flag_writable_strings.
4459
4460 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
4461
4462         PR c++/14156
4463         * typeck.c (maybe_warn_about_returning_address_of_location):
4464         Change check for VAR_DECL to use DECL_P instead.
4465
4466 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4467
4468         PR c++/14250
4469         * cvt.c (build_expr_type_conversion): Type must be complete before
4470         looking up for conversions.
4471
4472 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4473
4474         PR c++/14143
4475         * name-lookup.c (arg_assoc_class): Don't look into template
4476         arguments if it is not a primary template.
4477
4478 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
4479
4480         PR c++/12007
4481         * method.c (use_thunk): Always clone function argument tree.
4482
4483 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
4484
4485         PR c++/14199
4486         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
4487
4488         PR c++/14173
4489         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
4490         for all type variants.
4491
4492 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
4493
4494         PR c++/13927
4495         * decl.c (duplicate_decls): Return error_mark_node for invalid
4496         redeclarations.
4497         * name-lookup.c (push_namespace): Ignore the return value from
4498         pushdecl.
4499         * pt.c (push_template_decl_real): Robustify.
4500
4501         PR c++/14186
4502         * name-lookup.c (push_class_level_binding): Do not complain about
4503         adding a binding for a member whose name is the same as the
4504         enclosing class if the member is located in a base class of the
4505         current class.
4506
4507 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4508
4509         PR c++/14181
4510         * parser.c (cp_parser_new_expression): Parse an ill-formed
4511         direct-new-declarator after a parenthesized type-id to emit good
4512         diagnostic.
4513
4514 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
4515
4516         * cp-tree.def, cvt.c: Update copyright.
4517
4518 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
4519
4520         PR c++/11326
4521         * cp-tree.h (abi_version_at_least): Remove.
4522         * mangle.c: Include flags.h.
4523
4524 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
4525
4526         PR c++/13971
4527         * call.c (build_conditional_expr): Handle conversions between
4528         class types which result in differently cv-qualified type
4529         variants.
4530
4531         PR c++/14086
4532         * class.c (delete_duplicate_fields_1): Remove.
4533         (delete_duplicate_fields): Likewise.
4534         (finish_struct_anon): Remove check for members with the same name
4535         as their enclosing class.
4536         (check_field_decls): Do not call duplicate_fields.
4537         * decl.c (grokdeclarator): Remove check for static data members
4538         with the same name as their enclosing class.
4539         * name-lookup.c (push_class_level_binding): Check for members with
4540         the same name as their enclosing class.
4541
4542 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4543
4544         PR c++/14085
4545         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
4546
4547 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4548
4549         PR c++/13635
4550         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
4551         has full set of arguments.
4552
4553 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4554
4555         PR c++/13927
4556         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
4557
4558 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
4559
4560         PR c++/14122
4561         * cp-tree.h (delete_sanity): Change prototype.
4562         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
4563         Remove dead code.  Adjust code to warn about deleting an array.
4564         * typekc.c (decay_conversion): Use build_address and build_nop.
4565
4566         PR c++/14108
4567         * search.c (accessible_p): Do not check access in thunks.
4568
4569         PR c++/14083
4570         * call.c (build_conditional_expr): Call force_rvalue on the
4571         non-void operand in the case that one result is a throw-expression
4572         and the other is not.
4573
4574 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
4575
4576         PR c++/9851
4577         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
4578         the type name and look ahead for ::~, and bail out early with a
4579         better error message if the parse is going to fail.
4580
4581 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
4582
4583         * call.c (conversion_kind): New type.
4584         (conversion_rank): Likewise.
4585         (conversion): Likewise.
4586         (CONVERSION_RANK): New macro.
4587         (conversion_obstack): New variable.
4588         (obstack_initialized): Likewise.
4589         (z_candidate): Change type of convs and second_conv.
4590         (candidate_warning): New type.
4591         (IDENTITY_RANK): Remove.
4592         (EXACT_RANK): Likewise.
4593         (PROMO_RANK): Likewise.
4594         (STD_RANK): Likewise.
4595         (PBOOL_RANK): Likewise.
4596         (USER_RANK): Likewise.
4597         (ELLIPSIS_RANK): Likewise.
4598         (BAD_RANK): Likewise.
4599         (ICS_RANK): Likewise.
4600         (ICS_STD_RANK): Likewise.
4601         (ICS_USER_FLAG): Likewise.
4602         (ICS_ELLIPSIS_FLAG): Likewise.
4603         (ICS_THIS_FLAG): Likewise.
4604         (ICS_BAD_FLAG): Likewise.
4605         (NEED_TEMPORARY_P): Likewise.
4606         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
4607         (USER_CONV_CAND): Likewise.
4608         (USER_CONV_FN): Likewise.
4609         (conversion_obstack_alloc): New function.
4610         (alloc_conversion): Likewise.
4611         (validate_conversion_obstack): Likewise.
4612         (alloc_conversions): Likewise.
4613         (build_conv): Adjust to deal with new conversion data structures.
4614         (build_identity_conv): New function.
4615         (build_ambiguous_conv): Likewise.
4616         (standard_conversion): Adjust to deal with new conversion data
4617         structures.
4618         (convert_class_to_reference): Likewise.
4619         (direct_reference_binding): Likewise.
4620         (reference_binding): Likewise.
4621         (implicit_conversion): Likewise.
4622         (add_candidate): Likewise.
4623         (add_function_candidate): Likewise.
4624         (add_conv_candidate): Likewise.
4625         (build_builtin_candidate): Likewise.
4626         (print_z_candidate): Likewise.
4627         (merge_conversion_sequences): Likewise.
4628         (build_user_type_conversion_1): Likewise.
4629         (build_user_type_conversion): Likewise.
4630         (build_new_function_call): Likewise.
4631         (build_object_call): Likewise.
4632         (conditional_conversion): Likewise.
4633         (build_conditional_expr): Likewise.
4634         (build_new_op): Likewise.
4635         (build_op_delete_call): Likewise.
4636         (convert_like_real): Likewise.
4637         (build_over_call): Likewise.
4638         (build_new_method_call): Likewise.
4639         (is_subseq): Likewise.
4640         (maybe_handle_implicit_object): Likewise.
4641         (maybe_handle_ref_bind): Likewise.
4642         (compare_ics): Likewise.
4643         (source_type): Likewise.
4644         (add_warning): Likewise.
4645         (joust): Likewise.
4646         (can_convert_arg): Likewise.
4647         (can_convert_arg_bad): Likewise.
4648         (perform_implicit_conversion): Likewise.
4649         (perform_direct_initialization_if_possible): Likewise.
4650         (initialize_reference): Likewise.
4651         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
4652         * cp-tree.def (WRAPPER): Likewise.
4653         (IDENTITY_CONV): Remove.
4654         (LVALUE_CONV): Likewise.
4655         (QUAL_CONV): Likewise.
4656         (STD_CONV): Likewise.
4657         (PTR_CONV): Likewise.
4658         (PMEM_CONV): Likewise.
4659         (BASE_CONV): Likewise.
4660         (REF_BIND): Likewise.
4661         (USER_CONV): Likewise.
4662         (AMBIG_CONV): Likewise.
4663         (RVALUE_CONV): Likewise.
4664         * cp-tree.h (tree_wrapper): Remove.
4665         (WRAPPER_ZC): Remove.
4666         (lang_tree_node): Remove wrapper.
4667         (LOOKUP_SPECULATIVELY): Remove.
4668         (build_op_delete_call): Adjust prototype.
4669         (validate_conversion_obstack): Declare.
4670         (build_zc_wrapper): Remove.
4671         * cvt.c (convert_to_reference): Remove dead code.
4672         (ocp_convert): Likewise.
4673         * decl.c (redeclaration_error_message): Correct handling of
4674         templates.
4675         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
4676         (cp_tree_node_structure): Remove WRAPPER case.
4677         * decl2.c (finish_file): Call validate_conversion_obstack.
4678         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
4679         (build_op_delete_call): Likewise.
4680         (build_x_delete): Likewise.
4681         (build_delete): Adjust call to build_op_delete_call.
4682         * pt.c (tsubst_friend_declaration): Adjust code to determine
4683         whether or not a friend template is a definition.
4684         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
4685         * tree.c (build_zc_wrapper): Remove.
4686
4687 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
4688
4689         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
4690         * cp-tree.h: Don't declare cxx_builtin_type_decls.
4691         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
4692         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
4693
4694 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
4695
4696         * typeck.c (lookup_destructor): Fix typo in error message.
4697
4698 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
4699
4700         * call.c, parser.c, tree.c: Fix comment typos.
4701
4702 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
4703
4704         Bug 13856
4705         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
4706         * decl.c (duplicate_decls, start_function): Likewise.
4707
4708 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
4709
4710         * name-lookup.c (pushdecl): Issue shadow warnings directly.
4711         * parser.c (free_parser_stacks): Delete.
4712
4713 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
4714
4715         * rtti.c: Update copyright.
4716
4717 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4718
4719         PR c++/14033
4720         * decl.c (require_complete_types_for_parms): Do not insert
4721         error_mark_node in the parameter list.
4722
4723 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4724
4725         PR c++/14028
4726         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
4727         error when terminator can not be found.
4728
4729 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
4730
4731         Make-lang.in (po-generated):  Delete.
4732
4733 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
4734
4735         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
4736         targetm.calls.promote_prototypes.
4737
4738 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
4739
4740         PR middle-end/13750
4741         Revert:
4742         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
4743         PR pch/13361
4744         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
4745         (handle_pragma_implementation): Likewise.
4746
4747 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
4748
4749         PR c++/13714
4750         * typeck.c (lookup_destructor): Tweak error message.
4751
4752 2004-02-05  Jan Hubicka  <jh@suse.cz>
4753
4754         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
4755         functions.
4756
4757 2004-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4758
4759         PR c++/14008
4760         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
4761         code, only emits the diagnostic now. Added lookup of the identifier
4762         and support for qualified ids.
4763         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
4764         Parse an (invalid) type name as id-expression within a declarator.
4765         (cp_parser_simple_declaration): Use it.
4766         (cp_parser_member_declaration): Likewise.
4767         (cp_parser_make_typename_type): New function. Handle errors through
4768         cp_parser_diagnose_invalid_typename.
4769         (cp_parser_elaborated_type_specifier): Use it.
4770
4771 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4772
4773         PR c++/13932
4774         * call.c (convert_like_real): Use "converting" rather than
4775         "argument" as the descriptive keyword to
4776         dubious_conversion_warnings.
4777         * typeck.c (convert_for_assignment): Do not call
4778         dubious_conversion_warnings.
4779
4780 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4781
4782         PR c++/13086
4783         * init.c (build_delete): Emit a more informative error message in
4784         case of an incomplete type, and on the correct source line.
4785
4786 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
4787
4788         * error.c, search.c: Update copyright.
4789
4790 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4791
4792         PR c++/9941
4793         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
4794         linkage for the typeinfo name string.
4795
4796 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4797
4798         PR c++/13969
4799         * cp-tree.h (fold_non_dependent_expr): New function.
4800         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
4801         (cp_parser_template_argument): Use fold_non_dependent_expr.
4802         (cp_parser_direct_declarator): Likewise.
4803         * pt.c (fold_non_dependent_expr): New function.
4804         (convert_nontype_argument): Use it.
4805         (tsubst_qualified_id): Simplify.
4806         (tsubst_copy_and_build): Likewise.
4807
4808 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
4809
4810         * decl.c (cxx_push_function_context): Do not set
4811         current_function_is_thunk.
4812         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
4813         actual function.
4814
4815 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4816
4817         PR c++/13997
4818         * pt.c (more_specialized_class): Increase processing_template_decl
4819         while partial ordering.
4820
4821 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
4822
4823         PR c++/13925
4824         * decl.c (start_function): Do not call pushdecl for any
4825         instantiation or specialization of a primary template.
4826
4827 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
4828
4829         PR c++/13950
4830         * parser.c (cp_parser_class_name): Robustify.
4831
4832         PR c++/13970
4833         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
4834
4835         PR c++/14002
4836         * semantics.c (finish_id_expression): Do not return an
4837         IDENTIFIER_NODE when lookup finds a PARM_DECL.
4838
4839 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
4840
4841         PR c++/13978
4842         * pt.c (build_non_dependent_expr): Do not build
4843         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
4844
4845         PR c++/13968
4846         * semantics.c (finish_id_expression): Do not return an
4847         IDENTIFIER_NODE when lookup finds a VAR_DECL.
4848
4849         PR c++/13975
4850         * parser.c (cp_parser_simple_declaration): When skipping to the
4851         end of the statement swallow the terminating semicolon.
4852
4853 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
4854
4855         PR c++/13113
4856         * init.c (build_offset_ref): Improve error recovery for invalid
4857         uses of non-static member functions.
4858
4859         PR c++/13854
4860         * cp-tree.h (cp_build_type_attribute_variant): New function.
4861         * class.c (build_clone): Use cp_build_type_attribute_variant.
4862         * decl.c (duplicate_decls): Likewise.
4863         * pt.c (copy_default_args_to_explicit_spec): Likewise.
4864         (tsubst_function_type): Likewise.
4865         * tree.c (build_exception_variant): Check attributes before
4866         concluding that two types are the same.
4867         (cp_build_type-attribute_variant): New method.
4868         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
4869
4870         PR c++/13907
4871         * call.c (convert_class_to_reference): Keep better track of
4872         pedantically invalid user-defined conversions.
4873
4874 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4875
4876         PR c++/13957
4877         * pt.c (tsubst_qualified_id): Improved error message when a type
4878         is expected but not found.
4879
4880 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
4881
4882         * class.c: Fix comment typos.
4883         * decl.c: Likewise.
4884         * error.c: Likewise.
4885         * parser.c: Likewise.
4886         * pt.c: Likewise.
4887         * search.c: Likewise.
4888         * typeck.c: Likewise.
4889
4890 2004-01-30  Richard Henderson  <rth@redhat.com>
4891
4892         PR c++/13693
4893         * method.c (use_thunk): Don't force_target_expr for void thunks.
4894         * tree.c (build_target_expr_with_type): Assert non-void type.
4895         (force_target_expr): Likewise.
4896
4897 2004-01-30  Michael Matz  <matz@suse.de>
4898
4899         * parser.c (cp_parser_labeled_statement): Accept case ranges.
4900
4901 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4902
4903         DR206
4904         PR c++/13813
4905         * decl.c (grokdeclarator): Check immediatly type completeness for
4906         non-dependent types.
4907
4908 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4909
4910         PR c++/13683
4911         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
4912         a sizeof expression.block
4913
4914 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
4915
4916         PR c++/13883
4917         * mangle.c (write_encoding): Correct encoding of member template
4918         constructors.
4919
4920 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4921
4922         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
4923         template name as it was `<::' (digraph typo).
4924         (cp_parser_nth_token_starts_template_argument_list_p): New function.
4925         (cp_parser_id_expression): Use it.
4926         (cp_parser_nested_name_specifier_opt): Likewise.
4927         (cp_parser_template_name): Likewise.
4928         (cp_parser_class_name): Likewise.
4929         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
4930
4931 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
4932
4933         PR c++/13791
4934         * typeck.c (merge_types): Do not merge attributes into
4935         TYPENAME_TYPEs.
4936
4937         PR c++/13736
4938         * parser.c (cp_parser_direct_declarator): Do not prevent
4939         backtracking inside a parenthesized declarator.
4940         (cp_parser_parameter_declaration): Fix typo in comment.
4941
4942 2004-01-28  Jan Hubicka  <jh@suse.cz>
4943
4944         * semantics.c (expand_body)  Do emit_associated_thunks before
4945         expansion.
4946
4947 2004-01-27  Devang Patel  <dpatel@apple.com>
4948
4949         * name-lookup.c: Include "debug.h"
4950         (do_namespace_alias): Invoke debug_hooks to emit debug info
4951         for namespace alias.
4952         (do_local_using_decl): Invoke debug_hooks to emit debug info
4953         for using decl.
4954         (do_class_using_decl): Same.
4955         (do_toplevel_using_decl): Same.
4956         (do_using_directive): Same.
4957         (cp_emit_debug_info_for_using): New function.
4958         * Make-lang.in (cp/parser.o): Depend on debug.h
4959         (cp/name-lookup.o): Same.
4960
4961 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4962
4963         * cp-tree.h (language_function, lang_type_header): Use
4964         BOOL_BITFIELD.
4965         * name-lookup.h (cp_binding_level): Likewise.
4966
4967 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
4968
4969         PR c++/13663
4970         * semantics.c (finish_for_expr): Check for unresolved overloaded
4971         functions.
4972
4973         * class.c (add_method): Just check processing_template_decl to
4974         determine whether or not we are within a template.
4975         * decl2.c (maybe_retrofit_in_chrg): Likewise.
4976         * init.c (decl_constant_value): Check the type of the declaration,
4977         not TREE_READONLY.
4978         * name-lookup.c (maybe_push_to_top_level): Rename to ...
4979         (push_to_top_level): ... this.
4980         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
4981         * pt.c (push_template_decl_real): Reorder condition for speed.
4982         (convert_template_argument): Use dependency-checking functions in
4983         place of uses_template_parms.
4984         (lookup_template_class): Avoid calling uses_template_parms more
4985         than once.
4986         (uses_template_parms): Reimplement, using dependency-checking
4987         functions.
4988         (instantiate_class_template): Use push_to_top_level, not
4989         maybe_push_to_top_level.
4990         (type_unification_real): Simplify.
4991         (type_dependent_expression_p): Handle OFFSET_REFs and
4992         TEMPLATE_DECLs.
4993         (any_dependent_template_arguments_p): Handle multiple levels of
4994         template argument.
4995         * semantics.c (expand_or_defer_fn): Do not check
4996         uses_template_parms for template instantiations.
4997         * typeck.c (comptypes): Avoid calling cp_type_quals.
4998
4999 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
5000
5001         PR c++/13833
5002         * call.c (build_over_call): Do not convert arguments when
5003         processing a template.
5004         * pt.c (build_non_dependent_expr): Do not build a
5005         NON_DEPENDENT_EXPR for arithmetic constants.
5006
5007 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5008
5009         PR c++/13810
5010         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
5011         returns a TYPE_DECL. no further lookup is required.
5012         * semantics.c (check_template_template_default_arg): A TYPE_DECL
5013         is invalid. Rework to give better diagnostics.
5014
5015 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5016
5017         PR c++/13797
5018         * pt.c (instantiate_class_template): Add an error_mark_node
5019         check.
5020         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
5021
5022 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
5023
5024         PR c++/13701
5025         * decl.c (finish_function): Move the call to
5026         finish_fname_decls below the call to
5027         finish_eh_spec_block.
5028
5029 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
5030
5031         * optimize.c, typeck2.c: Update copyright.
5032
5033 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
5034
5035         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
5036         init.c, mangle.c, typeck.c: Update copyright.
5037
5038 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
5039
5040         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
5041
5042 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
5043
5044         * Make-lang.in: Replace $(docdir) with doc.
5045         (c++.info, c++.srcinfo): Dummy entry.
5046         (c++.man, c++.srcman): New rules.
5047         (c++.install-man): Revamp rule.
5048
5049 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
5050
5051         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
5052         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
5053         immediate $(shell) instead of deferred backquote.
5054
5055 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
5056
5057         PR c++/13651
5058         * parser.c (cp_parser_postfix_expression): When encountering
5059         incomplete type on left-hand side of "->" or ".", treat the entire
5060         expression as erroneous.
5061
5062         PR c++/13592
5063         * call.c (build_field_call): Remove.
5064         (n_build_method_call): Likewise.
5065         (build_method_call): Likewise.
5066         (build_new_method_call): Do not call build_field_call.
5067         * class.c (n_build_method_call): Remove.
5068         (print_class_statistics): Do not print it.
5069         * cp-tree.h (build_method_call): Remove declaration.
5070         (finish_object_call_expr): Likewise.
5071         (build_new_1): Do not use build_method_call.
5072         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
5073         when the function appearing on the right-hand-side of "." or "->"
5074         is not actually a function.
5075         * pt.c (tsubst_copy_and_build): Likewise.
5076         * semantics.c (finish_object_call_expr): Remove.
5077
5078 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
5079
5080         PR c++/13710
5081         * pt.c (tsubst): Use finish_typeof.
5082
5083 2004-01-18  Jason Merrill  <jason@redhat.com>
5084
5085         PR c++/11725
5086         * except.c (build_throw): In a template, set
5087         current_function_returns_abnormally.
5088
5089 2004-01-17  Fred Fish  <fnf@intrinsity.com>
5090
5091         PR c++/11895
5092         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
5093         except don't call array_type_nelts() with a VECTOR_TYPE.
5094
5095 2004-01-16  Jan Hubicka  <jh@suse.cz>
5096
5097         * mangle.c (write_mangled_name): Remove inline modifier.
5098
5099 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
5100
5101         PR c++/13574
5102         * decl.c (compute_array_index_type): Fix grammar in comment.
5103         * init.c (build_zero_init): Handle zero-sized arrays correctly.
5104
5105         PR c++/13178
5106         * call.c (name_as_c_string): Print conversion operator names
5107         correctly.
5108
5109         PR c++/13478
5110         * call.c (initialize_reference): Pass -1 for inner parameter to
5111         convert_like_real.
5112
5113 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5114
5115         PR c++/13407
5116         * parser.c (cp_parser_base_specifier): Check for an invalid
5117         keyword `typename' and emit an user-friendly error message.
5118
5119 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
5120
5121         PR pch/13361
5122         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
5123         (handle_pragma_implementation): Likewise.
5124
5125 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5126
5127         PR c++/9259
5128         * typeck.c (build_class_member_access_expr): Allow to access members
5129         of the currently open class.
5130         (finish_class_member_access_expr): Likewise.
5131
5132 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
5133
5134         PR c++/13659
5135         * name-lookup.c (validate_nonmember_using_decl): Take scope and
5136         name by value, instead of computing them.
5137         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
5138         arguments.  Pass them to validate_nonmember_using_decl.
5139         * name-lookup.h (do_local_using_decl): Adjust.
5140         (do_toplevel_using_decl): Likewise.
5141         * parser.c (cp_parser_using_declaration): Likewise.
5142         * pt.c (tsubst_expr): Likewise.
5143
5144 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
5145
5146         PR c++/13594
5147         PR c++/13658
5148         * name-lookup.c (qualified_lookup_using_namespace): Search
5149         strongly-associated namespaces first, and only then try other
5150         namespaces.
5151
5152 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
5153
5154         * Make-lang.in (c++.srcextra): Dummy entry.
5155
5156 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5157
5158         PR c++/8856
5159         * parser.c (cp_parser_template_name): Don't try to parse a
5160         conversion-function-id, as it cannot be a template-name.
5161         (cp_parser_simple_type_specifier): Check for invalid template-ids
5162         even after a built-in type.
5163
5164 2004-01-14  Jan Hubicka  <jh@suse.cz>
5165
5166         PR c++/12850
5167         * pt.c (instantiate_decl):  Do not increase function_depth.
5168
5169 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
5170
5171         PR c++/9021
5172         PR c++/11005
5173         * parser.c (cp_parser_elaborated_type_specifier): Warn about
5174         attributes and discard.
5175         * decl.c (xref_tag): Don't overwite existing attributes with
5176         NULL_TREE.
5177
5178 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5179
5180         PR c++/12335
5181         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
5182         is no destructor while looking up a BIT_NOT_EXPR.
5183
5184 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
5185
5186         * cxxfilt.c: Remove unused file.
5187
5188 2004-01-14  Jan Hubicka  <jh@suse.cz>
5189
5190         Partial fix to PR c++/12850
5191         * decl2.c (mark_used): Do not proactively instantiate templates
5192         when compiling in unit-at-a-time or not optimizing.
5193         * optimize.c (maybe_clone_body): Do not increase function depth.
5194
5195 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5196
5197         PR c++/13474
5198         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
5199
5200 2004-01-12  Steven Bosscher  <stevenb@suse.de>
5201
5202         PR c++/13558
5203         * parser.c (cp_parser_member_declaration): Any non-type is also
5204         not a class or a function.
5205
5206 2004-01-12  Jason Merrill  <jason@redhat.com>
5207
5208         PR c++/12815
5209         * class.c (build_base_path): Do not mark vtable references as
5210         TREE_CONSTANT.
5211         (build_vtbl_ref_1): Likewise.
5212
5213 2004-01-12  Richard Henderson  <rth@redhat.com>
5214
5215         PR opt/10776
5216         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
5217         (store_init_value): Use it.
5218         * decl.c (check_initializer): Expect full initialization code
5219         from store_init_value.
5220         * init.c (expand_aggr_init_1): Likewise.
5221         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
5222
5223 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
5224
5225         * class.c (layout_class_type): For non-POD class types, also copy
5226         the DECL_SIZE and DECL_MODE of fields to the base class type.
5227
5228 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5229
5230         PR c++/13289
5231         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
5232         calling regenerate_decl_from_template.
5233
5234 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
5235
5236         PR c++/4100
5237         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
5238         decl-specifier occurring along with a class definition.
5239
5240 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
5241
5242         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
5243         clauses to comments describing declares_class_or_enum.
5244         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
5245         false.
5246
5247 2004-01-12  Jan Hubicka  <jh@suse.cz>
5248
5249         * pt.c (for_each_template_parm): Do not check for duplicates.
5250         (for_each_template_parm): Use walk_tree duplicate checking code.
5251
5252 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
5253
5254         PR c++/3478
5255         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
5256         is error_mark_node, don't add any more decl_specs.
5257         (cp_parser_init_declarator): After committing to a declaration, if
5258         the decl_specifiers start with error_mark_node, issue an error and
5259         change the type to "int".
5260
5261 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
5262
5263         PR bootstrap/7817
5264         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
5265
5266 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5267
5268         DR 337
5269         PR c++/9256
5270         * pt.c (tsubst): Substitution must fail if we are attempting to
5271         create an array with element type that is an abstract class type.
5272         * decl.c (cp_finish_decl): Strip pointers and array types recursively
5273         before calling abstract_virtuals_error.
5274
5275 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
5276
5277         * name-lookup.c (qualified_lookup_using_namespace): Consider
5278         strong using directives even if we've already found a binding.
5279
5280 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
5281
5282         * cp-tree.h (cxx_expand_expr): Change prototype.
5283         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
5284
5285 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5286
5287         PR c++/12573
5288         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
5289         looking into them recursively. They can be there because of the
5290         new __offsetof__ extension.
5291
5292 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
5293
5294         * parser.c (cp_parser_save_member_function_body): Mark the
5295         definition static.
5296
5297 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
5298
5299         PR c++/13057
5300         * class.c (build_clone): Copy type attributes from the original
5301         function to the clone.
5302
5303         PR c++/12815
5304         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
5305         references as constant.
5306
5307         PR c++/12132
5308         * parser.c (cp_parser_explicit_instantiation): Improve error
5309         recovery.
5310         (cp_parser_require): Improve indication of the error location.
5311
5312         PR c++/13451
5313         * parser.c (cp_parser_class_head): Reorder logic to check for
5314         invalid qualification.
5315
5316 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
5317
5318         PR c++/13157
5319         * name-lookup.c (lookup_using_namespace): Remove spacesp
5320         parameter.
5321         (unqualified_namespace_lookup): Likewise.
5322         (lookup_qualified_name): Adjust accordingly.
5323         (lookup_name_real): Likewise.
5324         (lookup_arg_dependent): Do not eliminate the namespace of the
5325         functions found by unqualified name lookup unless that is the
5326         current namespace.
5327
5328 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
5329
5330         * semantics.c (push_deferring_access_checks): Fix format.
5331         (resume_deferring_access_checks): Likewise.
5332         (stop_deferring_access_checks): Likewise.
5333         (pop_deferring_access_checks): Likewise.
5334         (get_deferred_access_checks): Likewise.
5335         (pop_to_parent_deferring_access_checks): Likewise.
5336         (perform_deferred_access_checks): Likewise.
5337         (perform_or_defer_access_check): Likewise.
5338
5339 2004-01-04  Richard Henderson  <rth@redhat.com>
5340
5341         * call.c (build_over_call): Don't create a save_expr of an
5342         aggregate, but rather its address.
5343
5344 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
5345
5346         PR c++/13529
5347         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
5348         an offsetof expression.
5349
5350         * parser.c (cp_parser_parameter_declaration): Fix comment.
5351
5352         PR c++/12226
5353         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
5354         (reference_binding): Set it when appropriate.
5355         (build_temp): New function, split out from ...
5356         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
5357         (initialize_reference): Likewise.
5358
5359         PR c++/13536
5360         * parser.c (cp_parser): Add in_type_id_in_expr_p.
5361         (cp_parser_new): Initialize it.
5362         (cp_parser_postfix_expression): Set it.
5363         (cp_parser_sizeof_operand): Likewise.
5364         (cp_parser_parameteR_declaration): Do not commit early to tenative
5365         parsers when in_type_id_in_expr_p is set.
5366
5367 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5368
5369         PR c++/13094
5370         * parser.c (cp_parser_template_argument): Don't call
5371         make_unbound_class_template directly.
5372         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
5373         UNBOUND_CLASS_TEMPLATE tree node.
5374
5375 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
5376
5377         PR target/12729
5378         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
5379
5380 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
5381
5382         PR c++/13520
5383         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
5384         (DECL_FUNCTION_TEMPLATE_P): Use it.
5385         (DECL_CLASS_TEMPLATE_P): Likewise.
5386         * parser.c (cp_parser_lookup_name): Add is_template parameter.
5387         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
5388         (cp_parser_template_name): Likewise.
5389         (cp_parser_elaborated_type_specifier): Likewise.
5390         (cp_parser_namespace_name): Likewise.
5391         (cp_parser_class_name): Likewise.
5392         (cp_parser_lookup_name_simple): Likewise.
5393
5394 See ChangeLog.3 for earlier changes.