OSDN Git Service

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