OSDN Git Service

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