OSDN Git Service

2cf92d0a43547cd43c799ca1154a23841fcd012f
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
2
3         PR c++/16623
4         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
5         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
6         * class.c (add_implicitly_declared_members): Use
7         CLASSTYPE_LAZY_ASSIGNMENT_OP.
8         * method.c (lazily_declare_fn): Clear
9         CLASSTYPE_LAZY_ASSIGNMENT_OP.
10         * search.c (lookup_fnfields_1): Check it.
11
12 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
13
14         * cp-tree.h (vec_binfo_member): Remove.
15         * tree.c (vec_binfo_member): Remove.
16
17         * cp-tree.h (struct lang_type_class): Remove vfields field.
18         (CLASSTYPE_VFIELDS): Remove.
19         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
20         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
21         handling.
22         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
23         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
24         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
25
26 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
27
28         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
29         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
30         Moved to common.
31         (BINFO_LANG_SLOTS): Remove.
32         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
33         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
34         * class.c (check_bases): Adjust BINFO accessors.
35         (determine_primary_base, finish_struct_bits,
36         maybe_warn_about_overly_private_class, warn_hidden,
37         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
38         warn_about_ambiguous_bases, get_vfield_name,
39         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
40         add_vcall_offset_vtbl_entries_r): Likewise.
41         * dump.c (cp_dump_tree): Likewise.
42         * init.c (sort_mem_initializers, expand_member_init, build_delete,
43         push_base_cleanups): Likewise.
44         * method.c (do_build_copy_constructor, do_build_assign_ref,
45         synthesize_exception_spec): Likewise.
46         name-lookup.c (arg_assoc_class): Likewise.
47         * pt.c (instantiate_class_template,
48         get_template_base_recursive): Likewise.
49         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
50         * typeck2.c (process_init_constructor): Likewise.
51         * search.c (lookup_base_r, dynamic_cast_base_recurse,
52         dfs_access_in_type, dfs_walk_real, look_for_overrides,
53         types_overlap_p, copied_binfo, original_binfo): Likewise.
54         (binfo_for_vtable): Remove
55
56 2004-07-20  Steven Bosscher  <stevenb@suse.de>
57
58         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
59         thunk_alias, and the access and virtual_offset fields.
60         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
61         * decl.c (finish_case_label): Update c_add_case_node call.
62
63 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
64
65         Revert patch for PR c++/16623.
66         
67 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
68
69         * except.c: Remove two spurious carriage returns.
70
71 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
72
73         PR c++/16623
74         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
75         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
76         * class.c (add_implicitly_declared_members): Use
77         CLASSTYPE_LAZY_ASSIGNMENT_OP.
78         * method.c (lazily_declare_fn): Clear
79         CLASSTYPE_LAZY_ASSIGNMENT_OP.
80         * search.c (lookup_fnfields_1): Check it.
81
82 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
83
84         * class.c (add_method): Delay adding the slot until the end.
85         (determine_primary_base): Adjust VEC_iterate invokation.
86         (resort_type_method_vec, finish_struct_methods, warn_hidden,
87         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
88         build_vtbl_initializer): Likewise.
89         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
90         build_vbase_delete): Likewise.
91         * method.c (do_build_copy_constructor): Likewise.
92         * name-lookup.c (new_class_binding, print_binding_level,
93         poplevel_class, store_class_bindings, push_to_top_level,
94         pop_from_top_level): Likewise.
95         * pt.c (check_explicit_specialization): Likewise.
96         * search.c (lookup_conversion_operator, lookup_fnfields_1,
97         get_pure_virtuals, add_conversions, dfs_check_overlap,
98         binfo_for_vbase): Likewise.
99
100 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
101
102         PR c++/12170
103         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
104         innermost set of template arguments during deduction.  Simplify.
105
106 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
107
108         * typeck.c (build_modify_expr, build_x_modify_expr): Set
109         TREE_NO_WARNING on assignments with an operator other than '='.
110
111 2004-07-10  Steven Bosscher  <stevenb@suse.de>
112             Joseph S. Myers  <jsm@polyomino.org.uk>
113
114         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
115         * decl2.c (grokfield): Don't check current_class_depth via
116         unused TREE_COMPLEXITY.
117         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
118         to avoid the missing parentheses warning.
119         Don't set C_SET_EXP_ORIGINAL_CODE.
120
121 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
122
123         * tree.c (no_linkage_helper): Remove.
124         (no_linkage_check): Don't use walk_tree_without_duplicates.
125
126         * mangle.c (write_expression): Issue a sorry for zero-operand
127         functional casts.
128
129 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
130
131         PR c++/13092
132         * init.c (build_offset_ref): Build SCOPE_REF with non-null
133         TREE_TYPE for non-dependent names.
134         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
135         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
136         unknown_type_node as its TREE_TYPE.
137         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
138         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
139         (dump_expr) <SCOPE_REF case>: Likewise.
140
141 2004-07-17  Jason Merrill  <jason@redhat.com>
142
143         PR c++/16115
144         * call.c (type_passed_as): Make the invisible reference type
145         __restrict.
146         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
147         cp_genericize_r.  Handle invisible reference lowering.
148         (is_invisiref_parm): New fn.
149         (cp_genericize): Adjust the types of invisible reference parms.
150         Don't repeat the walk for clones.
151         * decl.c (store_parm_decls): Don't generate any code for clones.
152
153 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
154
155         * cp-tree.h (builtin_function): Declare.
156
157 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
158
159         * class.c (finish_struct_methods): Remove unncessary code.
160         (add_implicitly_declared_members): Create declarations for default
161         constructors and copy constructors lazily.
162         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
163         lazy_copy_ctor.
164         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
165         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
166         * decl2.c (check_classfn): Robustify.
167         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
168         (locate_ctor): Handle lazy default constructors.
169         (locate_copy): Handle lazy copy constructors.
170         (implicitly_declare_fn): Make sure we're looking at the
171         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
172         set TYPE_HAS_CONSTRUCTOR.
173         (lazily_declare_fn): New function.
174         * name-lookup.c (constructor_name_full): Simplify.
175         * search.c (lookup_fnfields_1): Lazily create methods, as
176         necessary.
177         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
178
179 2004-07-16  Steven Bosscher  <stevenb@suse.de>
180
181         * cp-tree.h (struct lang_type): Don't have three GTY options on a
182         single bit GTY desc.
183
184 2004-07-16  Richard Henderson  <rth@redhat.com>
185
186         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
187         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
188         * tree.c (cp_copy_res_decl_for_inlining): Remove.
189
190 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
191
192         * class.c (finish_struct_bits): Use for loop.
193         (propagate_binfo_offsets): Do primary binfo outside of loop.
194
195         PR c++/16583
196         * dump.c (cp_dump_tree): Don't dump the bases if there's no
197         binfo.
198
199         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
200
201 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
202
203         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
204         has_abstract_assign_ref.  Make methods a VEC(tree) *.
205         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
206         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
207         (CLASSTYPE_DESTRUCTORS): Likewise.
208         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
209         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
210         (add_method): Change prototoype.
211         * class.c (add_method): Remove error_p parameter.  Adjust for
212         changes to CLASSTYPE_METHOD_VEC.
213         (handle_using_decl): Adjust call to add_method.
214         (maybe_warn_about_overly_private_class): Adjust for
215         changes to CLASSTYPE_METHOD_VEC.
216         (resort_type_method_vec): Likewise.
217         (finish_struct_methods): Likewise.
218         (check_for_override): Likewise.
219         (warn_hidden): Likewise.
220         (add_implicitly_declared_members): Defer creation of assignment
221         operators.  Adjust call to add_method.
222         (clone_function_decl): Adjust call to add_method.
223         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
224         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
225         * decl.c (grok_special_member_properties): Don't set
226         TYPE_HAS_ABSTRACT_ASSIGN_REF.
227         * decl2.c (check_classfn): Adjust for
228         changes to CLASSTYPE_METHOD_VEC.
229         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
230         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
231         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
232         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
233         cp_finish_decl.
234         * pt.c (check_explicit_specialization): Adjust for
235         changes to CLASSTYPE_METHOD_VEC.
236         (instantiate_class_template): Do not set
237         TYPE_HAS_ABSTRACT_ASSIGN_REF.
238         * ptree.c (cxx_print_type): Don't try to print
239         CLASSTYPE_METHOD_VEC.
240         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
241         * search.c (lookup_field_r): Adjust for
242         changes to CLASSTYPE_METHOD_VEC.
243         (lookup_fnfields): Likewise.
244         (lookup_conversion_operator): Likewise.
245         (lookup_fnfields_1): Likewise.  Create assignment operators
246         lazily.
247         (look_for_overrides_here): Adjust for
248         changes to CLASSTYPE_METHOD_VEC.
249         (add_conversions): Likewise.
250         * semantics.c (finish_member_declaration): Adjust call to add_method.
251
252 2004-07-15  Jason Merrill  <jason@redhat.com>
253
254         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
255         references and pointers are compatible.
256
257 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
258
259         * decl.c (xref_basetypes): Refactor.
260         * tree.c (copy_base_binfos): Replace with ...
261         (copy_binfo): ... this. Deep copy the given binfo, (not the just
262         bases of the given base).
263         * cp-tree.h (copy_base_binfo): Remove.
264         (copy_binfo): Declare.
265
266 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
267         
268         * name-lookup.c (set_inherited_value_binding_p): Add class_type 
269         parameter.
270         (get_class_binding): Adjust.
271         (push_class_level_binding): Don't use set_inherited_value_binding_p.
272
273 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
274
275         * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
276         * decl.c (xref_basetypes): Set it here.
277
278         * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
279         Don't check for incomplete base.
280         (get_vfield_name): Simplify while loop.
281         * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
282
283 2004-07-14  Mark Mitchell  <mark@codesourcery.com>
284
285         * lex.c (cxx_make_type): Remove call to get_pointer_type.
286
287         * cp-tree.h (IDENTIFIER_VALUE): Remove.
288         (BINFO_PUSHDECLS_MARKED): Likewise.
289         (maybe_inject_for_scope_var): Likewise.
290         (push_class_decls): Likewise.
291         * name-lookup.h (push_class_binding): Remove.
292         (innermost_non_namespace_value): New function.
293         (outer_binding): Likewise.
294         * class.c (add_method): Push bindings before adding to
295         TYPE_METHODS.
296         (restore_class_cache): Do not restore class_shadowed.
297         (pushclass): Do not add USING_DECLs.  Do not call
298         push_class_decls.
299         * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
300         * decl.c (pushdecl): Use outer_binding.
301         (poplevel): Set the scope for an out-of-scope for-loop declaration
302         appropriately.
303         (cp_finish_decl): Don't call maybe_inject_for_scope_var.
304         * name-lookup.c (new_class_binding): New function.
305         (push_binding): Use it.
306         (pushdecl): Use innermost_non_namespace_value.
307         (maybe_inject_for_scope_var): Remove.
308         (push_class_binding): Remove.
309         (set_inherited_value_binding_p): New function.
310         (get_class_binding): New function.
311         (push_class_level_binding): Assert that the current_class_type is
312         being defined.
313         (outer_binding): New function.
314         (innermost_non_namespace_value): Likewise.
315         (lookup_name_real): Use outer_binding.
316         (lookup_name_current_level): Ignore out-of-scope variables.
317         * pt.c (check_template_shadow): Use innermost_non_namespace_value.
318         (lookup_template_class): Likewise.
319         * search.c (dfs_push_type_decls): Remove.
320         (dfs_push_decls): Likewise.
321         (setup_class_bindings): Likewise.
322         (lookup_field_1): Handle USING_DECLs from dependent scopes.
323         (marked_pushdecls_p): Remove.
324         (unmarked_pushdecls_p): Remove.
325         (marked_identifiers): Remove.
326         (setup_class_bindings): Remove.
327         (dfs_push_type_decls): Remove.
328         (dfs_push_decls): Remove.
329         (push_class_decls): Remove.
330         
331 2004-07-13  Mark Mitchell  <mark@codesourcery.com>
332
333         PR c++/16518
334         PR c++/16337
335         * decl.c (grokvardecl): Make declspecs parameter const.
336         (grokdeclarator): Likewise.  Adjust accordingly.
337         * decl.h (grokdeclarator): Adjust declaration.
338         * parser.c (cp_parser_init_declarator): Do not clear
339         decl_specifiers->attributes.
340
341         * cp-tree.h (lang_identifier): Remove class_value.
342         (IDENTIFIER_CLASS_VALUE): Remove.
343         (pop_class_decls): Likewise.
344         (init_search_processing): Likewise.
345         * class.c (handle_using_decl): Use lookup_member, not
346         IDENTIFIER_CLASS_VALUE.
347         (restore_class_cache): New function, split out from ...
348         (pushclass): ... here.  Do not call clear_identifier_class_values.
349         (invalidate_class_lookup_cache): Do not clear
350         IDENTIFIER_CLASS_VALUE.
351         (popclass): Do not call pop_class_decls.
352         (maybe_note_name_used_in_class): Do not save names looked up after
353         the class is complete.  Use lookup_member, not
354         IDENTIFIER_CLASS_VALUE.
355         * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
356         * decl.c (cxx_init_decl_processing): Do not call
357         init_search_processing.
358         * method.c (do_build_copy_constructor): Remove unnecessary code.
359         (do_build_assign_ref): Likewise.
360         * name-lookup.c (pushdecl): Use lookup_member, not
361         IDENTIFIER_CLASS_VALUE.
362         (set_identifier_type_value_with_scope): Set TREE_TYPE on the
363         type_shadowed list.
364         (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
365         (push_class_binding): Do not set it.
366         (clear_identifier_class_values): Remove.
367         (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
368         (store_binding): Do not save it.
369         (pop_from_top_level): Do not restore it.
370         * name-lookup.h (cxx_saved_binding): Remove class_value.
371         (clear_identifier_class_values): Remove.
372         * ptree.c (cxx_print_identifier): Do not print
373         IDENTIFIER_CLASS_VALUE.
374         * search.c (search_obstack): Remove.
375         (push_stack_level): Remove.
376         (pop_stack_level): Remove.
377         (search_level): Remove.
378         (search_stack): Remove.
379         (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
380         (setup_class_bindings): Use IDENTIFIER_MARKED, not
381         IDENTIFIER_CLASS_VALUE.
382         (marked_identifiers): New variable.
383         (push_class_decls): Clear IDENTIFIER_MARKED.
384         (pop_class_decls): Don't call pop_search_level.
385         (init_search_processing): Remove.
386
387 2004-07-12  Mark Mitchell  <mark@codesourcery.com>
388
389         * cp-tree.h (get_aggr_typedef): Remove.
390         * init.c (get_aggr_typedef): Likewise.
391
392         * name-lookup.c (push_class_level_binding): Simplify.
393
394 2004-07-12  Andrew Pinski  <apinski@apple.com>
395
396         PR c++/16475
397         Revert:
398         2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
399                 PR c++/16276
400                 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
401                 is not public.
402
403 2004-07-12  Eric Christopher  <echristo@redhat.com>
404
405         * parser.c (cp_parser_class_head): Remove unused variable.
406
407 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
408
409         * decl.c (grok_op_properties): Reject [de-]allocation functions
410         declared in a namespace, or declared as static.
411
412 2004-07-12  Nathan Sidwell  <nathan@codesourcery.com>
413
414         * cp-tree.h (make_binfo): Remove.
415         * decl.c (xref_basetypes): Use make_tree_binfo directly.
416         * tree.h (copy_base_binfos): Likewise.
417         (make_binfo): Remove.
418
419         * call.c (build_user_type_conversion_1, build_new_op,
420         check_constructor_callable, build_temp,
421         perform_direct_initialization_of_possible): Pass type directly to
422         lookup_fnfields & build_special_member_call.
423         (build_special_member_call): Accept a type, and complete it.
424         * class.c (finish_stuct_bits): Copy the BINFOs here.
425         * cvt.c (ocp_convert): Pass type directly to
426         build_special_member_call.
427         * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
428         (xref_basetypes): Allocate the binfo here. Adjust.
429         * init.c (build_init, build_new_1): Pass type directly to
430         build_special_member_call.
431         * lex.c (cxx_make_type): Do not allocate binfo here.
432         * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
433         * parser.c (cp_parser_class_head): Always call xref_basetypes.
434         * pt.c (instantiate_class_template): Likewise. Inhibit access
435         checking for template friends.
436         * ptree.c (cxx_print_type): Adjust record printing.
437         * search.c (lookup_base): When taking a type, complete it before
438         looking for a binfo.
439         (lookup_member): Delay completing a type.
440         (push_class_decls): Don't walk an incomplete type.
441         (lookup_conversions): Likewise.
442         * semantics.c (finish_stmt_expr_expr): Pass type directly to
443         build_special_member_call.
444         * tree.c (copy_base_binfos): Adjust.
445         (make_binfo): Likewise.
446         * typeck.c (build_modify_expr): Pass type directly to
447         build_special_member_call.
448         * typeck2.c (process_init_constructor): Check a binfo exists.
449         (build_m_component_ref): Allow accessing an incomplete type.
450         (build_functional_cast): Pass type directly to
451         build_special_member_call.
452
453 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
454
455         PR c++/2204
456         * config-lang.in (gtfiles): Add typeck2.c.
457         * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
458         gt-cp-typeck2.h.
459         * cp-tree.h: Declare complete_type_check_abstract.
460         * typeck2.c (pat_calc_hash, pat_compare,
461         complete_type_check_abstract): New functions.
462         (abstract_virtuals_error): If the type is abstract, register the
463         declaration within abstract_pending_vars for further checks.
464         Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
465         * decl.c (cp_finish_decl): Do not strip array types.
466         (create_array_type_for_decl): Check for abstractness of the element
467         type.
468         (complete_vars): Call complete_type_check_abstract.
469         * class.c (finish_struct): Prepare a list of virtual functions for
470         template types, and call complete_vars on it to check for abstractness.
471
472 2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
473
474         PR tree-optimization/14107
475         * decl.c (finish_function): Remove temporary band-aid.
476
477 2004-07-11  Mark Mitchell  <mark@codesourcery.com>
478
479         * call.c (build_operator_new_call): Avoid using push_to_top_level.
480         (build_new_op): Adjust call to lookup_function_nonclass.
481         * name-lookup.c (identifier_type_value): Adjust call to
482         lookup_name_real.
483         (lookup_name_real): Add block_p parameter.
484         (lookup_name_nonclass): Adjust call to lookup_name_real.
485         (lookup_function_nonclass): Likewise.
486         (lookup_name): Likewise.
487         * name-lookup.h (lookup_name_real): Change prototype.
488         (lookup_name_nonclass): Likewise.
489         * parser.c (cp_parser_lookup_name): Likewise.
490
491         * cp-tree.h (saved_scope): Make old_bindings a vector.
492         (unuse_fields): Remove.
493         * name-lookup.h (cxx_saved_binding): Define it.
494         * class.c (pushclass): Don't use unuse_fields.
495         * name-lookup.c (cxx_saved_binding_make): Remove.
496         (store_binding): Add new bindings to a vector, using an
497         accumulator style, rather than adding them to a list.
498         (store_bindings): Adjust accordingly.
499         (store_class_bindings): Likewise.
500         (push_to_top_level): Likewise.
501         (pop_from_top_level): Likewise.
502         * optimize.c (maybe_clone_body): Must push_to_top_level and
503         pop_from_top_level calls outside of loop.
504         * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
505         calls here from cp_parser_late_parsing_default_args.
506         (cp_parser_save_default_args): Record the class type in which the
507         function is declared.
508         (cp_parser_late_parsing_default_args): Do not call
509         push_nested_class/pop_nested_class.
510         * search.c (dfs_unuse_fields): Remove.
511         (unuse_fields): Remove.
512
513 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
514
515         * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
516         LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
517         * cp-tree.h (poplevel): Declare.
518         (set_block): Remove.
519         * decl.c (set_block): Remove.
520
521 2004-07-10  Mike Stump  <mrs@apple.com>
522
523         * decl2.c (import_export_class): Never export/import vtables
524         with inline key functions.
525
526 2004-07-09  Steven Bosscher  <stevenb@suse.de>
527
528         * typeck.c (c_expand_asm_operands): Remove.
529
530 2004-07-09  Mike Stump  <mrs@apple.com>
531
532         * typeck.c (build_class_member_access_expr): Skip null deref
533         warning when we don't dereference it.
534
535 2004-07-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
536
537         PR c++/8211
538         PR c++/16165
539         * class.c (check_field_decls): Improve -Weffc++ warning: do not
540         warn for pointers to functions/members, or for classes without
541         destructors.
542
543 2004-07-08  Mark Mitchell  <mark@codesourcery.com>
544
545         * name-lookup.h (struct cp_binding_level): Update documentation
546         for class_shadowed.
547
548 2004-07-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
549
550         PR c++/16169
551         * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
552         returning CALL_EXPR, and non-reference return type.
553
554 2004-07-08  Nathan Sidwell  <nathan@codesourcery.com>
555
556         * name-lookup.c (push_binding): Use VEC_reserve.
557
558 2004-07-08  Richard Henderson  <rth@redhat.com>
559
560         * cp-tree.h (expand_eh_spec_block): Remove.
561
562 2004-07-07  Mark Mitchell  <mark@codesourcery.com>
563
564         * cp-tree.h (saved_scope): Remove x_previous_class_type and
565         x_previous_class_values; add x_previous_class_level.
566         (previous_class_type): Remove.
567         (previous_class_values): Remove.
568         (previous_class_level): New macro.
569         * class.c (pushclass): Restore the identifier cache more
570         expeditiously.
571         (invalidate_class_lookup_cache): Use vector for class_shadowed and
572         previous_class_values.
573         * decl.c (poplevel): Likewise.
574         * name-lookup.c (cxx_binding_init): New function.
575         (cxx_binding_make): Use it.
576         (push_binding): For a binding in a class level, use a vector of
577         cp_class_binding nodes.
578         (push_binding_level): New function.
579         (begin_scope): Use it.
580         (leave_scope): Do not put class binding levels on the free list.
581         (print_binding_level): Adjust for the fact that class_shadowed is
582         a vector.
583         (poplevel_class): Likewise.
584         (clear_identifier_class_values): Likewise.
585         (push_class_level_binding): Likewise.
586         (set_class_shadows): Remove.
587         (store_binding): New function.
588         (store_class_bindings): New function.
589         (push_to_top_level): Use store_class_bindings as appropriate.
590         (pop_from_top_level): Use previous_class_level, not
591         previous_class_type.
592         * name-lookup.h (cp_class_binding): New type.
593         (cp_binding_level): Use a vector object for class_shadowed.
594         (push_binding_level): Declare.
595         (set_class_shadows): Remove.
596
597 2004-07-07  Andrew Pinski  <apinski@apple.com>
598
599         * class.c (instantiate_type): BUFFER_REF is dead.
600         * lex.c (init_operators): IN_EXPR is dead.
601
602 2004-07-07  Jason Merrill  <jason@redhat.com>
603
604         PR c++/16334
605         * call.c (build_new_op): Give overload warnings for built-in
606         candidates.
607
608 2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
609
610         PR c++/16276
611         * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
612         is not public.
613
614 2004-07-07  Nathan Sidwell  <nathan@codesourcery.com>
615
616         * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
617         * class.c (build_primary_vtable, check_bases,
618         determine_primary_base, finish_struct_bits,
619         maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
620         get_basefndecls, warn_hidden, walk_subobject_offsets,
621         build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
622         layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
623         finish_struct_1, get_vfield_name, contains_empty_class_p,
624         dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
625         dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
626         add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
627         BINFO macros.
628         * decl.c (xref_basetypes): Likewise.
629         * dump.c (cp_dump_tree): Likewise.
630         * error.c (dump_expr): Likewise.
631         * init.c (sort_mem_initializers, expand_member_init,
632         push_base_cleanups): Likewise.
633         * method.c (do_build_copy_constructor, do_build_assign_reg,
634         synthesize_exception_spec): Likewise.
635         * name-lookup.c (arg_assoc_class): Likewise.
636         * pt.c (instantiate_class_template, tsubst,
637         get_template_base_recursive): Likewise.
638         * ptree.c (cxx_print_type): Likewise.
639         * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
640         * search.c (lookup_base_r, dynamic_cast_base_recurse,
641         dfs_access_in_type, access_in_type, lookup_field_queue_p,
642         bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
643         marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
644         dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
645         binfo_for_vtable, copied_binfo, original_binfo): Likewise
646         * tree.c (copy_base_binfos, make_binfo): Likewise.
647         * typeck.c (commmon_base_type): Likewise
648         * typeck2.c (process_init_constructor): Likewise
649
650 2004-07-06  Joseph S. Myers  <jsm@polyomino.org.uk>
651
652         * decl.c (check_tag_decl): Name redeclared type in diagnostic.
653
654 2004-07-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
655
656         PR c++/3671
657         * pt.c (convert_nontype_argument): Disallow conversions between
658         different enumeration types.
659
660 2004-07-06  Nathan Sidwell  <nathan@codesourcery.com>
661
662         * cp-tree.h (BINFO_MARKED): Remove.
663         (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
664         BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
665         BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
666         (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
667         * class.c (build_base_path): Use BINFO_VIRTUAL_P.
668         (mark_primary_bases, determine_primary_base, base_derived_from,
669         dfs_find_final_overrider, dfs_find_final_overrider_q,
670         dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
671         dfs_modify_vtables, walk_subobject_offsets,
672         layout_nonempty_base_or_field, build_base_field,
673         build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
674         end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
675         finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
676         build_ctor_vtbl_group, accumulate_vtble_inits,
677         dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
678         build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
679         add_vcall_offset_vtbl_entries_1): Likewise.
680         * decl.c (xref_basetypes): Incomming virtual base indicated by
681         TREE_TYPE. Adjust.
682         * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
683         * init.c (finish_init_stmts, sort_mem_initializers,
684         emit_mem_initializers, build_vtble_address, expand_member_init,
685         push_base_cleanups): Likewise.
686         * method.c (do_build_copy_constructor): Likewise.
687         * pt.c (instantiate_class_template,
688         get_template_base_recursive): Likewise.
689         * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
690         get_pseudo_ti_desc): Likewise.
691         * search.c (lookup_base_r, dynamic_cast_base_recurse,
692         binfo_from_vbase, binfo_via_virtual, copied_binfo,
693         original_binfo): Likewise.
694         * semantics.c (finish_base_specifier): Virtualness is indicated
695         by TREE_TYPE.
696         * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
697
698 2004-07-06  Mark Mitchell  <mark@codesourcery.com>
699
700         Revert:
701         2004-06-24  Jason Merrill  <jason@redhat.com>
702         PR c++/16115
703         * decl.c (grokparms): Give the PARM_DECL reference type if the
704         parameter is passed by invisible reference.
705
706 2004-07-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
707
708         * cp-lang.c (cp_var_mod_type_p): Add extra arg.
709         * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
710         * pt.c (check_instantiated_args, unify): Likewise.
711
712 2004-07-05  Phil Edwards  <phil@codesourcery.com>
713
714         * Make-lang.in (check-c++, lang_checks):  Add some comments.
715
716 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
717
718         * cp-mudflap.c: Delete file.
719         * Makefile.in: Remove all references to cp-mudflap.o.
720
721 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
722
723         * decl.c (cxx_init_decl_processing): Call
724         build_common_tree_nodes before creating the global NAMESPACE_DECL.
725
726 2004-07-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
727
728         PR c++/2518
729         * call.c (build_operator_new_call): Look only at global scope.
730
731 2004-07-05  Nathan Sidwell  <nathan@codesourcery.com>
732
733         * call.c (enforce_access): Expect TREE_BINFO.
734         * class.c (binfo_ctor_vtable): Check TREE_BINFO.
735         * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
736         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
737         Adjust.
738         (BINFO_LANG_ELTS): Remove.
739         (BINFO_LANG_SLOTS): New.
740         (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
741         (CLASSTYPE_TEMPLATE_INFO): Adjust.
742         * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
743         * search.c (lookup_member): Check TREE_BINFO.
744         * semantics.c (perform_or_defer_access_check): Likewise.
745         (check_accessibility_of_qualified_id): Check
746         deferred_access_no_check.
747         * tree.c (make_binfo): Use make_tree_binfo.
748
749 2004-07-04  Mark Mitchell  <mark@codesourcery.com>
750
751         * method.c (implicitly_declare_fn): Set linkage of generated
752         functions.
753
754 2004-07-04  Richard Henderson  <rth@redhat.com>
755
756         * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
757
758 2004-07-03  Scott Brumbaugh  <scottb.lists@verizon.net>
759
760         PR c++/3761
761         * name-lookup.c (push_class_level_binding): Don't pass a
762         TREE_LIST of ambiguous names to check_template_shadow as it
763         only handles declarations. Instead, pull the declaration
764         out and pass that.
765
766 2004-07-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
767
768         PR c++/14971
769         * pt.c (check_explicit_specialization): Clarify error message.
770
771 2004-07-02  Richard Henderson  <rth@redhat.com>
772
773         * tree.c (cp_unsave_r): Update remap_save_expr call.
774
775 2004-07-02  Mark Mitchell  <mark@codesourcery.com>
776
777         PR c++/16240
778         * mangle.c (write_template_arg): Correct mangling.
779
780         PR c++/16297
781         * decl.c (grokdeclarator): Robustify.
782
783 2004-07-01  Richard Henderson  <rth@redhat.com>
784
785         * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
786         * method.c (synthesize_method): Don't clear_last_expr.
787         * name-lookup.c (maybe_push_cleanup_level): Likewise.
788
789 2004-07-01  Nick Clifton  <nickc@redhat.com>
790
791         * decl2.c (import_export_class): Invoke the
792         import_export_class field in the gcc_target structure if it is not
793         empty.
794
795 2004-06-30  Richard Henderson  (rth@redhat.com>
796
797         * decl.c (start_preparsed_function): Don't set immediate_size_expand.
798         * method.c (use_thunk): Likewise.
799
800 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
801
802         * call.c (build_over_call), typeck.c (build_function_call): Call
803         check_function_arguments instead of check_function_format.
804
805 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
806
807         * call.c (build_over_call), typeck.c (build_function_call): Update
808         calls to check_function_format.
809
810 2004-06-30  Richard Henderson  <rth@redhat.com>
811
812         * call.c (build_over_call): Use __builtin_memcpy for copying
813         CLASS_AS_BASE rather than funny casting.
814
815 2004-06-30  Richard Henderson  <rth@redhat.com>
816
817         * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
818         TYPE_SIZE_UNIT of full_type.
819
820 2004-06-30  Per Bothner  <per@bothner.com>
821
822         Conditionally compile support for --enable-mapped_location.
823         * decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
824         * decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
825         adjustments - which I don't understand.
826         * error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
827         * error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
828         (print_instantiation_partial_context):  Use expand_location.
829         * decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
830         * name-lookup.c:  Likewise.
831         * lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
832         * name-lookup.c:  Use input_line macro.
833         * parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
834         (cp_parser_statement):  Rename locaal variable statement_locus to
835         statement_location and use SET_EXPR_LOCATION macro.
836         * pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
837         * tree.c (cp_walk_subtrees):  Likewise.
838
839 2004-06-29  Per Bothner  <per@bothner.com>
840
841         * tree.c (build_min_nt, build_min, build_min_non_dep):
842         Don't set TREE_COMPLEXITY from input_line.
843
844 2004-06-29  Paul Brook  <paul@codesourcery.com>
845
846         * init.c: Include target.h.
847         (get_cookie_size): Remove and replace with target hook.
848         Update callers.
849         (build_new_1): Store the element size in the cookie.
850
851 2004-06-29  Nathan Sidwell  <nathan@codesourcery.com>
852
853         PR c++/16260
854         * parser.c (cp_parser_template_declaration_after_export): Disable
855         access checks here ...
856         (cp_parser_class_specifier): ... not here.
857
858 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
859
860         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
861         VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
862         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
863         TREE_CHECK macro.
864
865 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
866
867         * cp-tree.h (struct deferred_access): Move to ...
868         * semantics.c (struct deferred_access): ... here. Adjust.
869         (deferred_access_stack): Make a VEC(deferred_access),
870         (deferred_access_free_list): Remove.
871         (deferred_access_no_check): New.
872         (push_deferring_access_checks, resume_deferring_access_checks,
873         stop_deferring_access_checks, pop_deferring_access_checks,
874         get_deferred_access_checks, pop_to_parent_deferring_access_checks,
875         perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
876
877 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
878
879         PR c++/16174
880         * call.c (build_temp): Declare.
881         (check_constructor_callable): New.
882         (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
883         CONSTRUCTOR_CALLABLE.
884         (convert_like_real, initialize_reference): Use
885         check_constructor_callable.
886         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
887         (LOOKUP_*): Renumber.
888
889 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
890
891         * friend.c (add_friend): Only perform access checks when context
892         is a class.
893         * lex.c (cxx_make_type): Only create a binfo for aggregate types.
894         * parser.c (cp_parser_class_specifier): Disable access checks here
895         when parsing the body of a templated class.
896         * semantics.c (perform_or_defer_access_checks): Reorder to allow
897         NULL binfos when not checking access.
898
899 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
900
901         Use vector API for vbase list.
902         * cp-tree.h: Include vec.h
903         (DEF_VEC_P (tree)): New type.
904         (struct lang_type_class): Change vbase's member type.
905         (binfo_for_vbase): Declare.
906         * class.c (determine_primary_base, base_derived_from,
907         update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
908         warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
909         build_vtbl_initializer): Adjust.
910         * decl.c (xref_basetypes): Adjust, accumulate upper bound of
911         vbases.
912         * init.c (sort_mem_initializers, expand_member_init,
913         push_base_cleanups): Adjust.
914         * method.c (do_build_copy_constructor): Adjust.
915         * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
916         (binfo_for_vbase): New.
917         * tree.c (copy_base_binfos): Adjust.
918
919 2004-06-28  Mark Mitchell  <mark@codesourcery.com>
920
921         * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
922
923 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
924
925         PR c++/14123
926         * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
927         paranthesis in case of pointers to array members.
928         * error.c (dump_type_prefix): Likewise.
929         (dump_type_suffix): Maybe issue a whitespace when printing
930         ARRAY_TYPE.
931
932 2004-06-27  Mark Mitchell  <mark@codesourcery.com>
933
934         PR c++/16193
935         * parser.c (cp_parser_set_decl_spec_type): Refine test for
936         redefinition of built-in types.
937
938 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
939
940         * error.c (pp_template_argument_list_start): Remove.
941         (pp_template_argument_list_end): Likewise.
942         (pp_separate_with_comma): Use pp_cxx_separate_with.
943         (reinit_global_formatting_buffer): Remove.
944         (pp_non_consecutive_character): Likewise.
945         (dump_scope): Use pp_cxx_colon_colon.
946         (dump_template_parameter): Use pp_cxx_identifier,
947         pp_cxx_tree_identifier and pp_cxx_whitespace.
948         (dump_templat_bindings): Replace use of pp_string with sequence
949         of pp_cxx_whitespace and pp_equal.
950         (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
951         pp_cxx_colon_colon, pp_cxx_whitespace throughout.  Don't set
952         padding here.
953         (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
954         (dump_type_prefix): Don't set padding.  Use pp_cxx_whitespace,
955         pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
956         (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
957         pp_cxx_right_bracket, pp_cxx_identifier throughout,
958         (dump_decl): Likewise.
959         (dump_template_decl): Likewise.
960         (dump_function_decl): Likewise.  Set padding as appropriate.
961         (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
962         pp_cxx_right_paren.
963         (dump_exception_spec): Likewise.
964         (dump_function_name): Use pp_cxx_tree_identifier and
965         pp_cxx_identifier.
966         (dump_template_parms): Use pp_cxx_begin_template_argument_list and
967         pp_cxx_end_template_argument_list.
968         (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
969         pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
970         pp_cxx_whitespace throughout.
971         (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
972         pp_cxx_right_paren.
973         (dump_unary_op): Likewise.
974         (reinit_cxx_pp): New function.
975         (type_as_string); Use it.
976         (expr_as_string): Likewise.
977         (decl_as_string); Likewise.
978         (context_as_string): Likewise.
979         (lang_decl_name): Likewise.
980         (decl_to_string): Likewise.
981         (expr_to_string): Likewise.
982         (parm_to_string): Likewise.
983         (type_to_string): Likewise.
984         (args_to_string): Likewise.
985         (cv_to_string): Likewise.
986
987 2004-06-26  Mark Mitchell  <mark@codesourcery.com>
988
989         * cp-tree.h (cp_cv_quals): New type.
990         (cp_declarator): Use it instead of "tree" as appropriate.
991         (grok_method_quals): Adjust prototype.
992         (grokclassfn): Likewise.
993         (do_friend): Likewise.
994         * decl.c (grokfndecl): Use cp_cv_quals, not tree.
995         (grokdeclarator): Likewise.
996         * decl2.c (grok_method_quals): Likewise.
997         (grokclassfn): Likewise.
998         * friend.c (do_friend): Likewise.
999         * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
1000         * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
1001         (make_pointer_declarator): Likewise.
1002         (make_reference_declarator): Likewise.
1003         (make_ptrmem_declarator): Likewise.
1004         (cp_parser_ptr_operator): Likewise.
1005         (cp_parser_cv_qualifier_seq_opt): Likewise.
1006         (cp_parser_cv_qualifier_opt): Remove.
1007         (cp_parser_new_declarator_opt): Adjust call to
1008         cp_parser_ptr_operator.
1009         (cp_parser_conversion_declaration_opt): Likewise.
1010         (cp_parser_declarator): Use cp_cv_quals, not tree.
1011         (cp_parser_direct_declarator): Likewise.
1012
1013 2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1014
1015         * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
1016         Rename DECL_STMT to DECL_EXPR.
1017         * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
1018         * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
1019         * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
1020
1021 2004-06-26  Jan Hubicka  <jh@suse.cz>
1022
1023         PR C++/14865
1024         * decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
1025         reachability analysis.
1026
1027 2004-06-25  Mark Mitchell  <mark@codesourcery.com>
1028
1029         * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
1030         2004-06-23 change.
1031
1032 2004-06-25  Paul Brook  <paul@codesourcery.com>
1033
1034         * decl2.c (get_guard): Call targetm.cxx.guard_type.
1035         (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
1036
1037 2004-06-24  Mark Mitchell  <mark@codesourcery.com>
1038
1039         * decl.c (grokdeclarator): Restore error messages about __thread.
1040         * parser.c (cp_parser_decl_specifier_seq): Likewise.
1041
1042 2004-06-24  Jason Merrill  <jason@redhat.com>
1043
1044         PR c++/16115
1045         * decl.c (grokparms): Give the PARM_DECL reference type if the
1046         parameter is passed by invisible reference.
1047
1048 2004-06-24  Andreas Schwab  <schwab@suse.de>
1049
1050         * cp-tree.h (enum cp_storage_class): Remove trailing comma.
1051
1052 2004-06-23  Mark Mitchell  <mark@codesourcery.com>
1053
1054         * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
1055         (cp/decl.o): Likewise.
1056         (cp/decl2.o): Likewise.
1057         (cp/pt.o): Likewise.
1058         (cp/semantics.o): Likewise.
1059         * config-lang.in (gtfiles): Do not reference cp/lex.h.
1060         * class.c: Do not include lex.h.
1061         (add_implicitly_declared_members): Do not use
1062         adding_implicit_members.
1063         (check_bases_and_members): Do not talk about grok_x_components.
1064         * cp/cp-tree.h (adding_implicit_members): Remove.
1065         (cp_storage_class): New type.
1066         (cp_decl_spec): Likewise.
1067         (cp_decl_specifier_seq): Likewise.
1068         (cp_parameter_declarator): Use it for the decl_specifiers field.
1069         (check_tag_decl): Adjust prototype.
1070         (shadow_tag): Likewise.
1071         (groktypename): Likewise.
1072         (start_decl): Likewise.
1073         (start_function): Likewise.
1074         (start_method): Likewise.
1075         (grok_x_components): Remove.
1076         (grokfield): Adjust prototype.
1077         (grokbitfield): Likewise.
1078         (finish_member_class_template): Remove.
1079         * decl.c: Do not include lex.h.
1080         (adding_implicit_members): Do not define.
1081         (check_tag_decl): Do not use trees to represent decl-specifiers.
1082         (shadow_tag): Likewise.
1083         (groktypename): Likewise.
1084         (start_decl): Likewise.
1085         (grokvardecl): Likewise.
1086         (grokdeclarator): Likewise.
1087         (grokparms): Likewise.
1088         (start_function): Likewise.
1089         (start_method): Likewise.
1090         * decl.h (grokdeclarator): Adjust prototype.
1091         * decl2.c: Do not include lex.h.
1092         (grok_x_components): Remove.
1093         (grokfield): Do not use trees to represent decl-specifiers.
1094         (grokbitfield): Likewise.
1095         * lex.c: Do not include lex.h.
1096         * lex.h: Remove.
1097         * parser.c: Include target.h.
1098         (clear_decl_specs): New function.
1099         (cp_parser_translation_unit): Do not use trees to represent
1100         decl-specifiers.
1101         (cp_parser_postfix_expression): Likewise.
1102         (cp_parser_new_type_id): Likewise.
1103         (cp_parser_condition): Likewise.
1104         (cp_parser_simple_declaration): Likewise.
1105         (cp_parser_decl_specifier_seq): Likewise.
1106         (cp_parser_function_specifier_opt): Likewise.
1107         (cp_parser_conversion_type_id): Likewise.
1108         (cp_parser_template_parameter): Likewise.
1109         (cp_parser_explicit_instantiation): Likewise.
1110         (cp_parser_type_specifier): Likewise.
1111         (cp_parser_simple_type_specifier): Likewise.
1112         (cp_parser_init_declarator): Likewise.
1113         (cp_parser_type_id): Likewise.
1114         (cp_parser_type_specifier_seq): Likewise.
1115         (cp_parser_parameter_declaration): Likewise.
1116         (cp_parser_member_declaration): Likewise.
1117         (cp_parser_exception_declaration): Likewise.
1118         (cp_parser_function_definition_from_specifiers_and_declarator):
1119         Likewise.
1120         (cp_parser_single_declaration): Likewise.
1121         (cp_parser_save_member_function_body): Likewise.
1122         (cp_parser_friend_p): Likewise.
1123         (cp_parser_set_storage_class): New function.
1124         (cp_parser_set_decl_spec_type): Likewise.
1125         * pt.c: Do not include lex.h.
1126         * semantics.c: Likewise.
1127         (finish_member_class_template): Remove.
1128
1129 2004-06-23  Roger Sayle  <roger@eyesopen.com>
1130
1131         * call.c (build_cxx_call): Don't call expand_tree_builtin.  No
1132         longer take both "args" and "convert_args" as arguments.
1133         (build_op_delete_call): Update call to build_cxx_call.
1134         (build_over_call): Likewise, update call to build_cxx_call.
1135         * cp-tree.h (build_cxx_call): Update funtion prototype.
1136         * typeck.c (build_function_call): Don't call expand_tree_builtin.
1137         * rtti.c (throw_bad_cast): Update call to build_cxx_call.
1138         (throw_bad_typeid): Likewise.
1139         (build_dynamic_cast_1): Likewise.
1140
1141 2004-06-22  Richard Henderson  <rth@redhat.com>
1142
1143         * class.c (build_vfn_ref): Take a pointer not object.  Build
1144         an OBJ_TYPE_REF.
1145         (cp_fold_obj_type_ref): New.
1146         * call.c (build_over_call): Update build_vfn_ref call.
1147         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
1148         * cp-tree.h (cp_fold_obj_type_ref): Declare.
1149
1150 2004-06-21  Jason Merrill  <jason@redhat.com>
1151
1152         PR c++/16112
1153         * cp-gimplify.c (cp_gimplify_init_expr): Look through
1154         CLEANUP_POINT_EXPR.
1155
1156 2004-06-21  Mark Mitchell  <mark@codesourcery.com>
1157
1158         * cp-tree.def (NEW_EXPR): Add a fourth slot.
1159         * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
1160         (TREE_PARMLIST): Likewise.
1161         (CALL_DECLARATOR_PARMS): Likewise.
1162         (CALL_DECLARATOR_QUALS): Likewise.
1163         (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
1164         (cp_declarator_kind): New type.
1165         (cp_parameter_declarator): Likewise.
1166         (cp_declarator): Likewise.
1167         (cp_error_declarator): Likewise.
1168         (no_parameters): Likewise.
1169         (groktypename): Change prototype.
1170         (start_decl): Likewise.
1171         (start_handler_parms): Likewise.
1172         (get_scope_of_declarator): Likewise.
1173         (start_function): Likewise.
1174         (start_preparsed_function): New function.
1175         (start_function): Change prototype.
1176         (start_method): Likewise.
1177         (grokfield): Likewise.
1178         (grokbitfield): Likewise.
1179         (build_new): Likewise.
1180         (make_pointer_declarator): Remove.
1181         (make_reference_declarator): Likewise.
1182         (make_call_declarator): Likewise.
1183         (set_quals_and_spec): Likewise.
1184         (process_template_parm): Change prototype.
1185         (begin_function_definition): Remove.
1186         (finish_parmlist): Remove.
1187         * decl.c (groktypename): Do not use trees to represent
1188         declarators.
1189         (start_decl): Likewise.
1190         (start_handler_parms): Remove.
1191         (get_scope_of_declarator): Reimplement.
1192         (grokdeclarator): Do not use trees to represent declarators.
1193         (grokparms): Likewise.
1194         (start_function): Likewise.
1195         (start_method): Likewise.
1196         (build_void_list_mode): Do not use TREE_PARMLIST.
1197         * decl.h (grokdeclarator): Change prototype.
1198         * decl2.c (grok_method_quals): Robustify.
1199         (grok_x_components): Do not use trees to represent declarators.
1200         (grokfield): Likewise.
1201         (grokbitfield): Likewise.
1202         (start_objects): Build FUNCTION_DECLs, not declarators.
1203         (start_static_storage_duration_function): Likewise.
1204         * init.c (build_new): Simplify.
1205         * lex.c (make_pointer_declarator): Remove.
1206         (make_reference_declarator): Likewise.
1207         (make_call_declarator): Likewise.
1208         (set_quals_and_spec): Likewise.
1209         * method.c (use_thunk): Use start_preparsed_function.
1210         (synthesize_method): Likewise.
1211         (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
1212         * optimize.c (maybe_clone_body): Use start_preparsed_function.
1213         * parser.c (cp_error_declarator): New variable.
1214         (declarator_obstack): Likewise.
1215         (alloc_declarator): New function.
1216         (make_declarator): Likewise.
1217         (make_id_declarator): Likewise.
1218         (make_pointer_declarator): Likewise.
1219         (make_reference_declarator): Likewise.
1220         (make_ptrmem_declarator): Likewise.
1221         (make_call_declarator): Likewise.
1222         (make_array_declarator): Likewise.
1223         (no_parameters): New variable.
1224         (make_parameter_declarator): Likewise.
1225         (cp_parser_check_for_definition_in_return_type): Do not use trees
1226         to represent declarators.
1227         (cp_parser_translation_unit): Likewise.
1228         (cp_parser_new_expression): Likewise.
1229         (cp_parser_new_type_id): Likewise.
1230         (cp_parser_new_declarator_opt): Likewise.
1231         (cp_parser_direct_new_declarator): Likewise.
1232         (cp_parser_condition): Likewise.
1233         (cp_parser_declaration_statement): Likewise.
1234         (cp_parser_declaration): Likewise.
1235         (cp_parser_conversion_type_id): Likewise.
1236         (cp_parser_conversion_declarator_opt): Likewise.
1237         (cp_parser_template_parameter_list): Likewise.
1238         (cp_parser_template_parameter): Likewise.
1239         (cp_parser_explicit_instantiation): Likewise.
1240         (cp_parser_init_declarator): Likewise.
1241         (cp_parser_declarator): Likewise.
1242         (cp_parser_direct_declarator): Likewise.
1243         (cp_parser_type_id): Likewise.
1244         (cp_parser_parameter_declaration_clause): Likewise.
1245         (cp_parser_parameter_declaration_list): Likewise.
1246         (cp_parser_parameter_declaration): Likewise.
1247         (cp_parser_member_declaration): Likewise.
1248         (cp_parser_exception_declaration): Likewise.
1249         (cp_parser_check_declarator_template_parameters): Likewise.
1250         (cp_parser_function_definition_from_specifiers_and_declarator):
1251         Likewise.
1252         (cp_parser_save_member_function_body): Likewise.
1253         * pt.c (process_template_parm): Add is_non_type parameter.
1254         (convert_template_argument): Adjust call to groktypename.
1255         (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
1256         (tsubst): Do not expect declarators.
1257         (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
1258         argument.
1259         (instantiate_decl): Use start_preparsed_function.
1260         * semantics.c (begin_function_definition): Remove.
1261         (finish_parmlist): Remove.
1262         * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
1263         declarators.
1264
1265 2004-06-21  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
1266
1267         * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
1268         (build_new_method_call): Likewise.
1269         * decl.c (local_variable_p_walkfn): Don't walk into types.
1270         * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
1271         (build_anon_union_vars): Add new operand for COMPONENT_REF.
1272         * init.c (buld_new): Add new operand for ARRAY_REF.
1273         * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
1274         (do_build_assign_ref): Likewise.
1275         * parser.c (cp_parser_direct_new_declarator): Add new operands
1276         for ARRAY_REF.
1277         (cp_parser_direct_declarator): Likewise.
1278         * pt.c (tsubst): Likewise.
1279         (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
1280         for COMPONENT_REF.
1281         * semantics.c (finish_non_static_data_member): Add new operand
1282         for COMPONENT_REF.
1283         * typeck.c (build_class_member_access_expr): Likewise.
1284         (build_class_member_access_expr, finish_class_member_access_expr):
1285         Likewise.
1286         (build_ptrmemfunc_access_expr): Likewise.
1287         (build_array_ref): Add new operands for ARRAY_REF.
1288         * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
1289         * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
1290
1291 2004-06-21  Richard Henderson  <rth@redhat.com>
1292
1293         * dump.c (cp_dump_tree): Don't use dump_next_stmt.
1294         * parser.c (cp_parser_jump_statement): Update commentary.
1295         * pt.c (tsubst_expr): Use RETURN_EXPR.
1296         * semantics.c (finish_return_stmt): Likewise.
1297         (finalize_nrv_r): Likewise.
1298         * typeck.c, typeck2.c: Update file start commentary.
1299
1300 2004-06-21  Richard Henderson  <rth@redhat.com>
1301
1302         * semantics.c (finish_expr_stmt): Call verify_sequence_points.
1303
1304 2004-06-20  Richard Henderson  <rth@redhat.com>
1305
1306         * cp-tree.h (add_decl_stmt): Declare.
1307         * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
1308         * semantics.c (maybe_cleanup_point_expr): New.
1309         (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
1310         finish_for_expr, finish_switch_cond): Use it.
1311         (finalize_nrv_r): Don't build an EXPR_STMT.  Don't frob TREE_CHAIN.
1312
1313 2004-06-20  Richard Henderson  <rth@redhat.com>
1314
1315         * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
1316         * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
1317         (cp_gimplify_expr): Call it.
1318         (gimplify_cleanup_stmt): Move from c-gimplify.c.
1319         (cp_genericize): New.
1320         * decl.c (finish_function): Call it.
1321         * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
1322         (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
1323         (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
1324         (cp_genericize): Declare.
1325         * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
1326         * dump.c (cp_dump_tree): Likewise.
1327         * semantics.c (push_cleanup): Move from c-semantics.c.
1328
1329 2004-06-20  Zack Weinberg  <zack@codesourcery.com>
1330
1331         * cp-lang.c (has_c_linkage): Implement.
1332
1333         * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
1334         * decl.c (duplicate_decls): Use COPY_DECL_RTL.
1335         (builtin_function_1): Don't call make_decl_rtl.
1336         (build_cp_library_fn): Don't call set_mangled_name_for_decl.
1337         (grokvardecl): Don't call mangle_decl.
1338         * except.c (nothrow_libfn_p): Look at DECL_NAME, not
1339         DECL_ASSEMBLER_NAME.
1340         * method.c (set_mangled_name_for_decl): Delete.
1341         * name-lookup.c (pushdecl): When a local extern shadows a
1342         file-scope declaration of the same object, give both DECLs the
1343         same DECL_UID.
1344         * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
1345         on DECL_ASSEMBLER_NAME.
1346
1347 2004-06-19  Richard Henderson  <rth@redhat.com>
1348
1349         * cp-gimplify.c: Remove unnecessary prototypes.
1350         (cp_gimplify_stmt): Merge into ...
1351         (cp_gimplify_expr): ... here.  Move to end of file.  Handle
1352         stmts_are_full_exprs_p frobbing.
1353         * cp-tree.h (cp_gimplify_stmt): Remove.
1354         * pt.c (tsubst_expr): Merge prep_stmt and unify.
1355         * tree.c (init_tree): Don't set lang_gimplify_stmt.
1356
1357 2004-06-18  Richard Henderson  <rth@redhat.com>
1358
1359         PR c++/16034
1360         * semantics.c (begin_cond): New.
1361         (finish_cond): Rewrite to handle template DECL_STMTs specially.
1362         Assume that non-template decls go land before the conditional.
1363         (simplify_loop_decl_cond): Likewise.
1364         (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
1365         finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
1366         begin_switch_stmt, finish_switch_cond): Update to match.
1367
1368 2004-06-17  Jason Merrill  <jason@redhat.com>
1369
1370         PR c++/16015
1371         * semantics.c (simplify_aggr_init_expr): Don't return the slot.
1372         (finish_stmt_expr_expr): Update type after conversions.
1373         (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
1374         Handle void initializer.
1375         * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
1376
1377 2004-06-17  Geoffrey Keating  <geoffk@apple.com>
1378
1379         * class.c (build_clone): Don't call defer_fn, let mark_used do it.
1380         * cp-tree.h (defer_fn): Delete.
1381         * decl2.c (defer_fn): Delete.
1382         (finish_file): Simplify deferred_fns loops; check that
1383         only used inline functions get into deferred_fns.
1384         (mark_used): Inline previous contents of defer_fn.
1385
1386 2004-06-16  Richard Henderson  <rth@redhat.com>
1387
1388         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
1389         (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
1390         * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
1391         of CTOR_INITIALIZER ...
1392         (pp_cxx_statement): ... here.
1393         * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
1394         (finish_function): Use alloc_stmt_list to zap entire function.
1395         * parser.c (cp_parser_compound_statement): Update commentary.
1396         * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
1397         * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
1398         (finish_stmt_expr): Don't look through COMPOUND_STMT.
1399
1400 2004-06-16  Geoffrey Keating  <geoffk@apple.com>
1401
1402         * pt.c (mark_decl_instantiated): Don't call defer_fn.
1403
1404 2004-06-16  Richard Henderson  <rth@redhat.com>
1405
1406         * parser.c (cp_parser_labeled_statement): Update commentary.
1407         * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
1408         * tree.c (mark_local_for_remap_r): Likewise.
1409
1410 2004-06-16  Richard Henderson  <rth@redhat.com>
1411
1412         * parser.c (cp_parser_asm_definition): Update commentary.
1413         * pt.c (tsubst_expr): Use ASM_EXPR.
1414         * semantics.c (finish_asm_stmt): Likewise.
1415
1416 2004-06-16  Richard Henderson  <rth@redhat.com>
1417
1418         * decl.c (finish_destructor_body): Use LABEL_EXPR.
1419         * parser.c (cp_parser_statement): Update commentary.
1420         * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
1421         * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
1422         * tree.c (mark_local_for_remap_r): Likewise.
1423
1424 2004-06-16  Richard Henderson  <rth@redhat.com>
1425
1426         PR c++/16012
1427         * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
1428         statement in FOR_INIT_STMT for templates.
1429
1430 2004-06-15  Richard Henderson  <rth@redhat.com>
1431
1432         * call.c (initialize_reference): Don't build CLEANUP_STMT here.
1433         * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
1434         (genericize_try_block): Use gimplify_stmt.
1435         (genericize_catch_block, genericize_eh_spec_block): Likewise.
1436         (cp_gimplify_init_expr): Remove STMT_EXPR special case.
1437         (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
1438         * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
1439         (cp_tree_chain_matters_p): Remove.
1440         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
1441         (COMPOUND_STMT_BODY_BLOCK): New.
1442         (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
1443         (EXPR_STMT_STMT_EXPR_RESULT): New.
1444         (building_stmt_tree): Check cur_stmt_list.
1445         (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
1446         (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
1447         * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
1448         (cp_finish_decl): Use push_cleanup.
1449         (start_function, finish_function): Use statement lists.
1450         (finish_stmt): Do nothing.
1451         * except.c (begin_eh_spec_block): Use statement lists.
1452         (check_handlers_1, check_handlers): Likewise.
1453         * init.c (construct_virtual_base): Don't add extra compound stmts.
1454         (build_vec_init): Likewise.
1455         * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
1456         * name-lookup.h (struct cp_binding_level): Add statement_list.
1457         * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
1458         (cp_parser_labeled_statement, cp_parser_expression_statement,
1459         cp_parser_statement_seq_opt): Likewise.
1460         (cp_parser_compound_statement): Likewise.  Take bool for try block.
1461         (cp_parser_selection_statement): Tidy if processing.
1462         (cp_parser_already_scoped_statement): Rewrite to do what it says.
1463         * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
1464         (tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
1465         Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
1466         * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
1467         (finish_cond): New, rewritten from FINISH_COND.
1468         (simplify_loop_decl_cond): New.
1469         (finish_expr_stmt): Avoid nested EXPR_STMTs.
1470         (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
1471         begin_else_clause, finish_else_clause, finish_if_stmt,
1472         begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
1473         begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
1474         finish_for_cond, finish_for_stmt, begin_switch_stmt,
1475         finish_switch_cond, finish_switch_stmt, begin_try_block,
1476         finish_try_block, finish_cleanup_try_block, finish_function_try_block,
1477         finish_handler_sequence, finish_function_handler_sequence,
1478         begin_handler, finish_handler_parms, finish_handler,
1479         begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
1480         using statement lists.
1481         (begin_compound_stmt): Replace has_no_scope argument with flags.
1482         Update all callers.  Use statement lists.
1483         (finish_compound_stmt): Likewise.
1484         (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
1485         (current_scope_stmt_stack): Remove.
1486         (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
1487         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
1488         Rewrite with statement lists.
1489
1490 2004-06-15  Alexandre Oliva  <aoliva@redhat.com>
1491
1492         * parser.c: Change all assignments of c_lex_string_translate
1493         to true and false to 1 and 0.
1494         (cp_lexer_read_token): Convert type of the translated string.
1495         (cp_parser_skip_to_closing_parentheses): Preserve original
1496         value of c_lex_string_translate, and set it to -1 while
1497         running.
1498         (cp_parser_cache_group): Likewise.
1499         (cp_parser_cache_group_1): Renamed.
1500         (cp_parser_asm_operand_list): Remove redundant setting of
1501         c_lex_string_translate.
1502         (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
1503         Handle chained strings.
1504
1505 2004-06-12  Andrew Pinski  <apinski@apple.com>
1506
1507         PR c++/14639
1508         Revert:
1509         2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
1510
1511                 * cp-tree.h: Fix typo.
1512
1513                 * cp-tree.h: Include cgraph.h
1514                 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
1515                 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
1516
1517 2004-06-12  Jason Merrill  <jason@redhat.com>
1518
1519         PR tree-optimization/14107
1520         * decl.c (finish_function): Warn about no return in all functions.
1521
1522 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
1523
1524         * cp-tree.h (struct language_function): Remove cannot_inline.
1525         * decl.c (save_function_data): cannot_inline is no more.
1526         (cxx_push_function_context): Likewise.
1527         * decl2.c (start_objects, start_static_storage_duration_function):
1528         Reset DECL_INLINE, set DECL_UNINLINABLE.
1529
1530 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1531
1532         PR c++/15967
1533         * search.c (lookup_field): Propagate the ambiguity list.
1534         (lookup_fnfields): Likewise.
1535
1536 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1537
1538         PR c++/15947
1539         * parser.c (cp_parser_template_name): Ctors/dtors never need a
1540         template keyword to disambiguate.
1541
1542 2004-06-14  Mark Mitchell  <mark@codesourcery.com>
1543
1544         PR c++/15096
1545         * decl.c (grokdeclarator): Ignore pointer-to-members when
1546         computing template depth.
1547
1548         PR c++/14930
1549         * name-lookup.c (pushtag): Do not try to put class declarations in
1550         explicit specialization scopes.
1551
1552 2004-06-11  Andrew Pinski  <pinskia@physics.uc.edu>
1553
1554         * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
1555
1556 2004-06-11  Mark Mitchell  <mark@codesourcery.com>
1557
1558         PR c++/15862
1559         * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
1560         bindings for undeclared built-ins.
1561
1562 2004-06-11  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1563
1564         * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
1565         appear at the correct location.
1566
1567 2004-06-10  Jason Merrill  <jason@redhat.com>
1568
1569         PR c++/15875
1570         Revert:
1571         2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1572         * init.c (build_offset_ref): Build SCOPE_REF with non-null
1573         TREE_TYPE for non-dependent names.
1574         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
1575         unknown_type_node as its TREE_TYPE.
1576         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
1577         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
1578         (dump_expr) <SCOPE_REF case>: Likewise.
1579
1580 2004-06-10  Mark Mitchell  <mark@codesourcery.com>
1581
1582         PR c++/15227
1583         * parser.c (cp_parser_direct_declarator): Robustify.
1584
1585         PR c++/15877
1586         * pt.c (tsubst_copy): Use decl_constant_value on enumeration
1587         constants in non-dependent contexts.
1588
1589         PR c++/14211
1590         PR c++/15076
1591         * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
1592         necessary.
1593
1594 2004-06-10  Jakub Jelinek  <jakub@redhat.com>
1595
1596         PR c++/14791
1597         * decl.c (duplicate_decls): Handle fileptr_type_node arguments
1598         specially.
1599
1600 2004-06-09  Mark Mitchell  <mark@codesourcery.com>
1601
1602         Revert:
1603         PR c++/15815
1604         2004-06-07  Mark Mitchell  <mark@codesourcery.com>
1605         * lex.c (handle_pragma_interface): Deprecate.
1606         (handle_pragma_implementation): Likewise.
1607
1608 2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>
1609
1610         * g++spec.c (lang_specific_driver): Remove check for -lm
1611         and -lmath when check it see if it was the math library.
1612
1613 2004-06-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1614
1615         PR c++/7841
1616         * parser.c (cp_parser_direct_declarator): Reject constructor named
1617         as qualified template-id.
1618
1619 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
1620
1621         PR c++/15815
1622         * lex.c (handle_pragma_interface): Deprecate.
1623         (handle_pragma_implementation): Likewise.
1624
1625 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
1626
1627         PR c++/15766
1628         * parser.c (cp_parser_iteration_statement): Fix typo in error
1629         message.
1630
1631         PR c++/14777
1632         * pt.c (tsubst_default_argument): Do not defer access checks
1633         while substituting into the default argument.
1634
1635         PR c++/15554
1636         * pt.c (tsubst_copy): Do not try to substitute for an enumeration
1637         constant in a non-dependent context.
1638
1639         PR c++/15057
1640         * except.c (build_throw): Ensure that temp_expr has been
1641         initialized.
1642
1643 2004-06-06  Roger Sayle  <roger@eyesopen.com>
1644
1645         * cp/cp-tree.h (lvalue_or_else): Add function prototype.
1646
1647 2004-06-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1648
1649         PR c++/15503
1650         * parser.c (cp_parser_mem_initializer_id): Gracefully reject
1651         'typename', and accept 'template'.
1652
1653 2004-06-03  Andrew Pinski  <pinskia@physics.uc.edu>
1654             Jan Hubicka  <jh@suse.cz>
1655
1656         PR c++/14639
1657         * method.c (use_think): Do not mark thunk as referenced.
1658
1659 2004-06-03  Matt Austern  <austern@apple.com>
1660
1661         PR c++/15428
1662         * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
1663         is nonzero, and if we see a noninline definition of a key method,
1664         make the vtables nonweak.
1665
1666 2004-06-02  Matt Austern  <austern@apple.com>
1667
1668         * cp-tree.h (instantiate_decl): new boolean parameter,
1669         undefined_ok. Current behavior is equivalent to its being 0.
1670         * decl2.c (mark_used): Add new argument when calling instantiate_decl
1671         * pt.c (mark_decl_instantiated): Unconditionally make
1672         instantiations explicit unconditionally
1673         (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
1674         since mark_decl_instantiated now does it.
1675         (instantiate_class_member): New.  Instantiate a member of an
1676         explicitly instantiated class template.
1677         (do_type_instantiation): Explicitly instantiate members of an
1678         explicitly instantiated class template.
1679         (instantiate_decl): if undefined_ok is nonzero, and if we're
1680         trying to explicitly instantiated a template with no definition,
1681         change it to an implicit instantiation.
1682         (instantiate_pending_templates): Add new argument to instantiate_decl.
1683         * tree.c (cp_cannot_inline_tree_fn): Likewise.
1684
1685 2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
1686
1687         * cp-tree.h: Fix typo.
1688
1689         * cp-tree.h: Include cgraph.h
1690         (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
1691         TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
1692
1693 2004-06-01  Jason Merrill  <jason@redhat.com>
1694
1695         PR c++/15142
1696         * call.c (call_builtin_trap): Remove type parm.
1697         (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
1698         (build_x_va_arg): Dereference a null pointer for a non-POD argument.
1699
1700 2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1701
1702         PR c++/13092
1703         * init.c (build_offset_ref): Build SCOPE_REF with non-null
1704         TREE_TYPE for non-dependent names.
1705         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
1706         unknown_type_node as its TREE_TYPE.
1707         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
1708         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
1709         (dump_expr) <SCOPE_REF case>: Likewise.
1710
1711 2004-06-01  Richard Henderson  <rth@redhat.com>
1712             Andrew Pinski  <pinskia@physics.uc.edu>
1713
1714         * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
1715         * parser.c (struct cp_parser): Remove in_offsetof.
1716         (cp_parser_new): Don't set it.
1717         (cp_parser_unary_expression): Don't check it.
1718         (cp_parser_postfix_open_square_expression): Split out from ...
1719         (cp_parser_postfix_expression): ... here.
1720         (cp_parser_postfix_dot_deref_expression): Likewise.
1721         (cp_parser_builtin_offsetof): New.
1722         (cp_parser_primary_expression): Use it.
1723
1724 2004-06-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1725
1726         PR c++/14932
1727         * parser.c (cp_parser_postfix_expression): Allow subscript
1728         operator in offsetof.
1729
1730 2004-05-31  Mark Mitchell  <mark@codesourcery.com>
1731
1732         PR c++/15701
1733         * friend.c (add_friend): Do not try to perform access checks for
1734         functions from dependent classes.
1735
1736 2004-05-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1737
1738         * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
1739         (pp_cxx_begin_template_argument_list): Turn into a function.
1740         (pp_cxx_end_template_argument_list): Likewise.
1741         (pp_cxx_separate_with): Define.
1742         (pp_cxx_unqualified_id): Tidy.
1743         (pp_cxx_primary_expression): Likewise.
1744         (pp_cxx_postfix_expression): Likewise.
1745         (pp_cxx_expression): Likewise.
1746         (pp_cxx_simple_type_specifier): Likewise.
1747         (pp_cxx_type_specifier_seq): Likewise.
1748         (pp_cxx_parameter_declaration_clause): Likewise.
1749         (pp_cxx_exception_specification): Likewise.
1750         (pp_cxx_direct_declarator): Likewise.
1751         (pp_cxx_type_id): Likewise.
1752         * cxx-pretty-print.h (pp_cxx_whitespace): Export from
1753         cxx-pretty-print.c.
1754         (pp_cxx_left_paren): Likewise.
1755         (pp_cxx_right_paren): Likewise.
1756         (pp_cxx_left_brace): Likewise.
1757         (pp_cxx_right_brace): Likewise.
1758         (pp_cxx_left_bracket): Likewise.
1759         (pp_cxx_right_bracket): Likewise.
1760         (pp_cxx_dot): Likewise.
1761         (pp_cxx_identifier): Likewise.
1762         (pp_cxx_tree_identifier): Likewise.
1763         (pp_cxx_ampersand): New macro.
1764         (pp_cxx_star): Likewise.
1765         (pp_cxx_arrow): Likewise.
1766         (pp_cxx_semicolon): Likewise.
1767         (pp_cxx_complement): Likewise.
1768         (pp_cxx_begin_template_argument_list): Declaree.
1769         (pp_cxx_end_template_argument_list): Likewise.
1770         (pp_cxx_colon_colon): likewise.
1771
1772 2004-05-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
1773
1774         * parser.c (cp_parser_simple_type_specifier): Explicitly test
1775         against NULL_TREE.
1776
1777 2004-05-31  Kazu Hirata  <kazu@cs.umass.edu>
1778
1779         * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
1780         typeck.c: Fix comment formatting.
1781
1782 2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>
1783
1784         * cp-lang.c (cp_expand_decl): Remove.
1785         (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
1786
1787 2004-05-30  Andreas Jaeger  <aj@suse.de>
1788
1789         * lang-specs.h: Add missing initializers for .ii.
1790
1791 2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
1792
1793         * decl.c (cp_make_fname_decl): Free return value from
1794         fname_as_string.
1795
1796 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
1797
1798         PR c++/15083
1799         * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
1800         even in a templat.e
1801         * init.c (build_new): Likewise.
1802
1803         PR c++/15640
1804         * name-lookup.c (arg_assoc): Robustify.
1805
1806         PR c++/15471
1807         * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
1808         when determining the scope to use for a pointer to member.
1809         (lookup_anon_field): Give it external linkage.
1810         * cp-tree.h (lookup_anon_field): Declare it.
1811         * expr.c (cplus_expand_constant): Use it.
1812
1813 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
1814
1815         PR c++/14668
1816         * parser.c (cp_parser_simple_type_specifier): Call
1817         maybe_note_name_used_in_class.
1818
1819 2004-05-28  Tom Marshall  <tmarshall@real.com>
1820
1821         PR c++/15214
1822         * class.c (finish_struct_1): Warn only if the dtor is non-private or
1823         the class has friends.
1824
1825 2004-05-27  Adam Nemet  <anemet@lnxw.com>
1826
1827         PR c++/12883
1828         * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
1829         TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
1830
1831 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
1832
1833         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
1834         if it might be needed.
1835         * pt.c (mark_decl_instantiated): Only call defer_fn if
1836         the function actually needs processing in finish_file.
1837         * decl2.c (finish_file): Add check that elements in
1838         deferred_fns_used are really needed there.  Remove unnecessary
1839         test of DECL_SAVED_TREE.
1840
1841 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
1842
1843         * Make-lang.in: No need to specify $(LIBCPP).
1844
1845 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
1846
1847         PR c++/15044
1848         * parser.c (cp_parser_class_head): Robustify.
1849
1850         PR c++/15317
1851         * parser.c (cp_parser_decl_specifier_seq): Correct error in
1852         comment.
1853         (cp_parser_constructor_declarator_p): Treat attributes
1854         as decl-specifiers.
1855
1856         PR c++/15329
1857         * typeck.c (build_unary_op): Do not attempt to resolve casts to
1858         base classes in templates.
1859
1860 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
1861
1862         PR c++/15165
1863         * pt.c (instantiate_template): Robustify.
1864
1865 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
1866
1867         PR c++/15025
1868         * decl.c (xref_tag): Issue errors about redeclaring template
1869         classes as non-template classes.
1870
1871 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
1872
1873         PR c++/14821
1874         * name-lookup.c (supplement_binding): Allow redefinitions of
1875         namespace aliases.
1876
1877         PR c++/14883
1878         * parser.c (cp_parser_template_argument): Robustify.
1879
1880 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1881
1882         * class.c (alter_access): Use %E format specifier to print an
1883         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
1884         (push_lang_context): Likewise.
1885         * decl.c (lookup_label): Likewise.
1886         (grokdeclarator): Likewise.
1887         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
1888         * pt.c (do_type_instantiation): Likewise.
1889         * tree.c (handle_java_interface_attribute): Likewise.
1890         (handle_com_interface_attribute): Likewise.
1891         (handle_init_priority_attribute): Likewise.
1892
1893 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
1894
1895         PR c++/15285
1896         PR c++/15299
1897         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
1898         recognized as overloaded functions.
1899
1900 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
1901
1902         PR c++/15507
1903         * class.c (layout_nonempty_base_or_field): Do not try to avoid
1904         layout conflicts for unions.
1905
1906         PR c++/15542
1907         * typeck.c (build_x_unary_op): Instantiate template class
1908         specializations before looking for "operator &".
1909
1910         PR c++/15427
1911         * typeck.c (complete_type): Layout non-dependent array types, even
1912         in templates.
1913
1914         PR c++/15287
1915         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
1916         template.
1917
1918 2004-05-22  Roger Sayle  <roger@eyesopen.com>
1919
1920         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
1921         returning when TREE_TYPE is error_mark_node.
1922         * typeck.c (require_complete_type): Return error_mark_node if
1923         value's type is an error_mark_node.
1924
1925 2004-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
1926
1927         * optimize.c (calls_setjmp_r): Remove.
1928         (calls_setjmp_p): Remove.
1929         * cp-tree.c (calls_setjmp_p): Remove.
1930         * decl.c (finish_function): Do not call calls_setjmp_p.
1931
1932 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
1933
1934         * decl.c (cp_finish_decl): Use mark_decl_referenced.
1935         * decl2.c (maybe_make_one_only): Likewise.
1936         * method.c (use_thunk): Likewise.
1937
1938 2004-05-18  Jason Merrill  <jason@redhat.com>
1939
1940         * class.c (build_base_path): Tidy a bit.
1941
1942 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
1943
1944         * name-lookup.c (struct scope_binding): New.
1945         (EMPTY_SCOPE_BINDING): New.
1946         (lookup_using_namespace): Take a scope_binding instead of a
1947         cxx_binding.
1948         (qualified_lookup_using_namespace): Likewise.
1949         (cxx_binding_clear): Delete.
1950         (do_nonmember_using_decl): Use a scope_binding instead of a
1951         cxx_binding.
1952         (lookup_tag): Don't call select_decl.
1953         (ambiguous_decl): Don't return anything (and change callers to match).
1954         Take a scope_binding as the second parameter.
1955         (lookup_namespace_name): Use a scope_binding instead of a
1956         cxx_binding.
1957         (unqualified_namespace_lookup): Likewise.
1958         (lookup_qualified_name): Likewise.
1959         (select_decl): Take a scope_binding instead of a cxx_binding.
1960         Use macros rather than hand-coding tests for type-ness.
1961
1962 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
1963
1964         * cp-gimplify.c: Rename from cp-simplify.c.
1965         * Make-lang.in, optimize.c: Update.
1966
1967 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
1968
1969         Merge from tree-ssa-20020619-branch.  See
1970         ChangeLog.tree-ssa for details.
1971
1972         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
1973         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
1974         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
1975         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
1976         Merged.
1977         * cp-mudflap.c: New file.
1978         * cp-simplify.c:: New file.
1979
1980 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1981
1982         PR c++/14389
1983         * decl2.c (check_classfn): For member templates, compare also the
1984         template parameters to match the declaration.
1985         * cp-tree.h: Adjust declaration of check_classfn.
1986         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
1987         * friend.c (do_friend): Likewise.
1988         * pt.c (tsubst_friend_function): Likewise.
1989
1990 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
1991
1992         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
1993         Instead, dig into the representation type to find the array bound.
1994
1995 2004-04-30  Jason Merrill  <jason@redhat.com>
1996
1997         Refer to base members using COMPONENT_REFs where possible.
1998         * class.c (build_simple_base_path): New fn.
1999         (build_base_path): Use it for non-virtual base references.
2000         (layout_class_type): Change base fields to their real type
2001         after layout is done.
2002         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
2003         * cp-lang.c (cxx_get_alias_set): Use it.
2004
2005 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
2006
2007         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
2008         comment typos.
2009
2010 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2011
2012         PR c++/15064
2013         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
2014         used in integral constant expressions.
2015
2016 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
2017
2018         * init.c (build_aggr_init): Fix accidental use of C99 construct in
2019         previous change.
2020
2021         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
2022         braced initializer.
2023         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
2024         * decl.c (reshape_init): Use it.
2025         * init.c (perform_member_init): Remove redundant condition.
2026         (build_aggr_init): Adjust to handle brace-enclosed initializers
2027         correctly.
2028         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
2029
2030         * parser.c (cp_parser_initializer_clause): Do not set
2031         TREE_HAS_CONSTRUCTOR on the initializer.
2032         * rtti.c (tinfo_base_init): Likewise.
2033         (generic_initializer): Likewise.
2034         (ptr_initializer): Likewise.
2035         (ptm_initializer): Likewise.
2036         (class_initializer): Likewise.
2037         (get_pseudo_ti_init): Likewise.
2038         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
2039
2040 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
2041
2042         * name-lookup.c (anonymous_namespace_name): Make static.
2043
2044 2004-04-19  Roger Sayle  <roger@eyesopen.com>
2045
2046         PR middle-end/14531
2047         * class.c (build_base_path): Call fold whilst building the NULL
2048         pointer check expression trees.
2049
2050 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
2051
2052         * init.c (build_new_1): Don't use type size argument for Java
2053         _Jv_AllocObject call.
2054
2055 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
2056
2057         * method.c (make_alias_for_thunk): Remove preprocessor guard on
2058         declaration and definition.
2059
2060 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
2061
2062         PR c++/14808
2063         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
2064         than ASM_OUTPUT_DEF.
2065
2066 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
2067
2068         * decl2.c (mark_used): Don't segfault if cfun != NULL but
2069         current_function_decl == NULL.
2070
2071 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
2072
2073         PR c++/3518
2074         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
2075         level.
2076
2077 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2078
2079         * init.c (decl_constant_value): Don't look at DECL_INITIAL
2080         of PARM_DECL.
2081         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
2082         or TREE_SIDE_EFFECTS of a type.
2083
2084 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
2085
2086         PR c++/14007
2087         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
2088         cv-qualifier unification.
2089         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
2090
2091 2004-04-02  Jan Hubicka  <jh@suse.cz>
2092
2093         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
2094         * cp-tree.h (cp_update_decl_after_saving): Declare.
2095         * tree.c (cp_update_decl_after_saving): Define.
2096
2097 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
2098
2099         PR c++/14803
2100         * typeck.c (get_delta_difference): Call fold before returning the
2101         value.
2102
2103 2004-04-01  Richard Henderson  <rth@redhat.com>
2104
2105         PR c++/14804
2106         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
2107         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
2108
2109 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
2110
2111         PR c++/14810
2112         * name-lookup.c (maybe_push_cleanup_level): Robustify.
2113
2114 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2115
2116         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
2117
2118 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2119
2120         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
2121         * class.c (check_bitfield_decl): Likewise.
2122         * cvt.c (type_promotes_to): Likewise.
2123         * decl.c (finish_enum): Likewise.
2124         * mangle.c (write_builtin_type): Likewise.
2125         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
2126         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
2127         (build_binary_op): Likewise.
2128
2129 2004-03-31  Jan Hubicka  <jh@suse.cz>
2130
2131         * tree.h (optimize_function): Kill prototype.
2132         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
2133         * semantics.c (expand_body): Kill.
2134
2135 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
2136
2137         PR c++/14724
2138         * decl.c (start_decl_1): Do not decide whether or not to create a
2139         new cleanup level until after the type has been completed.
2140
2141         PR c++/14763
2142         * pt.c (tsubst_default_argument): Clear current_function_decl.
2143
2144 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
2145
2146         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
2147
2148 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
2149
2150         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
2151         is null, just print the literal name and return.
2152
2153 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
2154
2155         * cxx-pretty-print.c: Fix comment typos.
2156
2157 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
2158
2159         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
2160         Update copyright.
2161
2162 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
2163
2164         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
2165         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
2166         target hook.
2167
2168 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
2169
2170         PR 12267, 12391, 12560, 13129, 14114, 14133
2171         * cp-lang.c (c_reset_state): Delete.
2172         (push_file_scope, pop_file_scope): New stubs.
2173         * parser.c (c_parse_file): Call sorry() here if called more than once.
2174
2175 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2176
2177         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
2178         for INTEGER_CST.
2179
2180 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2181
2182         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
2183
2184 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2185
2186         * error.c (enum pad): Remove.
2187         (dump_qualifiers): Likewise.
2188         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
2189         (dump_aggr_type): Likewise.
2190         (dump_type_suffix): Likewise.
2191         (dump_simple_decl): Likewise.
2192         (dump_function_decl): Likewise.
2193         (cv_to_string): Likewise.
2194         (dump_type_prefix): Likewise.  Adjust return void.
2195         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
2196         cxx_pretty_print.h.
2197         (pp_cxx_template_keyword_if_needed): Document.
2198         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
2199         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
2200         MUST_NOT_THROW_EXPR.
2201
2202 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
2203
2204         PR c++/14616
2205         * decl.c (cp_finish_decl): Compute the size of arrays declared in
2206         templates, if their type is non-dependent.
2207
2208 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
2209
2210         * call.c (build_op_delete_call): Do not forget the placement
2211         arguments when iterating through mutiple delete operators.
2212
2213         * cp-tree.h (svaed_scope): Remove last_parms.
2214         (NEW_DELETE_OPNAME_P): New macro.
2215         (last_function_parms): Remove.
2216         (do_friend): Adjust prototype.
2217         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
2218         using last_function_parms.
2219         (grokfndecl): Take the PARM_DECLs as an argument, rather than
2220         using last_function_parms.
2221         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
2222         for class-specific operator new and operator delete.
2223         (grok_op_properties): Do not look for allocation functions with
2224         METHOD_TYPEs.
2225         (start_function): Use DECL_ARGUMENTS instead of
2226         last_function_parms.
2227         * decl.h (last_function_parms): Do not declare.
2228         * decl2.c (grokclassfn): Do not use last_function_parms.
2229         * friend.c (do_friend): Remove parmdecls parameter.
2230         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
2231         (pop_from_top_level): Do not restore it.
2232         * pt.c (check_explicit_specialization): Do not adjust
2233         last_function_parms.
2234
2235         * name-lookup.c (do_local_using_decl): Create a local binding for
2236         types brought in via using declarations.
2237
2238         * name-lookup.c (lookup_arg_dependent): Handle block-scope
2239         function declarations correctly.
2240
2241         * semantics.c (finish_id_expression): Correct handling of
2242         conversion operators to dependent types.
2243
2244         * typeck.c (lookup_destructor): Allow the use of destructors from
2245         base classes.
2246
2247 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2248
2249         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
2250         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
2251         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
2252         the field is named TEMPLATE_TYPE_PARM_INDEX.
2253
2254 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2255
2256         PR c++/14545
2257         * parser.c (cp_parser_functional_cast): A cast to anything
2258         but integral or enumaration type is not an integral constant
2259         expression.
2260         * pt.c (value_dependent_expression_p): Handle cast expressions
2261         without operands (such as "int()").
2262
2263 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
2264
2265         * semantics.c (finish_pseudo_destructor_expr): Allow differing
2266         cv-qualification between the type named by the
2267         pseudo-destructor-name and the object-type.
2268
2269         * search.c (accessible_base_p): Handle non-proper bases.
2270
2271         * name-lookup.c (do_nonmember_using_decl): If a using declaration
2272         refers to a single overloaded function, set the type of the
2273         function.
2274         * tree.c (lvalue_type): Simplify.
2275         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
2276         unknown type.
2277         (build_unary_op): Handle OVERLOADs with known types.
2278
2279         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
2280         function templates.
2281
2282         * parser.c (cp_parser_postfix_expression): Handle the use of
2283         "typename" in non-dependent contexts.  Convert appropriately when
2284         when using a qualified name after "->" or ".".
2285
2286         * call.c (conditional_conversion): Honor the requirement that some
2287         conversions refer to the original object.
2288
2289 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
2290
2291         * call.c (build_conditional_expr): Do not call force_rvalue for
2292         operands of void_type when the conditional expression itself has
2293         void type.
2294         * name-lookup.c (pushdecl): Don't consider a declaration of a
2295         function named "main" to be an overload of a type named "main".
2296         * parser.c (cp_parser_template_name): Perform name lookup when the
2297         template name is proceeded by "template" if the qualifying scope
2298         is non-dependent.
2299         * typeck.c (composite_pointer_type_r): Correctly handle
2300         pointer-to-member types.
2301         (build_const_cast): Likewise.
2302
2303 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
2304
2305         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
2306         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
2307         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
2308         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
2309         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
2310         (TYPEOF_TYPE_EXPR): New macro.
2311         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
2312         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
2313         * pt.c (tsubst): Likewise.
2314         * semantics.c (finish_typeof): Likewise.
2315         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
2316         and TEMPLATE_TYPE_PARM.
2317         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
2318         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
2319
2320 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
2321
2322         PR c++/14586
2323         * cp-tree.h (build_new_op): Change prototype.
2324         (build_x_binary_op): Likewise.
2325         * call.c (build_new_op): Add overloaded_p parameter.
2326         * decl2.c (grok_array_decl): Adjust call to build_new_op.
2327         * parser.c (cp_parser_binary_expression): Note that uses of
2328         overloaded operators prevents an expression from being considered
2329         an integral constant.
2330         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
2331         build_x_binary_op.
2332         * semantics.c (finish_call_expr): Likewise.
2333         * typeck.c (rationalize_conditional_expr): Likewise.
2334         (build_x_indirect_ref): Likewise.
2335         (build_x_binary_op): Likewise.
2336         (build_x_unary_op): Likewise.
2337         (build_x_compound_expr): Likewise.
2338         (build_modify_expr): Likewise.
2339         * typeck2.c (build_x_arrow): Likewise.
2340
2341 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
2342
2343         * cp-lang.c, ptree.c: Update copyright.
2344
2345 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
2346
2347         PR c++/14550
2348         * parser.c (cp_parser_non_integral_constant_expression): Encode
2349         more of the idiom that surrounded calls to this function within
2350         the function itself
2351         (cp_parser_primary_expression): Adjust accordingly.
2352         (cp_parser_postfix_expression): Likewise.
2353         (cp_parser_unary_expression): Likewise.
2354         (cp_parser_cast_expression): Likewise.
2355         (cp_parser_assignment_expression): Likewise.
2356         (cp_parser_expression): Likewise.
2357         (cp_parser_new_expression): Note that new-expressions are not
2358         allowed in integral constant expressions.
2359         (cp_parser_delete_expression): Likewise.
2360
2361 2004-03-12  Matt Austern  <austern@apple.com>
2362
2363         * decl2.c (maybe_make_one_only): Look at
2364         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
2365         to make an explicit instantiation weak.
2366         * method.c (use_thunk): Make sure we call comdat_linkage
2367         when appropriate.
2368         * pt.c (do_type_instantiation): On systems where weak symbols
2369         don't go in a static archive's TOC, explicit instantiation of a
2370         class must imply *explicit* instantiation of its memeber.
2371
2372 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
2373
2374         * call.c, cp-tree.h, pt.c: Fix comment typos.
2375
2376 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
2377
2378         PR c++/14510
2379         * decl.c (xref_tag): Disregard non-type declarations when
2380         looking up a tagged type.
2381
2382 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
2383
2384         PR c++/14397
2385         * call.c (convert_like_real): Build a const qualified temporary,
2386         when testing ctor access.
2387
2388 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
2389
2390         * call.c (initialize_reference): Fix typo.
2391
2392 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2393
2394         PR c++/14409
2395         * pt.c (determine_specialization): For member templates, match also
2396         constness.
2397
2398         PR c++/14448
2399         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
2400         non-dependent.
2401         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
2402
2403 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
2404
2405         PR c++/14230
2406         * call.c (initialize_reference): Handle initializers that are
2407         class-member access expressions applies to rvalues.
2408
2409 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
2410
2411         PR c++/14432
2412         * name-lookup.c (supplement_binding): Ignore functions that are
2413         marked DECL_ANTICIPATED.
2414
2415 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
2416
2417         PR c++/14401
2418         * class.c (check_field_decls): Complain about non-static data
2419         members of reference type in unions.  Propagate
2420         CLASSTYPE_REF_FIELDS_NEED_INIT and
2421         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
2422         data members.
2423         * init.c (perform_member_init): Complain about mbmers with const
2424         type that are not explicitly initialized.
2425
2426 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
2427
2428         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
2429         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
2430         (lang_identifier): Remove implicit_decl and error_locus.
2431         (IDENTIFIER_IMPLICIT_DECL): Remove.
2432         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
2433         (IDENTIFIER_ERROR_LOCUS): Likewise.
2434         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
2435         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
2436         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
2437         (implicitly_declare): Remove.
2438         * decl.c (warn_extern_redeclared_static): Remove check of
2439         IDENTIFIER_IMPLICIT_DECL.
2440         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
2441         (implicitly_declare): Remove.
2442         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
2443         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
2444         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
2445         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
2446         in the innermost scope, rather than at namespace scope.
2447         * name-lookup.c (push_local_binding): Give it external linkage.
2448         (pushdecl): Remove dead code.
2449         * name-lookup.h (push_local_binding): Declare it.
2450         * ptree.c (cxx_print_identifier): Don't print
2451         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
2452         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
2453         not IDENTIFIER_ERROR_LOCUS.
2454         * typeck.c (build_function_call): Remove dead code.
2455
2456 2004-03-08  Jason Merrill  <jason@redhat.com>
2457
2458         PR c++/13170
2459         * decl.c (xref_tag): Remove attribute handling.
2460         * cp-tree.h: Adjust prototype.
2461         * decl.c, parser.c, rtti.c: Adjust callers.
2462         * parser.c (cp_parser_class_head): Pass back attributes in the
2463         class head.
2464         (cp_parser_class_specifier): Adjust.
2465
2466 2004-03-08  Matt Austern  <austern@apple.com>
2467
2468         PR debug/14079
2469         * name-lookup.c (add_decl_to_level): Add extern variables, as well
2470         as static, to static_decls array.
2471
2472 2004-03-05  Jason Merrill  <jason@redhat.com>
2473
2474         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
2475
2476 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
2477
2478         * decl.c (grokfndecl): Update old incorrect comment.
2479         (grokvardecl): Diagnose C++ variables of type with no linkage.
2480
2481 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
2482
2483         PR c++/14369
2484         * pt.c (build_non_dependent_expr): Do not create a
2485         NON_DEPENDENT_EXPR for a THROW_EXPR.
2486
2487 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2488
2489         PR c++/14369
2490         * error.c (dump_expr): Handle THROW_EXPR.
2491
2492 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
2493
2494         PR c++/14360
2495         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
2496         lookup if ordinary name-lookup finds a non-function.
2497         * pt.c (tsubst_copy_and_build): Likewise.
2498
2499         PR c++/14361
2500         * parser.c (cp_parser_late_parsing_default_args): Check that there
2501         are no extra tokens after the end of the default-argument
2502         expression.
2503
2504 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
2505
2506         PR c++/14324
2507         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
2508         having C++ linkage for name-mangling purposes.
2509
2510         PR c++/14260
2511         * parser.c (cp_parser_direct_declarator): Recognize constructor
2512         declarators that use a template-id to name the class being
2513         constructed.
2514
2515         PR c++/14337
2516         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
2517         (tsubst_expr): Do not call tsubst_copy, even when
2518         processing_template_decl.
2519
2520 2004-03-01  Jeff Law  <law@redhat.com>
2521
2522         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
2523         the proper type.
2524
2525 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
2526
2527         PR c++/14138
2528         * name-lookup.h (push_scope): Change prototype.
2529         * name-lookup.c (push_scope): Do not reenter the current class
2530         scope.
2531         * decl.c (grokfndecl): Check return code from push_scope before
2532         calling pop_scope.
2533         * decl2.c (check_classfn): Likewise.
2534         * parser.c (cp_parser_conversion_function_id): Likewise.
2535         (cp_parser_init_declarator): Likewise.
2536         (cp_parser_direct_declarator): Likewise.
2537         (cp_parser_class_specifier): Likewise.
2538         (cp_parser_class_head): Likewise.
2539         (cp_parser_lookup_name): Likewise.
2540         (cp_parser_constructor_declarator_p): Likewise.
2541         * pt.c (instantiate_class_template): Likewise.
2542         (resolve_typename_type): Likewise.
2543
2544 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
2545
2546         PR c++/14267
2547         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
2548         extension.
2549
2550         PR debug/12103
2551         * class.c (update_vtable_entry_for_fn): Do not go through
2552         covariance machinery if the type returned by an overrider is the
2553         same as the original.
2554
2555 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
2556
2557         * call.c: Fix a comment typo.
2558
2559 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
2560
2561         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
2562
2563 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
2564
2565         PR c++/14278
2566         * parser.c (cp_parser_parameter_declaration_list): Commit
2567         to fewer tentative parses.
2568
2569 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2570
2571         PR c++/14284
2572         * pt.c (dependent_type_p_r): A template template parameter is a
2573         dependent type.
2574
2575 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2576
2577         PR c++/14246
2578         * mangle.c (write_template_arg_literal): Don't rely on identity for
2579         boolean constants.
2580
2581 2004-02-24  Jason Merrill  <jason@redhat.com>
2582
2583         * tree.c (build_exception_variant): Use check_qualified_type.
2584
2585 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
2586             Kazu Hirata  <kazu@cs.umass.edu>
2587
2588         * decl.c (cxx_init_decl_processing): Don't check
2589         flag_writable_strings.
2590
2591 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
2592
2593         PR c++/14156
2594         * typeck.c (maybe_warn_about_returning_address_of_location):
2595         Change check for VAR_DECL to use DECL_P instead.
2596
2597 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2598
2599         PR c++/14250
2600         * cvt.c (build_expr_type_conversion): Type must be complete before
2601         looking up for conversions.
2602
2603 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2604
2605         PR c++/14143
2606         * name-lookup.c (arg_assoc_class): Don't look into template
2607         arguments if it is not a primary template.
2608
2609 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2610
2611         PR c++/12007
2612         * method.c (use_thunk): Always clone function argument tree.
2613
2614 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
2615
2616         PR c++/14199
2617         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
2618
2619         PR c++/14173
2620         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
2621         for all type variants.
2622
2623 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
2624
2625         PR c++/13927
2626         * decl.c (duplicate_decls): Return error_mark_node for invalid
2627         redeclarations.
2628         * name-lookup.c (push_namespace): Ignore the return value from
2629         pushdecl.
2630         * pt.c (push_template_decl_real): Robustify.
2631
2632         PR c++/14186
2633         * name-lookup.c (push_class_level_binding): Do not complain about
2634         adding a binding for a member whose name is the same as the
2635         enclosing class if the member is located in a base class of the
2636         current class.
2637
2638 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2639
2640         PR c++/14181
2641         * parser.c (cp_parser_new_expression): Parse an ill-formed
2642         direct-new-declarator after a parenthesized type-id to emit good
2643         diagnostic.
2644
2645 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
2646
2647         * cp-tree.def, cvt.c: Update copyright.
2648
2649 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
2650
2651         PR c++/11326
2652         * cp-tree.h (abi_version_at_least): Remove.
2653         * mangle.c: Include flags.h.
2654
2655 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
2656
2657         PR c++/13971
2658         * call.c (build_conditional_expr): Handle conversions between
2659         class types which result in differently cv-qualified type
2660         variants.
2661
2662         PR c++/14086
2663         * class.c (delete_duplicate_fields_1): Remove.
2664         (delete_duplicate_fields): Likewise.
2665         (finish_struct_anon): Remove check for members with the same name
2666         as their enclosing class.
2667         (check_field_decls): Do not call duplicate_fields.
2668         * decl.c (grokdeclarator): Remove check for static data members
2669         with the same name as their enclosing class.
2670         * name-lookup.c (push_class_level_binding): Check for members with
2671         the same name as their enclosing class.
2672
2673 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2674
2675         PR c++/14085
2676         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
2677
2678 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2679
2680         PR c++/13635
2681         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
2682         has full set of arguments.
2683
2684 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2685
2686         PR c++/13927
2687         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
2688
2689 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
2690
2691         PR c++/14122
2692         * cp-tree.h (delete_sanity): Change prototype.
2693         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
2694         Remove dead code.  Adjust code to warn about deleting an array.
2695         * typekc.c (decay_conversion): Use build_address and build_nop.
2696
2697         PR c++/14108
2698         * search.c (accessible_p): Do not check access in thunks.
2699
2700         PR c++/14083
2701         * call.c (build_conditional_expr): Call force_rvalue on the
2702         non-void operand in the case that one result is a throw-expression
2703         and the other is not.
2704
2705 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
2706
2707         PR c++/9851
2708         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
2709         the type name and look ahead for ::~, and bail out early with a
2710         better error message if the parse is going to fail.
2711
2712 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
2713
2714         * call.c (conversion_kind): New type.
2715         (conversion_rank): Likewise.
2716         (conversion): Likewise.
2717         (CONVERSION_RANK): New macro.
2718         (conversion_obstack): New variable.
2719         (obstack_initialized): Likewise.
2720         (z_candidate): Change type of convs and second_conv.
2721         (candidate_warning): New type.
2722         (IDENTITY_RANK): Remove.
2723         (EXACT_RANK): Likewise.
2724         (PROMO_RANK): Likewise.
2725         (STD_RANK): Likewise.
2726         (PBOOL_RANK): Likewise.
2727         (USER_RANK): Likewise.
2728         (ELLIPSIS_RANK): Likewise.
2729         (BAD_RANK): Likewise.
2730         (ICS_RANK): Likewise.
2731         (ICS_STD_RANK): Likewise.
2732         (ICS_USER_FLAG): Likewise.
2733         (ICS_ELLIPSIS_FLAG): Likewise.
2734         (ICS_THIS_FLAG): Likewise.
2735         (ICS_BAD_FLAG): Likewise.
2736         (NEED_TEMPORARY_P): Likewise.
2737         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
2738         (USER_CONV_CAND): Likewise.
2739         (USER_CONV_FN): Likewise.
2740         (conversion_obstack_alloc): New function.
2741         (alloc_conversion): Likewise.
2742         (validate_conversion_obstack): Likewise.
2743         (alloc_conversions): Likewise.
2744         (build_conv): Adjust to deal with new conversion data structures.
2745         (build_identity_conv): New function.
2746         (build_ambiguous_conv): Likewise.
2747         (standard_conversion): Adjust to deal with new conversion data
2748         structures.
2749         (convert_class_to_reference): Likewise.
2750         (direct_reference_binding): Likewise.
2751         (reference_binding): Likewise.
2752         (implicit_conversion): Likewise.
2753         (add_candidate): Likewise.
2754         (add_function_candidate): Likewise.
2755         (add_conv_candidate): Likewise.
2756         (build_builtin_candidate): Likewise.
2757         (print_z_candidate): Likewise.
2758         (merge_conversion_sequences): Likewise.
2759         (build_user_type_conversion_1): Likewise.
2760         (build_user_type_conversion): Likewise.
2761         (build_new_function_call): Likewise.
2762         (build_object_call): Likewise.
2763         (conditional_conversion): Likewise.
2764         (build_conditional_expr): Likewise.
2765         (build_new_op): Likewise.
2766         (build_op_delete_call): Likewise.
2767         (convert_like_real): Likewise.
2768         (build_over_call): Likewise.
2769         (build_new_method_call): Likewise.
2770         (is_subseq): Likewise.
2771         (maybe_handle_implicit_object): Likewise.
2772         (maybe_handle_ref_bind): Likewise.
2773         (compare_ics): Likewise.
2774         (source_type): Likewise.
2775         (add_warning): Likewise.
2776         (joust): Likewise.
2777         (can_convert_arg): Likewise.
2778         (can_convert_arg_bad): Likewise.
2779         (perform_implicit_conversion): Likewise.
2780         (perform_direct_initialization_if_possible): Likewise.
2781         (initialize_reference): Likewise.
2782         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
2783         * cp-tree.def (WRAPPER): Likewise.
2784         (IDENTITY_CONV): Remove.
2785         (LVALUE_CONV): Likewise.
2786         (QUAL_CONV): Likewise.
2787         (STD_CONV): Likewise.
2788         (PTR_CONV): Likewise.
2789         (PMEM_CONV): Likewise.
2790         (BASE_CONV): Likewise.
2791         (REF_BIND): Likewise.
2792         (USER_CONV): Likewise.
2793         (AMBIG_CONV): Likewise.
2794         (RVALUE_CONV): Likewise.
2795         * cp-tree.h (tree_wrapper): Remove.
2796         (WRAPPER_ZC): Remove.
2797         (lang_tree_node): Remove wrapper.
2798         (LOOKUP_SPECULATIVELY): Remove.
2799         (build_op_delete_call): Adjust prototype.
2800         (validate_conversion_obstack): Declare.
2801         (build_zc_wrapper): Remove.
2802         * cvt.c (convert_to_reference): Remove dead code.
2803         (ocp_convert): Likewise.
2804         * decl.c (redeclaration_error_message): Correct handling of
2805         templates.
2806         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
2807         (cp_tree_node_structure): Remove WRAPPER case.
2808         * decl2.c (finish_file): Call validate_conversion_obstack.
2809         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
2810         (build_op_delete_call): Likewise.
2811         (build_x_delete): Likewise.
2812         (build_delete): Adjust call to build_op_delete_call.
2813         * pt.c (tsubst_friend_declaration): Adjust code to determine
2814         whether or not a friend template is a definition.
2815         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
2816         * tree.c (build_zc_wrapper): Remove.
2817
2818 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
2819
2820         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
2821         * cp-tree.h: Don't declare cxx_builtin_type_decls.
2822         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
2823         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
2824
2825 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
2826
2827         * typeck.c (lookup_destructor): Fix typo in error message.
2828
2829 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
2830
2831         * call.c, parser.c, tree.c: Fix comment typos.
2832
2833 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
2834
2835         Bug 13856
2836         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
2837         * decl.c (duplicate_decls, start_function): Likewise.
2838
2839 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
2840
2841         * name-lookup.c (pushdecl): Issue shadow warnings directly.
2842         * parser.c (free_parser_stacks): Delete.
2843
2844 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
2845
2846         * rtti.c: Update copyright.
2847
2848 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2849
2850         PR c++/14033
2851         * decl.c (require_complete_types_for_parms): Do not insert
2852         error_mark_node in the parameter list.
2853
2854 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2855
2856         PR c++/14028
2857         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
2858         error when terminator can not be found.
2859
2860 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
2861
2862         Make-lang.in (po-generated):  Delete.
2863
2864 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
2865
2866         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
2867         targetm.calls.promote_prototypes.
2868
2869 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
2870
2871         PR middle-end/13750
2872         Revert:
2873         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
2874         PR pch/13361
2875         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
2876         (handle_pragma_implementation): Likewise.
2877
2878 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
2879
2880         PR c++/13714
2881         * typeck.c (lookup_destructor): Tweak error message.
2882
2883 2004-02-05  Jan Hubicka  <jh@suse.cz>
2884
2885         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
2886         functions.
2887
2888 2004-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2889
2890         PR c++/14008
2891         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
2892         code, only emits the diagnostic now. Added lookup of the identifier
2893         and support for qualified ids.
2894         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
2895         Parse an (invalid) type name as id-expression within a declarator.
2896         (cp_parser_simple_declaration): Use it.
2897         (cp_parser_member_declaration): Likewise.
2898         (cp_parser_make_typename_type): New function. Handle errors through
2899         cp_parser_diagnose_invalid_typename.
2900         (cp_parser_elaborated_type_specifier): Use it.
2901
2902 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
2903
2904         PR c++/13932
2905         * call.c (convert_like_real): Use "converting" rather than
2906         "argument" as the descriptive keyword to
2907         dubious_conversion_warnings.
2908         * typeck.c (convert_for_assignment): Do not call
2909         dubious_conversion_warnings.
2910
2911 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2912
2913         PR c++/13086
2914         * init.c (build_delete): Emit a more informative error message in
2915         case of an incomplete type, and on the correct source line.
2916
2917 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
2918
2919         * error.c, search.c: Update copyright.
2920
2921 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
2922
2923         PR c++/9941
2924         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
2925         linkage for the typeinfo name string.
2926
2927 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
2928
2929         PR c++/13969
2930         * cp-tree.h (fold_non_dependent_expr): New function.
2931         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
2932         (cp_parser_template_argument): Use fold_non_dependent_expr.
2933         (cp_parser_direct_declarator): Likewise.
2934         * pt.c (fold_non_dependent_expr): New function.
2935         (convert_nontype_argument): Use it.
2936         (tsubst_qualified_id): Simplify.
2937         (tsubst_copy_and_build): Likewise.
2938
2939 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
2940
2941         * decl.c (cxx_push_function_context): Do not set
2942         current_function_is_thunk.
2943         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
2944         actual function.
2945
2946 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2947
2948         PR c++/13997
2949         * pt.c (more_specialized_class): Increase processing_template_decl
2950         while partial ordering.
2951
2952 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
2953
2954         PR c++/13925
2955         * decl.c (start_function): Do not call pushdecl for any
2956         instantiation or specialization of a primary template.
2957
2958 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
2959
2960         PR c++/13950
2961         * parser.c (cp_parser_class_name): Robustify.
2962
2963         PR c++/13970
2964         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
2965
2966         PR c++/14002
2967         * semantics.c (finish_id_expression): Do not return an
2968         IDENTIFIER_NODE when lookup finds a PARM_DECL.
2969
2970 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
2971
2972         PR c++/13978
2973         * pt.c (build_non_dependent_expr): Do not build
2974         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
2975
2976         PR c++/13968
2977         * semantics.c (finish_id_expression): Do not return an
2978         IDENTIFIER_NODE when lookup finds a VAR_DECL.
2979
2980         PR c++/13975
2981         * parser.c (cp_parser_simple_declaration): When skipping to the
2982         end of the statement swallow the terminating semicolon.
2983
2984 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
2985
2986         PR c++/13113
2987         * init.c (build_offset_ref): Improve error recovery for invalid
2988         uses of non-static member functions.
2989
2990         PR c++/13854
2991         * cp-tree.h (cp_build_type_attribute_variant): New function.
2992         * class.c (build_clone): Use cp_build_type_attribute_variant.
2993         * decl.c (duplicate_decls): Likewise.
2994         * pt.c (copy_default_args_to_explicit_spec): Likewise.
2995         (tsubst_function_type): Likewise.
2996         * tree.c (build_exception_variant): Check attributes before
2997         concluding that two types are the same.
2998         (cp_build_type-attribute_variant): New method.
2999         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
3000
3001         PR c++/13907
3002         * call.c (convert_class_to_reference): Keep better track of
3003         pedantically invalid user-defined conversions.
3004
3005 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3006
3007         PR c++/13957
3008         * pt.c (tsubst_qualified_id): Improved error message when a type
3009         is expected but not found.
3010
3011 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
3012
3013         * class.c: Fix comment typos.
3014         * decl.c: Likewise.
3015         * error.c: Likewise.
3016         * parser.c: Likewise.
3017         * pt.c: Likewise.
3018         * search.c: Likewise.
3019         * typeck.c: Likewise.
3020
3021 2004-01-30  Richard Henderson  <rth@redhat.com>
3022
3023         PR c++/13693
3024         * method.c (use_thunk): Don't force_target_expr for void thunks.
3025         * tree.c (build_target_expr_with_type): Assert non-void type.
3026         (force_target_expr): Likewise.
3027
3028 2004-01-30  Michael Matz  <matz@suse.de>
3029
3030         * parser.c (cp_parser_labeled_statement): Accept case ranges.
3031
3032 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3033
3034         DR206
3035         PR c++/13813
3036         * decl.c (grokdeclarator): Check immediatly type completeness for
3037         non-dependent types.
3038
3039 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3040
3041         PR c++/13683
3042         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
3043         a sizeof expression.block
3044
3045 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
3046
3047         PR c++/13883
3048         * mangle.c (write_encoding): Correct encoding of member template
3049         constructors.
3050
3051 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3052
3053         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
3054         template name as it was `<::' (digraph typo).
3055         (cp_parser_nth_token_starts_template_argument_list_p): New function.
3056         (cp_parser_id_expression): Use it.
3057         (cp_parser_nested_name_specifier_opt): Likewise.
3058         (cp_parser_template_name): Likewise.
3059         (cp_parser_class_name): Likewise.
3060         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
3061
3062 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
3063
3064         PR c++/13791
3065         * typeck.c (merge_types): Do not merge attributes into
3066         TYPENAME_TYPEs.
3067
3068         PR c++/13736
3069         * parser.c (cp_parser_direct_declarator): Do not prevent
3070         backtracking inside a parenthesized declarator.
3071         (cp_parser_parameter_declaration): Fix typo in comment.
3072
3073 2004-01-28  Jan Hubicka  <jh@suse.cz>
3074
3075         * semantics.c (expand_body)  Do emit_associated_thunks before
3076         expansion.
3077
3078 2004-01-27  Devang Patel  <dpatel@apple.com>
3079
3080         * name-lookup.c: Include "debug.h"
3081         (do_namespace_alias): Invoke debug_hooks to emit debug info
3082         for namespace alias.
3083         (do_local_using_decl): Invoke debug_hooks to emit debug info
3084         for using decl.
3085         (do_class_using_decl): Same.
3086         (do_toplevel_using_decl): Same.
3087         (do_using_directive): Same.
3088         (cp_emit_debug_info_for_using): New function.
3089         * Make-lang.in (cp/parser.o): Depend on debug.h
3090         (cp/name-lookup.o): Same.
3091
3092 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
3093
3094         * cp-tree.h (language_function, lang_type_header): Use
3095         BOOL_BITFIELD.
3096         * name-lookup.h (cp_binding_level): Likewise.
3097
3098 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
3099
3100         PR c++/13663
3101         * semantics.c (finish_for_expr): Check for unresolved overloaded
3102         functions.
3103
3104         * class.c (add_method): Just check processing_template_decl to
3105         determine whether or not we are within a template.
3106         * decl2.c (maybe_retrofit_in_chrg): Likewise.
3107         * init.c (decl_constant_value): Check the type of the declaration,
3108         not TREE_READONLY.
3109         * name-lookup.c (maybe_push_to_top_level): Rename to ...
3110         (push_to_top_level): ... this.
3111         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
3112         * pt.c (push_template_decl_real): Reorder condition for speed.
3113         (convert_template_argument): Use dependency-checking functions in
3114         place of uses_template_parms.
3115         (lookup_template_class): Avoid calling uses_template_parms more
3116         than once.
3117         (uses_template_parms): Reimplement, using dependency-checking
3118         functions.
3119         (instantiate_class_template): Use push_to_top_level, not
3120         maybe_push_to_top_level.
3121         (type_unification_real): Simplify.
3122         (type_dependent_expression_p): Handle OFFSET_REFs and
3123         TEMPLATE_DECLs.
3124         (any_dependent_template_arguments_p): Handle multiple levels of
3125         template argument.
3126         * semantics.c (expand_or_defer_fn): Do not check
3127         uses_template_parms for template instantiations.
3128         * typeck.c (comptypes): Avoid calling cp_type_quals.
3129
3130 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
3131
3132         PR c++/13833
3133         * call.c (build_over_call): Do not convert arguments when
3134         processing a template.
3135         * pt.c (build_non_dependent_expr): Do not build a
3136         NON_DEPENDENT_EXPR for arithmetic constants.
3137
3138 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3139
3140         PR c++/13810
3141         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
3142         returns a TYPE_DECL. no further lookup is required.
3143         * semantics.c (check_template_template_default_arg): A TYPE_DECL
3144         is invalid. Rework to give better diagnostics.
3145
3146 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3147
3148         PR c++/13797
3149         * pt.c (instantiate_class_template): Add an error_mark_node
3150         check.
3151         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
3152
3153 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
3154
3155         PR c++/13701
3156         * decl.c (finish_function): Move the call to
3157         finish_fname_decls below the call to
3158         finish_eh_spec_block.
3159
3160 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
3161
3162         * optimize.c, typeck2.c: Update copyright.
3163
3164 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
3165
3166         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
3167         init.c, mangle.c, typeck.c: Update copyright.
3168
3169 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
3170
3171         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
3172
3173 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
3174
3175         * Make-lang.in: Replace $(docdir) with doc.
3176         (c++.info, c++.srcinfo): Dummy entry.
3177         (c++.man, c++.srcman): New rules.
3178         (c++.install-man): Revamp rule.
3179
3180 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
3181
3182         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
3183         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
3184         immediate $(shell) instead of deferred backquote.
3185
3186 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
3187
3188         PR c++/13651
3189         * parser.c (cp_parser_postfix_expression): When encountering
3190         incomplete type on left-hand side of "->" or ".", treat the entire
3191         expression as erroneous.
3192
3193         PR c++/13592
3194         * call.c (build_field_call): Remove.
3195         (n_build_method_call): Likewise.
3196         (build_method_call): Likewise.
3197         (build_new_method_call): Do not call build_field_call.
3198         * class.c (n_build_method_call): Remove.
3199         (print_class_statistics): Do not print it.
3200         * cp-tree.h (build_method_call): Remove declaration.
3201         (finish_object_call_expr): Likewise.
3202         (build_new_1): Do not use build_method_call.
3203         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
3204         when the function appearing on the right-hand-side of "." or "->"
3205         is not actually a function.
3206         * pt.c (tsubst_copy_and_build): Likewise.
3207         * semantics.c (finish_object_call_expr): Remove.
3208
3209 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
3210
3211         PR c++/13710
3212         * pt.c (tsubst): Use finish_typeof.
3213
3214 2004-01-18  Jason Merrill  <jason@redhat.com>
3215
3216         PR c++/11725
3217         * except.c (build_throw): In a template, set
3218         current_function_returns_abnormally.
3219
3220 2004-01-17  Fred Fish  <fnf@intrinsity.com>
3221
3222         PR c++/11895
3223         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
3224         except don't call array_type_nelts() with a VECTOR_TYPE.
3225
3226 2004-01-16  Jan Hubicka  <jh@suse.cz>
3227
3228         * mangle.c (write_mangled_name): Remove inline modifier.
3229
3230 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
3231
3232         PR c++/13574
3233         * decl.c (compute_array_index_type): Fix grammar in comment.
3234         * init.c (build_zero_init): Handle zero-sized arrays correctly.
3235
3236         PR c++/13178
3237         * call.c (name_as_c_string): Print conversion operator names
3238         correctly.
3239
3240         PR c++/13478
3241         * call.c (initialize_reference): Pass -1 for inner parameter to
3242         convert_like_real.
3243
3244 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3245
3246         PR c++/13407
3247         * parser.c (cp_parser_base_specifier): Check for an invalid
3248         keyword `typename' and emit an user-friendly error message.
3249
3250 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
3251
3252         PR pch/13361
3253         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
3254         (handle_pragma_implementation): Likewise.
3255
3256 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3257
3258         PR c++/9259
3259         * typeck.c (build_class_member_access_expr): Allow to access members
3260         of the currently open class.
3261         (finish_class_member_access_expr): Likewise.
3262
3263 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
3264
3265         PR c++/13659
3266         * name-lookup.c (validate_nonmember_using_decl): Take scope and
3267         name by value, instead of computing them.
3268         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
3269         arguments.  Pass them to validate_nonmember_using_decl.
3270         * name-lookup.h (do_local_using_decl): Adjust.
3271         (do_toplevel_using_decl): Likewise.
3272         * parser.c (cp_parser_using_declaration): Likewise.
3273         * pt.c (tsubst_expr): Likewise.
3274
3275 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
3276
3277         PR c++/13594
3278         PR c++/13658
3279         * name-lookup.c (qualified_lookup_using_namespace): Search
3280         strongly-associated namespaces first, and only then try other
3281         namespaces.
3282
3283 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
3284
3285         * Make-lang.in (c++.srcextra): Dummy entry.
3286
3287 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3288
3289         PR c++/8856
3290         * parser.c (cp_parser_template_name): Don't try to parse a
3291         conversion-function-id, as it cannot be a template-name.
3292         (cp_parser_simple_type_specifier): Check for invalid template-ids
3293         even after a built-in type.
3294
3295 2004-01-14  Jan Hubicka  <jh@suse.cz>
3296
3297         PR c++/12850
3298         * pt.c (instantiate_decl):  Do not increase function_depth.
3299
3300 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
3301
3302         PR c++/9021
3303         PR c++/11005
3304         * parser.c (cp_parser_elaborated_type_specifier): Warn about
3305         attributes and discard.
3306         * decl.c (xref_tag): Don't overwite existing attributes with
3307         NULL_TREE.
3308
3309 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3310
3311         PR c++/12335
3312         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
3313         is no destructor while looking up a BIT_NOT_EXPR.
3314
3315 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
3316
3317         * cxxfilt.c: Remove unused file.
3318
3319 2004-01-14  Jan Hubicka  <jh@suse.cz>
3320
3321         Partial fix to PR c++/12850
3322         * decl2.c (mark_used): Do not proactively instantiate templates
3323         when compiling in unit-at-a-time or not optimizing.
3324         * optimize.c (maybe_clone_body): Do not increase function depth.
3325
3326 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3327
3328         PR c++/13474
3329         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
3330
3331 2004-01-12  Steven Bosscher  <stevenb@suse.de>
3332
3333         PR c++/13558
3334         * parser.c (cp_parser_member_declaration): Any non-type is also
3335         not a class or a function.
3336
3337 2004-01-12  Jason Merrill  <jason@redhat.com>
3338
3339         PR c++/12815
3340         * class.c (build_base_path): Do not mark vtable references as
3341         TREE_CONSTANT.
3342         (build_vtbl_ref_1): Likewise.
3343
3344 2004-01-12  Richard Henderson  <rth@redhat.com>
3345
3346         PR opt/10776
3347         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
3348         (store_init_value): Use it.
3349         * decl.c (check_initializer): Expect full initialization code
3350         from store_init_value.
3351         * init.c (expand_aggr_init_1): Likewise.
3352         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
3353
3354 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
3355
3356         * class.c (layout_class_type): For non-POD class types, also copy
3357         the DECL_SIZE and DECL_MODE of fields to the base class type.
3358
3359 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3360
3361         PR c++/13289
3362         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
3363         calling regenerate_decl_from_template.
3364
3365 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
3366
3367         PR c++/4100
3368         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
3369         decl-specifier occurring along with a class definition.
3370
3371 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
3372
3373         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
3374         clauses to comments describing declares_class_or_enum.
3375         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
3376         false.
3377
3378 2004-01-12  Jan Hubicka  <jh@suse.cz>
3379
3380         * pt.c (for_each_template_parm): Do not check for duplicates.
3381         (for_each_template_parm): Use walk_tree duplicate checking code.
3382
3383 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
3384
3385         PR c++/3478
3386         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
3387         is error_mark_node, don't add any more decl_specs.
3388         (cp_parser_init_declarator): After committing to a declaration, if
3389         the decl_specifiers start with error_mark_node, issue an error and
3390         change the type to "int".
3391
3392 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
3393
3394         PR bootstrap/7817
3395         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
3396
3397 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3398
3399         DR 337
3400         PR c++/9256
3401         * pt.c (tsubst): Substitution must fail if we are attempting to
3402         create an array with element type that is an abstract class type.
3403         * decl.c (cp_finish_decl): Strip pointers and array types recursively
3404         before calling abstract_virtuals_error.
3405
3406 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
3407
3408         * name-lookup.c (qualified_lookup_using_namespace): Consider
3409         strong using directives even if we've already found a binding.
3410
3411 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
3412
3413         * cp-tree.h (cxx_expand_expr): Change prototype.
3414         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
3415
3416 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3417
3418         PR c++/12573
3419         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
3420         looking into them recursively. They can be there because of the
3421         new __offsetof__ extension.
3422
3423 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
3424
3425         * parser.c (cp_parser_save_member_function_body): Mark the
3426         definition static.
3427
3428 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
3429
3430         PR c++/13057
3431         * class.c (build_clone): Copy type attributes from the original
3432         function to the clone.
3433
3434         PR c++/12815
3435         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
3436         references as constant.
3437
3438         PR c++/12132
3439         * parser.c (cp_parser_explicit_instantiation): Improve error
3440         recovery.
3441         (cp_parser_require): Improve indication of the error location.
3442
3443         PR c++/13451
3444         * parser.c (cp_parser_class_head): Reorder logic to check for
3445         invalid qualification.
3446
3447 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
3448
3449         PR c++/13157
3450         * name-lookup.c (lookup_using_namespace): Remove spacesp
3451         parameter.
3452         (unqualified_namespace_lookup): Likewise.
3453         (lookup_qualified_name): Adjust accordingly.
3454         (lookup_name_real): Likewise.
3455         (lookup_arg_dependent): Do not eliminate the namespace of the
3456         functions found by unqualified name lookup unless that is the
3457         current namespace.
3458
3459 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
3460
3461         * semantics.c (push_deferring_access_checks): Fix format.
3462         (resume_deferring_access_checks): Likewise.
3463         (stop_deferring_access_checks): Likewise.
3464         (pop_deferring_access_checks): Likewise.
3465         (get_deferred_access_checks): Likewise.
3466         (pop_to_parent_deferring_access_checks): Likewise.
3467         (perform_deferred_access_checks): Likewise.
3468         (perform_or_defer_access_check): Likewise.
3469
3470 2004-01-04  Richard Henderson  <rth@redhat.com>
3471
3472         * call.c (build_over_call): Don't create a save_expr of an
3473         aggregate, but rather its address.
3474
3475 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
3476
3477         PR c++/13529
3478         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
3479         an offsetof expression.
3480
3481         * parser.c (cp_parser_parameter_declaration): Fix comment.
3482
3483         PR c++/12226
3484         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
3485         (reference_binding): Set it when appropriate.
3486         (build_temp): New function, split out from ...
3487         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
3488         (initialize_reference): Likewise.
3489
3490         PR c++/13536
3491         * parser.c (cp_parser): Add in_type_id_in_expr_p.
3492         (cp_parser_new): Initialize it.
3493         (cp_parser_postfix_expression): Set it.
3494         (cp_parser_sizeof_operand): Likewise.
3495         (cp_parser_parameteR_declaration): Do not commit early to tenative
3496         parsers when in_type_id_in_expr_p is set.
3497
3498 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3499
3500         PR c++/13094
3501         * parser.c (cp_parser_template_argument): Don't call
3502         make_unbound_class_template directly.
3503         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
3504         UNBOUND_CLASS_TEMPLATE tree node.
3505
3506 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
3507
3508         PR target/12729
3509         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
3510
3511 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3512
3513         PR c++/13520
3514         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
3515         (DECL_FUNCTION_TEMPLATE_P): Use it.
3516         (DECL_CLASS_TEMPLATE_P): Likewise.
3517         * parser.c (cp_parser_lookup_name): Add is_template parameter.
3518         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
3519         (cp_parser_template_name): Likewise.
3520         (cp_parser_elaborated_type_specifier): Likewise.
3521         (cp_parser_namespace_name): Likewise.
3522         (cp_parser_class_name): Likewise.
3523         (cp_parser_lookup_name_simple): Likewise.
3524
3525 See ChangeLog.3 for earlier changes.