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