OSDN Git Service

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