OSDN Git Service

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