OSDN Git Service

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