OSDN Git Service

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