OSDN Git Service

Yet more Objective-C++...
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2005-05-17  Mike Stump  <mrs@apple.com>
2
3         Yet more Objective-C++...
4         
5         * cp-objcp-common.h (cxx_get_alias_set): Move from
6         here...
7         (cxx_warn_unused_global_decl): Likewise.
8         (cp_expr_size): Likewise.
9         (cp_tree_size): Likewise.
10         (cp_var_mod_type_p): Likewise.
11         (cxx_initialize_diagnostics): Likewise.
12         (cxx_types_compatible_p): Likewise.
13         * cp-tree.h: to here.
14         (do_poplevel): Add.
15         * lex.c (D_OBJC): Add.
16         (init_reswords): Add.
17         * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h.
18         * parser.c: Add c-common.h include.
19         * pt.c: Add c-common.h and cp-objcp-common.h includes.
20         (template_args_equal): Use objc_comptypes as well.
21         (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well.
22         * semantics.c (do_poplevel): Remove static.
23
24         * decl.c (objc_mark_locals_volatile): Don't change decls that are
25         already ok.
26         * decl2.c (generate_ctor_or_dtor_function): Add code to initialize
27         Objective C++ early enough.
28         * lex.c (struct resword reswords): Add Objective-C++ support.
29         * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++.
30         (cp_parser_objc_message_receiver): Add.
31         (cp_parser_objc_message_args): Likewise.
32         (cp_parser_objc_message_expression): Likewise.
33         (cp_parser_objc_encode_expression): Likewise.
34         (cp_parser_objc_defs_expression): Likewise.
35         (cp_parser_objc_protocol_expression): Likewise.
36         (cp_parser_objc_selector_expression): Likewise.
37         (cp_parser_objc_expression): Likewise.
38         (cp_parser_objc_visibility_spec): Likewise.
39         (cp_parser_objc_method_type): Likewise.
40         (cp_parser_objc_protocol_qualifiers): Likewise.
41         (cp_parser_objc_typename): Likewise.
42         (cp_parser_objc_selector_p): Likewise.
43         (cp_parser_objc_selector): Likewise.
44         (cp_parser_objc_method_keyword_params): Likewise.
45         (cp_parser_objc_method_tail_params_opt): Likewise.
46         (cp_parser_objc_interstitial_code): Likewise.
47         (cp_parser_objc_method_signature): Likewise.
48         (cp_parser_objc_method_prototype_list): Likewise.
49         (cp_parser_objc_method_definition_list): Likewise.
50         (cp_parser_objc_class_ivars): Likewise.
51         (cp_parser_objc_identifier_list): Likewise.
52         (cp_parser_objc_alias_declaration): Likewise.
53         (cp_parser_objc_class_declaration): Likewise.
54         (cp_parser_objc_protocol_declaration): Likewise.
55         (cp_parser_objc_protocol_refs_opt): Likewise.
56         (cp_parser_objc_superclass_or_category): Likewise.
57         (cp_parser_objc_class_interface): Likewise.
58         (cp_parser_objc_class_implementation): Likewise.
59         (cp_parser_objc_end_implementation): Likewise.
60         (cp_parser_objc_declaration): Likewise.
61         (cp_parser_objc_try_catch_finally_statement): Likewise.
62         (cp_parser_objc_synchronized_statement): Likewise.
63         (cp_parser_objc_throw_statement): Likewise.
64         (cp_parser_objc_statement): Likewise.
65         (cp_parser_primary_expression): Add Objective-C++.
66         (cp_parser_statement): Likewise.
67         (cp_parser_declaration): Likewise.
68         (cp_parser_simple_type_specifier): Likewise.
69         (cp_parser_type_name): Likewise.
70         (cp_parser_parameter_declaration_list): Likewise.
71         (cp_parser_member_declaration) Likewise.
72         * tree.c: Include debug.h.
73         * typeck.c (composite_pointer_type): Add Objective-C++ support.
74         (finish_class_member_access_expr): Likewise.
75         (build_function_call): Allow objc to rewrite FUNCTION_DECLs.
76         (build_modify_expr): Allow objc to generate write barriers.
77
78         * Make-lang.in (cp/tree.o): Add debug.h.
79         * tree.c (lvalue_p_1, case CONST_DECL): Add.
80
81 2005-05-17  Jakub Jelinek  <jakub@redhat.com>
82
83         PR c++/21454
84         * decl.c (maybe_deduce_size_from_array_init): Call
85         cp_apply_type_quals_to_decl after completing array type.
86
87 2005-05-16  Richard Henderson  <rth@redhat.com>
88
89         * decl.c (build_library_fn_1): Move setting TREE_NOTHROW ...
90         (build_library_fn): ... here.
91
92 2005-05-12  Ian Lance Taylor  <ian@airs.com>
93
94         * cp-tree.h (cp_stmt_codes): Don't define.
95         (statement_code_p): Declare.
96         (STATEMENT_CODE_P): Define.
97         * lex.c (statement_code_p): Define.
98         (cxx_init): Use actual codes in stmt_codes initializer, not
99         cp_stmt_codes macro.  Initialize statement_code_p directly, rather
100         than using INIT_STATEMENT_CODES.
101
102 2005-05-09  Mark Mitchell  <mark@codesourcery.com>
103
104         * typeck.c (build_unary_op): Do not resort to address arithmetic
105         when taking the address of a COMPONENT_REF.
106         
107 2005-05-08  Kazu Hirata  <kazu@cs.umass.edu>
108
109         * class.c (vtbl_init_data_s): Change the type of fns to
110         VEC(tree,gc)*.
111         (build_vtbl_initializer, add_vcall_offset, add_vcall_offset):
112         Use VEC instead of VARRAY.
113
114 2005-05-07  Richard Sandiford  <rsandifo@redhat.com>
115
116         * mangle.c: Remove a reference to the MIPS -mint64 option.
117
118 2005-05-07  Kazu Hirata  <kazu@cs.umass.edu>
119
120         * decl.c (wrapup_globals_for_namespace): Use VEC instead of
121         VARRAY.
122         * name-lookup.c (add_decl_to_level, begin_scope): Likewise.
123         * name-lookup.h (cp_binding_level): Change the type of
124         static_decls to VEC(tree,gc)*.
125
126         * mangle.c (globals): Change the type of substitutions to
127         VEC(tree,gc)*.
128         (dump_substitution_candidates, add_substitution,
129         find_substitution, finish_mangling, init_mangle): Use VEC
130         instead of VARRAY.
131
132 2005-05-06  Kazu Hirata  <kazu@cs.umass.edu>
133
134         * decl2.c (spew_debug): Remove.
135
136         * decl2.c (ssdf_decls, start_static_storage_duration_function,
137         generate_ctor_or_dtor_function): Use VEC instead of VARRAY.
138
139         * decl2.c (pending_statics, note_vague_linkage_var,
140         cp_finish_file): Use VEC instead of VARRAY.
141         (pending_statics_used): Remove.
142
143 2005-05-05  Kazu Hirata  <kazu@cs.umass.edu>
144
145         * decl2.c (deferred_fns, note_vague_linkage_fn,
146         cp_finish_file): Use VEC instead of VARRAY.
147
148 2005-05-05  Mark Mitchell  <mark@codesourcery.com>
149
150         PR c++/21352
151         * pt.c (build_non_dependent_expr): Use is_overloaded_fn.
152
153 2005-05-05  Kazu Hirata  <kazu@cs.umass.edu>
154
155         * pt.c: Fix a comment typo.
156
157 2005-05-04  Kazu Hirata  <kazu@cs.umass.edu>
158
159         * cp-tree.h (language_function): Change the type of
160         x_local_names to VEC.
161         * decl.c (push_local_name): Adjust uses of local_names.
162
163 2005-05-03  Kazu Hirata  <kazu@cs.umass.edu>
164
165         * friend.c, lex.c, mangle.c, repo.c: Update copyright.
166
167 2005-05-02  Kazu Hirata  <kazu@cs.umass.edu>
168
169         * class.c (local_classes, init_class_processing): Use VEC
170         instead of VARRAY.
171         * cp-tree.h (local_classes): Likewise.
172         * mangle.c (discriminator_for_local_entity): Likewise.
173         * name-lookup.c (pushtag): Likewise.
174
175         * class.c (current_lang_depth, push_lang_context,
176         pop_lang_context): Use VEC instead of VARRAY.
177         * cp-tree.h (saved_scope): Use VEC for lang_base instead of
178         VARRAY.
179         * name-lookup.c (push_to_top_level): Use VEC instead of
180         VARRAY.
181
182 2005-05-02  Paolo Bonzini  <bonzini@gnu.org>
183
184         * semantics.c (finish_call_expr): Call resolve_overloaded_builtin
185         for BUILT_IN_MD built-ins.
186
187 2005-05-02  Michael Matz  <matz@suse.de>
188
189         PR c++/19542
190         * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C
191         common frontend.
192         (null_node): Remove.
193         * lex.c (cxx_init): Move null_node initialisation to C common frontend.
194
195 2005-04-25  Ian Lance Taylor  <ian@airs.com>
196
197         * cp-tree.def: Add EXPR_STMT.
198         * cp-tree.h (cp_stmt_codes): Add EXPR_STMT.
199         (EXPR_STMT_EXPR): Define.
200         * cp-gimplify.c: Include "flags.h".
201         (gimplify_expr_stmt): New static function.
202         (cp_gimplify_expr): Handle EXPR_STMT.
203         * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression
204         rather than pp_expression.
205         (pp_cxx_statement): Handle EXPR_STMT.
206         * dump.c (cp_dump_tree): Handle EXPR_STMT.
207         * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes
208         initializer.
209
210 2005-04-25  Andrew Pinski  <pinskia@physics.uc.edu>
211
212         PR C++/21188
213         * rtti.c (ifnonnull): Cast the zero comparison operand
214         to the correct type.
215
216 2005-04-24  Jakub Jelinek  <jakub@redhat.com>
217
218         PR middle-end/20991
219         * class.c: Include cgraph.h.
220         (cp_fold_obj_type_ref): Set node->local.vtable_method.
221         * Make-lang.in (cgraph.o): Depend on $(CGRAPH_H).
222
223 2005-04-12  Markus F.X.J. Oberhumer  <markus@oberhumer.com>
224
225         * mangle.c (write_builtin_type): Handle integer types which are
226         not one of the shared integer type nodes and emit a "vendor
227         extended builtin type" with an encoding in the form of "u5int96".
228
229 2005-04-24  Ian Lance Taylor  <ian@airs.com>
230
231         * cp-tree.def (USING_STMT): Change class to tcc_statement.
232         (TRY_BLOCK, EH_SPEC_BLOCK, HANDLER, CLEANUP_STMT): Likewise.
233         (IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT): Likewise.
234         (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
235
236 2005-04-23  DJ Delorie  <dj@redhat.com>
237
238         * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c,
239         init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c,
240         repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning()
241         callers.
242
243 2005-04-22  Per Bothner  <per@bothner.com>
244
245         * decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if
246         input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__.
247
248 2005-04-22  Alexandre Oliva  <aoliva@redhat.com>
249
250         PR c++/21087
251         * name-lookup.c (push_overloaded_decl): Do not overload with
252         non-duplicate anticipated built-in.
253
254 2005-04-21  Kazu Hirata  <kazu@cs.umass.edu>
255
256         * cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT,
257         VTABLE_BASE, VTABLE_NAME_PREFIX, STATIC_NAME_FORMAT): Remove.
258
259 2005-04-21  Nathan Sidwell  <nathan@codesourcery.com>
260
261         * cp-tree.h: Adjust for new VEC API.
262         Define VEC(tree_pair_s,gc).
263         (struct save_scope): Adjust.
264         (struct lang_type_class): Adjust.
265         (unemitted_tinfo_decls): Adjust.
266         * class.c (add_method, resort_type_method_vec,
267         finish_struct_methods, struct find_final_overrider_data,
268         dfs_find_final_overrider_pre, find_final_overrider,
269         get_vcall_index, warn_hidden, walk_subobject_offsets,
270         check_methods, fixup_inline_methods, end_of_class,
271         warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
272         add_vcall_offset): Adjust.
273         * decl.c (xref_basetypes, finish_method): Adjust.
274         * decl2.c (check_classfn): Adjust.
275         * init.c (sort_mem_initializers, push_base_cleanups): Adjust.
276         * method.c (do_build_copy_constructor): Adjust.
277         * name-lookup.c (new_class_binding, store_binding, 
278         store_bindings, store_class_bindings): Adjust.
279         * name-lookup.h: Define VEC(cxx_saved_binding,gc),
280         VEC(cp_class_binding,gc).
281         (struct cp_binding_level): Adjust.
282         * parser.c: Define VEC(cp_token_position,heap).
283         (struct cp_lexer): Adjust.
284         (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
285         cp_lexer_save_tokens): Adjust.
286         * pt.c (retrieve_specialization,
287         check_explicit_specialization): Adjust.
288         * rtti.c (unemitted_tinfo_decls): Adjust.
289         (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
290         get_pseudo_ti_desc): Adjust.
291         * search.c (dfs_access_in_type, lookup_conversion_operator,
292         lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
293         dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
294         * semantics.c: Define VEC(deferred_access,gc).
295         (push_deferring_access_checks): Adjust.
296         * typeck2.c (abstract_virtuals_error): Adjust.
297
298 2005-04-20  Ian Lance Taylor  <ian@airs.com>
299
300         * cp-tree.def: Add STMT_EXPR.
301         * cp-tree.h (STMT_EXPR_NO_SCOPE): Define.
302         (STMT_EXPR_STMT): Define.
303         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
304         STMT_EXPR.
305         (pp_cxx_expression): Likewise.
306         (pp_cxx_statement): Call pp_cxx_statement, not pp_statement.
307         * dump.c (cp_dump_tree): Handle STMT_EXPR.
308
309 2005-04-18  Kazu Hirata  <kazu@cs.umass.edu>
310
311         * decl.c (expand_static_init): Call build2 and build3 instead
312         of build.
313
314         * cp-tree.h (VPTR_NAME, VPTR_NAME_P): Remove.
315
316 2005-04-17  Ian Lance Taylor  <ian@airs.com>
317
318         * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR.
319         * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle
320         ARROW_EXPR.
321         (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR.
322         (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and
323         ALIGNOF_EXPR.
324         * typeck.c (cxx_sizeof_or_alignof_type): Update call to
325         c_sizeof_or_alignof_type for change in parameter type.
326
327 2005-04-16  Mark Mitchell  <mark@codesourcery.com>
328
329         PR c++/21025
330         * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
331         which sizeof/alignof is dependent, rather than just whether we are
332         processing_template_decl.
333         
334 2005-04-17  Kazu Hirata  <kazu@cs.umass.edu>
335
336         * cp-tree.h (LOOKUP_GLOBAL): Remove.
337         (LOOKUP_ONLYCONVERTING, DIRECT_BIND, LOOKUP_NO_CONVERSION,
338         LOOKUP_DESTRUCTOR, LOOKUP_NO_TEMP_BIND, LOOKUP_PREFER_TYPES,
339         LOOKUP_PREFER_NAMESPACES, LOOKUP_CONSTRUCTOR_CALLABLE): Adjust
340         their values.
341
342 2005-04-15  Richard Henderson  <rth@redhat.com>
343
344         PR middle-end/14311
345         * semantics.c (finish_call_expr): Call resolve_overloaded_builtin.
346
347 2005-04-15  Kazu Hirata  <kazu@cs.umass.edu>
348
349         * cp-tree.h (lang_type_class): Remove redefined.  Move
350         java_interface into where redefined was.  Increment the width
351         of dummy.
352         (TYPE_REDEFINED): Remove.
353
354 2005-04-14  Kazu Hirata  <kazu@cs.umass.edu>
355
356         * cp-tree.h (SET_TMPL_ARG, ENUM_TI_TEMPLATE, ENUM_TI_ARGS,
357         CLASSTYPE_TEMPLATE_LEVEL): Remove.
358
359 2005-04-11  Mark Mitchell  <mark@codesourcery.com>
360
361         * decl2.c (determine_visibility): Don't use export_class_data.
362         (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
363         TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. 
364
365 2005-04-09  Kazu Hirata  <kazu@cs.umass.edu>
366
367         * cp-tree.h (cxx_alignof): Remove.
368
369         * cp-tree.h (DECL_ARRAY_DELETE_OPERATOR_P): Remove.
370
371         * cp-tree.h (EXCEPTION_CLEANUP_NAME, B_SET, B_CLR, B_TST,
372         CONV_STATIC_CAST): Remove.
373
374         * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Remove.
375
376         * cp-tree.h (VF_BINFO_VALUE, VF_BASETYPE_VALUE): Remove.
377
378         * cp-tree.h (cp_deprecated): Remove.
379
380 2005-04-08  Ian Lance Taylor  <ian@airs.com>
381
382         * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT,
383         CONTINUE_STMT, SWITCH_STMT.
384         * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT,
385         BREAK_STMT, CONTINUE_STMT, SWITCH_STMT.
386         (WHILE_COND, WHILE_BODY): Define.
387         (DO_COND, DO_BODY): Define.
388         (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define.
389         (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define.
390         * cp-gimplify.c (enum bc_t): Define.
391         (struct cp_gimplify_ctx, ctxp): Define.
392         (push_context, pop_context): New static functions.
393         (begin_bc_block, finish_bc_block): New static functions.
394         (build_bc_goto): New static function.
395         (gimplify_cp_loop, gimplify_for_stmt): New static functions.
396         (gimplify_while_stmt, gimplify_do_stmt): Likewise.
397         (gimplify_switch_stmt): Likewise.
398         (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT,
399         SWITCH_STMT, CONTINUE_STMT, BREAK_STMT.
400         (cp_genericize): Call push_context and pop_context.
401         * semantics.c (finish_break_stmt): Just call build_stmt
402         (BREAK_STMT) rather than build_break_stmt.
403         (finish_continue_stmt): Corresponding change.
404         * decl.c (pop_switch): Update call to c_do_switch_warnings for new
405         parameters.
406         * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT,
407         WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT.
408         * dump.c (cp_dump_tree): Likewise.
409
410 2005-04-08  Mark Mitchell  <mark@codesourcery.com>
411
412         PR c++/20905
413         * parser.c (cp_parser_type_specifier_seq): Add is_condition
414         parameter.
415         (cp_parser_new_type_id): Pass it.
416         (cp_parser_condition): Likewise.
417         (cp_parser_conversion_type_id): Likewise.
418         (cp_parser_type_id): Likewise.
419         (cp_parser_type_specifier_seq): In a condition, do not allow
420         invalid type-specifier combinations.
421         (cp_parser_exception_declaration): Adjust call to
422         cp_parser_type_specifier_seq. 
423
424         * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P.
425         * cp-tree.h (struct tinst_level): Add in_system_header_p.
426         (TINST_IN_SYSTEM_HEADER_P): New macro.
427         (make_tinst_level): Remove.
428         * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on
429         the instantiated class.
430         (push_tinst_level): Do not use make_tinst_level.  Set
431         TINST_IN_SYSTEM_HEADER_P.
432         (pop_tinst_level): Likewise.
433         (instantiate_class_template): Set in_system_header.
434         (instantiate_pending_templates): Likewise.
435         * tree.c (make_tinst_level): Remove.
436
437 2005-04-06  Joseph S. Myers  <joseph@codesourcery.com>
438
439         * decl.c (start_decl): Apply pending #pragma weak regardless of
440         scope.
441
442 2005-04-06  Mark Mitchell  <mark@codesourcery.com>
443
444         PR c++/20212
445         * pt.c (regenerate_decl_from_template): Copy attributes for
446         parameters from the pattern to the instantiation.
447
448 2005-04-05  Mark Mitchell  <mark@codesourcery.com>
449
450         PR c++/20734
451         * cp-tree.def (OFFSET_REF): Correct comments.
452         * init.c (build_offset_ref): Remove misleading comment.
453         * typeck.c (build_unary_op): Handle pointer-to-member creation
454         here, rather than ...
455         (unary_complex_lvalue): ... here.
456
457 2005-04-06  Jason Merrill  <jason@redhat.com>
458
459         PR c++/19312
460         * tree.c (stabilize_init): Don't bother trying to stabilize
461         something with no side-effects.
462
463 2005-04-05  Mark Mitchell  <mark@codesourcery.com>
464
465         PR c++/20763
466         * decl.c (grokdeclarator): Correct attribute handling.
467
468 2005-04-05  Mark Mitchell  <mark@codesourcery.com>
469
470         PR c++/19159
471         * decl2.c (import_export_decl): Use non-COMDAT external linkage
472         for virtual tables, typeinfo, etc. that will be emitted in only
473         one translation unit on systems without weak symbols.
474
475 2005-04-04  Mark Mitchell  <mark@codesourcery.com>
476
477         PR c++/20679
478         * parser.c (cp_parser_template_name): Fix thinko.
479
480 2005-04-04  Nathan Sidwell  <nathan@codesourcery.com>
481
482         PR c++/20746
483         * method.c (use_thunk): Protect covariant pointer return
484         adjustments from NULL pointers.
485
486 2005-04-04  Jan Hubicka  <jh@suse.cz>
487
488         * decl2.c (finish_objects): Revert my previous patch.
489         (cp_finish_file): Likewise.
490
491 2005-04-03  Kazu Hirata  <kazu@cs.umass.edu>
492
493         * pt.c: Fix comment typos.
494
495 2005-04-03  Nathan Sidwell  <nathan@codesourcery.com>
496
497         PR c++/20723
498         * pt.c (more_specialized_fn): Member functions are unordered wrt
499         non-members.  Conversion operators are unordered wrt other
500         functions.
501
502 2005-04-01  Nathan Sidwell  <nathan@codesourcery.com>
503
504         * call.c (add_template_candidates_real): Remove length parameter
505         from fn_type_unification call.
506         * class.c (resolve_address_of_overloaded_function): Likewise
507         * cp-tree.h (fn_type_unification): Remove length parameter.
508         * pt.c (get_bindings_overload): Remove.
509         (get_bindings_real): Rename to ...
510         (get_bindings): ... here.  Remove length and strict
511         parameters. Change return type flag to boolean.  Remove original
512         forwarding function.
513         (determine_specialization): Adjust get_bindings call.
514         (fn_type_unification): Remove length parameter.  Adjust.
515         (type_unification_real): Remove length parameter.  Adjust.
516         (resolve_overloaded_unification): Adjust get_bindings call.
517         (try_one_overload): Simplify confusing cascaded if control flow.
518         (unify): Remove length paramter from type_unification_real call.
519         (most_specialized_instantiation): Adjust get_bindings calls.
520         (most_specialized): Likewise.
521
522 2005-03-31  Nathan Sidwell  <nathan@codesourcery.com>
523
524         PR c++/19203, implement DR 214
525         * call.c (joust): Use more_specialized_fn.
526         * cp-tree.h (DEDUCE_ORDER): Remove.
527         (more_specialized): Replace with ...
528         (more_specialized_fn): ... this.
529         * pt.c (maybe_adjust_types_for_deduction): Remove DEDUCE_ORDER
530         case.
531         (type_unification_real): Remove DEDUCE_ORDER case.
532         (more_specialized): Replace with ...
533         (more_specialized_fn): ... this.  Implement DR 214.
534         (most_specialized_instantiation): Use get_bindings_real directly.
535
536 2005-03-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
537
538         PR c++/18644
539         * call.c (build_new_op): Remove check for -Wsynth.
540
541 2005-03-31  Jan Hubicka  <jh@suse.cz>
542
543         * decl2.c (finish_objects): Mark ctor as needed.
544         (cp_finish_file): Output variables only in nonunit-at-a-time.
545
546 2005-03-29  Richard Henderson  <rth@redhat.com>
547
548         PR c/20519
549         * decl.c (cp_complete_array_type): Rename from complete_array_type.
550         Use the new complete_array_type in c-common.c.  Update all callers.
551         * cp-tree.h (cp_complete_array_type): Update to match.
552
553 2005-03-24  Geoffrey Keating  <geoffk@apple.com>
554
555         * typeck.c (build_static_cast_1): Allow scalar_cast between
556         any integral, floating, or enumeration type.
557
558 2005-03-24  Steven Bosscher  <stevenb@suse.de>
559
560         * typeck.c (comptypes): First determine if the types are compatible
561         from a target-independent point of view.  Check target attributes
562         last.
563
564         * class.c (build_base_path):
565         (build_vbase_offset_vtbl_entries):
566         (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN.
567         * error.c (dump_expr): Likewise.
568         * init.c (build_zero_init, expand_cleanup_for_base,
569         build_vec_delete_1): Likewise.
570         * mangle.c (write_integer_cst): Likewise.
571         * method.c (thunk_adjust): Likewise.
572         * pt.c (convert_nontype_argument, tsubst, unify): Likewise.
573         * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise.
574         * typeck.c (build_ptrmemfunc_access_expr,
575         (get_member_function_from_ptrfunc): Likewise.
576
577 2005-03-23  Joseph S. Myers  <joseph@codesourcery.com>
578
579         * cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
580
581 2005-03-23  Joseph S. Myers  <joseph@codesourcery.com>
582
583         * cp-tree.h (perform_integral_promotions): Remove.
584         (default_conversion): Add.
585
586 2005-03-22  Mark Mitchell  <mark@codesourcery.com>
587
588         * parser.c (cp_parser_warn_min_max): New function.
589         (cp_parser_binary_expression): Use it.
590         (cp_parser_assignment_operator_opt): Likewise.
591         (cp_parser_operator): Likewise.
592
593 2005-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
594
595         PR c++/19980
596         * decl.c (start_preparsed_function): Robustify.
597
598 2005-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
599
600         PR c++/20499
601         * parser.c (cp_parser_class_head): Return NULL_TREE when
602         encountering a redefinition.
603
604 2005-03-22  Nathan Sidwell  <nathan@codesourcery.com>
605
606         PR c++/20465
607         PR c++/20381
608         * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a
609         template.
610
611 2005-03-21  Paolo Carlini  <pcarlini@suse.de>
612
613         PR c++/20461
614         PR c++/20536
615         * init.c (emit_mem_initializers): Don't crash on undefined
616         types.
617
618 2005-03-21  Paolo Carlini  <pcarlini@suse.de>
619
620         PR c++/20147
621         * semantics.c (finish_stmt_expr_expr): Return immediately
622         if error_operand_p (expr).
623
624 2005-03-21  Joseph S. Myers  <joseph@codesourcery.com>
625
626         * cp-tree.h (lvalue_or_else, lvalue_p): New.
627         * typeck.c (lvalue_or_else): New.  Call lvalue_error.
628
629 2005-03-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
630
631         PR c++/20240
632         * decl.c (decls_match): Compare context of VAR_DECL.
633
634 2005-03-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
635
636         PR c++/20333
637         * parser.c (cp_parser_postfix_expression) <case RID_TYPENAME>:
638         Check the return value of cp_parser_nested_name_specifier.
639
640 2005-03-18  Dale Johannesen <dalej@apple.com>
641
642         * cp/tree.c (cp_tree_equal):  Handle SSA_NAME.
643
644 2005-03-18  Paolo Carlini  <pcarlini@suse.de>
645
646         PR c++/20463
647         * parser.c (cp_parser_diagnose_invalid_type_name):
648         Check TYPE_BINFO (current_class_type) before attempting
649         to emit inform messages.
650
651 2005-03-17  Paolo Carlini  <pcarlini@suse.de>
652
653         PR c++/19966
654         * cp-tree.h (grok_op_properties): Change return type to void.
655         * decl.c (grok_op_properties): Return early - don't check the
656         arity - in case of a static member or an operator that cannot
657         be non-member; tidy a bit.
658
659 2005-03-17  Nathan Sidwell  <nathan@codesourcery.com>
660
661         PR c++/20186
662         * pt.c (contains_dependent_cast_p): Remove.
663         (fold_non_dependent_expr): Don't use it.
664         (value_dependent_expression_p): Use a switch statement.
665         reference_exprs can be dependent.
666
667 2005-03-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
668
669         PR c++/4403
670         PR c++/9783, DR433
671         * name-lookup.c (pushtag): Skip template parameter scope when
672         scope is ts_global.  Don't push tag into template parameter
673         scope.
674         * pt.c (instantiate_class_template): Reorder friend class
675         template substitution to handle non-dependent friend class
676         that hasn't been previously declared.
677
678 2005-03-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
679
680         Friend class name lookup 5/n
681         PR c++/1016
682         * cp-tree.h (pushtag): Adjust declaration.
683         * decl.c (lookup_and_check_tag): Call lookup_type_scope if
684         lookup_name fails.
685         (xref_tag): Adjust call to pushtag.  Make hidden class visible.
686         (start_enum): Adjust call to pushtag.
687         * name-lookup.c (ambiguous_decl): Ignore hidden names.
688         (qualify_lookup): Change return type to bool.
689         (hidden_name_p): New function.
690         (lookup_namespace_name, unqualified_namespace_lookup,
691         lookup_name_real): Use it.
692         (lookup_type_scope): Update comments.
693         (maybe_process_template_type_declaration): Change parameter name
694         from globalize to is_friend.
695         (pushtag): Change globalize parameter of type int to tag_scope.
696         Hide name if introduced by friend declaration.
697         * name-lookup.h (hidden_name_p): Add declaration.
698         * parser.c (cp_parser_lookup_name): Don't deal with hidden name
699         here.
700         * pt.c (push_template_decl_real): Make hidden class template
701         visible.
702         (lookup_template_class, instantiate_class_template): Adjust call
703         to pushtag.
704         * semantics.c (begin_class_definition): Likewise.
705         * rtti.c (init_rtti_processing, build_dynamic_cast_1, 
706         tinfo_base_init, emit_support_tinfos): Use ts_current instead of
707         ts_global.
708
709 2005-03-13  Mark Mitchell  <mark@codesourcery.com>
710
711         PR c++/20157
712         * pt.c (determine_specialization): Reject non-specializations. 
713
714 2005-03-11  Per Bothner  <per@bothner.com>
715
716         * cp-tree.h (struct cp_declarator): New id_loc field.
717         * cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's
718         location using c_lex_with_flags, instead of input_location.
719         (cp_parser_direct_declarator): Set declarator's id_loc from
720         cp_token's id_loc.
721
722 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
723
724         PR c++/18384, c++/18327
725         * decl.c (reshape_init_array): Use UHWI type for max_index_cst
726         and index.  Convert max_index to size_type_node if it isn't
727         host_integerp (, 1).
728
729 2005-03-09  Mark Mitchell  <mark@codesourcery.com>
730
731         PR c++/20208
732         * pt.c (tsubst_decl): Apply array-to-pointer and
733         function-to-pointer conversions to function arguments.
734         (regenerate_decl_from_template): Likewise.
735
736 2005-03-09  Paolo Carlini  <pcarlini@suse.de>
737
738         PR c++/16859    
739         * decl.c (complete_array_type): In pedantic mode, return
740         3 for an empty initializer list as the initializer for an
741         array of unknown bound (8.5.1/4).
742         (maybe_deduce_size_from_array_init): Fix final test to use
743         the above.
744
745 2005-03-08  Nathan Sidwell  <nathan@codesourcery.com>
746
747         PR c++/20186
748         * pt.c (contains_dependent_cast_p): New.
749         (fold_non_dependent_expr): Call it.
750
751 2005-03-08  Mark Mitchell  <mark@codesourcery.com>
752
753         PR c++/20142
754         * cp-tree.h (target_type): Remove.
755         * decl.c (layout_var_decl): Remove #if 0'd code.
756         (cp_finish_decl): Remove dead code.
757         * init.c (build_vec_init): When determining whether or not the
758         element type has an asignment operator, look through all array
759         dimensions. 
760         * typeck.c (target_type): Remove.
761
762 2005-03-07  Mark Mitchell  <mark@codesourcery.com>
763
764         * class.c (finish_struct_1): Do not warn about non-virtual
765         destructors in Java classes.
766
767 2005-03-05  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
768
769         PR c++/19311
770         * init.c (build_offset_ref): Don't build non-dependent SCOPE_REF.
771         * pt.c (build_non_dependent_expr): Don't build NON_DEPENDENT_EXPR
772         for OFFSET_TYPE.
773         * typeck.c (build_x_unary_op): Don't build non-dependent SCOPE_REF.
774         Also set PTRMEM_OK_P for NON_DEPENDENT_EXPR.
775         (build_unary_op): Handle building ADDR_EXPR of OFFSET_REF inside
776         template.
777
778 2005-03-02  Alexandre Oliva  <aoliva@redhat.com>
779
780         * name-lookup.c (push_overloaded_decl): Don't error if the new
781         decl matches the old one.
782         * decl.c (redeclaration_error_message): Likewise.
783
784 2005-03-01  Per Bothner  <per@bothner.com>
785
786         * decl.c (finish_function): Use SET_EXPR_LOCATION instead of
787         unavailable annotate_with_file_line, if USE_MAPPED_LOCATION.
788
789 2005-03-01  Nathan Sidwell  <nathan@codesourcery.com>
790
791         PR c++/20232
792         * class.c (update_vtable_entry_for_fn): Don't crash on invalid
793         covariancy. 
794
795         * cp-tree.g (THUNK_TARGET): Expand comment.
796         * method.c (use_thunk): Make sure we also use the target, if that
797         is a thunk.
798
799 2005-02-27  Jakub Jelinek  <jakub@redhat.com>
800
801         PR c++/20206
802         * decl.c (cxx_comdat_group): Put thunks for
803         TARGET_USE_LOCAL_THUNK_ALIAS_P (function) functions into the same
804         comdat group as the thunk target.
805
806 2005-02-24  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
807
808         * call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c,
809         parser.c: Fix comment typo(s).
810
811 2005-02-24  Jakub Jelinek  <jakub@redhat.com>
812
813         PR c++/20175
814         * decl.c (reshape_init): Don't warn about missing braces if STRING_CST
815         initializes a char/wchar_t array.
816
817 2005-02-23  Mark Mitchell  <mark@codesourcery.com>
818
819         PR c++/19878
820         * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
821         with internal linkage.
822
823 2005-02-23  Alexandre Oliva  <aoliva@redhat.com>
824
825         * decl.c (grokvardecl): Don't exempt anonymous types from having
826         linkage for variables that have linkage other than "C".
827
828 2005-02-23  Kazu Hirata  <kazu@cs.umass.edu>
829
830         * cp-objcp-common.h, error.c: Update copyright.
831
832 2005-02-22  Mark Mitchell  <mark@codesourcery.com>
833
834         PR c++/20073
835         * decl.c (start_decl_1): Don't clear TREE_READONLY.
836         (cp_finish_decl): Likewise.
837         (complete_vars): Call cp_apply_type_quals_to_decl.
838         * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in
839         cases where that's not valid.
840
841         PR c++/19991
842         * init.c (integral_constant_value): Iterate if the value of a decl
843         is itself a constant.
844
845         PR c++/20152
846         * parser.c (cp_parser_class_head): Check for redefintions here.
847         * semantics.c (begin_class_definition): Not here.
848         
849         PR c++/20153
850         * decl2.c (build_anon_union_vars): Add type parameter.
851         (finish_anon_union): Pass it.
852
853         PR c++/20148
854         * error.c (dump_expr): Do not print the body of a BIND_EXPR.
855         Handle STATEMENT_LIST.
856
857         PR c++/19883
858         * parser.c (cp_parser_direct_declarator): Always complain about
859         non-constant array bounds when in a function scope.
860         * semantics.c (finish_id_expression): Do not mark dependent names
861         as non-constant. 
862
863 2005-02-21  Douglas Gregor  <dgregor@cs.indiana.edu>
864         
865         PR c++/19076
866         PR c++/6628
867         * cp-tree.h (cp_apply_type_quals_to_decl): Declared.
868         * decl.c (grokdeclarator): Pedwarn about qualifying a function
869         type. 
870         Add qualifiers when declaring a typedef of a function type.
871         Member function pointers pick up the qualifiers of the typedef
872         used to declare them.
873         Don't complain about creating cv-qualified function types.
874         Complain about qualified function typedefs that are used to
875         declare non-static member functions or free functions.
876         Use cp_apply_type_quals_to_decl.
877         (start_preparsed_function): Use cp_apply_type_quals_to_decl.
878         (grokclassfn): Use cp_apply_type_quals_to_decl.
879         * error.c (dump_type_suffix): Print qualifiers for function
880         types. 
881         * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
882         (tsubst): When substituting a function type into a member
883         pointer type, pass along the qualifiers.
884         (unify): Unify member pointers to member function pointers.
885         * tree.c (cp_build_qualified_type_real): Function types may be
886         qualified. This includes restrict qualifiers.
887         * typeck.c (cp_apply_type_quals_to_decl): New function to replace
888         use of c_apply_type_quals_to_decl. Drops qualifiers that are being
889         added to function types.
890
891 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
892
893         PR 18785
894         * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
895         c_common_to_target_charset.  Delete bogus comment.
896
897 2005-02-18  Richard Henderson  <rth@redhat.com>
898
899         PR libstdc++/10606
900         * except.c (do_get_exception_ptr): New.
901         (expand_start_catch_block): Use it.
902
903 2005-02-19  Jakub Jelinek  <jakub@redhat.com>
904
905         * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING
906         if type is not error_mark_node.
907
908 2005-01-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
909
910         PR c++/19508
911         * decl2.c (grokfield): Do not apply attributes to template parameters
912         as they are ignored by tsubst anyway.
913
914 2005-02-18  Jakub Jelinek  <jakub@redhat.com>
915
916         PR c++/19813
917         * decl.c (start_decl_1): Clear TREE_READONLY flag if
918         its type has TYPE_NEEDS_CONSTRUCTING.
919         (complete_vars): Likewise.
920
921 2005-02-17  Alexandre Oliva  <aoliva@redhat.com>
922
923         PR c++/20028
924         * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a
925         template along with TYPE_SIZE.
926
927         PR c++/20022
928         * semantics.c (perform_deferred_access_checks): Use
929         get_deferred_access_checks to get the top of the stack.
930
931 2005-02-15  Alexandre Oliva  <aoliva@redhat.com>
932
933         PR c++/17788
934         * class.c (add_implicitly_declared_members, check_field_decl)
935         (check_field_decls, check_bases): Remove arguments, tests and
936         assignments of cant_have_default_ctor-related variables.
937
938 2005-02-15  Alexandre Oliva  <aoliva@redhat.com>
939
940         * decl2.c (mark_used): Set the source location of the used decl to
941         the current input location here...
942         * method.c (synthesize_method): ... not here.  Set input_location
943         from the decl instead.
944
945 2005-02-14  Nathan Sidwell  <nathan@codesourcery.com>
946
947         PR c++/19608
948         * parser.c (cp_parser_late_parsing_for_member): Use
949         current_function_decl as scope to push to and from.
950
951         PR c++/19884
952         * pt.c (check_explicit_specialization): Make sure namespace
953         binding lookup found an overloaded function.
954         (lookup_template_function): Just assert FNS is an overloaded
955         function.
956
957         PR c++/19895
958         * decl.c (grokdeclarator): Check for error mark node in ptrmem
959         construction.
960
961 2005-02-14  Alexandre Oliva  <aoliva@redhat.com>
962
963         PR c++/17816
964         * decl.c (redeclaration_error_message): Report redefinition of
965         pure virtual function.
966
967 2005-02-14  Nathan Sidwell  <nathan@codesourcery.com>
968
969         PR c++/19891
970         * class.c (build_simple_base_path): Build the component_ref
971         directly.
972         (update_vtable_entry_for_fn): Walk the covariant's binfo chain
973         rather than using lookup_base.
974         * search.c (dfs_walk_once): Add non-recursive assert check.
975         * typeck.c (build_class_member_access_expr): It is possible for
976         the member type to be both const and volatile.
977
978 2005-02-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
979
980         PR c++/14479
981         PR c++/19487
982         * pt.c (maybe_check_template_type): Remove.
983         * cp-tree.h (maybe_check_template_type): Remove prototype.
984         * name-lookup.c (maybe_process_template_type_declaration): Don't
985         use maybe_check_template_type.
986
987 2005-02-11  Richard Henderson  <rth@redhat.com>
988
989         PR c++/19632
990         * pt.c (get_mostly_instantiated_function_type): Save and restore
991         flag_access_control instead of push/pop_access_scope.
992
993 2005-02-10  Mark Mitchell  <mark@codesourcery.com>
994
995         PR c++/19755
996         * decl.c (reshape_init): Issue warnings about missing braces.
997
998 2005-02-11  Kazu Hirata  <kazu@cs.umass.edu>
999
1000         * cp-tree.def, except.c, ptree.c: Update copyright.
1001
1002 2005-02-09  Mark Mitchell  <mark@codesourcery.com>
1003
1004         PR c++/19811
1005         * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
1006         attempting name lookup.
1007
1008         * parser.c (cp_parser_unqualified_id): Initialize type_decl.
1009
1010         PR c++/19787
1011         * call.c (initialize_reference): Robustify.
1012
1013         PR ++/19732
1014         * decl.c (grokdeclarator): Check for invalid use of destructor
1015         names.
1016
1017         PR c++/19762
1018         * parser.c (cp_parser_unqualified_id): Avoid creating destructor
1019         names with invalid types.
1020
1021         PR c++/19826
1022         * parser.c (cp_parser_direct_declarator): Allow type-dependent
1023         expressions as array bounds.
1024
1025         PR c++/19739
1026         * parser.c (cp_parser_attributes_list): Allow empty lists.
1027
1028 2005-02-08  Mark Mitchell  <mark@codesourcery.com>
1029
1030         PR c++/19733
1031         * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR.
1032         (check_bases): Give warnings about a base class with a
1033         non-virtual destructor, even if it is implicit.
1034         (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR.
1035         (maybe_warn_about_overly_private_class): Don't use
1036         TYPE_HAS_DESTRUCTOR.
1037         (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR.
1038         (check_for_override): Give it external linkage.
1039         (add_implicitly_declared_members): Generate destructors lazily.
1040         (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
1041         TYPE_HAS_DESTRUCTOR.
1042         (check_bases_and_members): Call check_methods before
1043         check_field_decls.
1044         (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
1045         TYPE_HAS_DESTRUCTOR.
1046         (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR.
1047         * cp-tree.def (PSEUDO_DTOR_EXPR): Document.
1048         * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove.
1049         (lang_type_class): Add lazy_destructor.
1050         (CLASSTYPE_LAZY_DESTRUCTOR): New macro.
1051         (CLASSTYPE_DESTRUCTORS): Robustify.
1052         (TYPE_HAS_DESTRUCTOR): Remove.
1053         (check_for_override): Declare.
1054         (build_vbase_delete): Remove.
1055         * cvt.c (convert_to_void): Issue errors about pseudo-destructor
1056         expressions.
1057         * decl.c (cxx_maybe_build_cleanup): Remove dead code.
1058         * except.c (dtor_nothrow): Lazily create destructors if necessary.
1059         (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
1060         * init.c (build_delete): Lazily create destructors, if necessary.
1061         (build_vbase_delete): Remove.
1062         * method.c (locate_dtor): Simplify.
1063         (implicitly_declare_fn): Add support for destructors.
1064         * parser.c (cp_parser_lookup_name): Lazily create destructors, if
1065         necessary.
1066         * pt.c (check_explicit_specialization): Don't use
1067         TYPE_HAS_DESTRUCTOR.
1068         (instantiate_class_template): Likewise.
1069         * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR.
1070         * rtti.c (emit_support_tinfos): Robustify.
1071         * search.c (lookup_fnfields_1): Lazily create destructors.
1072         * typeck.c (build_class_member_access_expr): Remove
1073         PSEUDO_DTOR_EXPR handling.
1074         (lookup_destructor): Likewise.
1075
1076 2005-02-08  Kazu Hirata  <kazu@cs.umass.edu>
1077
1078         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update
1079         copyright.
1080
1081 2005-02-07  Mark Mitchell  <mark@codesourcery.com>
1082
1083         * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations
1084         on boolean variables.
1085         (cp_lexer_stop_debugging): Likewise.
1086
1087 2005-02-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1088
1089         PR c++/17401
1090         * parser.c (cp_parser_pure_specifier): Emit a specific error
1091         message with an invalid pure specifier.
1092         * decl2.c (grok_function_init): Remove.
1093         (grokfield): An initializer for a method is a always a pure
1094         specifier.
1095
1096 2005-02-02  Matt Austern  <austern@apple.com>
1097
1098         PR c++/19628
1099         * cp-tree.h (builtin_valid_in_constant_expr_p): Declare.
1100         * parser.c (cp_parser_postfix_expression): Accept function call in
1101         constant expression if builtin_valid_in_constant_expr_p is true
1102         for that function.
1103         * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly.
1104         * semantics.c (finish_id_expression): Accept function call in constant
1105         expression if builtin_valid_in_constant_expr_p is true for that
1106         function.
1107         * tree.c (builtin_valid_in_constant_expr_p): New.
1108
1109 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1110
1111         PR c++/17413
1112         * pt.c (check_instantiated_args): Improve error message.
1113         Fix logic when to print its second part.
1114
1115 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1116
1117         * cp-tree.h (complete_type_or_else): Remove macro.
1118         (complete_type_or_diagnostic): Rename to complete_type_or_else
1119         and remove last argument.
1120         * typeck.c (complete_type_or_diagnostic): Rename to
1121         complete_type_or_else and remove last argument.
1122
1123 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1124
1125         * cp-tree.h (commonparms): Remove prototype.
1126         (convert_arguments): Likewise.
1127         (PFN_FROM_PTRMEMFUNC): Remove.
1128         * typeck.c (commonparms): Make static.
1129         (convert_arguments): Add prototype. Make static.
1130         (PFN_FROM_PTRMEMFUNC): Replace by pfn_from_ptrmemfunc.
1131
1132 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1133
1134         * parser.c (cp_parser_primary_expression): Don't complain about
1135         floating-point literals in integral constant expressions when
1136         !pedantic.
1137
1138 2005-02-01  Alexandre Oliva  <aoliva@redhat.com>
1139
1140         * parser.c (cp_parser_template_id): Revert comment patch too.
1141
1142         PR c++/18757
1143         PR c++/19366
1144         PR c++/19499
1145         * parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
1146         Issue an error when creating the template id.
1147         * pt.c (fn_type_unification): Return early if the explicit
1148         template arg list is an error_mark_node.
1149
1150 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1151
1152         * decl.c (build_enumerator): Do not issue duplicate error messages
1153         about invalid enumeration constants.
1154         * parser.c (cp_parser_non_integral_constant_expression): Always
1155         set parser->non_integral_constant_expression_p.
1156         (cp_parser_primary_expression): Add cast_p parameter.  Issue
1157         errors about invalid uses of floating-point literals in
1158         cast-expressions.
1159         (cp_parser_postfix_expression): Add cast_p parameter.
1160         (cp_parser_open_square_expression): Pass it.
1161         (cp_parser_parenthesized_expression_list): Add cast_p parameter.
1162         (cp_parser_unary_expression): Likewise.
1163         (cp_parser_new_placement): Pass it.
1164         (cp_parser_direct_new_declarator): Likewise.
1165         (cp_parser_new_initializer): Likewise.
1166         (cp_parser_cast_expression): Add cast_p parameter.
1167         (cp_parser_binary_expression): Likewise.
1168         (cp_parser_question_colon_clause): Likewise.
1169         (cp_parser_assignment_expression): Likewise.
1170         (cp_parser_expression): Likewise.
1171         (cp_parser_constant_expression): If an integral constant
1172         expression is invalid, return error_mark_node.
1173         (cp_parser_expression_statement): Pass cast_p.
1174         (cp_parser_condition): Likewise.
1175         (cp_parser_iteration_statement): Likewise.
1176         (cp_parser_jump_statement): Likewise.
1177         (cp_parser_mem_initializer): Likewise.
1178         (cp_parser_template_argument): Likewise.
1179         (cp_parser_parameter_declaration): Likewise.
1180         (cp_parser_initializer): Likewise.
1181         (cp_parser_throw_expression): Likewise.
1182         (cp_parser_attribute_list): Likewise.
1183         (cp_parser_simple_cast_expression): Likewise.
1184         (cp_parser_functional_cast): Likewise.
1185         (cp_parser_late_parsing_default_args): Likewise.
1186         (cp_parser_sizeof_operand): Save/restore
1187         non_integral_constant_expression_p.
1188
1189 2005-01-31  Mike Stump  <mrs@apple.com>
1190
1191         * parser.c (cp_lexer_new_main): Get the first token, first, before
1192         doing anything.
1193
1194 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1195
1196         * decl.c (start_decl): Add missing parentheses.
1197
1198 2005-01-30  Mark Mitchell  <mark@codesourcery.com>
1199
1200         PR c++/19555
1201         * cp-tree.h (DECL_USE_TEMPLATE): Expand documentation.
1202         * decl.c (duplicate_decls): Do not discard
1203         DECL_IMPLICIT_INSTANTIATION when merging declarations.
1204         (start_decl): Do not SET_DECL_TEMPLATE_SPECIALIZATION for
1205         variables that do not have DECL_USE_TEMPLATE.
1206
1207         PR c++/19395
1208         * decl.c (grokdeclarator): Refactor code so that qualified names
1209         are never allowed as the declarator in a typedef.
1210
1211         PR c++/19367
1212         * name-lookup.c (do_nonmember_using_decl): Avoid overloading
1213         builtin declarations.
1214
1215         PR c++/19457
1216         * call.c (convert_like_real): Inline call to
1217         dubious_conversion_warnings here.
1218         * cp-tree.h (dubious_conversion_warnings): Remove.
1219         * semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before
1220         setting TREE_NEGATED_INT.
1221         * typeck.c (dubious_conversion_warnings): Remove.
1222
1223         PR c++/19349
1224         * name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
1225         memory.
1226
1227 2005-01-28  Mark Mitchell  <mark@codesourcery.com>
1228
1229         PR c++/19253
1230         * parser.c (cp_parser_diagnose_invalid_type_name): Commit to
1231         tentative parses.
1232
1233         PR c++/19667
1234         * pt.c (redeclare_class_template): Robustify.
1235
1236 2005-01-27  Steven Bosscher  <stevenb@suse.de>
1237
1238         * decl.c (finish_case_label): Use SWITCH_STMT accessor macros
1239         instead of SWITCH_EXPR ones.
1240         * pt.c (tsubst_expr): Likewise.
1241         * semantics.c (begin_switch_stmt, finish_switch_cond,
1242         finish_switch_stmt): Likewise.
1243
1244 2005-01-26  J"orn Rennecke <joern.rennecke@st.com>
1245
1246         PR c++/18370
1247         * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.
1248
1249 2005-01-25  Andrew Pinski  <pinskia@physics.uc.edu>
1250
1251         * class.c (abort_fndecl_addr): New variable.
1252         (build_vtbl_initializer): If we have a pure virtual function
1253         share the abort function's address.
1254         Include gt-cp-class.h at the end.
1255         * config-lang.in (gtfiles): Add cp/class.c.
1256
1257 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1258
1259         * cxx-pretty-print.c (pp_cxx_statement): Add prototype. Make static.
1260         (pp_cxx_function_definition): Make static.
1261         * cxx-pretty-print.h (pp_cxx_statement): Remove prototype.
1262         (pp_cxx_function_definition): Likewise.
1263
1264 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1265
1266         * name-lookup.c (print_binding_level): Make static.
1267         (constructor_name_full): Make static inline.
1268         (current_decl_namespace): Make static.
1269         * name-lookup.h (constructor_name_full): Remove prototype.
1270         (print_binding_level): Likewise.
1271         (current_decl_namespace): Likewise.
1272
1273 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1274
1275         * decl.h (debug_bindings_indentation): Remove.
1276
1277 2005-01-23  Kazu Hirata  <kazu@cs.umass.edu>
1278
1279         * typeck.c: Fix a comment typo.
1280
1281 2005-01-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1282
1283         PR c++/19208
1284         * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr
1285         at least once.
1286         (tsubst): Use fold_decl_constant_value in place of a bare call to
1287         integral_constant_value.
1288
1289 2005-01-20  Kazu Hirata  <kazu@cs.umass.edu>
1290
1291         * typeck.c (more_qualified_p): Remove.
1292         * cp-tree.h: Remove the corresponding prototype.
1293
1294 2005-01-19  Matt Austern  <austern@apple.com>
1295
1296         * typeck.c (comptypes): Handle return code from objc_comptypes
1297         correctly.
1298
1299 2005-01-19  Kazu Hirata  <kazu@cs.umass.edu>
1300
1301         * cp-tree.h, name-lookup.h: Remove unused prototypes.
1302
1303 2005-01-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1304
1305         PR c++/19375
1306         * semantics.c (finish_id_expression): Disable access checking for
1307         already lookuped FIELD_DECL.
1308
1309 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
1310
1311         * decl.c (delete_block): Remove.
1312         * cp-tree.h: Remove the corresponding prototype.
1313
1314         * decl.c (vtable_decl_p, vtype_decl_p, walk_globals_data,
1315         walk_vtables_r, walk_vtables, walk_globals_r, walk_globals):
1316         Remove.
1317         * cp-tree.h: Remove the corresponding prototypes.
1318
1319         * tree.c (count_functions, bound_pmf_p, cp_is_overload_p,
1320         cp_update_decl_after_saving, name_p): Remove.
1321         * cp-tree.h: Remove the corresponding prototypes.
1322
1323 2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>
1324
1325         PR c/19472
1326         * semantics.c (finish_asm_stmt): Strip nops off
1327         input memory operands.
1328
1329 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
1330
1331         * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,
1332         typeck2.c: Update copyright.
1333
1334 2005-01-16  Kazu Hirata  <kazu@cs.umass.edu>
1335
1336         * class.c (get_enclosing_class): Remove.
1337         * cp-tree.h: Remove the corresponding prototypes.
1338
1339         * cvt.c (convert_lvalue): Remove.
1340         * cp-tree.h: Remove the corresponding prototype.
1341
1342         * pt.c (tinst_for_decl): Remove.
1343         * cp-tree.h: Remove the corresponding prototypes.
1344
1345         * tree.c (hash_chainon): Remove.
1346         * cp-tree.h: Remove the corresponding prototypes.
1347
1348 2005-01-15  Jakub Jelinek  <jakub@redhat.com>
1349
1350         PR c++/19263
1351         * typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
1352         of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
1353
1354 2005-01-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1355
1356         * Make-lang.in (cp-warn): Don't append $(WERROR).
1357
1358 2005-01-10  Kazu Hirata  <kazu@cs.umass.edu>
1359
1360         * cp-tree.h: Fix a comment typo.
1361
1362 2005-01-07  Nathan Sidwell  <nathan@codesourcery.com>
1363
1364         PR c++/19298
1365         * pt.c (tsubst_qualified_id): Call convert_from_reference.
1366
1367 2005-01-06  Mark Mitchell  <mark@codesourcery.com>
1368
1369         PR c++/19244
1370         * class.c (add_implicitly_declared_members): Remove dead code.
1371         * decl.c (grokfndecl): Add sfk parameter.  Use it do set
1372         DECL_CONSTRUCTOR_P.
1373         (grokdeclarator): Adjust calls to grokfndecl.
1374         * method.c (implicitly_declare_fn): Improve documentation.
1375         * parser.c (cp_parser_direct_declarator): Do not consider a
1376         function to be a constructor if the containing class was
1377         originally anonymous.
1378
1379 2005-01-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1380
1381         PR c++/17154
1382         * search.c (lookup_field_1): Handle using declaration in
1383         class template partial specialization.
1384
1385 2005-01-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1386
1387         PR c++/19258
1388         * pt.c (push_access_scope): Handle friend defined in class.
1389         (pop_access_scope): Likewise.
1390
1391 2005-01-06  Nathan Sidwell  <nathan@codesourcery.com>
1392
1393         PR c++/19270
1394         * pt.c (tsubst_copy) <ARRAY_REF case>: Handle separately.
1395         (tsubst_copy_and_build) <ARRAY_REF case>: Remove obsolete
1396         array-new handling code.  Use build_x_binary_op.
1397
1398 2005-01-05  Nathan Sidwell  <nathan@codesourcery.com>
1399
1400         PR c++/19030
1401         * cp-tree.h (start_decl): Take pointer to pushed scope, not bool.
1402         * name-lookup.h (push_scope): Return pushed scope, not flag.
1403         * name-lookup.c (push_scope): Return scope that should be popped,
1404         not a flag.
1405         * decl.c (start_decl): Adjust.
1406         (grokfndecl): Adjust scope push and pop.
1407         * decl2.c (check_classfn): Likewise.
1408         * parser.c (cp_parser_condition, cp_parser_conversion_function_id,
1409         cp_parser_init_declarator, cp_parser_direct_declarator,
1410         cp_parser_class_specifier, cp_parser_class_head,
1411         cp_parser_lookup_name,
1412         cp_parser_constructor_declarator_p): Likewise.
1413         * pt.c (instantiate_class_template,
1414         resolve_typename_type): Likewise.
1415
1416 2005-01-03  Volker Reichelt  <reichelt@igpm.rwth-aaachen.de>
1417
1418         PR c++/14136
1419         * parser.c (cp_parser_unqualified_id): Do not issue error message
1420         for typedef-name as destructor declarator when performing an
1421         uncommitted tentative parse.
1422
1423 2005-01-01  Steven Bosscher  <stevenb@suse.de>
1424
1425         PR middle-end/17544
1426         * decl.c (finish_function): Fix comment.  Annotate the compiler
1427         generated return with the current file name and line 0.
1428
1429 2004-12-31  Richard Henderson  <rth@redhat.com>
1430
1431         PR middle-end/17799
1432         * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P.
1433         * class.c (build_vtable): Don't conditionallize setting it
1434         based on DWARF2_DEBUG.
1435         (layout_class_type): Set DECL_IGNORED_P.
1436         * decl2.c (get_guard): Likewise.
1437         * rtti.c (get_tinfo_decl, build_lang_decl): Likewise.
1438         * tree.c (build_local_temp): Likewise.
1439
1440 2004-12-30  Mark Mitchell  <mark@codesourcery.com>
1441
1442         * cp-tree.h (cp_declarator): Split "name" field into
1443         qualifying_scope and unqualified_name.
1444         * decl.c (get_scope_of_declarator): Adjust accordingly.
1445         (grokdeclarator): Likewise.
1446         * decl2.c (grokfield): Likewise, and adjust call to
1447         do_class_using_decl.
1448         * name-lookup.c (do_class_using_decl): Split "decl" into
1449         "scope" and "name".  Remove unnecessary code.
1450         * name-lookup.h (do_class_using_decl): Adjust declaration.
1451         * parser.c (make_id_declarator): Split "id" into qualifying_scope
1452         and unqualified_name.
1453         (cp_parser_using_declaration): Adjust call to do_class_using_decl.
1454         (cp_parser_direct_declarator): Adjust to handle the fact that
1455         cp_parser_declarator_id no longer returns a SCOPE_REF.
1456         (cp_parser_direct_declarator): Likewise.
1457         (cp_parser_declarator_id): Do not create a SCOPE_REF for qualified
1458         names.
1459         (cp_parser_member_declaration): Adjust call to make_id_declarator.
1460         (cp_parser_check_declarator_template_parameters): Do not expect a
1461         SCOPE_REF.
1462
1463         * decl.c (duplicate_decls): Call ggc_free on declarations we will
1464         not be needing any longer.
1465
1466         PR c++/19190
1467         * cvt.c (convert_to_void): Do not use STRIP_NOPs.
1468
1469 2004-12-28  Richard Henderson  <rth@redhat.com>
1470
1471         PR inline-asm/15740
1472         * semantics.c (finish_asm_stmt): Resolve asm names.  Validate input
1473         constraints.  Mark memory inputs addressable.
1474
1475 2004-12-27  Jason Merrill  <jason@redhat.com>
1476
1477         * decl.c (expand_static_init): Don't use shortcut if
1478         targetm.relaxed_ordering.
1479
1480 2004-12-27  Mark Mitchell  <mark@codesourcery.com>
1481
1482         PR c++/19149
1483         * decl.c (check_tag_decl): Robustify.
1484
1485 2004-12-23  Mark Mitchell  <mark@codesourcery.com>
1486
1487         PR c++/17595
1488         * parser.c (cp_parser_error): Issue better messages about
1489         #pragma in locations where it is not permitted.
1490
1491         PR c++/17413
1492         * pt.c (check_instantiated_args): Remove bogus SFINAE code.
1493
1494         * cvt.c (convert_to_void): Fix typo in comment.
1495
1496 2004-12-23  Alexandre Oliva  <aoliva@redhat.com>
1497
1498         PR c++/18962
1499         * pt.c (check_explicit_specialization): Use the argument list from
1500         the definition in a template function specialization definition.
1501
1502 2004-12-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1503
1504         PR c++/18733
1505         * pt.c (check_explicit_specialization): Use special logic to validate
1506         befriended specializations.
1507
1508 2004-12-22  Mark Mitchell  <mark@codesourcery.com>
1509
1510         * rtti.c (emit_support_tinfos): Avoid using C99 semantics.
1511
1512         PR c++/18464
1513         * call.c (build_this): In templates, do not bother with
1514         build_unary_op.
1515         * typeck.c (unary_complex_lvalue): In a template, always refuse
1516         simplifications.
1517
1518         PR c++/18492
1519         * cp-gimplify.c (cp_genericize): Relax assertion.
1520
1521         PR c++/11224
1522         * cvt.c (convert_to_void): Warn about unused values.
1523
1524         PR c++/18257
1525         * rtti.c (emit_support_tinfos): On systems without weak symbols,
1526         emit the runtime library type-info objects as non-COMDAT.
1527
1528 2004-12-21  Mark Mitchell  <mark@codesourcery.com>
1529
1530         PR c++/18378
1531         * call.c (convert_like_real): Do not permit the use of a copy
1532         constructor to copy a packed field.
1533
1534         PR c++/19063
1535         * decl.c (grokdeclarator): Return error_mark_node, not
1536         void_type_node, to indicate errors.
1537         * parser.c (cp_parser_template_parameter_list): Robustify.
1538         (cp_parser_template_parameter): Likewise.
1539
1540         PR c++/19034
1541         * tree.c (cp_tree_equal): Handle OVERLOAD.
1542
1543 2004-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1544
1545         * decl.c (define_label): Use POP_TIMEVAR_AND_RETURN.
1546         * name-lookup.c (pushdecl_class_level): Likewise.
1547
1548 2004-12-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1549
1550         * name-lookup.c (pushtag): Add missing POP_TIMEVAR_AND_RETURN.
1551
1552 2004-12-21  Andrew Pinski  <pinskia@physics.uc.edu>
1553
1554         PR c++/18984
1555         * cp-gimplify.c (cp_genericize_r): Don't insert first but instead
1556         check to see if contains the pointer.  Insert the statement before
1557         returning.
1558
1559 2004-12-21  Nathan Sidwell  <nathan@codesourcery.com>
1560
1561         PR c++/14075
1562         * decl.c (check_initializer): Check string initializer of array is
1563         not parenthesized.
1564         * cp-tree.h (PAREN_STRING_LITERAL_P): New.
1565         * semantics.c (finish_parenthesized_expr): Mark a STRING_CST.
1566         * error.c (dump_expr): <STRING_CST case> Add parens, if needed.
1567
1568         * cp-tree.def (TEMPLATE_TYPE_PARM,
1569         BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder
1570         for better code efficiency.
1571         * cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check.
1572         (CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization.
1573         (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P,
1574         INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P,
1575         CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P,
1576         TYPE_PTROBV_P): Likewise.
1577
1578         PR c++/18975
1579         * method.c (do_build_copy_constructor): Refactor. Don't const
1580         qualify a mutable field.
1581         (do_build_assign_ref): Likewise.
1582
1583 2004-12-20  Matt Austern <austern@apple.com>
1584
1585         PR c++/19044
1586         * decl.c (make_rtl_for_nonlocal_decl): Use
1587         set_builtin_user_assembler_name.
1588
1589 2004-12-19  Mark Mitchell  <mark@codesourcery.com>
1590
1591         * cp-tree.h (note_decl_for_pch): New function.
1592         * class.c (build_clone): Call note_decl_for_pch.
1593         * semantics.c (finish_member_declaration): Likewise.
1594         (note_decl_for_pch): New function.
1595
1596 2004-12-17  Steven Bosscher  <stevenb@suse.de>
1597
1598         * init.c (build_zero_init): max_index is the number of
1599         elements, minus 1.
1600
1601 2004-12-17  Nathan Sidwell  <nathan@codesourcery.com>
1602
1603         PR c++/18721
1604         * class.c (add_method): Do not push conversion operators into a
1605         binding level.
1606
1607         * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE_TYPE): Reformat.
1608         * error.c (dump_decl): <TYPE_DECL case> Remove extraneous braces.
1609
1610 2004-12-16  Nathan Sidwell  <nathan@codesourcery.com>
1611
1612         PR c++/18905
1613         * cp-tree.h (integral_constant_value): Declare.
1614         * call.c (null_ptr_cst_p): Use integral_constant_value, not
1615         decl_constant_value.
1616         (convert_like_real): Likewise.
1617         * class.c (check_bitfield_decl): Likewise.
1618         * cvt.c (ocp_convert): Likewise.
1619         (convert): Remove unnecessary decl_constant_value call.
1620         * decl.c (compute_array_index_type): Use integral_constant_value,
1621         not decl_constant_value.
1622         (build_enumerator): Likewise.
1623         * decl2.c (grokfield): Likewise.
1624         * init.c (decl_constant_value): Simplify.
1625         (integral_constant_value): New.
1626         * pt.c (fold_decl_constant_value): Use integral_constant_value,
1627         remove subsequent check.
1628         (tsubst): Use integral_constant_value, not decl_constant_value.
1629         (tsubst_copy, unify): Likewise.
1630         * typeck.c (decay_conversion): Likewise.
1631         (build_compound_expr): Remove unnecessary decl_constant_value
1632         calls.
1633         (build_static_cast_1, build_reinterpret_cast_1):
1634         (convert_for_assignment): Remove comment about not calling
1635         decl_constant_value.
1636
1637 2004-12-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1638
1639         PR c++/18825
1640         * pt.c (instantiate_class_template): Set input_location for
1641         friend function.
1642         (tsubst_friend_function): Don't set input_location here.
1643         Make sure the context is complete if necessary.
1644
1645 2004-12-15  Nathan Sidwell  <nathan@codesourcery.com>
1646
1647         PR c++/18981
1648         * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE
1649         flag setting.
1650
1651 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
1652
1653         PR c++/18738
1654         * decl.c (make_typename_type): Do not handle namespace-scoped
1655         names here.
1656         (tag_name): Handle typename_type.
1657         (check_elaborated_type_specifier): Handle typenames.
1658         * parser.c (cp_parser_diagnose_invalid_type_name): Improve
1659         comment.
1660         (cp_parser_elaborated_type_specifier): Use
1661         cp_parser_diagnose_invalid_type_name.
1662
1663 2004-12-14  Andrew Pinski  <pinskia@physics.uc.edu>
1664
1665         PR c++/18965
1666         * init.c (build_zero_init): If the max_index is 0, there is no
1667         need to create a RANGE_EXPR.
1668
1669 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
1670
1671         PR c++/18793
1672         * cp-objcp-common.c (cp_expr_size): Loosen assertion.
1673
1674 2004-12-14  Nathan Sidwell  <nathan@codesourcery.com>
1675
1676         PR c++/18949
1677         * pt.c (tsubst_copy_and_build): <INDIRECT_REF case> Check that a
1678         REFERENCE_REF_P is dereferencing a reference type.
1679         * typeck.c (build_static_cast): Convert from reference even in a
1680         template.
1681         (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise.
1682
1683 2004-12-14  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1684
1685         * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function.
1686         (cp_parser_name_lookup_error): Use it.
1687         (cp_parser_check_for_invalid_template_id): Likewise.
1688         (cp_parser_skip_to_closing_parenthesis): Likewise.
1689         (cp_parser_nested_name_specifier_opt): Likewise.
1690         (cp_parser_simple_declaration, cp_parser_template_id): Likewise.
1691         (cp_parser_parameter_declaration_list): Likewise.
1692         (cp_parser_parameter_declaration): Likewise.
1693         (cp_parser_template_name): Let cp_parser_simulate_error perform
1694         the checking.
1695         (cp_parser_committed_to_tentative_parse): Remove.
1696
1697 2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>
1698
1699         PR c++/18968
1700         * class.c (build_base_path): Convert the zero constant to the correct
1701         type when comparing.
1702
1703 2004-12-13  Mark Mitchell  <mark@codesourcery.com>
1704
1705         PR c++/18925
1706         * class.c (layout_class_type): Determine the visibility of static
1707         data members.
1708
1709 2004-12-12  Roger Sayle  <roger@eyesopen.com>
1710
1711         PR middle-end/12454
1712         * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the
1713         condition is a constant and the unexecuted clause is empty.
1714
1715 2004-12-10  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1716
1717         PR c++/18731
1718         * parser.c (cp_parser_class_head): Reject typedef-name in class head.
1719
1720 2004-12-09  Matt Austern  <austern@apple.com>
1721
1722         PR c++/18514
1723         * name-lookup.c (do_nonmember_using_decl): A real function
1724         declaration takes precedence over an anticipated declaration.
1725
1726 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1727
1728         * parser.c (cp_parser_member_declaration): Fix comment typo.
1729
1730 2004-12-09  Alexandre Oliva  <aoliva@redhat.com>
1731
1732         PR c++/18757
1733         * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID
1734         if parsing failed.
1735
1736 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1737
1738         PR c++/18073
1739         * typeck.c (build_reinterpret_cast_1): Allow cast from vector type.
1740
1741 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
1742
1743         PR c++/16681
1744         * init.c (build_zero_init): Build a RANGE_EXPR for an array
1745         initializer.
1746
1747 2004-12-08  Kelley Cook  <kcook@gcc.gnu.org>
1748
1749         * typeck.c: Remove DOS line endings.
1750
1751 2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1752
1753         PR c++/18100
1754         * decl.c (lookup_and_check_tag): Diagnose nested class with
1755         the same name as enclosing class.
1756
1757 2004-12-08  Nathan Sidwell  <nathan@codesourcery.com>
1758
1759         PR c++/18803
1760         * cp-tree.h (REFERENCE_REF_P): New.
1761         (CPTI_TYPE_INFO_TYPE): Rename to ...
1762         (CPTI_CONST_TYPE_INFO_TYPE): ... here.
1763         (CPTI_TYPE_INFO_REF_TYPE): Remove.
1764         (type_info_type_node): Rename to ...
1765         (const_type_info_type_node): ... here.
1766         (type_info_ref_type): Remove.
1767         * call.c (build_user_type_conversion): Reformat.
1768         (resolve_args): Do not convert_from_reference.
1769         (build_object_call): Call convert_from_reference.
1770         (prep_operand): Do not convert_from_reference.
1771         (build_new_method_call): Likewise.
1772         * class.c (build_vfield_ref): Likewise.
1773         * cvt.c (convert_to_reference): Likewise.
1774         (convert_from_reference): Build INDIRECT_REF here, not with
1775         build_indirect_ref.
1776         (convert_force): Do not convert_from_reference.
1777         (build_expr_type_conversion): Likewise.
1778         * decl.c (grok_reference_init): Likewise.
1779         * decl2.c (delete_sanity): Likewise.
1780         * except.c (initialize_handler_parm): Use POINTER_TYPE_P.
1781         * init.c (build_dtor_call): Do not convert_from_reference.
1782         * parser.c (cp_parser_template_argument): Unwrap indirected
1783         reference. Allow TEMPLATE_PARM_INDEX as an object parm.
1784         * pt.c (tsubst_copy_and_build) <case INDIRECT_REF>: Use
1785         convert_from_reference, if indicated.
1786         <case CALL_EXPR>: Do not convert_from_reference.
1787         <case PARM_DECL, VAR_DECL>: Convert_from_reference if needed.
1788         (tsubst_initializer_list): Do not convert_from_reference.
1789         * rtti.c (init_rtti_processing): Adjust node creation.
1790         (throw_bad_typeid): Use const_type_info_type_node.
1791         Do not convert_from_reference.
1792         (typeid_ok_p): Use const_type_info_type_node.
1793         (build_typeid, get_typeid): Always return type_info typed node.
1794         (build_dynamic_cast_1): Dont convert_from_reference. Refactor.
1795         * semantics.c (finish_stmt_expr_expr): Do not
1796         convert_from_reference.
1797         (finish_id_expression): Convert_from_reference as appropriate.
1798         * typeck.c (decay_conversion): Do not convert_from_reference.
1799         (finish_class_member_access_expr): Likewise.
1800         (build_indirect_ref): Use POINTER_TYPE_P.
1801         (convert_arguments): Do not convert_from_reference.
1802         (build_modify_expr): Likewise.
1803         (convert_for_initialization): Likewise.
1804         * typeck2.c (build_x_arrow): Likewise.
1805
1806 2004-12-07  Ziemowit Laski  <zlaski@apple.com>
1807
1808         * cp-tree.h (struct lang_type_class): Rename 'objc_protocols'
1809         field to 'objc_info'.
1810
1811 2004-12-07  Kazu Hirata  <kazu@cs.umass.edu>
1812
1813         * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.
1814
1815 2004-12-07  Roger Sayle  <roger@eyesopen.com>
1816
1817         * name-lookup.c (leave_scope): We only need to update
1818         class_binding_level when leaving a class scope.
1819
1820 2004-12-06  Ziemowit Laski  <zlaski@apple.com>
1821
1822         * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field.
1823
1824 2004-12-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1825
1826         PR c++/17011, c++/17971
1827         * pt.c (tsubst_copy) <FIELD_DECL case>: Check and diagnose
1828         invalid field.
1829         (tsubst_copy_and_build) <COMPONENT_REF case>: Check
1830         error_mark_node after member substitution.
1831         * semantics.c (finish_id_expression): Call
1832         finish_non_static_data_member for non-dependent FIELD_DECL.
1833
1834 2004-12-03  Nathan Sidwell  <nathan@codesourcery.com>
1835
1836         PR c++/18782
1837         * decl.c (grokdeclarator): Make sure class in pointer to member is
1838         not a namespace.
1839
1840 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
1841
1842         PR c++/18318
1843         * parser.c (cp_parser_new_type_id): Move array size expression
1844         checks from here ...
1845         * init.c (build_new): ... to here.
1846
1847 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
1848
1849         PR c++/18758
1850         * parser.c (cp_parser_class_head): Return NULL_TREE when
1851         push_template_decl fails.  Update comment.
1852
1853 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1854
1855         PR c++/15664, c++/18276
1856         * pt.c (tsubst_decl) <TEMPLATE_DECL case>: Reorganize.  Correctly
1857         tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM.
1858
1859 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1860
1861         PR c++/18123
1862         * parser.c (cp_parser_type_specifier): Catch template declaration
1863         of enum.
1864
1865 2004-12-01  Matt Austern  <austern@apple.com>
1866
1867         * name-lookup.c (namespace_binding): Omit alias check for global
1868         namespace.
1869
1870 2004-12-01  Nathan Sidwell  <nathan@codesourcery.com>
1871
1872         PR c++/18729
1873         * parser.c (cp_parser_class_name): Check decl's type is not
1874         error_mark_node.
1875
1876         PR c++/17431
1877         * call.c (standard_conversion): Add FLAGS parameter. Do not allow
1878         derived to base conversion when checking constructor
1879         accessibility.
1880         (implicit_conversion): Pass FLAGS to standard_conversion.
1881         (check_constructir_callable): Disallow conversion functions.
1882
1883 2004-11-30  Kazu Hirata  <kazu@cs.umass.edu>
1884
1885         * parser.c: Fix comment typos.
1886
1887 2004-11-27  Mark Mitchell  <mark@codesourcery.com>
1888
1889         PR c++/18368
1890         * parser.c (cp_parser_check_for_definition_in_return_type): Take
1891         the defined type as a parameter, and inform the user about the
1892         possibility of a missing semicolon.
1893         (cp_parser_explicit_instantiation): Adjust call to
1894         cp_parser_check_for_definition_in_return_type.
1895         (cp_parser_init_declarator): Likewise.
1896         (cp_parser_member_declaration): Likewise.
1897
1898         PR c++/18674
1899         * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit
1900         typename from comments.
1901         * cp-tree.h (TYPENAME_IS_ENUM_P): New macro.
1902         (TYPENAME_IS_CLASS_P): Likewise.
1903         (make_typename_type): Change prototype.
1904         * decl.c (struct_typename_info): New type.
1905         (typename_compare): Expect the second argument to be a
1906         typename_info, not a tree.
1907         (build_typename_type): Add tag_type parameter.  Do not create a
1908         new type until necessary.
1909         (make_typename_type): Add tag_type parameter.
1910         * error.c (TYPENAME_TYPE): Print tags other than "typename" if
1911         appropriate.
1912         * friend.c (make_friend_class): Adjust call to make_typename_type.
1913         * parser.c (cp_parser_make_typename_type): Likewise.
1914         (cp_parser_primary_expression): Adjust call to
1915         cp_parser_lookup_name.
1916         (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name.
1917         (cp_parser_class_or_namespace_name): Likewise.
1918         (cp_parser_postfix_expression): Adjust calls to
1919         make_typename_type.
1920         (cp_parser_mem_initializer_id): Adjust calls to
1921         cp_parser_class_name.
1922         (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name.
1923         (cp_parser_template_name): Likewise.
1924         (cp_parser_template_argument): Likewise.
1925         (cp_parser_type_name): Adjust call to cp_parser_class_name.
1926         (cp_parser_elaborated_type_specifier): Adjust calls to
1927         make_typename_type and cp_parser_lookup_name.
1928         (cp_parser_namespace_name): Likewise.
1929         (cp_parser_class_name): Replace type_p parameter with tag_type.
1930         Adjust calls to make_typename_type and cp_parser_lookup_name.
1931         (cp_parser_class_head): Adjust calls to cp_parser_class_name.
1932         (cp_parser_base_specifier): Likewise.
1933         (cp_parser_lookup_name): Replace is_type parameter with tag_type.
1934         Adjust calls to make_typename_type and lookup_qualified_name.
1935         (cp_parser_lookup_name_simple): Adjust call to
1936         cp_parser_lookup_name.
1937         (cp_parser_constructor_declarator_p): Adjust call to
1938         cp_parser_class_name.
1939         * pt.c (convert_template_argument): Adjust all to
1940         make_typename_type.
1941         (tsubst_decl): Do not pre-substitute the type of the declaration.
1942         (tsubst): Hand off declarations more quickly.  Adjust call to
1943         make_typename_type.
1944
1945         PR c++/18512
1946         * parser.c (cp_parser_postfix_dot_deref_expression): Robustify.
1947
1948 2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>
1949
1950         PR c/7544
1951         * Make-lang.in (cp/decl2.o): Update dependencies.
1952         * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.
1953
1954 2004-11-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1955
1956         PR c++/18652
1957         * name-lookup.c (pushtag): Change return type to tree.
1958         * cp-tree.h (pushtag): Adjust declaration.
1959         * decl.c (xref_tag, start_enum): Use return value of pushtag.
1960         * pt.c (push_template_decl_real): Return immediately if
1961         pushdecl_namespace_level returns error_mark_node.
1962
1963 2004-11-27  Kazu Hirata  <kazu@cs.umass.edu>
1964
1965         * pt.c: Fix a comment typo.
1966
1967 2004-11-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1968
1969         Friend class name lookup 4/n
1970         * class.c (pushclass): Don't call cxx_remember_type_decls.
1971         * cp-tree.h (clear_anon_tags): Remove declaration.
1972         * decl.c (grokdeclarator): Don't call lookup_tag_reverse.
1973         * name-lookup.c (binding_entry_free, binding_table_free): Comment
1974         out functions.
1975         (binding_table_find_anon_type, binding_table_reverse_maybe_remap,
1976         binding_table_remove_anonymous_types, cxx_remember_type_decls,
1977         bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag,
1978         lookup_tag_reverse): Remove
1979         (begin_scope, leave_scope, kept_level_p, print_binding_level):
1980         Don't use type_decls field in cp_binding_level.
1981         (maybe_process_template_type_declaration, pushtag): Set
1982         CLASSTYPE_NESTED_UTDS directly.
1983         * name-lookup.h (binding_table_remove_anonymous_types,
1984         cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove
1985         declaration.
1986         (cp_binding_level): Remove type_decls field.
1987
1988 2004-11-26  Kazu Hirata  <kazu@cs.umass.edu>
1989
1990         * typeck.c: Fix a comment typo.
1991
1992 2004-11-25  Mark Mitchell  <mark@codesourcery.com>
1993
1994         PR c++/18445
1995         * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
1996         unknown_type as non matching.  Tidy up.
1997         * pt.c (build_non_dependent_expr): Do not build a
1998         NON_DEPENDENT_EXPR for a VAR_DECL.
1999
2000         PR c++/18001
2001         * cp-tree.h (lvalue_or_else): Remove declaration.
2002         * tree.c (lvalue_or_else): Remove.
2003         * typeck.c (build_unary_op): Adjust call to lvalue_or_else.
2004         (build_modify_expr): Likewise.
2005
2006         PR c++/18625
2007         * decl.c (duplicate_decls): Return error_mark_node on error, as
2008         specified.
2009
2010         PR c++/18466
2011         * decl.c (grokvardecl): Keep track of whether or not a there was
2012         explicit qualification.
2013         * name-lookup.c (set_decl_namespace): Complain about explicit
2014         qualification of a name within its own namespace.
2015
2016         PR c++/18545
2017         * typeck.c (check_return_expr): Robustify.
2018
2019 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2020
2021         Friend class name lookup 3/n, PR c++/3332
2022         * name-lookup.c (push_inner_scope, pop_inner_scope): New functions.
2023         (lookup_type_scope): Don't deal with name from user declaration
2024         specially.
2025         * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations.
2026         * parser.c (cp_parser_class_specifier): Use push_inner_scope and
2027         pop_inner_scope.
2028
2029 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2030
2031         Friend class name lookup 2/n, PR c++/14513, c++/15410
2032         * name-lookup.c (lookup_name_real): Simplify.
2033         (lookup_type_scope): Add SCOPE parameter.  Handle friend class
2034         lookup.
2035         * name-lookup.h (tag_scope): New enum type.
2036         (lookup_type_scope): Adjust declaration.
2037         * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
2038         Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
2039         (start_enum): Likewise.  Add assertion test that NAME is
2040         IDENTIFIER_NODE.  Use anonymous name for dummy ENUMERAL_TYPE in
2041         case of error.
2042         * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
2043         * parser.c (cp_parser_elaborated_type_specifier,
2044         cp_parser_class_head): Adjust call to xref_tag.
2045         * pt.c (lookup_template_class, instantiate_class_template):
2046         Likewise.
2047         * rtti.c (init_rtti_processing, build_dynamic_cast_1,
2048         tinfo_base_init, emit_support_tinfos): Likewise.
2049
2050 2004-11-25  Joseph S. Myers  <joseph@codesourcery.com>
2051
2052         * g++spec.c, lex.c: Avoid ` as left quote in diagnostics.
2053
2054 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
2055
2056         PR c++/17473
2057         * name-lookup.c (supplement_binding): Do not allow typedefs to be
2058         redefined in class scope.
2059
2060         PR c++/18285
2061         * parser.c (cp_parser_set_decl_type_spec): Do not try to allow
2062         redefinitions of builtin types other that "bool" or "wchar_t".
2063
2064 2004-11-24  Steven Bosscher  <stevenb@suse.de>
2065
2066         * decl.c (cxx_init_decl_processing): Don't clear
2067         flag_inline_functions.
2068
2069 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
2070
2071         * pt.c (tsubst_function_type): Do not permit function types which
2072         return arrays or functions.
2073
2074         PR c++/18586
2075         * parser.c (cp_parser_init_declarator): Do not pop scope twice.
2076
2077         PR c++/18530
2078         * cp-tree.h (CTOR_NAME): Remove.
2079         (DTOR_NAME): Remove.
2080         * decl.c (initialize_predefined_identifiers): Add spaces to the
2081         end of constructor and destructor names.
2082
2083 2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2084
2085         PR c++/8929
2086         * decl.c (start_decl): Check for invalid specialization headers.
2087
2088 2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
2089
2090         PR c++/16882
2091
2092         * call.c (standard_conversion): Move check for conversions between
2093         vector pointers...
2094         * typeck.c (ptr_reasonably_similar): ... here.
2095
2096 2004-11-23  Ben Elliston  <bje@au.ibm.com>
2097
2098         * cp-tree.h (context_as_string): Remove extern.
2099         * error.c (context_as_string): Remove.
2100
2101         * cp-tree.h (cp_type_qual_from_rid): Remove extern.
2102         * lex.c (cp_type_qual_from_rid): Remove.
2103
2104         * cp-tree.h (do_poplevel): Remove extern.
2105         (check_multiple_declarators): Likewise.
2106         * semantics.c (do_poplevel): Make static.
2107         (check_multiple_declarators): Remove.
2108
2109         * cp-tree.h (check_final_overrider): Remove extern.
2110         * search.c (check_final_overrider): Make static.
2111
2112         * cp-tree.h (build_artificial_parm): Remove extern.
2113         * decl2.c (build_artificial_parm): Make static.
2114
2115 2004-11-22  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2116
2117         PR c++/18354
2118         * typeck.c (build_unary_op) <CONVERT_EXPR, NEGATE_EXPR>: Unify code.
2119         Make sure the result is always a rvalue.
2120
2121 2004-11-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2122
2123         * decl.c (start_preparsed_function): Call check_function_type even
2124         in templates.
2125         (require_complete_types_for_parms): Skip dependent types.
2126         (check_function_type): Likewise.
2127
2128 2004-11-16  Steven Bosscher  <stevenb@suse.de>
2129
2130         * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h.
2131         * search.c: Don't include it.
2132
2133 2004-11-15  Andrew Pinski  <pinskia@physics.uc.edu>
2134
2135         * cp-gimplify.c: Include pointer-set.h
2136         (cp_genericize_r): Use pointer_sets instead of a hashtable.
2137         Also instert the new statement for CLEANUP_STMT.
2138         (cp_genericize): Use pointer_sets instead of a hashtable.
2139         * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h.
2140
2141 2004-11-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2142
2143         Friend class name lookup 1/n, PR c++/18471
2144         * decl.c (lookup_and_check_tag): New function.
2145         (xref_tag, start_enum): Use it.
2146         (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check
2147         before !DECL_IMPLICIT_TYPEDEF_P.  Also display previously declared
2148         location.
2149         * name-lookup.c (lookup_name_current_level): Rename to ...
2150         (lookup_name_innermost_nonclass_level): ... this.
2151         (lookup_type_scope): New function.
2152         * name-lookup.h (lookup_name_current_level): Rename to ...
2153         (lookup_name_innermost_nonclass_level): ... this.
2154         (lookup_type_scope): Add declaration.
2155
2156 2004-11-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2157
2158         PR c++/17344
2159         * pt.c (coerce_template_parms): Only emit error message about
2160         invalid template argument when TF_ERROR.
2161
2162 2004-11-12  Mark Mitchell  <mark@codesourcery.com>
2163
2164         PR c++/18389
2165         * decl.c (start_decl): Make sure to set *pop_scope_p.  Return
2166         error_mark_node to indicate errors.
2167
2168         PR c++/18429
2169         * parser.c (cp_parser_direct_declarator): Disallow non-constant
2170         array bounds when not inside a function.
2171
2172         PR c++/18436
2173         * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
2174         unqualified name resolves to a member function.
2175
2176         PR c++/18407
2177         * pt.c (tsubst_copy_and_build): Handle qualified names used from a
2178         derived class correctly.
2179
2180         * decl2.c (import_export_decl): Fix typo in comment.
2181         * tree.c (pod_type_p): Likewise.
2182
2183 2004-11-10  Andrew Pinski  <pinskia@physics.uc.edu>
2184
2185         * typeck.c (cxx_mark_addressable): Add braces around the first if.
2186
2187 2004-11-10  Adam Nemet  <anemet@lnxw.com>
2188
2189         PR middle-end/18160
2190         * typeck.c (cxx_mark_addressable): Issue an error if address of an
2191         explicit register variable is requested.
2192
2193 2004-11-10  Nathan Sidwell  <nathan@codesourcery.com>
2194
2195         PR c++/18143
2196         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New.
2197         (struct lang_decl_flags): Add thunk_p flag.
2198         (struct lang_decl): Remove separate fixed_offset. Place
2199         cloned_function and fixed_offset into union.
2200         (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust.
2201         (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust.
2202         (THUNK_FIXED_OFFSET): Adjust.
2203         * method.c (make_thunk): Adjust.
2204
2205 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
2206
2207         PR c++/18369
2208         * init.c (build_new_1): Handle parenthesized type-ids that name an
2209         array type.  Tidy.
2210
2211 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
2212
2213         * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
2214         pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
2215         quoting in diagnostics.
2216         * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
2217         quoting in printf format.
2218         * decl.c (duplicate_decls, start_decl): Use %qD instead of
2219         unquoted %D.
2220
2221 2004-11-08  Kazu Hirata  <kazu@cs.umass.edu>
2222
2223         * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c,
2224         search.c, typeck2.c: Fix comment formatting.
2225
2226 2004-11-04  Ulrich Weigand  <uweigand@de.ibm.com>
2227
2228         PR tree-optimization/18184
2229         * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
2230         of different modes or alias-all flags as equivalent.
2231         * typeck.c (comptypes): Likewise.
2232
2233 2004-11-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2234
2235         DR 49, 100
2236         * cp-tree.h (TYPE_REF_OBJ_P): New macro.
2237         (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P,
2238         TYPE_REFFN_P): Document.
2239         (fold_decl_constant_value): New prototype.
2240         * pt.c (convert_nontype_argument_function): Rewrite and extract
2241         parts into...
2242         (fold_decl_constant_value, convert_nontype_argument_function): New.
2243         (lookup_template_class): Add comment about useless double call.
2244         * mangle.c (write_expression): Strip conversions before lowering
2245         pointer to members.
2246         * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow
2247         enum to enum conversion.
2248
2249 2004-11-02  Mark Mitchell  <mark@codesourcery.com>
2250
2251         PR c++/18124
2252         * parser.c (cp_parser_type_parameter): Robustify.
2253
2254         PR c++/18155
2255         * parser.c (cp_parser_single_declaration): Disallow template
2256         typedefs.
2257
2258         PR c++/18177
2259         * typeck.c (build_const_cast): Use error_operand_p.
2260
2261 2004-11-02  Ziemowit Laski  <zlaski@apple.com>
2262
2263         * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
2264         (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
2265         * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
2266         from cp-lang.c.
2267         * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
2268         from cp-lang.c.
2269         (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
2270
2271 2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
2272
2273         PR c++/18064
2274         * search.c (check_final_overrider): Deprecate gnu covariant extension.
2275
2276 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2277
2278         Convert diagnostics to use quoting flag q 9/n
2279         * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
2280         get_delta_difference):  Use new quotation style.
2281         * repo.c (reopen_repo_file_for_write): Likewise.
2282         * pt.c (do_type_instantiation): Likewise.
2283         * parser.c (cp_parser_diagnose_invalid_type_name):
2284         * name-lookup.c (push_overloaded_decl, set_decl_namespace):
2285         * error.c (cp_print_error_function,
2286         print_instantiation_full_context): Likewise.
2287         * decl.c (define_label, grok_reference_init,
2288         maybe_deduce_size_from_array_init, revert_static_member_fn):
2289         * decl2.c (check_classfn): Likewise.
2290         * class.c (add_method, check_field_decls, layout_class_type,
2291         resolve_address_of_overloaded_function): Likewise.
2292         * call.c (build_x_va_arg, build_over_call): Likewise.
2293
2294 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2295
2296         Convert diagnostics to use quoting flag q 8/n
2297         * cvt.c (cp_convert_to_pointer, warn_ref_binding,
2298         convert_to_reference, ocp_convert, convert_to_void
2299         cp_convert_to_pointer): Use new quotation style.
2300
2301 2004-10-31  Mark Mitchell  <mark@codesourcery.com>
2302
2303         PR c++/15172
2304         * typeck2.c (store_init_value): Use split_nonconstant_init even
2305         for types that require construction.
2306
2307 1004-10-28  Matt Austern  <austern@apple.com>
2308
2309         PR c++/17542
2310         * cp-tree.h (class_key_or_enum_as_string): Declare.
2311         * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string
2312         and remove static qualifier.
2313         * decl.c (shadow_tag): Warn about ignored attributes in class/struct/
2314         union/enum declaration.
2315
2316 2004-10-29  Kazu Hirata  <kazu@cs.umass.edu>
2317
2318         * pt.c: Fix a comment typo.
2319
2320 2004-10-28  Nathan Sidwell  <nathan@codesourcery.com>
2321
2322         * typeck.c (composite_pointer_type): Remove comment about DR 195.
2323         (build_reinterpret_cast_1): Revert DR195 patch. Only emit a
2324         warning when being pedantic.
2325         (build_reinterpet_cast, build_c_cast): Adjust.
2326
2327 2004-10-29  Mark Mitchell  <mark@codesourcery.com>
2328
2329         PR c++/17695
2330         * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they
2331         appear in a constructor/destructor that will be cloned.
2332
2333 1004-10-28  Matt Austern  <austern@apple.com>
2334
2335         PR c++/14124
2336         * decl.c (finish_enum): Handle packed attribute.
2337         * parser.c (cp_parser_enum_specifier): Process trailing attributes.
2338
2339 2004-10-28  Mark Mitchell  <mark@codesourcery.com>
2340
2341         PR c++/17132
2342         * pt.c (instantiate_class_template): Increment
2343         processing_template_decl when substituting into a member class
2344         template.
2345
2346 2004-10-27  Mark Mitchell  <mark@codesourcery.com>
2347
2348         PR c++/17435
2349         * call.c (convert_like_real): Fix formatting.
2350         (initialize_reference): When binding a temporary to a base class,
2351         ensure that the nominal copy made is to the derived class, not the
2352         base class.
2353
2354         PR c++/18140
2355         * parser.c (cp_parser_next_token_ends_template_argument_p): Do not
2356         include ">>".
2357
2358 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
2359
2360         * decl.c (bad_specifiers): Move the q after the %.
2361
2362 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
2363
2364         * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after
2365         the %.
2366
2367 2004-10-26  Mark Mitchell  <mark@codesourcery.com>
2368
2369         * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT.
2370         * search.c (current_scope): Fix prototype.
2371
2372         PR c++/18093
2373         * search.c (current_scope): Return the innermost non-block scope,
2374         not the innermost non-block, non-namespace scope.
2375         (at_namespace_scope_p): Adjust accordingly.
2376         (dfs_accessible_post): Do not pass namespaces to is_friend.
2377         (dfs_walk_once_accessible_r): Likewise.
2378         * decl.c (grokvardecl): Adjust call to current_scope.
2379         (build_enumerator): Likewise.
2380         * parser.c (cp_parser_using_declaration): Likewise.
2381         (cp_parser_direct_declarator): Use at_namespace_scope_p instead of
2382         current_scope.
2383         (cp_parser_class_head): Adjust call to current_scope.
2384         * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the
2385         alias.
2386
2387         PR c++/18020
2388         * pt.c (tusbst_copy_and_build): Resolve enumeration constants to
2389         their underlying values.
2390
2391         PR c++/18161
2392         * typeck.c (build_binary_op): Honor build_type, even when in a
2393         template.
2394
2395 2004-10-26  Nathan Sidwell  <nathan@codesourcery.com>
2396
2397         * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
2398         padding token checking.
2399
2400 2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>
2401
2402         PR c++/18121
2403         * decl.c (grokdeclarator) <case cdk_array>: Remove the call
2404         layout_type as it is already done by create_array_type_for_decl.
2405
2406 2004-10-22  Nathan Sidwell  <nathan@codesourcery.com>
2407
2408         PR c++/18095
2409         * parser.c (eof_token): Make const, correctly initialize rid and
2410         location fields.
2411         (struct cp_lexer): Replace buffer_end pointer with buffer_length
2412         count. Adjust.
2413         (cp_lexer_new_main): Directly grow lexer's buffer here.  Don't
2414         zero it out.
2415         (cp_lexer_new_from_tokens): Adjust.
2416         (cp_lexer_grow_buffer): Remove.
2417         (cp_lexer_peek_nth_token, cp_lexer_consume_token,
2418         cp_lexer_purge_token): Add const casts.
2419
2420 2004-10-21  Mark Mitchell  <mark@codesourcery.com>
2421
2422         PR c++/18073
2423         PR c++/10841
2424         * cp-tree.h (convert_to_base): Change prototype.
2425         (build_ptrmemfunc): Likewise.
2426         (convert_ptrmem): New function.
2427         * call.c (struct conversion): Adjust documentation for base_p.
2428         (standard_conversion): Set base_p for ck_pmem conversions as
2429         appropriate.
2430         (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
2431         conversions.
2432         * class.c (convert_to_base): Handle both pointers and objects.
2433         Add nonnull parameter.
2434         (build_vfield_ref): Adjust call to convert_to_base.
2435         * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
2436         (convert_force): Likewise.
2437         * typeck.c (build_unary_op): Likewise.
2438         (convert_ptrmem): New function.
2439         (build_static_cast_1): Use it.
2440         (build_reinterpret_cast): Allow conversions to vector types.
2441         (get_delta_difference): Add c_cast_p parameter.
2442         (build_ptrmemfunc): Likewise.  Adjust calls to
2443         get_delta_difference.
2444
2445 2004-10-21  Andrew Pinski  <pinskia@physics.uc.edu>
2446
2447         PR c++/13560
2448         * error.c (cp_error_at): Output the context as it might be
2449         different file as the other location.
2450
2451 2004-10-21  Kazu Hirata  <kazu@cs.umass.edu>
2452
2453         * typeck.c: Fix a comment typo.
2454
2455 2004-10-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2456
2457         PR c++/13495
2458         * decl.c (make_unbound_class_template): Add PARM_LIST parameter.
2459         * cp-tree.h (make_unbound_class_template): Adjust prototype.
2460         * parser.c (cp_parser_lookup_name): Adjust call to
2461         make_unbound_class_template.
2462         (cp_parser_single_declaration): Handle member class of class
2463         template as template friend parsing correctly.
2464         * friend.c (is_friend): Call is_specialization_of_friend for
2465         template friend class.
2466         (make_friend_class): Handle member class of class template as
2467         template friend.
2468         * pt.c (is_specialization_of_friend): Likewise.
2469         (instantiate_class_template): Likewise.
2470         (tsubst): Adjust call to make_unbound_class_template.
2471
2472 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
2473
2474         * typeck.c (composite_pointer_type): Add comment about DR 195
2475         (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
2476         Allow function pointer conversions that DR195 suggests.
2477         (build_reinterpret_cast, build_c_cast): Update
2478         build_reinterpret_cast_1 calls.
2479
2480 2004-10-20  Kazu Hirata  <kazu@cs.umass.edu>
2481
2482         * call.c, typeck.c: Fix comment typos.
2483
2484 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
2485
2486         * parser.c (cp_token_position): New typedef. Define VEC thereof.
2487         (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make
2488         next_token and last_token cp_token_position. Make saved_tokens a
2489         VEC(cp_token_position).
2490         (eof_token): New static variable.
2491         (CP_SAVED_TOKENS_SIZE): Rename to ...
2492         (CP_SAVED_TOKEN_STACK): ... here.
2493         (cp_lexer_new_main): Adjust main lexer creation and buffer
2494         filling.
2495         (cp_lexer_new_from_tokens): Do not copy the tokens, merely point
2496         to the parent buffer.  Do not append eof token.
2497         (cp_lexer_destroy): Only free buffer if non-NULL. Free token
2498         stack.
2499         (cp_lexer_next_token, cp_lexer_prev_token): Remove.
2500         (cp_lexer_token_position, cp_lexer_token_at): New.
2501         (cp_lexer_saving_tokens): Adjust. Make inline.
2502         (cp_lexer_advance_token, cp_lexer_token_difference): Remove.
2503         (cp_lexer_peek_token_emit_debug_info): Fold into ...
2504         (cp_lexer_peek_token): ... here.
2505         (cp_lexer_peek_nth_token): Don't peek past EOF.
2506         (cp_lexer_consume_token): Set next_token to eof_token, if reaching
2507         EOF.
2508         (cp_lexer_purge_token): Adjust eof setting.
2509         (cp_lexer_purge_tokens_after): Likewise.
2510         (cp_lexer_save_tokens): Push next_token directly.
2511         (cp_lexer_commit_tokens): Adjust.
2512         (cp_lexer_rollback_tokens): Pop next_token directly.
2513         (cp_parser_check_for_invalid_template_id): Adjust token purging.
2514         (cp_parser_translation_unit): Do not consume the EOF.
2515         (cp_parser_nested_name_specifier_opt): Adjust token purging.
2516         (cp_parser_template_id, cp_parser_template_name): Likewise.
2517
2518 2004-10-19  Mark Mitchell  <mark@codesourcery.com>
2519
2520         PR c++/14035
2521         * call.c (struct conversion): Add base_p.
2522         (convert_like): Add c_cast_p argument.
2523         (convert_like_with_conversion): Likewise.
2524         (build_conv): Clear base_p.
2525         (standard_conversion): Set it, for derived-to-base conversions.
2526         (convert_like_real): Add c_cast_p parameter.  Handle pointer
2527         conversions directly rather than relying on ocp_convert.
2528         (perform_direct_initialization_if_possible): Add c_cast_p
2529         parameter.
2530         * cp-tree.h (perform_direct_initialization_if_possible): Change
2531         prototype.
2532         (convert_member_func_to_ptr): New function.
2533         * typeck.c (check_for_casting_away_constness): Add diag_fn
2534         parameter.
2535         (build_static_cast_1): New function, split out from ...
2536         (build_static_cast): ... here.  Use build_static_cast_1.
2537         (build_reinterpret_cast_1): New function, split out from ...
2538         (build_reinterpret_cast): ... here.  Use build_reinterpret_cast_1.
2539         (build_const_cast_1): New function, split out from ...
2540         (build_const_cast): ... here.  Use build_const_cast_1.
2541         (build_c_cast): Rewrite to use build_const_cast_1,
2542         build_static_cast_1, and build_reinterpret_cast_1.
2543         (convert_member_func_to_ptr): New function.
2544
2545 2004-10-19  Paolo Bonzini  <bonzini@gnu.org>
2546
2547         PR c++/18047
2548         * parser.c (enum cp_parser_prec): Give relational expressions
2549         a higher precedence than equality expressions.
2550
2551 2004-10-15  Nathan Sidwell  <nathan@codesourcery.com>
2552
2553         * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
2554         (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
2555         (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
2556         (enum base_access): Reorganize.
2557         (accessible_base_p, accessible_p): Add consider_local_p parameter.
2558         * call.c (standard_conversion): Update comment about
2559         DERIVED_FROM_P.
2560         (enforce_access): Adjust accessible_p call.
2561         (build_over_call): Adjust accessible_base_p call.
2562         * class.c (convert_to_base): Adjust lookup_base call.
2563         (build_vtbl_ref_1): Likewise.
2564         (warn_about_ambiguous_bases): Likewise. Add early exit.
2565         * cvt.c (convert_to_pointer_force) Adjust lookup_base call.
2566         * search.c (accessible_base_p): Add consider_local_p parameter.
2567         (lookup_base): Pass consider_local_p to accessible_base_p call.
2568         (friend_accessible_p): Check whether scope is a class member.
2569         Remove unnecessary class template check.
2570         (accessible_p): Add consider_local_p parameter. Use it.
2571         (adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
2572         * tree.c (maybe_dummy_object): Likewise.
2573         * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
2574         (build_class_member_access_expr): Adjust lookup_base call.
2575         * typeck2.c (binfo_or_else): Likewise.
2576         * rtti.c (build_dynamic_cast_1): Access can consider friendship
2577         and current scope.
2578
2579 2004-10-17  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2580
2581         PR c++/17743
2582         * decl2.c (grokfield): Apply attributes also to TYPE_DECLs.
2583
2584 2004-10-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2585
2586         PR c++/10479
2587         * parser.c (cp_parser_parenthesized_expression_list): Fold
2588         non-dependent expressions in attribute lists.
2589
2590 2004-10-15  Mark Mitchell  <mark@codesourcery.com>
2591
2592         PR c++/17042
2593         * decl.c (declare_global_var): Use the return value from pushdecl.
2594
2595         PR c++/14667
2596         * parser.c (cp_parser_simple_declaration): Do not diagnose invalid
2597         type names if we have already found a valid type.
2598         (cp_parser_member_declaration): Likewise.
2599
2600         PR c++/17916
2601         * parser.c (cp_parser_member_specification_opt): Handle
2602         CPP_PRAGMA.
2603
2604 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
2605
2606         * dump.c, g++spec.c, repo.c: Update copyright.
2607
2608 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
2609
2610         * decl.c: Fix a comment typo.
2611
2612 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
2613
2614         PR c++/16301
2615         * name-lookup.c (parse_using_directive): If we have a
2616         error_mark_node, do not set the decl namespace associations
2617         on it.
2618
2619 2004-10-14  Mark Mitchell  <mark@codesourcery.com>
2620
2621         PR c++/17976
2622         * decl.c (cp_finish_decl): Do not call expand_static_init more
2623         than once for a single variable.
2624
2625 2004-10-14  Matt Austern  <austern@apple.com>
2626
2627         * Make-lang.in (pt.o): depends on pointer-set.h
2628         * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
2629         * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
2630         (for_each_template_parm): Convert from htab_t to pointer_set_t.
2631         * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
2632
2633 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
2634
2635         PR c++/17661
2636         * semantics.c (finish_for_expr): Convert expression to void
2637         so that we don't create temporaries for a?b:c.
2638
2639 2004-10-13  Kazu Hirata  <kazu@cs.umass.edu>
2640
2641         * search.c: Fix a comment typo.
2642
2643 2004-10-12  Nathan Sidwell  <nathan@codesourcery.com>
2644
2645         * class.c (dfs_modify_vtables): Simplify condition. Return
2646         dfs_skip_bases as appropriate.
2647         (modify_all_vtables): Walk in pre-order.
2648         * search.c (dfs_walk_all, dfs_walk_once_r,
2649         dfs_walk_once_accessible_r): Assert post order function never
2650         returns dfs_skip_bases.
2651
2652         * search.c (struct lookup_base_data_s): New.
2653         (lookup_base_r): Replace with ...
2654         (dfs_lookup_base): ... this.
2655         (lookup_base): Use dfs_walk_all.
2656
2657 2004-10-12  Kazu Hirata  <kazu@cs.umass.edu>
2658
2659         * search.c: Fix comment typos.
2660
2661 2004-10-11  Mark Mitchell  <mark@codesourcery.com>
2662
2663         PR c++/15786
2664         * parser.c (cp_parser_declarator): Add member_p parameter.
2665         (cp_parser_condition): Adjust calls to cp_parser_declarator.
2666         (cp_parser_explicit_instantiation): Likewise.
2667         (cp_parser_init_declarator): Likewise.
2668         (cp_parser_direct_declarator): Add member_p parameter.  Do not
2669         parse tentatively when parsing the parameters to a member.
2670         (cp_parser_type_id): Adjust calls to cp_parser_declarator.
2671         (cp_parser_parameter_declaration): Likewise.
2672         (cp_parser_member_declaration): Likewise.
2673         (cp_parser_exception_declaration): Likewise.
2674
2675         PR c++/17936
2676         * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment.
2677         * pt.c (optimize_specialization_lookup_p): Do not optimize lookups
2678         for members of partial or explicit specializations.
2679
2680         PR c++/17929
2681         * decl2.c (finish_anon_union): Robustify.
2682
2683 2004-10-11  Nathan Sidwell  <nathan@codesourcery.com>
2684
2685         * cp-tree.h (get_dynamic_cast_base_type): Rename to ...
2686         (dcast_base_hint): ... here.
2687         * rtti.c (build_dynamic_cast_1): Use dcast_base_hint.
2688         * search.c (struct dcast_data_s): New.
2689         (dynamic_cast_base_recurse): Remove. Replace with ...
2690         (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New.
2691         (get_dynamic_cast_base_type): Rename to ...
2692         (dcast_base_hint): ... here.  Use dfs_walk_once_accessible.
2693         (accessible_r): Remove.
2694         (dfs_accessible_post): New, broken out of accessible_r.
2695         (accessible_p): Use dfs_walk_once_accessible.
2696         (dfs_walk_once_accessible_r): New. From accessible_r.
2697         (dfs_walk_once_accessible): New. From acessible_p.
2698
2699         * cp-tree.h (SAME_BINFO_TYPE_P): New.
2700         * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare
2701         binfo types.
2702         (convert_to_base_statically, determine_primary_bases,
2703         update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits,
2704         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
2705         accumulate_vtbl_inits, dfs_accumulate_vtbl_inits,
2706         build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise.
2707         * init.c (expand_member_init): Likewise.
2708         * search.c (lookup_base_r, dynamic_cast_base_recurse,
2709         binfo_via_virtual, copied_binfo, binfo_for_vbase,
2710         original_binfo): Likewise.
2711         * tree.c (copy_binfo): Likewise.
2712
2713 2004-10-11  Kazu Hirata  <kazu@cs.umass.edu>
2714
2715         * semantics.c: Fix comment typos.
2716
2717 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
2718
2719         PR c++/17554
2720         part of c++/17657
2721         middle-end/17703
2722         * semantics.c (maybe_cleanup_point_expr): Call
2723         fold_build_cleanup_point_expr.
2724         (maybe_cleanup_point_expr_void): New function.
2725         (add_decl_expr): Call maybe_cleanup_point_expr_void.
2726         (finish_expr_stmt): Likewise.
2727         (finish_return_stmt): Likewise.
2728         (finish_for_expr): Likewise.
2729         (finish_asm_stmt): Likewise.
2730         * typeck.c (condition_conversion): Call
2731         fold_build_cleanup_point_expr.
2732
2733 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
2734
2735         PR c++/17907
2736         * semantics.c (add_decl_expr): If the decl has a size which
2737         has side effects then the decl expression needs a cleanup point.
2738
2739 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
2740
2741         PR c++/17393
2742         * decl.c (grokdeclarator): Robustify error-recovery on invalid
2743         declarations.
2744
2745 2004-10-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2746
2747         Convert diagnostics to use quoting flag q 7/n
2748         * typeck.c (composite_pointer_type_r, composite_pointer_type,
2749         cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr,
2750         string_conv_p, build_class_member_access_expr,
2751         build_class_member_access_expr, lookup_destructor,
2752         finish_class_member_access_expr, build_indirect_ref,
2753         get_member_function_from_ptrfunc, build_function_call,
2754         convert_arguments, build_binary_op, pointer_diff, build_unary_op,
2755         check_for_casting_away_constness, build_static_cast,
2756         build_reinterpret_cast, build_const_cast, build_c_cast,
2757         build_modify_expr, get_delta_difference, build_ptrmemfunc,
2758         dubious_conversion_warnings, convert_for_assignment,
2759         convert_for_initialization,
2760         maybe_warn_about_returning_address_of_local, check_return_expr):
2761         Use quoting marks.
2762
2763         * typeck2.c (error_not_base_type, readonly_error,
2764         abstract_virtuals_error, cxx_incomplete_type_diagnostic,
2765         store_init_value, digest_init, build_x_arrow,
2766         build_m_component_ref, require_complete_eh_spec_types): Likewise.
2767
2768         * tree.c (cp_build_qualified_type_real,
2769         handle_java_interface_attribute, handle_init_priority_attribute):
2770         Likewise.
2771
2772         * semantics.c (finish_asm_stmt, finish_non_static_data_member,
2773         finish_pseudo_destructor_expr,
2774         check_template_template_default_arg, begin_class_definition,
2775         finish_base_specifier, qualified_name_lookup_error,
2776         finish_id_expression, finish_typeof): Likewise.
2777
2778         * search.c (lookup_base, check_final_overrider,
2779         look_for_overrides_r): Likewise.
2780
2781         * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise.
2782
2783 2004-10-09  Mark Mitchell  <mark@codesourcery.com>
2784
2785         PR c++/17867
2786         * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
2787         constructor.
2788
2789         PR c++/17670
2790         * init.c (build_new): Correct comments.
2791         * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
2792         the non-array case.
2793
2794         PR c++/17821
2795         * parser.c (cp_parser_postfix_dot_deref_expression): If the
2796         pseduo-destructor-name production does not work, fall back to the
2797         ordinary production.
2798
2799         PR c++/17826
2800         * tree.c (cp_tree_equal): Handle a BASELINK.
2801
2802         PR c++/17524
2803         * cp-tree.h (check_var_type): New function.
2804         * decl.c (check_var_type): New function, split out from ...
2805         (grokdeclarator): ... here.
2806         * pt.c (tsubst_decl): Use check_var_type.
2807
2808         PR c++/17685
2809         * decl.c (grokdeclarator): Disallow declarations of operators as
2810         non-functions.
2811
2812 2004-10-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
2813
2814         PR c++/17868
2815         * error.c (dump_expr): Add missing case for RDIV_EXPR.
2816
2817 2004-10-08  Kazu Hirata  <kazu@cs.umass.edu>
2818
2819         * pt.c, search.c: Fix comment typos.
2820
2821 2004-10-08  Nathan Sidwell  <nathan@codesourcery.com>
2822
2823         * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp,
2824         unmarkedp): Remove.
2825         (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New.
2826         * class.c (struct find_final_overrider_data): Remove most_derived,
2827         vpath_list and vpath fields.  Add path field.
2828         (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust.
2829         (dfs_find_final_overrider): Rename to ...
2830         (dfs_find_final_overrider_pre): ... here. Adjust.
2831         (dfs_find_final_overrider_post): Adjust.
2832         (dfs_find_final_overrider_q): Fold into
2833         dfs_find_final_overrider_pre.
2834         (find_final_overrider): Adjust dfs searching.
2835         (dfs_modify_vtables): Don't mark binfo here.
2836         (modify_all_vtables): Use dfs_walk_once.
2837         (build_vtt_inits): Likwise. Use dfs_walk_all.
2838         (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here.
2839         Return dfs_skip_bases as appropriate.
2840         (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate.
2841         * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as
2842         appropriate. Don't mark binfo here.
2843         (initialize_vtbl_ptrs): Use dfs_walk_once.
2844         * search.c (struct vbase_info): Remove unused struct.
2845         (access_in_type): Use dfs_walk_once.
2846         (dfs_access_in_type): Don't mark binfo here.
2847         (dfs_accessible_queue_p, dfs_accessible_p) Remove.
2848         Fold into ...
2849         (accessible_r): ... here. New. Specialize dfs_walk_once.
2850         (accessible_p): Use accessible_r.
2851         (lookup_field_queue_p): Remove. Fold into ...
2852         (lookup_field_r): ... here. Adjust.
2853         (lookup_member): Use dfs_walk_all.
2854         (dfs_walk_real, dfs_walk): Replace with ...
2855         (dfs_walk_all, dfs_walk_once): ... these.
2856         (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once.
2857         (dfs_unmark, unmarkedp, markedp): Remove.
2858         (dfs_get_pure_virtuals): Don't mark binfo here.
2859         (get_pure_virtuals): Use dfs_walk_once.
2860         (dfs_debug_unmarked_p): Remove. Fold into ...
2861         (dfs_debug_mark): ... here.
2862         (note_debug_info_needed): Use dfs_walk_all.
2863
2864 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
2865
2866         * pt.c (tsubst_expr) <case ASM_EXPR>: Look passed the
2867         CLEANUP_POINT_EXPR to get the asm expression.
2868
2869 2004-10-07  Mark Mitchell  <mark@codesourcery.com>
2870
2871         * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
2872         (DECL_MEMBER_TEMPLATE_P): New macro.
2873         (is_member_template): Remove.
2874         (class_method_index_for_fn): New function.
2875         * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
2876         * class.c (finish_struct_methods): Remove out-of-date comment.
2877         * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
2878         * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
2879         class_method_index_for_fn.
2880         * pt.c (is_member_template): Remove.
2881         (is_member_template_class): Likewise.
2882         (optimize_specialization_lookup_p): New function.
2883         (retrieve_specialization): Optimize lookups for members that are
2884         not member templates.
2885         (register_specialization): Adjust accordingly.
2886         (build_template_decl): Add member_template_p parameter.  Set
2887         DECL_MEMBER_TEMPLATE_P.
2888         (process_partial_specialization): Adjust call to
2889         retrieve_specialization.
2890         (push_template_decl_real): Determine whether the template is a
2891         member template.
2892         (lookup_template_class): Use retrieve_specialization.
2893         (tsubst_decl): Adjust call to retrieve_specialization.
2894         (tsubst_exception_specification): New function.
2895         (tsubst): Use it.
2896         (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
2897         (instantiate_template): Adjust call to retrieve_specialization.
2898         (regenerate_decl_from_template): Do not actually generate a new
2899         DECL.
2900         (instantiate_decl): Adjust call to retrieve_specialization.
2901         (class_method_index_for_fn): New method.
2902
2903 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
2904
2905         * parser.c (cp_parser_asm_definition): Look passed the
2906         CLEANUP_POINT_EXPR to get the asm expression.
2907
2908 2004-10-06  Andrew Pinski  <pinskia@physics.uc.edu>
2909
2910         PR c++/17368
2911         * semantics.c (finish_asm_stmt): Asm expressions need cleanup
2912         also.
2913
2914 2004-10-05  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2915
2916         Convert diagnostics to use quoting flag q 6/n
2917         * pt.c (finish_member_template_decl, check_specialization_scope,
2918         maybe_process_partial_specialization, determine_specialization,
2919         check_explicit_specialization, maybe_check_template_type,
2920         process_partial_specialization, check_default_tmpl_args,
2921         push_template_decl_real, redeclare_class_template,
2922         convert_nontype_argument, coerce_template_parms,
2923         lookup_template_class, push_tinst_level,
2924         instantiate_class_template, tsubst_arg_types,
2925         tsubst_function_type, tsubst, tsubst_qualified_id,
2926         tsubst_copy_and_build, check_instantiated_args,
2927         do_decl_instantiation, do_type_instantiation,
2928         invalid_nontype_parm_type_p, check_specialization_namespace,
2929         convert_template_argument, determine_specialization,
2930         check_template_shadow, tsubst_decl
2931         instantiate_pending_templates): Use quoting marks.
2932
2933 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
2934
2935         PR c++/17829
2936         * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
2937         unqualified lookup finds a member function.
2938
2939 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2940
2941         Convert diagnostics to use quoting flag q 5/n
2942         * parser.c (cp_parser_name_lookup_error,
2943         cp_parser_diagnose_invalid_type_name,
2944         cp_parser_primary_expression, cp_parser_unqualified_id,
2945         cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement,
2946         cp_parser_jump_statement, cp_parser_simple_declaration,
2947         cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
2948         cp_parser_type_parameter, cp_parser_template_id,
2949         cp_parser_template_name, cp_parser_direct_declarator,
2950         cp_parser_parameter_declaration_list, cp_parser_class_head,
2951         cp_parser_base_specifier, cp_parser_lookup_name,
2952         cp_parser_late_parsing_default_args,
2953         cp_parser_optional_template_keyword
2954         cp_parser_elaborated_type_specifier, cp_parser_check_class_key,
2955         cp_parser_check_access_in_redeclaration): Use quoting marks.
2956
2957         * name-lookup.c (supplement_binding, pushdecl,
2958         check_for_out_of_scope_variable, validate_nonmember_using_decl,
2959         do_nonmember_using_decl, lookup_tag, set_decl_namespace,
2960         push_namespace, do_namespace_alias, do_using_directive,
2961         ambiguous_decl, lookup_namespace_name, add_function): Likewise.
2962
2963         * method.c (use_thunk): Likewise.
2964
2965         * lex.c (unqualified_name_lookup_error,
2966         unqualified_fn_lookup_error): Likewise.
2967
2968 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2969
2970         Convert diagnostics to use quoting flag q 4/n
2971         * except.c (decl_is_java_type, build_throw,
2972         is_admissible_throw_operand, check_handlers_1, check_handlers):
2973         Use quoting formats.
2974         * friend.c (add_friend, make_friend_class, do_friend): Likewise.
2975         * init.c (sort_mem_initializers, emit_mem_initializers,
2976         member_init_ok_or_else, expand_member_init, is_aggr_type,
2977         build_offset_ref, build_java_class_ref): Likewise.
2978
2979 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2980
2981         Convert diagnostics to use quoting flag q 3/n
2982         * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
2983         redeclaration_error_message, lookup_label, check_goto,
2984         make_typename_type, make_unbound_class_template,
2985         fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1,
2986         grok_reference_init, layout_var_decl, maybe_commonize_var,
2987         check_for_uninitialized_const_var, reshape_init_array,
2988         reshape_init, check_initializer, cp_finish_decl,
2989         member_function_or_else, bad_specifiers, grokfndecl, grokvardecl,
2990         check_static_variable_definition, compute_array_index_type,
2991         create_array_type_for_decl, check_special_function_return_type,
2992         grokdeclarator, check_default_argument, grokparms,
2993         grok_ctor_properties, grok_op_properties,
2994         check_elaborated_type_specifier, xref_tag, finish_enum,
2995         build_enumerator, check_function_type, start_preparsed_function,
2996         store_parm_decls): Use quoting formats.
2997         * decl2.c (grok_array_decl, delete_sanity, check_member_template,
2998         check_java_method, check_classfn, finish_static_data_member_decl,
2999         grokfield, grokbitfield, grok_function_init,
3000         build_anon_union_vars, coerce_new_type, coerce_delete_type,
3001         check_default_args): Likewise.
3002         * parser.c (cp_parser_decl_specifier_seq): Likewise.
3003
3004 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3005
3006         Convert diagnostics to use quoting flag q 2/n
3007         * class.c (build_base_path, add_method, alter_access,
3008         handle_using_decl, check_bases,
3009         maybe_warn_about_overly_private_class, find_final_overrider,
3010         warn_hidden, finish_struct_anon, add_implicitly_declared_members,
3011         check_bitfield_decl, check_field_decls, layout_empty_base,
3012         build_base_field, check_methods, layout_virtual_bases,
3013         warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
3014         resolve_address_of_overloaded_function, instantiate_type,
3015         note_name_declared_in_class): Use format flag "q" for quoting.
3016
3017 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3018
3019         Convert diagnostics to use quoting flag q 1/n
3020         * error.c (locate_error): Ignore quoting flag q.
3021         * call.c (build_user_type_conversion_1, build_operator_new_call,
3022         build_object_call, op_error, build_conditional_expr,
3023         build_new_op, build_op_delete_call, enforce_access,
3024         convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
3025         convert_default_arg, build_over_call, build_new_method_call,
3026         joust, perform_implicit_conversion, initialize_reference): Use the
3027         quoting flag q.
3028
3029 2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>
3030
3031         PR c++/17797
3032         * typeck.c (build_reinterpret_cast): Return if the inner type
3033         is error_mark_node.
3034
3035 2004-10-01  Jan Hubicka  <jh@suse.cz>
3036
3037         * semantics.c (expand_body): Update call of tree_rest_of_compilation.
3038
3039 2004-09-30  Nathan Sidwell  <nathan@codesourcery.com>
3040
3041         * cp-tree.h (struct lang_decl): Shrink by reordering fields and
3042         turning operator_code and fixed_offset into bitfields.
3043
3044 2004-09-29  Joseph S. Myers  <jsm@polyomino.org.uk>
3045
3046         * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
3047
3048 2004-09-29  Jason Merrill  <jason@redhat.com>
3049
3050         PR tree-optimization/17697
3051         * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
3052
3053 2004-09-28  Jason Merrill  <jason@redhat.com>
3054
3055         PR middle-end/17525
3056         * class.c (build_base_field): Set TYPE_MODE.
3057
3058 2004-09-28  Roger Sayle  <roger@eyesopen.com>
3059
3060         PR driver/17537
3061         * g++spec.c (lang_specific_driver): Unrecognized libraries, other
3062         than -lc and -lm, may require linking against libstc++.
3063
3064 2004-09-28  Kazu Hirata  <kazu@cs.umass.edu>
3065
3066         * tree.c: Fix a comment typo.
3067
3068 2004-09-28  Nathan Sidwell  <nathan@codesourcery.com>
3069
3070         * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
3071         (struct secondary_vptr_vtt_init_data_s): New.
3072         (build_vtt_inits): Adjust dfs_walkers.
3073         (dfs_build_secondary_vptr_vtt_inits): Caller data is a
3074         secondary_vptr_vtt_init_data_s structure. Adjust.
3075         (dfs_ctor_vtable_bases_queue_p): Remove.
3076         (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
3077
3078         * pt.c (struct get_template_base_data_s): Remove.
3079         (get_template_base_r): Fold into get_template_base.
3080         (get_template_base): Walk base binfos directly in inheritance
3081         graph order.
3082
3083 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
3084
3085         PR c++/17642
3086         * cp-tree.h (fold_if_not_in_template): New function.
3087         * call.c (build_conditional_expr): Use fold_if_not_in_template.
3088         (build_cxx_call): Likewise.
3089         * cvt.c (convert_to_complex): Likewise.
3090         (ocp_convert): Likewise.
3091         (convert): Likewise.
3092         (convert_force): Likewise.
3093         * decl.c (compute_array_index_type): Clear
3094         processing_template_decl while folding array bounds.
3095         * pt.c (convert_nontype_argument): Clear
3096         processing_template_decl while processing non-type argument
3097         initialization.
3098         * tree.c (fold_if_not_in_template): New function.
3099         * typeck.c (build_class_member_access_expr): Use
3100         fold_if_not_in_template.
3101         (build_array_ref): Likewise.
3102         (build_binary_op): Likewise.  Do not try to optimize computations
3103         when processing templates.
3104         (cp_pointer_int_sum): Use fold_if_not_in_template.
3105         (pointer_diff): Likewise.
3106         (build_unary_op): Likewise.
3107         (build_reinterpret_cast): Likewise.
3108         (get_delta_difference): Likewise.
3109         (expand_ptrmemfunc_cst): Likewise.
3110         (dubious_conversion_warnings): Likewise.
3111
3112 2004-09-27  Matt Austern  <austern@apple.com>
3113
3114         * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
3115         (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
3116         tokens that come from headers that are implicitly extern "C".
3117         (struct cp_parser): new one-bit field, implicit_extern_c.
3118         (cp_parser_new): Set parser's implicit_extern_c to false.
3119         (cp_parser_translation_unit): Pop lang context if we were in a
3120         header that was implicitly extern "C".
3121         (cp_parser_declaration_seq_opt): Push/pop lang context as
3122         required by the token's and parser's implicit_extern_c.
3123
3124 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
3125
3126         PR c++/17585
3127         * cp-tree.h (shared_member_p): Declare.
3128         * search.c (shared_member_p): Give it external linkage.
3129         * semantics.c (finish_qualified_id_expr): Use it.
3130         (finish_id_expression): Likewise.
3131
3132         PR c++/17585
3133         * semantics.c (finish_id_expression): Do not add "this->" to
3134         static member functions.
3135
3136 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
3137
3138         PR c++/17681
3139         * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
3140
3141         * class.c (struct count_depth_data): Remove.
3142         (dfs_depth_post, dfs_depth_q): Remove.
3143         (find_final_overrider): Use number of vbase classes as depth
3144         bound.
3145
3146         * cp-tree.h (types_overlap_p): Remove.
3147         * search.c (struct overlap_info): Remove.
3148         (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
3149
3150         * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
3151         (get_template_base_recursive): Remove. Replace with ...
3152         (get_template_base_r): ... this.
3153         (struct get_template_base_data_s): New.
3154         (get_template_base): Use get_template_base_r via dfs_walk.  Always
3155         return NULL on failure.
3156         (unify): Remove error_mark_node check from get_template_base result.
3157
3158 2004-09-24  Paolo Bonzini  <bonzini@gnu.org>
3159
3160         * parser.c (cp_parser_expression_stack): Clarify why it is
3161         an array of NUM_PREC_VALUES elements.
3162         (cp_parser_binary_expression): Clarify why we do not need to
3163         handle stack overflow.
3164
3165 2004-09-24  Nathan Sidwell  <nathan@codesourcery.com>
3166
3167         PR c++/16889
3168         * search.c (lookup_field_queue_p): Correct check for hidden base.
3169
3170         * search.c (bfs_walk): Remove.
3171         (lookup_member): Use dfs_walk_real.
3172         (dfs_walk_real): Move and adjust documentation from bfs_walk.
3173
3174 2004-09-23  Zack Weinberg  <zack@codesourcery.com>
3175
3176         * decl.c (grokfndecl): If ::main is found not to return int,
3177         correct it after issuing a diagnostic.
3178         (grokdeclarator): If the incoming type was error_mark_node, do
3179         not complain about declaring something with no type.
3180         (start_function): Change check for ::main not returning int to
3181         an assertion, as grokfndecl now catches this when the user did it.
3182         * init.c (perform_member_init, sort_mem_initializers)
3183         (emit_mem_initializers): Make most diagnostics be issued on
3184         the line of current_function_decl, not whatever the current
3185         input line is.
3186         * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
3187         definition and declaration with #ifdef ENABLE_CHECKING.
3188         Avoid unnecessary use of fprintf.
3189         (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
3190         definitions to avoid warnings.
3191         (cp_lexer_new_main): Add assertion that first token is not a
3192         padding token.
3193         (cp_lexer_new_from_token_array): Fold into ...
3194         (cp_lexer_new_from_tokens): ... here.  Add assertion that
3195         first token is not a padding token.
3196         (cp_lexer_set_source_position_from_token): Move nearer to callers.
3197         Remove unused lexer argument.
3198         (cp_lexer_peek_token): Just print debugging report (if enabled)
3199         and return lexer->next_token.
3200         (cp_lexer_skip_purged_tokens): Delete.
3201         (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
3202         inline, simplify bodies.
3203         (cp_lexer_peek_nth_token): Add debugging report a la
3204         cp_lexer_peek_token.
3205         (cp_lexer_consume_token): Correct commentary.  Advance over
3206         purged tokens here.  Set current source position here, from
3207         token to be returned.  Avoid unnecessary use of fprintf.
3208         (cp_lexer_purge_token): Advance next_token pointer over this and
3209         subsequent purged tokens.
3210         (cp_parser_error): Adjust source position to that of the
3211         peeked token.
3212         (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
3213         (cp_parser_string_literal): Remove some excessive cleverness.
3214         (cp_parser_enum_specifier): Call start_enum before consuming
3215         the opening brace.
3216         (cp_parser_member_declaration): Make the "extra semicolon"
3217         diagnostic consistently-worded with the other place this is
3218         diagnosed.  Explicitly set the diagnostic location to the
3219         location of the offending semicolon.
3220         (cp_parser_enclosed_template_argument_list): Use %</%> quoting
3221         in diagnostics.  Do not use cp_parser_require.  Set location
3222         of diagnostics about improper use of '>>' to location of
3223         offending token.
3224         (cp_parser_late_parsing_for_member):
3225         Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
3226         (cp_parser_late_parsing_default_args): Likewise.  Manually
3227         move some logic outside the loop.
3228
3229 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
3230
3231         PR c++/17618
3232         * cvt.c (cp_convert_to_pointer): Return early when the type is
3233         an error_mark_node.
3234
3235 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
3236
3237         PR c++/13989
3238         PR c++/9844
3239         * decl.c (grokfndecl): Add new argument "attrlist", use it
3240         to call cplus_decl_attributes.
3241         (start_function): Remove call to cplus_decl_attributes.
3242         * cvt.c (ocp_convert): Add support to use type conversion
3243         function to vector type.
3244         * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
3245         to the parsed type.
3246
3247 2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
3248
3249         PR c++/17596
3250
3251         * parser.c (cp_parser_token_tree_map_node,
3252         cp_parser_pm_expression, cp_parser_additive_expression,
3253         cp_parser_multiplicative_expression, cp_parser_shift_expression,
3254         cp_parser_relational_expression, cp_parser_equality_expression,
3255         cp_parser_and_expression, cp_parser_exclusive_or_expression,
3256         cp_parser_inclusive_or_expression,
3257         cp_parser_logical_and_expression,
3258         cp_parser_logical_or_expression): Removed.
3259         (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
3260         binops, binops_by_token): New.
3261         (cp_parser_assignment_expression): Use cp_parser_binary_expression.
3262         (cp_parser_new): Initialize binops_by_token.
3263         (cp_parser_binary_expression): Rewritten.
3264         (N_CP_TTYPES): New.
3265
3266 2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
3267
3268         * parser.c: Fix a comment typo.
3269
3270 2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
3271
3272         PR c++/17620
3273         * decl.c (xref_basetypes): Look through typedefs before checking
3274         for duplicate base.
3275
3276 2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
3277
3278         * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
3279         * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
3280         * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
3281         (init_rtti_processing): Initialize it to something realistic.
3282         (get_tinfo_decl): Adjust pushing the new decl.
3283
3284         * cp-tree.h (struct lang_type_class): Remove marked flags, add
3285         diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
3286         (TYPE_MARKED_P): New.
3287         (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
3288         (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
3289         CLEAR_CLASSTYPE_MARKED_N): Remove.
3290         (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
3291         CLEAR_CLASSTYPE_MARKED_*): Remove.
3292         * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
3293         shaped and repeated base properties.
3294         * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
3295         * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
3296         class_hint_flags): Remove.
3297         (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
3298         CLASSTYPE_DIAMOND_SHAPED_P.
3299
3300 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
3301
3302         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
3303         cp-objcp-common.h.
3304         (objcp_tsubst_copy_and_build): Reformat function signature.
3305         * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
3306         (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
3307
3308 2004-09-21  Zack Weinberg  <zack@codesourcery.com>
3309
3310         * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
3311         Don't handle CPP_PRAGMA tokens specially.
3312         (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
3313         purge the token; do clear token->value after processing.  Add
3314         assertion at beginning that token->value is nonzero.
3315         (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
3316         CPP_PRAGMA as a full statement or declaration in its own right.
3317
3318 2004-09-21  Matt Austern  <austern@apple.com>
3319
3320         PR c++/15049
3321         * decl.c (grokvardecl): Accept declarations of global variables
3322         using anonymous types.
3323
3324 2004-09-21  Roger Sayle  <roger@eyesopen.com>
3325
3326         PR c++/7503
3327         * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
3328         if either operand has side-effects.
3329         * typeck.c (rationalize_conditional_expr): Assert that neither
3330         operand of MIN_EXPR or MAX_EXPR has side-effects.
3331         (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
3332         Check that the "lhs" is a valid lvalue, i.e. that neither operand
3333         of a MIN_EXPR or MAX_EXPR has a side-effect.
3334
3335 2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
3336
3337         * cp-tree.h (struct lang_type_header): Remove
3338         uses_multiple_inheritance field.
3339         (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
3340         (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
3341         (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
3342         (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
3343         (TYPE_CONTAINS_VPTR_P): Likewise.
3344         * call.c (add_template_candidate_real): Use
3345         CLASSTYPE_VBASECLASSES.
3346         (build_special_member_call): Likewise.
3347         * class.c (finish_struct_bits): Remove
3348         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
3349         bookkeeping.
3350         (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
3351         (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
3352         bookkeeping.
3353         (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
3354         (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
3355         Likewise.
3356         * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
3357         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
3358         bookkeeping.
3359         (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
3360         * decl2.c (maybe_retrofit_in_chrg): Likewise.
3361         * init.c (expand_member, push_base_cleanups): Likewise.
3362         * pt.c (instantiate_class_template): Remove
3363         TYPE_USES_MULTIPLE_INHERITANCE,
3364         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
3365         bookkeeping.
3366         * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
3367         check.
3368         * typeck2.c (process_init_constructor): Replace some sorrys with
3369         asserts.
3370
3371 2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
3372
3373         * decl.c (reshape_init_array): Initialize max_index_cst to fix
3374         bootstrap failure.
3375
3376 2004-09-20  Mark Mitchell  <mark@codesourcery.com>
3377
3378         PR c++/17530
3379         * pt.c (tsubst): Fix parentheses to accomodate emacs.
3380         (tsubst_baselink): If we get a single function, mark it as used.
3381
3382 2004-09-20  Matt Austern <austern@apple.com>
3383             Zack Weinberg  <zack@codesourcery.com>
3384
3385         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
3386         Apply lbasename to input_filename before passing to get_fileinfo.
3387         * semantics.c (begin_class_definition): Likewise.
3388         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
3389         correct filename.  Rename variables to be less confusing.
3390         (handle_pragma_implementation): Likewise.  Disable "appears
3391         after file is included" diagnostic.
3392
3393         * parser.c (struct cp_token): Add in_system_header fiag.
3394         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
3395         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
3396         (CPP_NONE, cp_lexer_read_token): Delete.
3397         (struct cp_lexer): Remove first_token, string_tokens,
3398         main_lexer_p fields.  Clarify comments.
3399         (struct cp_token_cache): Now just a pair of pointers.
3400         (CP_LEXER_BUFFER_SIZE): New #define.
3401         (CPP_PURGED): New fake token type.
3402         (cp_lexer_new_from_token_array, cp_lexer_destroy)
3403         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
3404         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
3405         New functions.
3406         (cp_lexer_new_from_tokens): Now a simple wrapper around
3407         cp_lexer_new_from_token_array.
3408         (cp_lexer_set_source_position_from_token): Also update
3409         in_system_header.
3410         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
3411         Don't wrap round.
3412         (cp_lexer_token_difference): Dont handle wrapping round.
3413         (cp_lexer_new_main): Enable pragma deferral and raw strings,
3414         read the entire translation unit through c_lex_with_flags into
3415         this lexer's buffer, then turn raw strings back off again.
3416         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
3417         (cp_lexer_get_preprocessor_token): No need to handle not being
3418         the main lexer.  Set token->in_system_header too.
3419         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
3420         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
3421         (cp_lexer_peek_nth_token): Likewise.
3422         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
3423         the other tokens down.
3424         (cp_lexer_purge_tokens_after): Likewise.
3425         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
3426         about there being no tokens.
3427         (cp_lexer_print_token): Revise to give useful information on
3428         all tokens.
3429         (struct cp_parser): Add field translate_strings_p.
3430         (cp_parser_new): Initialize it.
3431         (cp_parser_translation_unit): Destroy the lexer when done.
3432         (cp_parser_parameter_declaration): Restructure saving of
3433         default arguments.
3434         (cp_parser_save_member_function_body): Likewise.
3435         (cp_parser_check_for_invalid_template_id)
3436         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
3437         Adjust calls to cp_lexer_advance_token.
3438         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
3439         No need to fiddle c_lex_string_translate.
3440         (cp_parser_primary_expression, cp_parser_linkage_specification)
3441         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
3442         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
3443         Use cp_parser_string_literal.
3444         (cp_parser_attribute_list): Save and restore
3445         parser->translate_strings_p, not c_lex_string_translate.
3446         (cp_parser_cache_group): Delete.
3447         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
3448         not take a cache argument.
3449
3450 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3451
3452         PR c++/14179
3453         * decl.c (reshape_init): Extract array handling into...
3454         (reshape_init_array): New function. Use integers instead of trees
3455         for indices. Handle out-of-range designated initializers.
3456
3457 2004-09-20  Steven Bosscher  <stevenb@suse.de>
3458
3459         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
3460         to null_node.
3461
3462 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
3463
3464         * decl2.c (determine_visibility): Allow class visibility
3465         directives to override targetm.cxx.export_class_data.
3466
3467 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
3468
3469         * call.c, semantics.c: Follow spelling conventions.
3470         * class.c: Fix a comment typo.
3471
3472 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
3473
3474         PR pch/13361
3475         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
3476         (handle_pragma_implementation): Likewise.
3477
3478 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
3479             Zack Weinberg  <zack@codesourcery.com>
3480
3481         * cp-tree.def: Use tree_code_class enumeration constants
3482         instead of code letters.
3483         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
3484         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
3485         Update for new tree-class enumeration constants.
3486
3487 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
3488
3489         PR c++/16002
3490         * parser.c (cp_parser_simple_declaration): Commit to tentative
3491         parses after seeing a decl-specifier.
3492         (cp_parser_simple_declaration): Eliminate spurious message.
3493         (cp_parser_init_declarator): Adjust error message.
3494
3495         PR c++/16029
3496         * lex.c (unqualified_name_lookup_error): Mark the dummy
3497         declaration as used.
3498
3499         PR c++/17501
3500         * parser.c (cp_parser_nested_name_specifier): Do not resolve
3501         typename types if the user explicitly said "typename".
3502
3503 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
3504
3505         * error.c (dump_decl): Make sure there is lang_specific info before
3506         checking for DTOR and CTOR decls.
3507
3508 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
3509
3510         * class.c (copy_virtuals): Remove.
3511         (build_primary_vtable): Use copy_list directly.
3512         (build_secondary_vtable): Likewise.
3513         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
3514         (create_vtable_ptr): Likewise.
3515
3516 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
3517
3518         * search.c: Follow spelling conventions.
3519
3520 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
3521
3522         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
3523         VEC(tree).
3524         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
3525         comments.
3526         * call.c (build_new_method_call): Don't confirm a pure virtual is
3527         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
3528         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
3529         (fixup_inline_methods, finish_struct): Likewise.
3530         * decl.c (finish_method): Likewise.
3531         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
3532         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
3533         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
3534         vector to avoid repeating the list in error messages.
3535
3536 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
3537
3538         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
3539         * cp-tree.h (cxx_comdat_group): Declare.
3540         * decl.c (cxx_comdat_group): New function.
3541
3542 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
3543
3544         * search.c (get_pure_virtuals): Remove unused variables.
3545
3546         * cp-tree.h (struct lang_decl_flags): Remove
3547         needs_final_overrider.
3548         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
3549         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
3550         * class.c (finish_struct_bits): Correct comment about
3551         CLASSTYPE_PURE_VIRTUALS.
3552         * search.c (get_pure_virtuals): Remove useless loop.
3553
3554 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
3555
3556         PR c++/17324
3557         * mangle.c (partially_mangled_name): New variable.
3558         (partially_mangled_name_len): Likewise.
3559         (save_partially_mangled_name): New function.
3560         (restore_partially_mangled_name): Likewise.
3561         (write_encoding): Save and restore partially mangled names around
3562         calls to get_mostly_instantiated_function_type.
3563         (write_unqualified_name): Likewise.
3564
3565 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
3566
3567         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
3568
3569 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
3570
3571         PR c++/16162
3572         * parser.c (cp_parser_id_expression): Correct value for
3573         is_declarator.
3574         (cp_parser_nested_name_specifier_opt): Look through typenames as
3575         necessary.
3576         (cp_parser_template_name): Honor check_dependency_p.
3577
3578         PR c++/16716
3579         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
3580         Robustify.
3581
3582         PR c++/17327
3583         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
3584         gcc_unreacable.
3585
3586 2004-09-12  Richard Henderson  <rth@redhat.com>
3587
3588         PR c++/16254
3589         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
3590         * typeck.c (condition_conversion): Likewise.
3591
3592 2004-09-11  Richard Henderson  <rth@redhat.com>
3593
3594         PR c++/17404
3595         * pt.c (cur_stmt_expr): Move from tsubst_expr.
3596         (tsubst_expr) <case STMT_EXPR>: Move ...
3597         (tsubst_copy_and_build): ... here.
3598
3599 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
3600
3601         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
3602         comment explaining them moved to c-common.h.
3603         * lex.c (interface_only, interface_unknown, extract_interface_info):
3604         Delete definitions.
3605         (cxx_finish): Don't reset interface_unknown.
3606         (handle_pragma_interface): Don't set interface_only and
3607         interface_unknown; just the like-named fields in finfo.
3608         (handle_pragma_implementation): Adjust comment.
3609         * decl2.c (cp_finish_file): Don't reset interface_only and
3610         interface_unknown.
3611         * method.c (synthesize_method): Don't reset interface_unknown or
3612         call extract_interface_info.
3613         * pt.c (pop_tinst_level): Don't call extract_interface_info.
3614         * decl.c (start_cleanup_fn): Don't save or restore interface_only
3615         and interface_unknown.
3616         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
3617         and use the result instead of the interface_only/interface_unknown
3618         globals.
3619         (start_preparsed_function): Likewise.
3620         * lex.c (cxx_make_type): Likewise.
3621         * semantics.c (begin_class_definition): Likewise.
3622         (expand_body): Don't call extract_interface_info.
3623
3624 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
3625
3626         * decl.c (objc_mark_locals_volatile): Make description of
3627         routine more descriptive; only mark VAR_DECLs at each
3628         binding level.
3629
3630 2004-09-10  Richard Henderson  <rth@redhat.com>
3631
3632         PR c++/17386
3633         * call.c (build_vfield_ref): Move...
3634         * class.c (build_vfield_ref): ... here.  Convert datum to the
3635         primary base containing the vptr.
3636         (make_new_vtable): Simplify build_primary_vtable arguments.
3637         (finish_struct_1): Do not duplicate TYPE_VFIELD.
3638         * typeck.c (build_class_member_access_expr): Don't warn for
3639         null object access to base fields.
3640
3641 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
3642
3643         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
3644         New functions, to be called from ObjC++.
3645
3646 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
3647
3648         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
3649         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
3650         comment typos.
3651
3652 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
3653
3654         * typeck.c (build_c_cast): Preserve the cast if casting
3655         to and from an Objective-C type.
3656
3657 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
3658
3659         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
3660         * typeck.c: Include c-common.h.
3661         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
3662         return the result if nonnegative.
3663
3664 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
3665
3666         * decl2.c (import_export_class)
3667         * lex.c (handle_pragma_interface):
3668         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
3669
3670 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
3671
3672         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
3673         * semantics.c: Include c-common.h.
3674         (finish_compound_stmt): Call objc_clear_super_receiver().
3675
3676 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
3677
3678         * cp-tree.h (do_poplevel): New prototype.
3679         * semantics.c (do_poplevel): Make externally visible.
3680
3681 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
3682
3683         * cp-tree.h (tree_pair_s): Define a GC'd vector.
3684         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
3685         * semantics.c (deferred_access): Likewise.
3686
3687 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
3688
3689         * semantics.c (expand_body): Assert that we are not nested.
3690
3691 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
3692
3693         * decl.c (build_enumerator): Use add_double and int_fits_type_p
3694         instead of cp_build_binary_op, to avoid creating short-lived trees.
3695         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
3696         lookahead instead of backtracking.  Move some code to avoid a
3697         conditional branch.
3698         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
3699         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
3700         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
3701         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
3702
3703 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3704
3705         * decl.c (grok_declarator): Remove a redundant semicolon.
3706
3707         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
3708         Correct comments describing function parameters.
3709
3710 2004-09-03  Matt Austern  <austern@apple.com>
3711         Compile speed improvement.
3712         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
3713         Otherwise define a stub macro that expands to nothing.
3714         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
3715         define a stub macro that expands to 0.
3716         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
3717         (cp_lexer_stop_debugging): Likewise.
3718         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
3719         define a stub macro that expands to NULL.
3720         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
3721         (cp_lexer_new_from_tokens): Likewise.
3722
3723 2004-09-03  Jan Hubicka  <jh@suse.cz>
3724
3725         * decl.c (finish_function): Clean out pointers we no longer need.
3726
3727 2004-09-03  Jan Beulich  <jbeulich@novell.com>
3728
3729         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
3730         than "-lm".
3731
3732 2004-09-02  Paul Brook  <paul@codesourcery.com>
3733
3734         * decl2.c (determine_visibility): Only check data visibility
3735         for VAR_DECLS.
3736
3737 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
3738
3739         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
3740         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
3741         * decl2.c (determine_visibility): Honor
3742         TARGET_CXX_EXPORT_CLASS_DATA.
3743
3744         * class.c (key_method): Rename to ...
3745         (determine_key_method): ... this.
3746         (finish_struct_1): Adjust accordingly.
3747         * cp-tree.h (key_method): Declare.
3748         * decl2.c (maybe_emit_vtables): Determine the key method here if
3749         it has not already been done.
3750
3751 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
3752
3753         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
3754         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
3755         (cp/cp-decl.c): Do not depend on gtype-cp.h.
3756         (cp/cp-objcp-common.o): New target.
3757         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
3758         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
3759         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
3760         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
3761         respectively.
3762         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
3763         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
3764         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
3765         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
3766         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
3767         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
3768         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
3769         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
3770         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
3771         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
3772         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
3773         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
3774         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
3775         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
3776         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
3777         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
3778         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
3779         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
3780         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
3781         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
3782         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
3783         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
3784         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
3785         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
3786         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
3787         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
3788         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
3789         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
3790         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
3791         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
3792         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
3793         hooks to cp-objcp-common.h.
3794         (finish_file): New function.
3795         * cp-objcp-common.c: New file.
3796         * cp-objcp-common.h: New file.
3797         * cp-tree.h (cp_finish_file): New prototype.
3798         * decl.c: Do not include gtype-cp.h.
3799         * decl2.c (finish_file): Rename to cp_finish_file.
3800
3801 2004-08-31  Richard Henderson  <rth@redhat.com>
3802
3803         PR c++/17221
3804         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
3805         (tsubst_copy_and_build): ... here.
3806
3807 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
3808
3809         * cp-tree.h (initialize_artificial_var): Declare.
3810         * decl.c (initialize_artifical_var): New function.
3811         * class.c (initialize_array): Remove.
3812         (initialize_vtable): Use initialize_artificial_var.
3813         (build_vtt): Likewise.
3814         (build_ctor_vtbl_group): Likewise.
3815
3816 2004-08-30  Richard Henderson  <rth@redhat.com>
3817
3818         * class.c (build_base_path): Use build_address directly.
3819         * typeck.c (build_unary_op): Don't lower &a.b to pointer
3820         arithmetic directly.
3821         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
3822         means !initializer_constant_valid_p.
3823
3824 2004-08-30  Richard Henderson  <rth@redhat.com>
3825
3826         * class.c (fixed_type_or_null): Use get_base_address before
3827         assuming an ADDR_EXPR is non-null.
3828
3829 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3830
3831         * name-lookup.c (pop_binding, pushdecl,
3832         set_identifier_type_value_with_scope, push_overloaded_decl,
3833         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
3834         * parser.c (cp_parser_diagnose_invalid_type_name,
3835         cp_parser_postfix_expression, cp_parser_unary_expression,
3836         cp_parser_check_declarator_template_para): Likewise.
3837         * pt.c (push_inline_template_parms_recursive,
3838         check_explicit_specialization, convert_nontype_argument,
3839         coerce_template_template_parms, uses_template_parms,
3840         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
3841         tsubst_expr, instantiate_template,
3842         maybe_adjust_types_for_deduction, type_unification_real,
3843         resolve_overloaded_unification, template_decl_level,
3844         type_dependent_expression_p): Likewise.
3845         * search.c (lookup_base_r): Likewise.
3846         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
3847         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
3848         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
3849         * typeck.c (common_type, get_member_function_from_ptrfunc,
3850         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
3851         * typeck2.c (cxx_incomplete_type_diagnostic,
3852         split_nonconstant_init_1, store_init_value,
3853         process_init_constructor): Likewise.
3854
3855 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3856
3857         * call.c (check_dtor_name): Replace abort with gcc_assert or
3858         gcc_unreachable.
3859         (build_call, add_builtin_candidate, build_new_op,
3860         convert_like_real, build_over_call, in_charge_arg_for_name,
3861         source_type, joust): Likewise.
3862         * class.c (build_simple_base_path, get_vcall_index,
3863         finish_struct_1, instantiate_type, get_enclosing_class,
3864         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
3865         * cp-gimplify.c (cp_genericize): Likewise.
3866         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
3867         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
3868         * decl.c (poplevel, make_unbound_class_template, reshape_init,
3869         check_special_function_return_type, grokdeclarator,
3870         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
3871         finish_function): Likewise.
3872         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
3873         * error.c (dump_global_iord, dump_decl, dump_template_decl,
3874         language_to_string): Likewise.
3875         * except.c (choose_personality_routine): Likewise.
3876         * friend.c (do_friend): Likewise.
3877         * g++spec.c (lang_specific_driver): Likewise.
3878         * init.c (build_zero_init, expand_default_init, build_new_1,
3879         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
3880         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
3881         * mangle.c (add_substitution, write_unscoped_name,
3882         write_template_prefix, write_identifier,
3883         write_special_name_destructor, write_type, write_builtin_type,
3884         write_expression, write_template_param,
3885         write_java_integer_type_codes): Likewise.
3886         * method.c (implicitly_declare_fn): Likewise.
3887
3888 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3889
3890         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
3891         (BINFO_INDIRECT_PRIMARY_P): Remove.
3892         * class.c (determine_primary_base): Rename to ...
3893         (determine_primary_bases): ... here.  Set all primary bases.
3894         (set_primary_base): Remove.
3895         (mark_primary_bases): Remove.
3896         (build_simple_base_path, walk_subobject_offsets,
3897         propagate_binfo_offsets, end_of_class): Adjust.
3898         (layout_class_type): Rename determine_primary_base call.
3899         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
3900         to type_as_string.
3901         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
3902         build_rtti_vtbl_entries): Adjust.
3903         * init.c (build_vtbl_address): Adjust.
3904
3905         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
3906
3907 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
3908
3909         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
3910         CXX_AND_OBJCXX_OBJS.
3911         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
3912         separately on the link line.
3913
3914 2004-08-28  Jason Merrill  <jason@redhat.com>
3915
3916         * decl.c (expand_static_init): Avoid bogus warnings.
3917
3918 2004-08-27  Jason Merrill  <jason@redhat.com>
3919
3920         PR c++/16851
3921         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
3922
3923         PR c++/13684
3924         * decl.c (expand_static_init): Use thread-safety API.
3925         (register_dtor_fn): Return the call, don't expand it.
3926         * tree.c (add_stmt_to_compound): New fn.
3927         (stabilize_call): Use it.
3928
3929 2004-08-27  Richard Henderson  <rth@redhat.com>
3930
3931         * cp-tree.def (OFFSETOF_EXPR): New.
3932         * parser.c (cp_parser_builtin_offsetof): Either built an
3933         OFFSETOF_EXPR, or call fold_offsetof immediately.
3934         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
3935
3936 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
3937
3938         * call.c (validate_conversion_obstack): Replace
3939         my_friendly_assert with gcc_assert or gcc_unreachable.
3940         (direct_reference_binding, merge_conversion_sequences,
3941         build_user_type_conversion_1, perform_overload_resolution,
3942         build_op_delete_call, enforce_access, call_builtin_trap,
3943         build_over_call, build_special_member_call, build_new_method_call,
3944         initialize_reference): Likewise.
3945         * class.c (build_base_path, build_primary_vtable, alter_access,
3946         check_bases, update_vtable_entry_for_fn, layout_empty_base,
3947         clone_function_decl, adjust_clone_args,
3948         type_requires_array_cookie, include_empty_classes,
3949         finish_struct_1, resolve_address_of_overloaded_function,
3950         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
3951         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
3952         accumulate_vtbl_inits, build_vtbl_initializer,
3953         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
3954         * cvt.c (build_up_reference, convert_to_reference): Likewise.
3955         * decl.c (poplevel, duplicate_decls, make_typename_type,
3956         cxx_init_decl_processing, reshape_init, check_initializer,
3957         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
3958         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
3959         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
3960         xref_basetypes, start_preparsed_function, save_function_data,
3961         finish_function, finish_method, maybe_register_incomplete_var,
3962         complete_vars): Likewise.
3963         * decl2.c (grok_array_decl, check_member_template,
3964         check_classfn, finish_static_data_member_decl, coerce_new_type,
3965         coerce_delete_type, import_export_class, decl_needed_p,
3966         determine_visibility, import_export_decl, build_cleanup,
3967         start_static_initialization_or_destructi, do_static_destruction,
3968         prune_vars_needing_no_initialization,
3969         build_offset_ref_call_from_tree): Likewise.
3970         * error.c (dump_decl, dump_expr): Likewise.
3971         * init.c (finish_init_stmts, build_zero_init,
3972         expand_virtual_init, expand_default_init, expand_aggr_init_1,
3973         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
3974         Likewise.
3975         * mangle.c (write_method_parms, write_template_args,
3976         write_expression, write_template_arg): Likewise.
3977         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
3978         * name-lookup.c (pop_binding, begin_scope, leave_scope,
3979         resume_scope, push_using_decl, validate_nonmember_using_decl,
3980         is_ancestor, poplevel_class, set_inherited_value_binding_p,
3981         push_class_level_binding, do_class_using_decl, push_namespace,
3982         pop_namespace, add_using_namespace, ambiguous_decl,
3983         lookup_namespace_name, lookup_type_current_level,
3984         maybe_process_template_type_declaration): Likewise.
3985         * parser.c (cp_lexer_peek_nth_token,
3986         cp_parser_parse_and_diagnose_invalid_typ,
3987         cp_parser_translation_unit, cp_parser_template_id,
3988         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
3989         * pt.c (push_access_scope, finish_member_template_decl,
3990         push_inline_template_parms_recursive, add_outermost_template_args,
3991         get_innermost_template_args, begin_explicit_instantiation,
3992         end_explicit_instantiation, retrieve_specialization,
3993         is_specialization_of, is_specialization_of_friend,
3994         register_specialization, check_explicit_specialization,
3995         comp_template_parms, process_template_parm,
3996         process_partial_specialization, convert_nontype_argument,
3997         coerce_template_template_parms, coerce_template_parms,
3998         mangle_class_name_for_template, lookup_template_function,
3999         lookup_template_class, instantiate_class_template, tsubst_decl,
4000         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
4001         instantiate_template, fn_type_unification, type_unification_real,
4002         get_template_base, regenerate_decl_from_template,
4003         template_for_substitution, instantiate_decl,
4004         get_mostly_instantiated_function_type, dependent_scope_ref_p,
4005         value_dependent_expression_p, resolve_typename_type): Likewise.
4006         * repo.c (repo_emit_p): Likewise.
4007         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
4008         create_tinfo_types, emit_tinfo_decl): Likewise.
4009         * search.c (lookup_base_r, lookup_base, lookup_field_1,
4010         dfs_access_in_type, build_baselink, lookup_member,
4011         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
4012         * semantics.c (perform_or_defer_access_check,
4013         finish_non_static_data_member, finish_stmt_expr_expr,
4014         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
4015         finish_template_template_parm, finish_member_declaration,
4016         emit_associated_thunks): Likewise.
4017         * tree.c (build_target_expr_with_type, force_target_expr,
4018         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
4019         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
4020         cxx_sizeof_or_alignof_type, perform_integral_promotions,
4021         build_class_member_access_expr, finish_class_member_access_expr,
4022         build_ptrmemfunc_access_expr, build_unary_op,
4023         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
4024         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
4025         * typeck2.c (complete_type_check_abstract,
4026         abstract_virtuals_error, process_init_constructor,
4027         add_exception_specifier): Likewise.
4028
4029 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
4030
4031         * class.c (build_vtbl_initializer): Use ssize_int.
4032         * decl.c (complete_array_type): Likewise.
4033         * method.c (finish_thunk): Likewise.
4034         * search.c (get_dynamic_base_type): Likewise.
4035
4036 2004-08-26  Richard Henderson  <rth@redhat.com>
4037
4038         * cp-tree.h (DECL_FIELD_IS_BASE): New.
4039         * class.c (build_base_field): Set it.
4040         (build_simple_base_path): Use it.
4041         (fixed_type_or_null): Don't consider base fields definitive.
4042
4043 2004-08-25  Roger Sayle  <roger@eyesopen.com>
4044
4045         PR middle-end/16693
4046         PR tree-optimization/16372
4047         * decl.c (finish_enum): Make the precision of the enumerated type
4048         the same width as the underlying integer type.
4049
4050 2004-08-25  Mark Mitchell  <mark@codesourcery.com>
4051
4052         PR c++/17155
4053         * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++
4054         functions.
4055
4056         * mangle.c (get_identifier_nocopy): Add cast.
4057
4058         * cp-tree.h (mangle_type): Remove.
4059         * mangle.c (globals): GTY it.
4060         (mangle_obstack): New variable.
4061         (name_obstack): Likewise.
4062         (name_base): Likewise.
4063         (write_char): Adjust accordingly.
4064         (write_chars): Likewise.
4065         (write_string): Likewise.
4066         (start_mangling): Initialize G.substitutions only one.  Add
4067         ident_p parameter.
4068         (finish_mangling): Use VARRAY_CLEAR to reclaim
4069         storage in G.substitutions.  Use obstack_finish.
4070         (init_mangle): Adjust for changes to variable names above.
4071         Initialize G.substitutions.
4072         (mangle_decl_string): Adjust call to start_mangling.
4073         (get_identifier_nocopy): New function.
4074         (mangle_decl): Use it.
4075         (mangle_type_string): Adjust call to start_mangling.
4076         (mangle_special_for_type): Likewise.
4077         (mangle_vtt_for_type): Likewise.
4078         (mangle_ctor_vtbl_for_type): Likewise.
4079         (mangle_thunk): Likewise.
4080         (mangle_guard_variable): Likewise.
4081         (mangle_ref_init_variable): Likewise.
4082
4083 2004-08-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4084
4085         PR c++/14428
4086         * pt.c (redeclare_class_template): Check the type of non-type and
4087         template template parameter.
4088
4089 2004-08-25  Nathan Sidwell  <nathan@codesourcery.com>
4090
4091         * call.c (convert_class_to_reference): Adjust build_int_cst calls.
4092         (build_user_type_conversion_1, convert_like_real,
4093         build_java_interface_fn_ref, build_special_member_call): Likewise.
4094         * class.c (finish_struct_1, build_vtbl_initializer): Likewise.
4095         * cp-gimplify.c (cp_gimplify_expr): Likewise.
4096         * cvt.c (cp_convert_to_pointer): Likewise.
4097         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
4098         * decl2.c (start_static_initialization_or_destruction,
4099         generate_ctor_or_dtor_function): Likewise.
4100         * except.c (build_throw): Likewise.
4101         * mangle.c (write_integer_cst): Likewise.
4102         * method.c (finish_thunk): Likewise.
4103         * rtti.c (build_headof, get_tinfo_decl_dynamic,
4104         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
4105         get_pseudo_ti_init): Likewise.
4106         * search.c (get_dynamic_cast_base_type): Likewise.
4107
4108 2004-08-25  Zack Weinberg  <zack@codesourcery.com>
4109
4110         * class.c, search.c: Remove references to DWARF_DEBUG.
4111
4112 2004-08-25  Adam Nemet  <anemet@lnxw.com>
4113
4114         * repo.c (extract_string): Reset backquote after one character.
4115         (get_base_filename): Fix indentation.
4116
4117 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
4118
4119         * decl.c (cxx_init_decl_processing): Adjust
4120         build_common_tree_nodes call.
4121
4122 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
4123
4124         PR c++/16889
4125         * (is_subobject_of_p): Resurrect & optimize.
4126         (lookup_field_r): Use it.
4127
4128 2004-08-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4129
4130         PR c++/16706
4131         * search.c (friend_accessible_p): Increment processing_template_decl
4132         when deal with TEMPLATE_DECL of SCOPE.
4133
4134 2004-08-24  Nathan Sidwell  <nathan@codesourcery.com>
4135
4136         PR c++/17149
4137         * semantics.c (check_accessibility_of_qualified_id): Defer check
4138         if qualifying_type is a template parameter.
4139
4140 2004-08-23  Mark Mitchell  <mark@codesourcery.com>
4141
4142         PR c++/17163
4143         * pt.c (instantiate_decl): Do not try to apply
4144         DECL_DECLARED_INLINED_P to a VAR_DECL.
4145
4146         * search.c (build_baselink): Fix typo in comment.
4147
4148 2004-08-22 Andrew Pinski  <apinski@apple.com>
4149
4150         Revert:
4151         2004-08-22  Andrew Pinski  <apinski@apple.com>
4152         PR c++/14029
4153         * typeck.c (build_unary_op): Use &a.b if the folded lowered
4154         expression is not constant.
4155
4156 2004-08-23  Nathan Sidwell  <nathan@codesourcery.com>
4157
4158         * name-lookup.c (pushdecl): Rename build_type_copy call.
4159         * tree.c (cp_build_qualified_type_real,
4160         build_exception_variant, handle_java_interface_attribute): Likewise.
4161
4162 2004-08-22  Andrew Pinski  <apinski@apple.com>
4163
4164         PR c++/14029
4165         * typeck.c (build_unary_op): Use &a.b if the folded lowered
4166         expression is not constant.
4167
4168 2004-08-20  Mark Mitchell  <mark@codesourcery.com>
4169
4170         PR c++/17121
4171         * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P.
4172
4173 2004-08-21  Joseph S. Myers  <jsm@polyomino.org.uk>
4174
4175         PR c++/17120
4176         * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for
4177         MODOP_EXPR.
4178
4179 2004-08-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4180
4181         * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION
4182         before calling comp_template_args.
4183
4184 2004-08-20  Nathan Sidwell  <nathan@codesourcery.com>
4185
4186         * class.c (build_vtbl_initializer): Use build_int_cst for
4187         negative size types.
4188         * decl.c (complete_array_type): Likewise.
4189         * method.c (finish_thunk): Likewise.
4190
4191 2004-08-20  Andreas Tobler  <a.tobler@schweiz.ch>
4192
4193         * tree.c: Remove unused mark_local_for_remap_r.
4194
4195 2004-08-19  Eric Christopher  <echristo@redhat.com>
4196
4197         * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
4198         * tree.c (cxx_unsave_expr_now): Delete.
4199         (cp_unsave_r): Ditto.
4200
4201 2004-08-19  Mark Mitchell  <mark@codesourcery.com>
4202
4203         PR c++/15890
4204         * pt.c (push_template_decl_real): Disallow template allocation
4205         functions with fewer than two parameters.
4206
4207 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
4208
4209         * cp-tree.h (build_shared_int_cst): Remove.
4210         * tree.c (shared_int_cache): Remove.
4211         (build_shared_int_cst): Remove.
4212         * class.c (finish_struct_1): Use build_int_cst.
4213
4214 2004-08-19  Nathan Sidwell  <nathan@codesourcery.com>
4215
4216         * decl.c (finish_enum): Do not copy value node early, copy
4217         later.
4218         * lex.c (cxx_init): Force null_node to be unique.
4219
4220 2004-08-19  Joseph S. Myers  <jsm@polyomino.org.uk>
4221
4222         PR c++/17041
4223         * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING
4224         from input for MODOP_EXPR.
4225
4226 2004-08-18  Mark Mitchell  <mark@codesourcery.com>
4227
4228         * pt.c (dependent_template_p): Fix typo in commment.
4229
4230         PR c++/17068
4231         * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as
4232         dependent.
4233
4234 2004-08-17  Mark Mitchell  <mark@codesourcery.com>
4235
4236         PR c++/16246
4237         * pt.c (unify): Tidy ARRAY_TYPE handling.  Make sure that non-type
4238         arguments have the same type as the corresponding parameter.
4239
4240         PR c++/16215
4241         * parser.c (cp_parser_name_lookup_error): If parser->object_scope
4242         is set use it for diagnostic purposes.
4243         (cp_parser_pseudo_destructor_name): Remove special-case error
4244         message.
4245
4246         PR c++/15871
4247         * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions.
4248
4249         PR c++/16965
4250         * cp-tree.h (qualified_name_lookup_error): Add parameter.
4251         * name-lookup.c (do_class_using_decl): Restrict set of entities
4252         passed to cp_emit_debug_info_for_using more carefully.
4253         (lookup_qualified_name): Allow lookup_member to return sets of
4254         ambiguous entries.
4255         * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter.
4256         (cp_parser_primary_expression): Handle ambiguous lookups.
4257         (cp_parser_template_name): Adjust use of cp_parser_lookup_name.
4258         (cp_parser_template_argument): Likewise.
4259         (cp_parser_elaborate_type_specifier): Likewise.
4260         (cp_parser_namespace_name): Likewise.
4261         (cp_parser_class_name): Likewise.
4262         (cp_parser_lookup_name_simple): Likewise.
4263         * pt.c (tsubst_qualified_id): Handle ambiguous results.
4264         (tsubst_expr): Likewise.
4265         * semantics.c (qualified_name_lookup_error): Add decl paramter.
4266         For ambiguous lookups, print candidates.
4267
4268 2004-08-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4269
4270         PR c++/6749
4271         * pt.c (instantiate_pending_templates): Add int parameter.  Don't
4272         return anything.
4273         * cp-tree.h (instantiate_pending_templates): Adjust prototype.
4274         * decl2.c (finish_file): Adjust call to
4275         instantiate_pending_templates.
4276
4277 2004-08-15  Roger Sayle  <roger@eyesopen.com>
4278
4279         * call.c (build_vfield_ref, build_call, build_conditional_expr,
4280         convert_arg_to_ellipsis, build_x_va_arg, build_over_call,
4281         build_java_interface_fn_ref, build_special_member_call,
4282         build_new_method_call, initialize_reference): Replace calls to
4283         build with calls to buildN.
4284         * class.c (build_base_path, convert_to_base_statically,
4285         build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits,
4286         build_vtbl_initializer): Likewise.
4287         * cp-gimplify.c (genericize_try_block, genericize_catch_block,
4288         gimplify_if_stmt, cp_genericize_r): Likewise.
4289         * cvt.c (convert_to_void): Likewise.
4290         * decl.c (check_initializer, finish_constructor_body,
4291         finish_destructor_body): Likewise.
4292         * error.c (dump_expr): Likewise.
4293         * except.c (build_exc_ptr, expand_start_catch_block, build_throw):
4294         Likewise.
4295         * init.c (perform_member_init, expand_virtual_init,
4296         expand_cleanup_for_base, build_init, expand_default_init,
4297         build_offset_ref, decl_constant_value, build_new, build_new_1,
4298         build_vec_delete_1, build_vec_init, build_delete,
4299         push_base_cleanups, build_vec_delete): Likewise.
4300         * mangle.c (write_integer_cst): Likewise.
4301         * method.c (thunk_adjust, do_build_copy_constructor,
4302         do_build_assign_ref): Likewise.
4303         * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build,
4304         unify, build_non_dependent_expr): Likewise.
4305         * rtti.c (build_headof, build_typeid, ifnonnull,
4306         build_dyanmic_cast_1, tinfo_base_init): Likewise.
4307         * semantics.c (begin_compound_stmt, finish_call_expr,
4308         finish_pseudo_destructor_expr, finish_id_expression,
4309         simplify_aggr_init_expr, finalize_nrv_r): Likewise.
4310         * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top,
4311         array_type_nelts_total, stabilize_call): Likewise.
4312         * typeck.c (decay_conversion, build_class_member_access_expr,
4313         lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref,
4314         get_member_function_from_ptrfunc, build_binary_op, pointer_diff,
4315         build_x_unary_op, build_unary_op, unary_complex_lvalue,
4316         build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst,
4317         check_return_expr): Likewise.
4318         * typeck2.c (split_nonconstant_1, split_nonconstant_init_1,
4319         split_nonconstant_init, store_init_value, build_m_component_ref):
4320         Likewise.
4321
4322 2004-08-15  Nathan Sidwell  <nathan@codesourcery.com>
4323
4324         * call.c (convert_class_to_reference,
4325         build_user_type_conversion_1, convert_like_real,
4326         build_java_interface_fn_ref, build_special_member_call): Use
4327         build_int_cst.
4328         * class.c (build_vtbl_initializer): Likewise.
4329         * cp-gimplify.c (cp_gimplify_expr): Likewise.
4330         * cvt.c (cp_convert_to_pointer): Likewise.
4331         * decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
4332         * decl2.c (start_static_initialization_or_destruction,
4333         generate_ctor_or_dtor_function): Likewise.
4334         * except.c (build_throw): Likewise.
4335         * lex.c (cxx_init): Likewise.
4336         * mangle.c (write_integer_cst): Likewise.
4337         * rtti.c (build_headof, get_tinfo_decl_dynamic,
4338         build_dynamic_cast_1, ptr_initializer, ptm_initializer,
4339         get_pseudo_ti_init): Likewise.
4340         * search.c (get_dynamic_cast_base_type): Likewise.
4341         * tree.c (build_shared_int_cst): Likewise.
4342
4343 2004-08-12  Mark Mitchell  <mark@codesourcery.com>
4344
4345         PR c++/16273
4346         * class.c (count_depth_data): New type.
4347         (dfs_depth_post): New function.
4348         (dfs_depth_q): Likewise.
4349         (find_final_overrider_data_s): Change type of vpath.
4350         Add vpath_list.
4351         (dfs_find_final_overrider_1): New function.
4352         (dfs_find_final_overrider): Use it.
4353         (dfs_find_final_overrider_q): Adjust use of vpath.
4354         (dfs_find_final_overrider_post): Likewise.
4355         (find_final_overrider): Use dfs_depth.  Allocate and deallocate
4356         vpath_list.
4357
4358 2004-08-12 Jan Beulich <jbeulich@novell.com>
4359
4360         * parser.c (cp_parser_asm_definition): Properly consume scope operator
4361         tokens preceding the clobbers. Don't check for scope operator
4362         following inputs. Simplify inputs handling to match that now used for
4363         clobbers.
4364
4365 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
4366
4367         PR c++/16698
4368         * except.c (build_throw): Allocate cleanup_type and the function
4369         for __cxa_throw separately.
4370
4371         PR c++/16853
4372         * call.c (standard_conversion): Do not accept conversions between
4373         pointers to members if the class types are unrelated.
4374
4375         PR c++/16618
4376         * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile
4377         char &" instead of just "char &".
4378
4379         PR c++/16870
4380         * pt.c (tsubst): Just return the unknown_type_node.
4381
4382 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
4383
4384         PR c++/16964
4385         * parser.c (cp_parser_class_specifier): Robustify.
4386
4387         PR c++/16904
4388         * pt.c (tsubst_copy_and_build): Complain about invalid
4389         qualification.
4390
4391         PR c++/16929
4392         * pt.c (tsubst_default_argument): Clear out current_class_ptr and
4393         current_class_ref while tsubsting.
4394
4395 2004-08-10  Mark Mitchell  <mark@codesourcery.com>
4396
4397         PR c++/16971
4398         * parser.c (cp_parser_init_declarator): Robustify.
4399
4400 2004-08-06  Richard Sandiford  <rsandifo@redhat.com>
4401
4402         * typeck2.c (process_init_constructor): Guard the missing field warning
4403         with warn_missing_field_initializers rather than extra_warnings.
4404
4405 2004-08-06  Paolo Bonzini  <bonzini@gnu.org>
4406
4407         * class.c (instantiate_type) <ENTRY_VALUE_EXPR>: Do not handle.
4408
4409 2004-08-05  Mark Mitchell  <mark@codesourcery.com>
4410
4411         * decl.c (start_preparsed_function): Move determine_visibility
4412         call.
4413         * decl2.c (determine_visibility): Incorporate dllexport testing.
4414
4415 2004-08-05  Geoffrey Keating  <geoffk@apple.com>
4416
4417         * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option
4418         means that libstdc++ is needed.
4419
4420 2004-08-05  Nathan Sidwell  <nathan@codesourcery.com>
4421
4422         * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
4423
4424 2004-08-04  Geoffrey Keating  <geoffk@apple.com>
4425
4426         * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
4427         than passing it as a parameter to rest_of_decl_compilation.
4428         * decl2.c (grokfield): Use set_user_assembler_name.
4429
4430 2004-08-04  Nathan Sidwell  <nathan@codesourcery.com>
4431
4432         * decl.c (complete_array_type): Don't gratuitously copy
4433         maxindex. Its type is always set.
4434
4435 2004-08-04  Paul Brook  <paul@codesourcery.com>
4436
4437         * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H.
4438         * cp-tree.h (struct language_function): Rename x_dtor_label to
4439         x_cdtor_label.
4440         (dtor_label): Rename ...
4441         (cdtor_label): ... to this.
4442         * decl.c (begin_constructor_body): Remove.
4443         (check_special_function_return_type): Maybe change the return type.
4444         (grokdeclarator): Pass the class type.
4445         (start_preparsed_function): Constructors may need a return label.
4446         (finish_constructor_body, finish_destructor_body): Set the return
4447         value.
4448         (begin_function_body): Don't call begin_constructor_body.
4449         (finish_function): Don't warn for constructors or destructors.
4450         (implicitly_declare_fn): Maybe change the return type.
4451         * optimize.c: Include target.h.
4452         (maybe_clone_body): Remap the function result.
4453         * semantics.c: Include target.h.
4454         (finish_return_stmt): Maybe jump to return label for constructors.
4455
4456 2004-08-03  Mark Mitchell  <mark@codesourcery.com>
4457
4458         * class.c (build_vtable): Do not set DECL_VISIBILITY here.
4459         (check_field_decls): Or here.
4460         (check_methods): Or here.
4461         (initialize_array): Don't mess with DECL_CONTEXT.
4462         * cp-tree.h (start_decl): Adjust prototype.
4463         (determine_visibility): New function.
4464         * decl.c (duplicate_decls): Remove checks for hidden "operator
4465         new".
4466         (build_library_fn_1): Give all library functions default
4467         visibility.
4468         (start_decl): Add pop_scope_p parameter.  Tidy.
4469         (cp_finish_decl): Do not pop scopes here.  Call
4470         determine_visibility for variable definitions.
4471         (start_preparsed_function): Call determine_visibility.
4472         * decl2.c (determine_visibility): New function.
4473         * method.c (use_thunk): Fix formatting.
4474         * parser.c (cp_parser_condition): Adjust calls to start_decl.
4475         (cp_parser_init_declarator): Likewise.
4476         * pt.c (instantiate_decl): Always call pop_nested_class.
4477         * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
4478         (tinfo_base_init): Likewise.
4479
4480 2004-08-02  Mark Mitchell  <mark@codesourcery.com>
4481
4482         PR c++/16707
4483         * name-lookup.c (validate_nonmember_using_decl): Robustify.
4484
4485 2004-08-01  Mark Mitchell  <mark@codesourcery.com>
4486
4487         PR c++/16224
4488         * name-lookup.c (decl_namespace): Remove.
4489         (current_decl_namespace): Use decl_namespace_context instead of
4490         decl_namespace.
4491         (push_decl_namespace): Likewise.
4492         (arg_assoc_class): Likewise.
4493         (arg_assoc_type): Likewise.
4494         * pt.c (check_specialization_namespace): New function.
4495         (maybe_process_partial_specialization): Use it.
4496         (register_specialization): Likewise.
4497
4498         PR c++/16489
4499         * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro.
4500         * call.c (null_ptr_cst_p): Handle variables with constant
4501         initializers.
4502         * pt.c (convert_nontype_argument): Use
4503         DECL_INTEGRAL_CONSTANT_VAR_P.
4504         * semantics.c (finish_id_expression): Likewise.
4505
4506         PR c++/16529
4507         * decl.c (duplicate_decls): Reject duplicate namespace
4508         declarations.
4509
4510         PR c++/16810
4511         * typeck.c (build_ptrmemfunc): Loosen assertion.
4512
4513 2004-08-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4514
4515         * call.c (z_candidate::template_decl): Rename from template.
4516         (add_template_candidate_real): Adjust member reference.
4517         (joust): Likewise.
4518
4519 2004-07-29  Mark Mitchell  <mark@codesourcery.com>
4520
4521         * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
4522         (lang_decl_flags): Narrow the width of "languages".  Add
4523         repo_available_p.
4524         (DECL_NEEDED_P): Remove.
4525         (FOR_EACH_CLONE): New macro.
4526         (DECL_REPO_AVAILABLE_P): Likewise.
4527         (DECL_TINFO_P): Likewise.
4528         (set_linkage_according_to_type): Declare.
4529         (import_export_vtable): Remove.
4530         (import_export_tinfo): Likewise.
4531         (mark_needed): New function.
4532         (decl_needed_p): Likewise.
4533         (note_vauge_linkage_fn): Likewise.
4534         (init_repo): Change prototype.
4535         (repo_template_used): Remove.
4536         (repo_template_instantiated): Likewise.
4537         (repo_emit_p): New function.
4538         (repo_export_class_p): Likewise.
4539         (no_linkage_check): Change prototype.
4540         * class.c (set_linkage_according_to_type): New function.
4541         (build_vtable): Use it.  Do not call import_export_vtable.  Set
4542         DECL_IGNORED_P if appropriate.
4543         * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
4544         (make_rtL_for_nonlocal_decls): Check for template instantiations
4545         explicitly.
4546         (grokfndecl): Adjust call to no_linkage_check.
4547         (set_linkage_for_static_data_member): New function.
4548         (grokvardecl): Use it.  Adjust call to no_linkage_check.
4549         (grokdeclarator): Use set_linkage_for_static_data_member.
4550         * decl2.c (note_vague_linkage_fn): New function.
4551         (note_vague_linkage_var): Likewise.
4552         (finish_static_data_member_decl): Use it.
4553         (import_export_vtable): Remove.
4554         (import_export_class): Use repo_export_class_p.
4555         (var_finalized_p): Simplify.
4556         (maybe_emit_vtables): Simplify.
4557         (mark_needed): New function.
4558         (decl_needed_p): Likewise.
4559         (import_export_decl): Add documentation and consistency checks.
4560         Use repo_emit_p.  Handle virtual tables and RTTI information
4561         here.
4562         (import_export_tinfo): Remove.
4563         (write_out_vars): Call import_export_decl.
4564         (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
4565         whenever one is.
4566         (finish_file): Use decl_needed_p.  Do not call import_export_decl
4567         for undefined static data members.  Do not warn about undefined
4568         inlines when using a repository.
4569         (mark_used): Use note_vague_linkage_fn.  Always defer template
4570         instantiations.
4571         * lex.c (cxx_init): Adjust call to init_repo.  Always set
4572         flag_unit_at_a-time.
4573         * method.c (synthesize_method): Remove unncessary
4574         import_export_decl call.
4575         (implicitly_declare_fn): Use set_linkage_according_to_type.
4576         * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
4577         * pt.c (instantiate_class_template): Don't redundantly add classes
4578         to keyed_classes.  Don't call repo_template_used.
4579         (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
4580         templates with internal linkage.
4581         (check_instantiated_args): Adjust call to no_linkage_check.
4582         (instantiate_template): Use FOR_EACH_CLONE.
4583         (mark_definable): New function.
4584         (mark_decl_instantiated): Use it.
4585         (do_decl_instantiation): Adjust tests for explicit instantiation
4586         after "extern template".
4587         (instantiate_class_member): Do not use repo_template_instantiated.
4588         (do_type_instantiation): Simplify.
4589         (instantiate_decl): Use mark_definable.  Check repo_emit_p.
4590         Simplify.
4591         * repo.c (repo_get_id): Remove.
4592         (original_repo): Remove.
4593         (IDENTIFIER_REPO_USED): Remove.
4594         (IDENTIFIER_REPO_CHOSEN): Remove.
4595         Remove all #if 0'd code.
4596         (repo_template_used): Remove.
4597         (repo_template_instantiated): Remove.
4598         (temporary_obstack_initialized_p): New variable.
4599         (init_repo): Register with lang_post_pch_load.  Avoid creating
4600         identifiers unnecessarily.  Don't use original_repo.  Close the
4601         file here.
4602         (reopen_repo_file_for_write): Not here.
4603         (finish_repo): Always write out a new repository file.
4604         (repo_emit_p): New function.
4605         (repo_export_class_p): Likewise.
4606         * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
4607         (involves_incomplete_p): New function.
4608         (tinfo_base_init): Use it.
4609         (ptr_initializer): Remove non_public_ptr parameter.
4610         (ptm_initializer): Likewise.
4611         (get_pseudo_ti_init): Likewise.
4612         (unemitted_tinfo_decl_p): Remove.
4613         (emit_tinfo_decl): Use import_export_decl.
4614         * semantics.c (expand_body): Move updates of static_ctors and
4615         static_dtors to ...
4616         (expand_or_defer_fn): ... here.
4617         * tree.c (no_linkage_check): Add relaxed_p parameter.
4618
4619 2004-07-28  Eric Christopher  <echristo@redhat.com>
4620
4621         * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
4622
4623 2004-07-28  Nathan Sidwell  <nathan@codesourcery.com>
4624
4625         * cp-tree.h (struct tree_pair_s): New.
4626         (typedef tree_pair_p): New.
4627         (DEF_VEC_O(tree_pair_s)): New.
4628         (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s).
4629         (CLASSTYPE_VCALL_INDICES): Update documentation.
4630         * class.c (get_vcall_index): Adjust.
4631         (add_vcall_offset): Adjust.
4632
4633 2004-07-27  Kelley Cook  <kcook@gcc.gnu.org>
4634
4635         * pt.c, typeck.c: Remove spurious carriage returns.
4636
4637 2004-07-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4638
4639         PR c++/14429
4640         * pt.c (coerce_template_template_parms) <PARM_DECL case>: Only check
4641         when the type of ARG is not dependent.
4642
4643 2004-07-26  Geoffrey Keating  <geoffk@apple.com>
4644
4645         * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX.
4646         (lang_specific_driver): If the C++ or math library options don't
4647         start with '-l', don't count them as added libraries.
4648
4649 2004-07-26  Nathan Sidwell  <nathan@codesourcery.com>
4650
4651         * decl.c (xref_basetypes): Adjust base access vector creation.
4652         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base
4653         access accesses.
4654         * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise.
4655
4656 2004-07-26  Niall Douglas  <s_fsfeurope2@nedprod.com>
4657             Brian Ryner  <bryner@brianryner.com>
4658
4659         PR c++/15000
4660         PR c++/9283
4661         * class.c (check_field_decls): Apply hidden visibility if
4662         -fvisibility-inlines-hidden and inlined unless otherwise specified
4663         (build_vtable): Set vtable visibility to class visibility.
4664         (check_field_decls): Default static member visibility to class
4665         visibility.
4666         (check_methods): Default method visibility to class visibility.
4667         * cp-tree.h: Added CLASSTYPE_VISIBILITY and
4668         CLASSTYPE_VISIBILITY_SPECIFIED macro.
4669         * decl.c (duplicate_decls): New logic for merging definition decls
4670         with declaration decls. Added ignore & warning when non default
4671         applied to global operator new or delete.
4672         * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED
4673         wherever VISIBILITY was changed
4674         * rtti.c (get_tinfo_decl): Set typeinfo visibility to class
4675         visibility.
4676         (tinfo_base_init): Set typeinfo name visibility to class visibility.
4677
4678 2004-07-25  Bernardo Innocenti  <bernie@develer.com>
4679
4680         * decl.c: Rename all identifiers named `class' to `cl'.
4681         * cp-tree.h: Likewise.
4682
4683 2004-07-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4684
4685         * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW.
4686         * typeck2.c (abstract_virtuals_error): Use GGC_NEW.
4687         * name-lookup.c (binding_entry_make): Use GGC_NEW.
4688         (binding_table_construct): Use GGC_CNEWVEC.
4689         (binding_table_new): Use GGC_NEW.
4690         (cxx_binding_make): Likewise.
4691         (begin_scope): Likewise.
4692         (push_to_top_level): Use GCC_CNEW.
4693         * parser.c (cp_token_cache_new): Likewise.
4694         (cp_token_cache_push_token): Likewise.
4695         (cp_lexer_new_main): Likewise.
4696         (cp_lexer_new_from_tokens): Likewise.
4697         (cp_parser_context_new): Likewise.
4698         (cp_parser_new): Likewise.
4699         (cp_lexer_new_from_tokens): Use GGC_NEWVEC.
4700         * lex.c (cxx_make_type): Use GGC_CNEW.
4701         (retrofit_lang_decl): Use GGC_NEWVAR.
4702         (cxx_dup_lang_specific_decl): Likewise.
4703         (copy_lang_type): Likewise.
4704         * decl.c (use_label): Use GGC_NEW instead of ggc_alloc.
4705         (save_function_data): Likewise.
4706         (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared.
4707         (cxx_push_function_context): Likewise.
4708
4709 2004-07-25  Richard Henderson  <rth@redhat.com>
4710
4711         * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and
4712         DECL_IGNORED_P on RESULT_DECL.
4713         * semantics.c (finalize_nrv): Copy them too.
4714
4715 2004-07-23  Nathan Sidwell  <nathan@codesourcery.com>
4716
4717         * search.c (lookup_conversion_operator): Avoid two loops.
4718         (add_conversions): Remove.
4719         (check_hidden_convs, split_conversions,
4720         lookup_conversions_r):  New.
4721         (lookup_conversions): Use lookup_conversions_r.
4722
4723 2004-07-22  Nathan Sidwell  <nathan@codesourcery.com>
4724
4725         * pt.c (get_template_base): Check type is completable.
4726
4727 2004-07-21  Eric Christopher  <echristo@redhat.com>
4728
4729         * decl.c (poplevel): Inline unused variable checking.
4730         Change formatting.
4731
4732 2004-07-21  Paolo Bonzini  <bonzini@gnu.org>
4733
4734         * typeck.c (build_binary_op): Do not use RDIV_EXPR for
4735         integer vectors.
4736
4737 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4738
4739         PR c++/14497
4740         * pt.c (check_explicit_specialization): Remove extension to accept
4741         specializations without template headers. Fall-through to normal
4742         processing.
4743
4744 2004-07-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
4745
4746         PR c++/509
4747         * pt.c (determine_specialization): New parameter template_count.
4748         Disambiguate between member templates and member functions counting
4749         the template headers.
4750         (check_explicit_specialization): Update caller.
4751         (tsubst_friend_function): Likewise.
4752
4753 2004-07-20  Steven Bosscher  <stevenb@suse.de>
4754
4755         * cp-tree.def (TINST_LEVEL): Make it an 'x' node.
4756         * cp-tree.h (tinst_level_t): New tree type.
4757         (union lang_tree_node): Handle it.
4758         (TINST_LOCATION): New accessor macro.
4759         (make_tinst_level): New prototype.
4760         * cp-lang.c (cp_tree_size): Handle TINST_LEVEL.
4761         * decl.c (cp_tree_node_structure): Likewise.
4762         * error.c (print_instantiation_full_context): Use TINST_LOCATION.
4763         (print_instantiation_partial_context): Likewise.
4764         * pt.c (pop_tinst_level): Likewise.
4765          (push_tinst_level): Use make_tinst_level.
4766         * tree.c (make_tinst_level): New function.
4767         (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node.
4768
4769 2004-07-20  Mark Mitchell  <mark@codesourcery.com>
4770
4771         * parser.c (cp_parser_simple_type_specifier): Fix typo.
4772
4773         PR c++/16637
4774         * parser.c (cp_parser_simple_type_specifier): Do not record usage
4775         of globally-qualified names.
4776
4777 2004-07-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4778
4779         PR c++/16175
4780         * error.c (dump_type) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Output
4781         cv qualifier.
4782
4783 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
4784
4785         PR c++/16623
4786         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
4787         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
4788         * class.c (add_implicitly_declared_members): Use
4789         CLASSTYPE_LAZY_ASSIGNMENT_OP.
4790         * method.c (lazily_declare_fn): Clear
4791         CLASSTYPE_LAZY_ASSIGNMENT_OP.
4792         * search.c (lookup_fnfields_1): Check it.
4793
4794 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
4795
4796         * cp-tree.h (vec_binfo_member): Remove.
4797         * tree.c (vec_binfo_member): Remove.
4798
4799         * cp-tree.h (struct lang_type_class): Remove vfields field.
4800         (CLASSTYPE_VFIELDS): Remove.
4801         (SET_BINFO_NEW_VTABLE_MARKED): Adjust.
4802         * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS
4803         handling.
4804         (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P.
4805         (finish_struct_1): Remove CLASSTYPE_VFIELDS handling.
4806         * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P.
4807
4808 2004-07-20  Nathan Sidwell  <nathan@codesourcery.com>
4809
4810         * cp-tree.h (DEF_VEC_P(tree)): Remove here.
4811         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
4812         Moved to common.
4813         (BINFO_LANG_SLOTS): Remove.
4814         * tree.c (copy_binfo): Adjust BINFO creation and accessors.
4815         * decl.c (xref_basetypes): Adjust BINFO creation and accessors.
4816         * class.c (check_bases): Adjust BINFO accessors.
4817         (determine_primary_base, finish_struct_bits,
4818         maybe_warn_about_overly_private_class, warn_hidden,
4819         walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
4820         warn_about_ambiguous_bases, get_vfield_name,
4821         dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
4822         add_vcall_offset_vtbl_entries_r): Likewise.
4823         * dump.c (cp_dump_tree): Likewise.
4824         * init.c (sort_mem_initializers, expand_member_init, build_delete,
4825         push_base_cleanups): Likewise.
4826         * method.c (do_build_copy_constructor, do_build_assign_ref,
4827         synthesize_exception_spec): Likewise.
4828         name-lookup.c (arg_assoc_class): Likewise.
4829         * pt.c (instantiate_class_template,
4830         get_template_base_recursive): Likewise.
4831         * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
4832         * typeck2.c (process_init_constructor): Likewise.
4833         * search.c (lookup_base_r, dynamic_cast_base_recurse,
4834         dfs_access_in_type, dfs_walk_real, look_for_overrides,
4835         types_overlap_p, copied_binfo, original_binfo): Likewise.
4836         (binfo_for_vtable): Remove
4837
4838 2004-07-20  Steven Bosscher  <stevenb@suse.de>
4839
4840         * cp-tree.h (struct lang_decl_flags): Unify the template_info and
4841         thunk_alias, and the access and virtual_offset fields.
4842         (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust.
4843         * decl.c (finish_case_label): Update c_add_case_node call.
4844
4845 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
4846
4847         Revert patch for PR c++/16623.
4848
4849 2004-07-19  Kelley Cook  <kcook@gcc.gnu.org>
4850
4851         * except.c: Remove two spurious carriage returns.
4852
4853 2004-07-19  Mark Mitchell  <mark@codesourcery.com>
4854
4855         PR c++/16623
4856         * cp-tree.h (lang_type_class): Add lazy_assignment_op.
4857         (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro.
4858         * class.c (add_implicitly_declared_members): Use
4859         CLASSTYPE_LAZY_ASSIGNMENT_OP.
4860         * method.c (lazily_declare_fn): Clear
4861         CLASSTYPE_LAZY_ASSIGNMENT_OP.
4862         * search.c (lookup_fnfields_1): Check it.
4863
4864 2004-07-19  Nathan Sidwell  <nathan@codesourcery.com>
4865
4866         * class.c (add_method): Delay adding the slot until the end.
4867         (determine_primary_base): Adjust VEC_iterate invokation.
4868         (resort_type_method_vec, finish_struct_methods, warn_hidden,
4869         walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases,
4870         build_vtbl_initializer): Likewise.
4871         * init.c (sort_mem_initializers, build_delete, push_base_cleanups,
4872         build_vbase_delete): Likewise.
4873         * method.c (do_build_copy_constructor): Likewise.
4874         * name-lookup.c (new_class_binding, print_binding_level,
4875         poplevel_class, store_class_bindings, push_to_top_level,
4876         pop_from_top_level): Likewise.
4877         * pt.c (check_explicit_specialization): Likewise.
4878         * search.c (lookup_conversion_operator, lookup_fnfields_1,
4879         get_pure_virtuals, add_conversions, dfs_check_overlap,
4880         binfo_for_vbase): Likewise.
4881
4882 2004-07-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4883
4884         PR c++/12170
4885         * pt.c (unify) <BOUND_TEMPLATE_TEMPLATE_PARM case>: Use only
4886         innermost set of template arguments during deduction.  Simplify.
4887
4888 2004-07-19  Joseph S. Myers  <jsm@polyomino.org.uk>
4889
4890         * typeck.c (build_modify_expr, build_x_modify_expr): Set
4891         TREE_NO_WARNING on assignments with an operator other than '='.
4892
4893 2004-07-10  Steven Bosscher  <stevenb@suse.de>
4894             Joseph S. Myers  <jsm@polyomino.org.uk>
4895
4896         * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
4897         * decl2.c (grokfield): Don't check current_class_depth via
4898         unused TREE_COMPLEXITY.
4899         * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
4900         to avoid the missing parentheses warning.
4901         Don't set C_SET_EXP_ORIGINAL_CODE.
4902
4903 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
4904
4905         * tree.c (no_linkage_helper): Remove.
4906         (no_linkage_check): Don't use walk_tree_without_duplicates.
4907
4908         * mangle.c (write_expression): Issue a sorry for zero-operand
4909         functional casts.
4910
4911 2004-07-18  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
4912
4913         PR c++/13092
4914         * init.c (build_offset_ref): Build SCOPE_REF with non-null
4915         TREE_TYPE for non-dependent names.
4916         * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF.
4917         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
4918         unknown_type_node as its TREE_TYPE.
4919         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
4920         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
4921         (dump_expr) <SCOPE_REF case>: Likewise.
4922
4923 2004-07-17  Jason Merrill  <jason@redhat.com>
4924
4925         PR c++/16115
4926         * call.c (type_passed_as): Make the invisible reference type
4927         __restrict.
4928         * cp-gimplify.c (gimplify_cleanup_stmt): Rename to
4929         cp_genericize_r.  Handle invisible reference lowering.
4930         (is_invisiref_parm): New fn.
4931         (cp_genericize): Adjust the types of invisible reference parms.
4932         Don't repeat the walk for clones.
4933         * decl.c (store_parm_decls): Don't generate any code for clones.
4934
4935 2004-07-17  Joseph S. Myers  <jsm@polyomino.org.uk>
4936
4937         * cp-tree.h (builtin_function): Declare.
4938
4939 2004-07-16  Mark Mitchell  <mark@codesourcery.com>
4940
4941         * class.c (finish_struct_methods): Remove unncessary code.
4942         (add_implicitly_declared_members): Create declarations for default
4943         constructors and copy constructors lazily.
4944         * cp-tree.h (lang_type_class): Remove lazy_default_ctor and
4945         lazy_copy_ctor.
4946         (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
4947         (CLASSTYPE_LAZY_COPY_CTOR): Likewise.
4948         * decl2.c (check_classfn): Robustify.
4949         (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
4950         (locate_ctor): Handle lazy default constructors.
4951         (locate_copy): Handle lazy copy constructors.
4952         (implicitly_declare_fn): Make sure we're looking at the
4953         TYPE_MAIN_VARIANT for a class before creating functions.  Don't
4954         set TYPE_HAS_CONSTRUCTOR.
4955         (lazily_declare_fn): New function.
4956         * name-lookup.c (constructor_name_full): Simplify.
4957         * search.c (lookup_fnfields_1): Lazily create methods, as
4958         necessary.
4959         (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.
4960
4961 2004-07-16  Steven Bosscher  <stevenb@suse.de>
4962
4963         * cp-tree.h (struct lang_type): Don't have three GTY options on a
4964         single bit GTY desc.
4965
4966 2004-07-16  Richard Henderson  <rth@redhat.com>
4967
4968         * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
4969         * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
4970         * tree.c (cp_copy_res_decl_for_inlining): Remove.
4971
4972 2004-07-16  Nathan Sidwell  <nathan@codesourcery.com>
4973
4974         * class.c (finish_struct_bits): Use for loop.
4975         (propagate_binfo_offsets): Do primary binfo outside of loop.
4976
4977         PR c++/16583
4978         * dump.c (cp_dump_tree): Don't dump the bases if there's no
4979         binfo.
4980
4981         * pt.c (tsubst) <TREE_BINFO case>: We should never get here.
4982
4983 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
4984
4985         * cp-tree.h (lang_type_class): Remove has_real_assign_ref and
4986         has_abstract_assign_ref.  Make methods a VEC(tree) *.
4987         (TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
4988         (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
4989         (CLASSTYPE_DESTRUCTORS): Likewise.
4990         (TYPE_HAS_REAL_ASSIGN_REF): Remove.
4991         (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
4992         (add_method): Change prototoype.
4993         * class.c (add_method): Remove error_p parameter.  Adjust for
4994         changes to CLASSTYPE_METHOD_VEC.
4995         (handle_using_decl): Adjust call to add_method.
4996         (maybe_warn_about_overly_private_class): Adjust for
4997         changes to CLASSTYPE_METHOD_VEC.
4998         (resort_type_method_vec): Likewise.
4999         (finish_struct_methods): Likewise.
5000         (check_for_override): Likewise.
5001         (warn_hidden): Likewise.
5002         (add_implicitly_declared_members): Defer creation of assignment
5003         operators.  Adjust call to add_method.
5004         (clone_function_decl): Adjust call to add_method.
5005         (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
5006         (finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
5007         * decl.c (grok_special_member_properties): Don't set
5008         TYPE_HAS_ABSTRACT_ASSIGN_REF.
5009         * decl2.c (check_classfn): Adjust for
5010         changes to CLASSTYPE_METHOD_VEC.
5011         * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
5012         (locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
5013         (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
5014         (implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
5015         cp_finish_decl.
5016         * pt.c (check_explicit_specialization): Adjust for
5017         changes to CLASSTYPE_METHOD_VEC.
5018         (instantiate_class_template): Do not set
5019         TYPE_HAS_ABSTRACT_ASSIGN_REF.
5020         * ptree.c (cxx_print_type): Don't try to print
5021         CLASSTYPE_METHOD_VEC.
5022         * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
5023         * search.c (lookup_field_r): Adjust for
5024         changes to CLASSTYPE_METHOD_VEC.
5025         (lookup_fnfields): Likewise.
5026         (lookup_conversion_operator): Likewise.
5027         (lookup_fnfields_1): Likewise.  Create assignment operators
5028         lazily.
5029         (look_for_overrides_here): Adjust for
5030         changes to CLASSTYPE_METHOD_VEC.
5031         (add_conversions): Likewise.
5032         * semantics.c (finish_member_declaration): Adjust call to add_method.
5033
5034 2004-07-15  Jason Merrill  <jason@redhat.com>
5035
5036         * cp-lang.c (cxx_types_compatible_p): To the middle-end,
5037         references and pointers are compatible.
5038
5039 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
5040
5041         * decl.c (xref_basetypes): Refactor.
5042         * tree.c (copy_base_binfos): Replace with ...
5043         (copy_binfo): ... this. Deep copy the given binfo, (not the just
5044         bases of the given base).
5045         * cp-tree.h (copy_base_binfo): Remove.
5046         (copy_binfo): Declare.
5047
5048 2004-07-15  Mark Mitchell  <mark@codesourcery.com>
5049
5050         * name-lookup.c (set_inherited_value_binding_p): Add class_type
5051         parameter.
5052         (get_class_binding): Adjust.
5053         (push_class_level_binding): Don't use set_inherited_value_binding_p.
5054
5055 2004-07-15  Nathan Sidwell  <nathan@codesourcery.com>
5056
5057         * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here.
5058         * decl.c (xref_basetypes): Set it here.
5059
5060         * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here.
5061         Don't check for incomplete base.
5062         (get_vfield_name): Simplify while loop.
5063         * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here.
5064
5065 2004-07-14  Mark Mitchell  <mark@codesourcery.com>
5066
5067         * lex.c (cxx_make_type): Remove call to get_pointer_type.
5068
5069         * cp-tree.h (IDENTIFIER_VALUE): Remove.
5070         (BINFO_PUSHDECLS_MARKED): Likewise.
5071         (maybe_inject_for_scope_var): Likewise.
5072         (push_class_decls): Likewise.
5073         * name-lookup.h (push_class_binding): Remove.
5074         (innermost_non_namespace_value): New function.
5075         (outer_binding): Likewise.
5076         * class.c (add_method): Push bindings before adding to
5077         TYPE_METHODS.
5078         (restore_class_cache): Do not restore class_shadowed.
5079         (pushclass): Do not add USING_DECLs.  Do not call
5080         push_class_decls.
5081         * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c.
5082         * decl.c (pushdecl): Use outer_binding.
5083         (poplevel): Set the scope for an out-of-scope for-loop declaration
5084         appropriately.
5085         (cp_finish_decl): Don't call maybe_inject_for_scope_var.
5086         * name-lookup.c (new_class_binding): New function.
5087         (push_binding): Use it.
5088         (pushdecl): Use innermost_non_namespace_value.
5089         (maybe_inject_for_scope_var): Remove.
5090         (push_class_binding): Remove.
5091         (set_inherited_value_binding_p): New function.
5092         (get_class_binding): New function.
5093         (push_class_level_binding): Assert that the current_class_type is
5094         being defined.
5095         (outer_binding): New function.
5096         (innermost_non_namespace_value): Likewise.
5097         (lookup_name_real): Use outer_binding.
5098         (lookup_name_current_level): Ignore out-of-scope variables.
5099         * pt.c (check_template_shadow): Use innermost_non_namespace_value.
5100         (lookup_template_class): Likewise.
5101         * search.c (dfs_push_type_decls): Remove.
5102         (dfs_push_decls): Likewise.
5103         (setup_class_bindings): Likewise.
5104         (lookup_field_1): Handle USING_DECLs from dependent scopes.
5105         (marked_pushdecls_p): Remove.
5106         (unmarked_pushdecls_p): Remove.
5107         (marked_identifiers): Remove.
5108         (setup_class_bindings): Remove.
5109         (dfs_push_type_decls): Remove.
5110         (dfs_push_decls): Remove.
5111         (push_class_decls): Remove.
5112
5113 2004-07-13  Mark Mitchell  <mark@codesourcery.com>
5114
5115         PR c++/16518
5116         PR c++/16337
5117         * decl.c (grokvardecl): Make declspecs parameter const.
5118         (grokdeclarator): Likewise.  Adjust accordingly.
5119         * decl.h (grokdeclarator): Adjust declaration.
5120         * parser.c (cp_parser_init_declarator): Do not clear
5121         decl_specifiers->attributes.
5122
5123         * cp-tree.h (lang_identifier): Remove class_value.
5124         (IDENTIFIER_CLASS_VALUE): Remove.
5125         (pop_class_decls): Likewise.
5126         (init_search_processing): Likewise.
5127         * class.c (handle_using_decl): Use lookup_member, not
5128         IDENTIFIER_CLASS_VALUE.
5129         (restore_class_cache): New function, split out from ...
5130         (pushclass): ... here.  Do not call clear_identifier_class_values.
5131         (invalidate_class_lookup_cache): Do not clear
5132         IDENTIFIER_CLASS_VALUE.
5133         (popclass): Do not call pop_class_decls.
5134         (maybe_note_name_used_in_class): Do not save names looked up after
5135         the class is complete.  Use lookup_member, not
5136         IDENTIFIER_CLASS_VALUE.
5137         * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c.
5138         * decl.c (cxx_init_decl_processing): Do not call
5139         init_search_processing.
5140         * method.c (do_build_copy_constructor): Remove unnecessary code.
5141         (do_build_assign_ref): Likewise.
5142         * name-lookup.c (pushdecl): Use lookup_member, not
5143         IDENTIFIER_CLASS_VALUE.
5144         (set_identifier_type_value_with_scope): Set TREE_TYPE on the
5145         type_shadowed list.
5146         (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE.
5147         (push_class_binding): Do not set it.
5148         (clear_identifier_class_values): Remove.
5149         (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE.
5150         (store_binding): Do not save it.
5151         (pop_from_top_level): Do not restore it.
5152         * name-lookup.h (cxx_saved_binding): Remove class_value.
5153         (clear_identifier_class_values): Remove.
5154         * ptree.c (cxx_print_identifier): Do not print
5155         IDENTIFIER_CLASS_VALUE.
5156         * search.c (search_obstack): Remove.
5157         (push_stack_level): Remove.
5158         (pop_stack_level): Remove.
5159         (search_level): Remove.
5160         (search_stack): Remove.
5161         (lookup_member): Don't check IDENTIFIER_CLASS_VALUE.
5162         (setup_class_bindings): Use IDENTIFIER_MARKED, not
5163         IDENTIFIER_CLASS_VALUE.
5164         (marked_identifiers): New variable.
5165         (push_class_decls): Clear IDENTIFIER_MARKED.
5166         (pop_class_decls): Don't call pop_search_level.
5167         (init_search_processing): Remove.
5168
5169 2004-07-12  Mark Mitchell  <mark@codesourcery.com>
5170
5171         * cp-tree.h (get_aggr_typedef): Remove.
5172         * init.c (get_aggr_typedef): Likewise.
5173
5174         * name-lookup.c (push_class_level_binding): Simplify.
5175
5176 2004-07-12  Andrew Pinski  <apinski@apple.com>
5177
5178         PR c++/16475
5179         Revert:
5180         2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
5181                 PR c++/16276
5182                 * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
5183                 is not public.
5184
5185 2004-07-12  Eric Christopher  <echristo@redhat.com>
5186
5187         * parser.c (cp_parser_class_head): Remove unused variable.
5188
5189 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5190
5191         * decl.c (grok_op_properties): Reject [de-]allocation functions
5192         declared in a namespace, or declared as static.
5193
5194 2004-07-12  Nathan Sidwell  <nathan@codesourcery.com>
5195
5196         * cp-tree.h (make_binfo): Remove.
5197         * decl.c (xref_basetypes): Use make_tree_binfo directly.
5198         * tree.h (copy_base_binfos): Likewise.
5199         (make_binfo): Remove.
5200
5201         * call.c (build_user_type_conversion_1, build_new_op,
5202         check_constructor_callable, build_temp,
5203         perform_direct_initialization_of_possible): Pass type directly to
5204         lookup_fnfields & build_special_member_call.
5205         (build_special_member_call): Accept a type, and complete it.
5206         * class.c (finish_stuct_bits): Copy the BINFOs here.
5207         * cvt.c (ocp_convert): Pass type directly to
5208         build_special_member_call.
5209         * decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
5210         (xref_basetypes): Allocate the binfo here. Adjust.
5211         * init.c (build_init, build_new_1): Pass type directly to
5212         build_special_member_call.
5213         * lex.c (cxx_make_type): Do not allocate binfo here.
5214         * name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
5215         * parser.c (cp_parser_class_head): Always call xref_basetypes.
5216         * pt.c (instantiate_class_template): Likewise. Inhibit access
5217         checking for template friends.
5218         * ptree.c (cxx_print_type): Adjust record printing.
5219         * search.c (lookup_base): When taking a type, complete it before
5220         looking for a binfo.
5221         (lookup_member): Delay completing a type.
5222         (push_class_decls): Don't walk an incomplete type.
5223         (lookup_conversions): Likewise.
5224         * semantics.c (finish_stmt_expr_expr): Pass type directly to
5225         build_special_member_call.
5226         * tree.c (copy_base_binfos): Adjust.
5227         (make_binfo): Likewise.
5228         * typeck.c (build_modify_expr): Pass type directly to
5229         build_special_member_call.
5230         * typeck2.c (process_init_constructor): Check a binfo exists.
5231         (build_m_component_ref): Allow accessing an incomplete type.
5232         (build_functional_cast): Pass type directly to
5233         build_special_member_call.
5234
5235 2004-07-12  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5236
5237         PR c++/2204
5238         * config-lang.in (gtfiles): Add typeck2.c.
5239         * Make-lang.in: Tweak typeck2.c dependencies, and add rule for
5240         gt-cp-typeck2.h.
5241         * cp-tree.h: Declare complete_type_check_abstract.
5242         * typeck2.c (pat_calc_hash, pat_compare,
5243         complete_type_check_abstract): New functions.
5244         (abstract_virtuals_error): If the type is abstract, register the
5245         declaration within abstract_pending_vars for further checks.
5246         Inspect also dependent types. Handle IDENTIFIER_NODEs as decl.
5247         * decl.c (cp_finish_decl): Do not strip array types.
5248         (create_array_type_for_decl): Check for abstractness of the element
5249         type.
5250         (complete_vars): Call complete_type_check_abstract.
5251         * class.c (finish_struct): Prepare a list of virtual functions for
5252         template types, and call complete_vars on it to check for abstractness.
5253
5254 2004-07-12  Paolo Bonzini  <bonzini@gnu.org>
5255
5256         PR tree-optimization/14107
5257         * decl.c (finish_function): Remove temporary band-aid.
5258
5259 2004-07-11  Mark Mitchell  <mark@codesourcery.com>
5260
5261         * call.c (build_operator_new_call): Avoid using push_to_top_level.
5262         (build_new_op): Adjust call to lookup_function_nonclass.
5263         * name-lookup.c (identifier_type_value): Adjust call to
5264         lookup_name_real.
5265         (lookup_name_real): Add block_p parameter.
5266         (lookup_name_nonclass): Adjust call to lookup_name_real.
5267         (lookup_function_nonclass): Likewise.
5268         (lookup_name): Likewise.
5269         * name-lookup.h (lookup_name_real): Change prototype.
5270         (lookup_name_nonclass): Likewise.
5271         * parser.c (cp_parser_lookup_name): Likewise.
5272
5273         * cp-tree.h (saved_scope): Make old_bindings a vector.
5274         (unuse_fields): Remove.
5275         * name-lookup.h (cxx_saved_binding): Define it.
5276         * class.c (pushclass): Don't use unuse_fields.
5277         * name-lookup.c (cxx_saved_binding_make): Remove.
5278         (store_binding): Add new bindings to a vector, using an
5279         accumulator style, rather than adding them to a list.
5280         (store_bindings): Adjust accordingly.
5281         (store_class_bindings): Likewise.
5282         (push_to_top_level): Likewise.
5283         (pop_from_top_level): Likewise.
5284         * optimize.c (maybe_clone_body): Must push_to_top_level and
5285         pop_from_top_level calls outside of loop.
5286         * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope
5287         calls here from cp_parser_late_parsing_default_args.
5288         (cp_parser_save_default_args): Record the class type in which the
5289         function is declared.
5290         (cp_parser_late_parsing_default_args): Do not call
5291         push_nested_class/pop_nested_class.
5292         * search.c (dfs_unuse_fields): Remove.
5293         (unuse_fields): Remove.
5294
5295 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
5296
5297         * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
5298         LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
5299         * cp-tree.h (poplevel): Declare.
5300         (set_block): Remove.
5301         * decl.c (set_block): Remove.
5302
5303 2004-07-10  Mike Stump  <mrs@apple.com>
5304
5305         * decl2.c (import_export_class): Never export/import vtables
5306         with inline key functions.
5307
5308 2004-07-09  Steven Bosscher  <stevenb@suse.de>
5309
5310         * typeck.c (c_expand_asm_operands): Remove.
5311
5312 2004-07-09  Mike Stump  <mrs@apple.com>
5313
5314         * typeck.c (build_class_member_access_expr): Skip null deref
5315         warning when we don't dereference it.
5316
5317 2004-07-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5318
5319         PR c++/8211
5320         PR c++/16165
5321         * class.c (check_field_decls): Improve -Weffc++ warning: do not
5322         warn for pointers to functions/members, or for classes without
5323         destructors.
5324
5325 2004-07-08  Mark Mitchell  <mark@codesourcery.com>
5326
5327         * name-lookup.h (struct cp_binding_level): Update documentation
5328         for class_shadowed.
5329
5330 2004-07-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5331
5332         PR c++/16169
5333         * typeck.c (check_return_expr): Improve -Weffc++ warning: handle
5334         returning CALL_EXPR, and non-reference return type.
5335
5336 2004-07-08  Nathan Sidwell  <nathan@codesourcery.com>
5337
5338         * name-lookup.c (push_binding): Use VEC_reserve.
5339
5340 2004-07-08  Richard Henderson  <rth@redhat.com>
5341
5342         * cp-tree.h (expand_eh_spec_block): Remove.
5343
5344 2004-07-07  Mark Mitchell  <mark@codesourcery.com>
5345
5346         * cp-tree.h (saved_scope): Remove x_previous_class_type and
5347         x_previous_class_values; add x_previous_class_level.
5348         (previous_class_type): Remove.
5349         (previous_class_values): Remove.
5350         (previous_class_level): New macro.
5351         * class.c (pushclass): Restore the identifier cache more
5352         expeditiously.
5353         (invalidate_class_lookup_cache): Use vector for class_shadowed and
5354         previous_class_values.
5355         * decl.c (poplevel): Likewise.
5356         * name-lookup.c (cxx_binding_init): New function.
5357         (cxx_binding_make): Use it.
5358         (push_binding): For a binding in a class level, use a vector of
5359         cp_class_binding nodes.
5360         (push_binding_level): New function.
5361         (begin_scope): Use it.
5362         (leave_scope): Do not put class binding levels on the free list.
5363         (print_binding_level): Adjust for the fact that class_shadowed is
5364         a vector.
5365         (poplevel_class): Likewise.
5366         (clear_identifier_class_values): Likewise.
5367         (push_class_level_binding): Likewise.
5368         (set_class_shadows): Remove.
5369         (store_binding): New function.
5370         (store_class_bindings): New function.
5371         (push_to_top_level): Use store_class_bindings as appropriate.
5372         (pop_from_top_level): Use previous_class_level, not
5373         previous_class_type.
5374         * name-lookup.h (cp_class_binding): New type.
5375         (cp_binding_level): Use a vector object for class_shadowed.
5376         (push_binding_level): Declare.
5377         (set_class_shadows): Remove.
5378
5379 2004-07-07  Andrew Pinski  <apinski@apple.com>
5380
5381         * class.c (instantiate_type): BUFFER_REF is dead.
5382         * lex.c (init_operators): IN_EXPR is dead.
5383
5384 2004-07-07  Jason Merrill  <jason@redhat.com>
5385
5386         PR c++/16334
5387         * call.c (build_new_op): Give overload warnings for built-in
5388         candidates.
5389
5390 2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>
5391
5392         PR c++/16276
5393         * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo
5394         is not public.
5395
5396 2004-07-07  Nathan Sidwell  <nathan@codesourcery.com>
5397
5398         * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
5399         * class.c (build_primary_vtable, check_bases,
5400         determine_primary_base, finish_struct_bits,
5401         maybe_warn_about_overly_private_class, dfs_find_final_overrider_q,
5402         get_basefndecls, warn_hidden, walk_subobject_offsets,
5403         build_base_fields, create_vtable_ptr, propagate_binfo_offsets,
5404         layout_virtual_bases, end_of_class, warn_about_ambiguous_bases,
5405         finish_struct_1, get_vfield_name, contains_empty_class_p,
5406         dump_class_hierarchy_r, finish_vtbls, build_vtt_inits,
5407         dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits,
5408         add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust
5409         BINFO macros.
5410         * decl.c (xref_basetypes): Likewise.
5411         * dump.c (cp_dump_tree): Likewise.
5412         * error.c (dump_expr): Likewise.
5413         * init.c (sort_mem_initializers, expand_member_init,
5414         push_base_cleanups): Likewise.
5415         * method.c (do_build_copy_constructor, do_build_assign_reg,
5416         synthesize_exception_spec): Likewise.
5417         * name-lookup.c (arg_assoc_class): Likewise.
5418         * pt.c (instantiate_class_template, tsubst,
5419         get_template_base_recursive): Likewise.
5420         * ptree.c (cxx_print_type): Likewise.
5421         * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
5422         * search.c (lookup_base_r, dynamic_cast_base_recurse,
5423         dfs_access_in_type, access_in_type, lookup_field_queue_p,
5424         bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp,
5425         marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp,
5426         dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet,
5427         binfo_for_vtable, copied_binfo, original_binfo): Likewise
5428         * tree.c (copy_base_binfos, make_binfo): Likewise.
5429         * typeck.c (commmon_base_type): Likewise
5430         * typeck2.c (process_init_constructor): Likewise
5431
5432 2004-07-06  Joseph S. Myers  <jsm@polyomino.org.uk>
5433
5434         * decl.c (check_tag_decl): Name redeclared type in diagnostic.
5435
5436 2004-07-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5437
5438         PR c++/3671
5439         * pt.c (convert_nontype_argument): Disallow conversions between
5440         different enumeration types.
5441
5442 2004-07-06  Nathan Sidwell  <nathan@codesourcery.com>
5443
5444         * cp-tree.h (BINFO_MARKED): Remove.
5445         (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED,
5446         BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P,
5447         BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n.
5448         (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P.
5449         * class.c (build_base_path): Use BINFO_VIRTUAL_P.
5450         (mark_primary_bases, determine_primary_base, base_derived_from,
5451         dfs_find_final_overrider, dfs_find_final_overrider_q,
5452         dfs_find_inal_overrider_post, update_vtable_entry_for_fn,
5453         dfs_modify_vtables, walk_subobject_offsets,
5454         layout_nonempty_base_or_field, build_base_field,
5455         build_base_fields, propagate_binfo_offsets, layout_virtual_bases,
5456         end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable,
5457         finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits,
5458         build_ctor_vtbl_group, accumulate_vtble_inits,
5459         dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries,
5460         build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r,
5461         add_vcall_offset_vtbl_entries_1): Likewise.
5462         * decl.c (xref_basetypes): Incomming virtual base indicated by
5463         TREE_TYPE. Adjust.
5464         * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P.
5465         * init.c (finish_init_stmts, sort_mem_initializers,
5466         emit_mem_initializers, build_vtble_address, expand_member_init,
5467         push_base_cleanups): Likewise.
5468         * method.c (do_build_copy_constructor): Likewise.
5469         * pt.c (instantiate_class_template,
5470         get_template_base_recursive): Likewise.
5471         * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init,
5472         get_pseudo_ti_desc): Likewise.
5473         * search.c (lookup_base_r, dynamic_cast_base_recurse,
5474         binfo_from_vbase, binfo_via_virtual, copied_binfo,
5475         original_binfo): Likewise.
5476         * semantics.c (finish_base_specifier): Virtualness is indicated
5477         by TREE_TYPE.
5478         * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P.
5479
5480 2004-07-06  Mark Mitchell  <mark@codesourcery.com>
5481
5482         Revert:
5483         2004-06-24  Jason Merrill  <jason@redhat.com>
5484         PR c++/16115
5485         * decl.c (grokparms): Give the PARM_DECL reference type if the
5486         parameter is passed by invisible reference.
5487
5488 2004-07-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5489
5490         * cp-lang.c (cp_var_mod_type_p): Add extra arg.
5491         * decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
5492         * pt.c (check_instantiated_args, unify): Likewise.
5493
5494 2004-07-05  Phil Edwards  <phil@codesourcery.com>
5495
5496         * Make-lang.in (check-c++, lang_checks):  Add some comments.
5497
5498 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
5499
5500         * cp-mudflap.c: Delete file.
5501         * Makefile.in: Remove all references to cp-mudflap.o.
5502
5503 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
5504
5505         * decl.c (cxx_init_decl_processing): Call
5506         build_common_tree_nodes before creating the global NAMESPACE_DECL.
5507
5508 2004-07-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5509
5510         PR c++/2518
5511         * call.c (build_operator_new_call): Look only at global scope.
5512
5513 2004-07-05  Nathan Sidwell  <nathan@codesourcery.com>
5514
5515         * call.c (enforce_access): Expect TREE_BINFO.
5516         * class.c (binfo_ctor_vtable): Check TREE_BINFO.
5517         * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
5518         (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
5519         Adjust.
5520         (BINFO_LANG_ELTS): Remove.
5521         (BINFO_LANG_SLOTS): New.
5522         (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
5523         (CLASSTYPE_TEMPLATE_INFO): Adjust.
5524         * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
5525         * search.c (lookup_member): Check TREE_BINFO.
5526         * semantics.c (perform_or_defer_access_check): Likewise.
5527         (check_accessibility_of_qualified_id): Check
5528         deferred_access_no_check.
5529         * tree.c (make_binfo): Use make_tree_binfo.
5530
5531 2004-07-04  Mark Mitchell  <mark@codesourcery.com>
5532
5533         * method.c (implicitly_declare_fn): Set linkage of generated
5534         functions.
5535
5536 2004-07-04  Richard Henderson  <rth@redhat.com>
5537
5538         * typeck.c (cxx_mark_addressable): Don't put_var_into_stack.
5539
5540 2004-07-03  Scott Brumbaugh  <scottb.lists@verizon.net>
5541
5542         PR c++/3761
5543         * name-lookup.c (push_class_level_binding): Don't pass a
5544         TREE_LIST of ambiguous names to check_template_shadow as it
5545         only handles declarations. Instead, pull the declaration
5546         out and pass that.
5547
5548 2004-07-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
5549
5550         PR c++/14971
5551         * pt.c (check_explicit_specialization): Clarify error message.
5552
5553 2004-07-02  Richard Henderson  <rth@redhat.com>
5554
5555         * tree.c (cp_unsave_r): Update remap_save_expr call.
5556
5557 2004-07-02  Mark Mitchell  <mark@codesourcery.com>
5558
5559         PR c++/16240
5560         * mangle.c (write_template_arg): Correct mangling.
5561
5562         PR c++/16297
5563         * decl.c (grokdeclarator): Robustify.
5564
5565 2004-07-01  Richard Henderson  <rth@redhat.com>
5566
5567         * class.c (fixed_type_or_null): Don't handle RTL_EXPR.
5568         * method.c (synthesize_method): Don't clear_last_expr.
5569         * name-lookup.c (maybe_push_cleanup_level): Likewise.
5570
5571 2004-07-01  Nick Clifton  <nickc@redhat.com>
5572
5573         * decl2.c (import_export_class): Invoke the
5574         import_export_class field in the gcc_target structure if it is not
5575         empty.
5576
5577 2004-06-30  Richard Henderson  (rth@redhat.com>
5578
5579         * decl.c (start_preparsed_function): Don't set immediate_size_expand.
5580         * method.c (use_thunk): Likewise.
5581
5582 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
5583
5584         * call.c (build_over_call), typeck.c (build_function_call): Call
5585         check_function_arguments instead of check_function_format.
5586
5587 2004-06-30  Joseph S. Myers  <jsm@polyomino.org.uk>
5588
5589         * call.c (build_over_call), typeck.c (build_function_call): Update
5590         calls to check_function_format.
5591
5592 2004-06-30  Richard Henderson  <rth@redhat.com>
5593
5594         * call.c (build_over_call): Use __builtin_memcpy for copying
5595         CLASS_AS_BASE rather than funny casting.
5596
5597 2004-06-30  Richard Henderson  <rth@redhat.com>
5598
5599         * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and
5600         TYPE_SIZE_UNIT of full_type.
5601
5602 2004-06-30  Per Bothner  <per@bothner.com>
5603
5604         Conditionally compile support for --enable-mapped_location.
5605         * decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
5606         * decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
5607         adjustments - which I don't understand.
5608         * error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
5609         * error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
5610         (print_instantiation_partial_context):  Use expand_location.
5611         * decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
5612         * name-lookup.c:  Likewise.
5613         * lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
5614         * name-lookup.c:  Use input_line macro.
5615         * parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
5616         (cp_parser_statement):  Rename locaal variable statement_locus to
5617         statement_location and use SET_EXPR_LOCATION macro.
5618         * pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
5619         * tree.c (cp_walk_subtrees):  Likewise.
5620
5621 2004-06-29  Per Bothner  <per@bothner.com>
5622
5623         * tree.c (build_min_nt, build_min, build_min_non_dep):
5624         Don't set TREE_COMPLEXITY from input_line.
5625
5626 2004-06-29  Paul Brook  <paul@codesourcery.com>
5627
5628         * init.c: Include target.h.
5629         (get_cookie_size): Remove and replace with target hook.
5630         Update callers.
5631         (build_new_1): Store the element size in the cookie.
5632
5633 2004-06-29  Nathan Sidwell  <nathan@codesourcery.com>
5634
5635         PR c++/16260
5636         * parser.c (cp_parser_template_declaration_after_export): Disable
5637         access checks here ...
5638         (cp_parser_class_specifier): ... not here.
5639
5640 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
5641
5642         * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK,
5643         VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK,
5644         BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate
5645         TREE_CHECK macro.
5646
5647 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
5648
5649         * cp-tree.h (struct deferred_access): Move to ...
5650         * semantics.c (struct deferred_access): ... here. Adjust.
5651         (deferred_access_stack): Make a VEC(deferred_access),
5652         (deferred_access_free_list): Remove.
5653         (deferred_access_no_check): New.
5654         (push_deferring_access_checks, resume_deferring_access_checks,
5655         stop_deferring_access_checks, pop_deferring_access_checks,
5656         get_deferred_access_checks, pop_to_parent_deferring_access_checks,
5657         perform_deferred_access_checks, perform_or_defer_access_check): Adjust.
5658
5659 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
5660
5661         PR c++/16174
5662         * call.c (build_temp): Declare.
5663         (check_constructor_callable): New.
5664         (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for
5665         CONSTRUCTOR_CALLABLE.
5666         (convert_like_real, initialize_reference): Use
5667         check_constructor_callable.
5668         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New.
5669         (LOOKUP_*): Renumber.
5670
5671 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
5672
5673         * friend.c (add_friend): Only perform access checks when context
5674         is a class.
5675         * lex.c (cxx_make_type): Only create a binfo for aggregate types.
5676         * parser.c (cp_parser_class_specifier): Disable access checks here
5677         when parsing the body of a templated class.
5678         * semantics.c (perform_or_defer_access_checks): Reorder to allow
5679         NULL binfos when not checking access.
5680
5681 2004-06-28  Nathan Sidwell  <nathan@codesourcery.com>
5682
5683         Use vector API for vbase list.
5684         * cp-tree.h: Include vec.h
5685         (DEF_VEC_P (tree)): New type.
5686         (struct lang_type_class): Change vbase's member type.
5687         (binfo_for_vbase): Declare.
5688         * class.c (determine_primary_base, base_derived_from,
5689         update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class,
5690         warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits,
5691         build_vtbl_initializer): Adjust.
5692         * decl.c (xref_basetypes): Adjust, accumulate upper bound of
5693         vbases.
5694         * init.c (sort_mem_initializers, expand_member_init,
5695         push_base_cleanups): Adjust.
5696         * method.c (do_build_copy_constructor): Adjust.
5697         * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust.
5698         (binfo_for_vbase): New.
5699         * tree.c (copy_base_binfos): Adjust.
5700
5701 2004-06-28  Mark Mitchell  <mark@codesourcery.com>
5702
5703         * parser.c (cp_parser_set_decl_spec_type): Fix thinko.
5704
5705 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5706
5707         PR c++/14123
5708         * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put
5709         paranthesis in case of pointers to array members.
5710         * error.c (dump_type_prefix): Likewise.
5711         (dump_type_suffix): Maybe issue a whitespace when printing
5712         ARRAY_TYPE.
5713
5714 2004-06-27  Mark Mitchell  <mark@codesourcery.com>
5715
5716         PR c++/16193
5717         * parser.c (cp_parser_set_decl_spec_type): Refine test for
5718         redefinition of built-in types.
5719
5720 2004-06-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5721
5722         * error.c (pp_template_argument_list_start): Remove.
5723         (pp_template_argument_list_end): Likewise.
5724         (pp_separate_with_comma): Use pp_cxx_separate_with.
5725         (reinit_global_formatting_buffer): Remove.
5726         (pp_non_consecutive_character): Likewise.
5727         (dump_scope): Use pp_cxx_colon_colon.
5728         (dump_template_parameter): Use pp_cxx_identifier,
5729         pp_cxx_tree_identifier and pp_cxx_whitespace.
5730         (dump_templat_bindings): Replace use of pp_string with sequence
5731         of pp_cxx_whitespace and pp_equal.
5732         (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier,
5733         pp_cxx_colon_colon, pp_cxx_whitespace throughout.  Don't set
5734         padding here.
5735         (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier.
5736         (dump_type_prefix): Don't set padding.  Use pp_cxx_whitespace,
5737         pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout.
5738         (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket,
5739         pp_cxx_right_bracket, pp_cxx_identifier throughout,
5740         (dump_decl): Likewise.
5741         (dump_template_decl): Likewise.
5742         (dump_function_decl): Likewise.  Set padding as appropriate.
5743         (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and
5744         pp_cxx_right_paren.
5745         (dump_exception_spec): Likewise.
5746         (dump_function_name): Use pp_cxx_tree_identifier and
5747         pp_cxx_identifier.
5748         (dump_template_parms): Use pp_cxx_begin_template_argument_list and
5749         pp_cxx_end_template_argument_list.
5750         (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren,
5751         pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and
5752         pp_cxx_whitespace throughout.
5753         (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and
5754         pp_cxx_right_paren.
5755         (dump_unary_op): Likewise.
5756         (reinit_cxx_pp): New function.
5757         (type_as_string); Use it.
5758         (expr_as_string): Likewise.
5759         (decl_as_string); Likewise.
5760         (context_as_string): Likewise.
5761         (lang_decl_name): Likewise.
5762         (decl_to_string): Likewise.
5763         (expr_to_string): Likewise.
5764         (parm_to_string): Likewise.
5765         (type_to_string): Likewise.
5766         (args_to_string): Likewise.
5767         (cv_to_string): Likewise.
5768
5769 2004-06-26  Mark Mitchell  <mark@codesourcery.com>
5770
5771         * cp-tree.h (cp_cv_quals): New type.
5772         (cp_declarator): Use it instead of "tree" as appropriate.
5773         (grok_method_quals): Adjust prototype.
5774         (grokclassfn): Likewise.
5775         (do_friend): Likewise.
5776         * decl.c (grokfndecl): Use cp_cv_quals, not tree.
5777         (grokdeclarator): Likewise.
5778         * decl2.c (grok_method_quals): Likewise.
5779         (grokclassfn): Likewise.
5780         * friend.c (do_friend): Likewise.
5781         * method.c (implicitly_declare_fn): Adjust call to grokclassfn.
5782         * parser.c (make_call_declarator): Use cp_cv_quals, not tree.
5783         (make_pointer_declarator): Likewise.
5784         (make_reference_declarator): Likewise.
5785         (make_ptrmem_declarator): Likewise.
5786         (cp_parser_ptr_operator): Likewise.
5787         (cp_parser_cv_qualifier_seq_opt): Likewise.
5788         (cp_parser_cv_qualifier_opt): Remove.
5789         (cp_parser_new_declarator_opt): Adjust call to
5790         cp_parser_ptr_operator.
5791         (cp_parser_conversion_declaration_opt): Likewise.
5792         (cp_parser_declarator): Use cp_cv_quals, not tree.
5793         (cp_parser_direct_declarator): Likewise.
5794
5795 2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
5796
5797         * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c:
5798         Rename DECL_STMT to DECL_EXPR.
5799         * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise.
5800         * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
5801         * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees.
5802
5803 2004-06-26  Jan Hubicka  <jh@suse.cz>
5804
5805         PR C++/14865
5806         * decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
5807         reachability analysis.
5808
5809 2004-06-25  Mark Mitchell  <mark@codesourcery.com>
5810
5811         * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from
5812         2004-06-23 change.
5813
5814 2004-06-25  Paul Brook  <paul@codesourcery.com>
5815
5816         * decl2.c (get_guard): Call targetm.cxx.guard_type.
5817         (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
5818
5819 2004-06-24  Mark Mitchell  <mark@codesourcery.com>
5820
5821         * decl.c (grokdeclarator): Restore error messages about __thread.
5822         * parser.c (cp_parser_decl_specifier_seq): Likewise.
5823
5824 2004-06-24  Jason Merrill  <jason@redhat.com>
5825
5826         PR c++/16115
5827         * decl.c (grokparms): Give the PARM_DECL reference type if the
5828         parameter is passed by invisible reference.
5829
5830 2004-06-24  Andreas Schwab  <schwab@suse.de>
5831
5832         * cp-tree.h (enum cp_storage_class): Remove trailing comma.
5833
5834 2004-06-23  Mark Mitchell  <mark@codesourcery.com>
5835
5836         * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
5837         (cp/decl.o): Likewise.
5838         (cp/decl2.o): Likewise.
5839         (cp/pt.o): Likewise.
5840         (cp/semantics.o): Likewise.
5841         * config-lang.in (gtfiles): Do not reference cp/lex.h.
5842         * class.c: Do not include lex.h.
5843         (add_implicitly_declared_members): Do not use
5844         adding_implicit_members.
5845         (check_bases_and_members): Do not talk about grok_x_components.
5846         * cp/cp-tree.h (adding_implicit_members): Remove.
5847         (cp_storage_class): New type.
5848         (cp_decl_spec): Likewise.
5849         (cp_decl_specifier_seq): Likewise.
5850         (cp_parameter_declarator): Use it for the decl_specifiers field.
5851         (check_tag_decl): Adjust prototype.
5852         (shadow_tag): Likewise.
5853         (groktypename): Likewise.
5854         (start_decl): Likewise.
5855         (start_function): Likewise.
5856         (start_method): Likewise.
5857         (grok_x_components): Remove.
5858         (grokfield): Adjust prototype.
5859         (grokbitfield): Likewise.
5860         (finish_member_class_template): Remove.
5861         * decl.c: Do not include lex.h.
5862         (adding_implicit_members): Do not define.
5863         (check_tag_decl): Do not use trees to represent decl-specifiers.
5864         (shadow_tag): Likewise.
5865         (groktypename): Likewise.
5866         (start_decl): Likewise.
5867         (grokvardecl): Likewise.
5868         (grokdeclarator): Likewise.
5869         (grokparms): Likewise.
5870         (start_function): Likewise.
5871         (start_method): Likewise.
5872         * decl.h (grokdeclarator): Adjust prototype.
5873         * decl2.c: Do not include lex.h.
5874         (grok_x_components): Remove.
5875         (grokfield): Do not use trees to represent decl-specifiers.
5876         (grokbitfield): Likewise.
5877         * lex.c: Do not include lex.h.
5878         * lex.h: Remove.
5879         * parser.c: Include target.h.
5880         (clear_decl_specs): New function.
5881         (cp_parser_translation_unit): Do not use trees to represent
5882         decl-specifiers.
5883         (cp_parser_postfix_expression): Likewise.
5884         (cp_parser_new_type_id): Likewise.
5885         (cp_parser_condition): Likewise.
5886         (cp_parser_simple_declaration): Likewise.
5887         (cp_parser_decl_specifier_seq): Likewise.
5888         (cp_parser_function_specifier_opt): Likewise.
5889         (cp_parser_conversion_type_id): Likewise.
5890         (cp_parser_template_parameter): Likewise.
5891         (cp_parser_explicit_instantiation): Likewise.
5892         (cp_parser_type_specifier): Likewise.
5893         (cp_parser_simple_type_specifier): Likewise.
5894         (cp_parser_init_declarator): Likewise.
5895         (cp_parser_type_id): Likewise.
5896         (cp_parser_type_specifier_seq): Likewise.
5897         (cp_parser_parameter_declaration): Likewise.
5898         (cp_parser_member_declaration): Likewise.
5899         (cp_parser_exception_declaration): Likewise.
5900         (cp_parser_function_definition_from_specifiers_and_declarator):
5901         Likewise.
5902         (cp_parser_single_declaration): Likewise.
5903         (cp_parser_save_member_function_body): Likewise.
5904         (cp_parser_friend_p): Likewise.
5905         (cp_parser_set_storage_class): New function.
5906         (cp_parser_set_decl_spec_type): Likewise.
5907         * pt.c: Do not include lex.h.
5908         * semantics.c: Likewise.
5909         (finish_member_class_template): Remove.
5910
5911 2004-06-23  Roger Sayle  <roger@eyesopen.com>
5912
5913         * call.c (build_cxx_call): Don't call expand_tree_builtin.  No
5914         longer take both "args" and "convert_args" as arguments.
5915         (build_op_delete_call): Update call to build_cxx_call.
5916         (build_over_call): Likewise, update call to build_cxx_call.
5917         * cp-tree.h (build_cxx_call): Update funtion prototype.
5918         * typeck.c (build_function_call): Don't call expand_tree_builtin.
5919         * rtti.c (throw_bad_cast): Update call to build_cxx_call.
5920         (throw_bad_typeid): Likewise.
5921         (build_dynamic_cast_1): Likewise.
5922
5923 2004-06-22  Richard Henderson  <rth@redhat.com>
5924
5925         * class.c (build_vfn_ref): Take a pointer not object.  Build
5926         an OBJ_TYPE_REF.
5927         (cp_fold_obj_type_ref): New.
5928         * call.c (build_over_call): Update build_vfn_ref call.
5929         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
5930         * cp-tree.h (cp_fold_obj_type_ref): Declare.
5931
5932 2004-06-21  Jason Merrill  <jason@redhat.com>
5933
5934         PR c++/16112
5935         * cp-gimplify.c (cp_gimplify_init_expr): Look through
5936         CLEANUP_POINT_EXPR.
5937
5938 2004-06-21  Mark Mitchell  <mark@codesourcery.com>
5939
5940         * cp-tree.def (NEW_EXPR): Add a fourth slot.
5941         * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
5942         (TREE_PARMLIST): Likewise.
5943         (CALL_DECLARATOR_PARMS): Likewise.
5944         (CALL_DECLARATOR_QUALS): Likewise.
5945         (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
5946         (cp_declarator_kind): New type.
5947         (cp_parameter_declarator): Likewise.
5948         (cp_declarator): Likewise.
5949         (cp_error_declarator): Likewise.
5950         (no_parameters): Likewise.
5951         (groktypename): Change prototype.
5952         (start_decl): Likewise.
5953         (start_handler_parms): Likewise.
5954         (get_scope_of_declarator): Likewise.
5955         (start_function): Likewise.
5956         (start_preparsed_function): New function.
5957         (start_function): Change prototype.
5958         (start_method): Likewise.
5959         (grokfield): Likewise.
5960         (grokbitfield): Likewise.
5961         (build_new): Likewise.
5962         (make_pointer_declarator): Remove.
5963         (make_reference_declarator): Likewise.
5964         (make_call_declarator): Likewise.
5965         (set_quals_and_spec): Likewise.
5966         (process_template_parm): Change prototype.
5967         (begin_function_definition): Remove.
5968         (finish_parmlist): Remove.
5969         * decl.c (groktypename): Do not use trees to represent
5970         declarators.
5971         (start_decl): Likewise.
5972         (start_handler_parms): Remove.
5973         (get_scope_of_declarator): Reimplement.
5974         (grokdeclarator): Do not use trees to represent declarators.
5975         (grokparms): Likewise.
5976         (start_function): Likewise.
5977         (start_method): Likewise.
5978         (build_void_list_mode): Do not use TREE_PARMLIST.
5979         * decl.h (grokdeclarator): Change prototype.
5980         * decl2.c (grok_method_quals): Robustify.
5981         (grok_x_components): Do not use trees to represent declarators.
5982         (grokfield): Likewise.
5983         (grokbitfield): Likewise.
5984         (start_objects): Build FUNCTION_DECLs, not declarators.
5985         (start_static_storage_duration_function): Likewise.
5986         * init.c (build_new): Simplify.
5987         * lex.c (make_pointer_declarator): Remove.
5988         (make_reference_declarator): Likewise.
5989         (make_call_declarator): Likewise.
5990         (set_quals_and_spec): Likewise.
5991         * method.c (use_thunk): Use start_preparsed_function.
5992         (synthesize_method): Likewise.
5993         (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
5994         * optimize.c (maybe_clone_body): Use start_preparsed_function.
5995         * parser.c (cp_error_declarator): New variable.
5996         (declarator_obstack): Likewise.
5997         (alloc_declarator): New function.
5998         (make_declarator): Likewise.
5999         (make_id_declarator): Likewise.
6000         (make_pointer_declarator): Likewise.
6001         (make_reference_declarator): Likewise.
6002         (make_ptrmem_declarator): Likewise.
6003         (make_call_declarator): Likewise.
6004         (make_array_declarator): Likewise.
6005         (no_parameters): New variable.
6006         (make_parameter_declarator): Likewise.
6007         (cp_parser_check_for_definition_in_return_type): Do not use trees
6008         to represent declarators.
6009         (cp_parser_translation_unit): Likewise.
6010         (cp_parser_new_expression): Likewise.
6011         (cp_parser_new_type_id): Likewise.
6012         (cp_parser_new_declarator_opt): Likewise.
6013         (cp_parser_direct_new_declarator): Likewise.
6014         (cp_parser_condition): Likewise.
6015         (cp_parser_declaration_statement): Likewise.
6016         (cp_parser_declaration): Likewise.
6017         (cp_parser_conversion_type_id): Likewise.
6018         (cp_parser_conversion_declarator_opt): Likewise.
6019         (cp_parser_template_parameter_list): Likewise.
6020         (cp_parser_template_parameter): Likewise.
6021         (cp_parser_explicit_instantiation): Likewise.
6022         (cp_parser_init_declarator): Likewise.
6023         (cp_parser_declarator): Likewise.
6024         (cp_parser_direct_declarator): Likewise.
6025         (cp_parser_type_id): Likewise.
6026         (cp_parser_parameter_declaration_clause): Likewise.
6027         (cp_parser_parameter_declaration_list): Likewise.
6028         (cp_parser_parameter_declaration): Likewise.
6029         (cp_parser_member_declaration): Likewise.
6030         (cp_parser_exception_declaration): Likewise.
6031         (cp_parser_check_declarator_template_parameters): Likewise.
6032         (cp_parser_function_definition_from_specifiers_and_declarator):
6033         Likewise.
6034         (cp_parser_save_member_function_body): Likewise.
6035         * pt.c (process_template_parm): Add is_non_type parameter.
6036         (convert_template_argument): Adjust call to groktypename.
6037         (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
6038         (tsubst): Do not expect declarators.
6039         (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
6040         argument.
6041         (instantiate_decl): Use start_preparsed_function.
6042         * semantics.c (begin_function_definition): Remove.
6043         (finish_parmlist): Remove.
6044         * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
6045         declarators.
6046
6047 2004-06-21  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
6048
6049         * call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
6050         (build_new_method_call): Likewise.
6051         * decl.c (local_variable_p_walkfn): Don't walk into types.
6052         * decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
6053         (build_anon_union_vars): Add new operand for COMPONENT_REF.
6054         * init.c (buld_new): Add new operand for ARRAY_REF.
6055         * method.c (do_build_copy_constructor): New op for COMPONENT_REF.
6056         (do_build_assign_ref): Likewise.
6057         * parser.c (cp_parser_direct_new_declarator): Add new operands
6058         for ARRAY_REF.
6059         (cp_parser_direct_declarator): Likewise.
6060         * pt.c (tsubst): Likewise.
6061         (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
6062         for COMPONENT_REF.
6063         * semantics.c (finish_non_static_data_member): Add new operand
6064         for COMPONENT_REF.
6065         * typeck.c (build_class_member_access_expr): Likewise.
6066         (build_class_member_access_expr, finish_class_member_access_expr):
6067         Likewise.
6068         (build_ptrmemfunc_access_expr): Likewise.
6069         (build_array_ref): Add new operands for ARRAY_REF.
6070         * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
6071         * tree.c (count_trees_r, no_linkage_helper): Don't walk in types.
6072
6073 2004-06-21  Richard Henderson  <rth@redhat.com>
6074
6075         * dump.c (cp_dump_tree): Don't use dump_next_stmt.
6076         * parser.c (cp_parser_jump_statement): Update commentary.
6077         * pt.c (tsubst_expr): Use RETURN_EXPR.
6078         * semantics.c (finish_return_stmt): Likewise.
6079         (finalize_nrv_r): Likewise.
6080         * typeck.c, typeck2.c: Update file start commentary.
6081
6082 2004-06-21  Richard Henderson  <rth@redhat.com>
6083
6084         * semantics.c (finish_expr_stmt): Call verify_sequence_points.
6085
6086 2004-06-20  Richard Henderson  <rth@redhat.com>
6087
6088         * cp-tree.h (add_decl_stmt): Declare.
6089         * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR.
6090         * semantics.c (maybe_cleanup_point_expr): New.
6091         (add_decl_stmt, finish_expr_stmt, finish_return_stmt,
6092         finish_for_expr, finish_switch_cond): Use it.
6093         (finalize_nrv_r): Don't build an EXPR_STMT.  Don't frob TREE_CHAIN.
6094
6095 2004-06-20  Richard Henderson  <rth@redhat.com>
6096
6097         * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def.
6098         * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c.
6099         (cp_gimplify_expr): Call it.
6100         (gimplify_cleanup_stmt): Move from c-gimplify.c.
6101         (cp_genericize): New.
6102         * decl.c (finish_function): Call it.
6103         * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT.
6104         (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h.
6105         (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise.
6106         (cp_genericize): Declare.
6107         * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT.
6108         * dump.c (cp_dump_tree): Likewise.
6109         * semantics.c (push_cleanup): Move from c-semantics.c.
6110
6111 2004-06-20  Zack Weinberg  <zack@codesourcery.com>
6112
6113         * cp-lang.c (has_c_linkage): Implement.
6114
6115         * cp-tree.h (set_mangled_name_for_decl): Don't prototype.
6116         * decl.c (duplicate_decls): Use COPY_DECL_RTL.
6117         (builtin_function_1): Don't call make_decl_rtl.
6118         (build_cp_library_fn): Don't call set_mangled_name_for_decl.
6119         (grokvardecl): Don't call mangle_decl.
6120         * except.c (nothrow_libfn_p): Look at DECL_NAME, not
6121         DECL_ASSEMBLER_NAME.
6122         * method.c (set_mangled_name_for_decl): Delete.
6123         * name-lookup.c (pushdecl): When a local extern shadows a
6124         file-scope declaration of the same object, give both DECLs the
6125         same DECL_UID.
6126         * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE
6127         on DECL_ASSEMBLER_NAME.
6128
6129 2004-06-19  Richard Henderson  <rth@redhat.com>
6130
6131         * cp-gimplify.c: Remove unnecessary prototypes.
6132         (cp_gimplify_stmt): Merge into ...
6133         (cp_gimplify_expr): ... here.  Move to end of file.  Handle
6134         stmts_are_full_exprs_p frobbing.
6135         * cp-tree.h (cp_gimplify_stmt): Remove.
6136         * pt.c (tsubst_expr): Merge prep_stmt and unify.
6137         * tree.c (init_tree): Don't set lang_gimplify_stmt.
6138
6139 2004-06-18  Richard Henderson  <rth@redhat.com>
6140
6141         PR c++/16034
6142         * semantics.c (begin_cond): New.
6143         (finish_cond): Rewrite to handle template DECL_STMTs specially.
6144         Assume that non-template decls go land before the conditional.
6145         (simplify_loop_decl_cond): Likewise.
6146         (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt,
6147         finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond,
6148         begin_switch_stmt, finish_switch_cond): Update to match.
6149
6150 2004-06-17  Jason Merrill  <jason@redhat.com>
6151
6152         PR c++/16015
6153         * semantics.c (simplify_aggr_init_expr): Don't return the slot.
6154         (finish_stmt_expr_expr): Update type after conversions.
6155         (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR.
6156         Handle void initializer.
6157         * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void.
6158
6159 2004-06-17  Geoffrey Keating  <geoffk@apple.com>
6160
6161         * class.c (build_clone): Don't call defer_fn, let mark_used do it.
6162         * cp-tree.h (defer_fn): Delete.
6163         * decl2.c (defer_fn): Delete.
6164         (finish_file): Simplify deferred_fns loops; check that
6165         only used inline functions get into deferred_fns.
6166         (mark_used): Inline previous contents of defer_fn.
6167
6168 2004-06-16  Richard Henderson  <rth@redhat.com>
6169
6170         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill.
6171         (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New.
6172         * cxx-pretty-print.c (pp_cxx_function_definition): Move handling
6173         of CTOR_INITIALIZER ...
6174         (pp_cxx_statement): ... here.
6175         * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK.
6176         (finish_function): Use alloc_stmt_list to zap entire function.
6177         * parser.c (cp_parser_compound_statement): Update commentary.
6178         * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT.
6179         * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise.
6180         (finish_stmt_expr): Don't look through COMPOUND_STMT.
6181
6182 2004-06-16  Geoffrey Keating  <geoffk@apple.com>
6183
6184         * pt.c (mark_decl_instantiated): Don't call defer_fn.
6185
6186 2004-06-16  Richard Henderson  <rth@redhat.com>
6187
6188         * parser.c (cp_parser_labeled_statement): Update commentary.
6189         * pt.c (tsubst_expr): Use CASE_LABEL_EXPR.
6190         * tree.c (mark_local_for_remap_r): Likewise.
6191
6192 2004-06-16  Richard Henderson  <rth@redhat.com>
6193
6194         * parser.c (cp_parser_asm_definition): Update commentary.
6195         * pt.c (tsubst_expr): Use ASM_EXPR.
6196         * semantics.c (finish_asm_stmt): Likewise.
6197
6198 2004-06-16  Richard Henderson  <rth@redhat.com>
6199
6200         * decl.c (finish_destructor_body): Use LABEL_EXPR.
6201         * parser.c (cp_parser_statement): Update commentary.
6202         * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR.
6203         * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise.
6204         * tree.c (mark_local_for_remap_r): Likewise.
6205
6206 2004-06-16  Richard Henderson  <rth@redhat.com>
6207
6208         PR c++/16012
6209         * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init
6210         statement in FOR_INIT_STMT for templates.
6211
6212 2004-06-15  Richard Henderson  <rth@redhat.com>
6213
6214         * call.c (initialize_reference): Don't build CLEANUP_STMT here.
6215         * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
6216         (genericize_try_block): Use gimplify_stmt.
6217         (genericize_catch_block, genericize_eh_spec_block): Likewise.
6218         (cp_gimplify_init_expr): Remove STMT_EXPR special case.
6219         (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
6220         * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
6221         (cp_tree_chain_matters_p): Remove.
6222         * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
6223         (COMPOUND_STMT_BODY_BLOCK): New.
6224         (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
6225         (EXPR_STMT_STMT_EXPR_RESULT): New.
6226         (building_stmt_tree): Check cur_stmt_list.
6227         (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
6228         (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
6229         * decl.c (poplevel): Use pop_stmt_list for minding cleanups.
6230         (cp_finish_decl): Use push_cleanup.
6231         (start_function, finish_function): Use statement lists.
6232         (finish_stmt): Do nothing.
6233         * except.c (begin_eh_spec_block): Use statement lists.
6234         (check_handlers_1, check_handlers): Likewise.
6235         * init.c (construct_virtual_base): Don't add extra compound stmts.
6236         (build_vec_init): Likewise.
6237         * name-lookup.c (maybe_push_cleanup_level): Use statement lists.
6238         * name-lookup.h (struct cp_binding_level): Add statement_list.
6239         * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
6240         (cp_parser_labeled_statement, cp_parser_expression_statement,
6241         cp_parser_statement_seq_opt): Likewise.
6242         (cp_parser_compound_statement): Likewise.  Take bool for try block.
6243         (cp_parser_selection_statement): Tidy if processing.
6244         (cp_parser_already_scoped_statement): Rewrite to do what it says.
6245         * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
6246         (tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
6247         Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
6248         * semantics.c (do_poplevel, do_pushlevel): Use statement lists.
6249         (finish_cond): New, rewritten from FINISH_COND.
6250         (simplify_loop_decl_cond): New.
6251         (finish_expr_stmt): Avoid nested EXPR_STMTs.
6252         (begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
6253         begin_else_clause, finish_else_clause, finish_if_stmt,
6254         begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
6255         begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
6256         finish_for_cond, finish_for_stmt, begin_switch_stmt,
6257         finish_switch_cond, finish_switch_stmt, begin_try_block,
6258         finish_try_block, finish_cleanup_try_block, finish_function_try_block,
6259         finish_handler_sequence, finish_function_handler_sequence,
6260         begin_handler, finish_handler_parms, finish_handler,
6261         begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
6262         using statement lists.
6263         (begin_compound_stmt): Replace has_no_scope argument with flags.
6264         Update all callers.  Use statement lists.
6265         (finish_compound_stmt): Likewise.
6266         (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
6267         (current_scope_stmt_stack): Remove.
6268         (simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
6269         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
6270         Rewrite with statement lists.
6271
6272 2004-06-15  Alexandre Oliva  <aoliva@redhat.com>
6273
6274         * parser.c: Change all assignments of c_lex_string_translate
6275         to true and false to 1 and 0.
6276         (cp_lexer_read_token): Convert type of the translated string.
6277         (cp_parser_skip_to_closing_parentheses): Preserve original
6278         value of c_lex_string_translate, and set it to -1 while
6279         running.
6280         (cp_parser_cache_group): Likewise.
6281         (cp_parser_cache_group_1): Renamed.
6282         (cp_parser_asm_operand_list): Remove redundant setting of
6283         c_lex_string_translate.
6284         (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]:
6285         Handle chained strings.
6286
6287 2004-06-12  Andrew Pinski  <apinski@apple.com>
6288
6289         PR c++/14639
6290         Revert:
6291         2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
6292
6293                 * cp-tree.h: Fix typo.
6294
6295                 * cp-tree.h: Include cgraph.h
6296                 (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
6297                 TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
6298
6299 2004-06-12  Jason Merrill  <jason@redhat.com>
6300
6301         PR tree-optimization/14107
6302         * decl.c (finish_function): Warn about no return in all functions.
6303
6304 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
6305
6306         * cp-tree.h (struct language_function): Remove cannot_inline.
6307         * decl.c (save_function_data): cannot_inline is no more.
6308         (cxx_push_function_context): Likewise.
6309         * decl2.c (start_objects, start_static_storage_duration_function):
6310         Reset DECL_INLINE, set DECL_UNINLINABLE.
6311
6312 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6313
6314         PR c++/15967
6315         * search.c (lookup_field): Propagate the ambiguity list.
6316         (lookup_fnfields): Likewise.
6317
6318 2004-06-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6319
6320         PR c++/15947
6321         * parser.c (cp_parser_template_name): Ctors/dtors never need a
6322         template keyword to disambiguate.
6323
6324 2004-06-14  Mark Mitchell  <mark@codesourcery.com>
6325
6326         PR c++/15096
6327         * decl.c (grokdeclarator): Ignore pointer-to-members when
6328         computing template depth.
6329
6330         PR c++/14930
6331         * name-lookup.c (pushtag): Do not try to put class declarations in
6332         explicit specialization scopes.
6333
6334 2004-06-11  Andrew Pinski  <pinskia@physics.uc.edu>
6335
6336         * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior.
6337
6338 2004-06-11  Mark Mitchell  <mark@codesourcery.com>
6339
6340         PR c++/15862
6341         * name-lookup.c (unqualified_namespace_lookup): Do not ignore type
6342         bindings for undeclared built-ins.
6343
6344 2004-06-11  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6345
6346         * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
6347         appear at the correct location.
6348
6349 2004-06-10  Jason Merrill  <jason@redhat.com>
6350
6351         PR c++/15875
6352         Revert:
6353         2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6354         * init.c (build_offset_ref): Build SCOPE_REF with non-null
6355         TREE_TYPE for non-dependent names.
6356         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
6357         unknown_type_node as its TREE_TYPE.
6358         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
6359         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
6360         (dump_expr) <SCOPE_REF case>: Likewise.
6361
6362 2004-06-10  Mark Mitchell  <mark@codesourcery.com>
6363
6364         PR c++/15227
6365         * parser.c (cp_parser_direct_declarator): Robustify.
6366
6367         PR c++/15877
6368         * pt.c (tsubst_copy): Use decl_constant_value on enumeration
6369         constants in non-dependent contexts.
6370
6371         PR c++/14211
6372         PR c++/15076
6373         * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when
6374         necessary.
6375
6376 2004-06-10  Jakub Jelinek  <jakub@redhat.com>
6377
6378         PR c++/14791
6379         * decl.c (duplicate_decls): Handle fileptr_type_node arguments
6380         specially.
6381
6382 2004-06-09  Mark Mitchell  <mark@codesourcery.com>
6383
6384         Revert:
6385         PR c++/15815
6386         2004-06-07  Mark Mitchell  <mark@codesourcery.com>
6387         * lex.c (handle_pragma_interface): Deprecate.
6388         (handle_pragma_implementation): Likewise.
6389
6390 2004-06-09  Andrew Pinski  <pinskia@physics.uc.edu>
6391
6392         * g++spec.c (lang_specific_driver): Remove check for -lm
6393         and -lmath when check it see if it was the math library.
6394
6395 2004-06-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6396
6397         PR c++/7841
6398         * parser.c (cp_parser_direct_declarator): Reject constructor named
6399         as qualified template-id.
6400
6401 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
6402
6403         PR c++/15815
6404         * lex.c (handle_pragma_interface): Deprecate.
6405         (handle_pragma_implementation): Likewise.
6406
6407 2004-06-07  Mark Mitchell  <mark@codesourcery.com>
6408
6409         PR c++/15766
6410         * parser.c (cp_parser_iteration_statement): Fix typo in error
6411         message.
6412
6413         PR c++/14777
6414         * pt.c (tsubst_default_argument): Do not defer access checks
6415         while substituting into the default argument.
6416
6417         PR c++/15554
6418         * pt.c (tsubst_copy): Do not try to substitute for an enumeration
6419         constant in a non-dependent context.
6420
6421         PR c++/15057
6422         * except.c (build_throw): Ensure that temp_expr has been
6423         initialized.
6424
6425 2004-06-06  Roger Sayle  <roger@eyesopen.com>
6426
6427         * cp/cp-tree.h (lvalue_or_else): Add function prototype.
6428
6429 2004-06-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6430
6431         PR c++/15503
6432         * parser.c (cp_parser_mem_initializer_id): Gracefully reject
6433         'typename', and accept 'template'.
6434
6435 2004-06-03  Andrew Pinski  <pinskia@physics.uc.edu>
6436             Jan Hubicka  <jh@suse.cz>
6437
6438         PR c++/14639
6439         * method.c (use_think): Do not mark thunk as referenced.
6440
6441 2004-06-03  Matt Austern  <austern@apple.com>
6442
6443         PR c++/15428
6444         * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
6445         is nonzero, and if we see a noninline definition of a key method,
6446         make the vtables nonweak.
6447
6448 2004-06-02  Matt Austern  <austern@apple.com>
6449
6450         * cp-tree.h (instantiate_decl): new boolean parameter,
6451         undefined_ok. Current behavior is equivalent to its being 0.
6452         * decl2.c (mark_used): Add new argument when calling instantiate_decl
6453         * pt.c (mark_decl_instantiated): Unconditionally make
6454         instantiations explicit unconditionally
6455         (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
6456         since mark_decl_instantiated now does it.
6457         (instantiate_class_member): New.  Instantiate a member of an
6458         explicitly instantiated class template.
6459         (do_type_instantiation): Explicitly instantiate members of an
6460         explicitly instantiated class template.
6461         (instantiate_decl): if undefined_ok is nonzero, and if we're
6462         trying to explicitly instantiated a template with no definition,
6463         change it to an implicit instantiation.
6464         (instantiate_pending_templates): Add new argument to instantiate_decl.
6465         * tree.c (cp_cannot_inline_tree_fn): Likewise.
6466
6467 2004-06-02  Andrew Pinski  <pinskia@physics.uc.edu>
6468
6469         * cp-tree.h: Fix typo.
6470
6471         * cp-tree.h: Include cgraph.h
6472         (DECL_NEEDED_P): Use cgraph_*node on the decl instead of
6473         TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl.
6474
6475 2004-06-01  Jason Merrill  <jason@redhat.com>
6476
6477         PR c++/15142
6478         * call.c (call_builtin_trap): Remove type parm.
6479         (convert_arg_to_ellipsis): Change a non-POD argument to integer type.
6480         (build_x_va_arg): Dereference a null pointer for a non-POD argument.
6481
6482 2004-06-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
6483
6484         PR c++/13092
6485         * init.c (build_offset_ref): Build SCOPE_REF with non-null
6486         TREE_TYPE for non-dependent names.
6487         * pt.c (type_dependent_expression_p): Handle SCOPE_REF with
6488         unknown_type_node as its TREE_TYPE.
6489         * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK.
6490         * error.c (dump_decl) <SCOPE_REF case>: Use pp_expression.
6491         (dump_expr) <SCOPE_REF case>: Likewise.
6492
6493 2004-06-01  Richard Henderson  <rth@redhat.com>
6494             Andrew Pinski  <pinskia@physics.uc.edu>
6495
6496         * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof".
6497         * parser.c (struct cp_parser): Remove in_offsetof.
6498         (cp_parser_new): Don't set it.
6499         (cp_parser_unary_expression): Don't check it.
6500         (cp_parser_postfix_open_square_expression): Split out from ...
6501         (cp_parser_postfix_expression): ... here.
6502         (cp_parser_postfix_dot_deref_expression): Likewise.
6503         (cp_parser_builtin_offsetof): New.
6504         (cp_parser_primary_expression): Use it.
6505
6506 2004-06-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6507
6508         PR c++/14932
6509         * parser.c (cp_parser_postfix_expression): Allow subscript
6510         operator in offsetof.
6511
6512 2004-05-31  Mark Mitchell  <mark@codesourcery.com>
6513
6514         PR c++/15701
6515         * friend.c (add_friend): Do not try to perform access checks for
6516         functions from dependent classes.
6517
6518 2004-05-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6519
6520         * cxx-pretty-print.c (pp_cxx_colon_colon): Expor.
6521         (pp_cxx_begin_template_argument_list): Turn into a function.
6522         (pp_cxx_end_template_argument_list): Likewise.
6523         (pp_cxx_separate_with): Define.
6524         (pp_cxx_unqualified_id): Tidy.
6525         (pp_cxx_primary_expression): Likewise.
6526         (pp_cxx_postfix_expression): Likewise.
6527         (pp_cxx_expression): Likewise.
6528         (pp_cxx_simple_type_specifier): Likewise.
6529         (pp_cxx_type_specifier_seq): Likewise.
6530         (pp_cxx_parameter_declaration_clause): Likewise.
6531         (pp_cxx_exception_specification): Likewise.
6532         (pp_cxx_direct_declarator): Likewise.
6533         (pp_cxx_type_id): Likewise.
6534         * cxx-pretty-print.h (pp_cxx_whitespace): Export from
6535         cxx-pretty-print.c.
6536         (pp_cxx_left_paren): Likewise.
6537         (pp_cxx_right_paren): Likewise.
6538         (pp_cxx_left_brace): Likewise.
6539         (pp_cxx_right_brace): Likewise.
6540         (pp_cxx_left_bracket): Likewise.
6541         (pp_cxx_right_bracket): Likewise.
6542         (pp_cxx_dot): Likewise.
6543         (pp_cxx_identifier): Likewise.
6544         (pp_cxx_tree_identifier): Likewise.
6545         (pp_cxx_ampersand): New macro.
6546         (pp_cxx_star): Likewise.
6547         (pp_cxx_arrow): Likewise.
6548         (pp_cxx_semicolon): Likewise.
6549         (pp_cxx_complement): Likewise.
6550         (pp_cxx_begin_template_argument_list): Declaree.
6551         (pp_cxx_end_template_argument_list): Likewise.
6552         (pp_cxx_colon_colon): likewise.
6553
6554 2004-05-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
6555
6556         * parser.c (cp_parser_simple_type_specifier): Explicitly test
6557         against NULL_TREE.
6558
6559 2004-05-31  Kazu Hirata  <kazu@cs.umass.edu>
6560
6561         * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
6562         typeck.c: Fix comment formatting.
6563
6564 2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>
6565
6566         * cp-lang.c (cp_expand_decl): Remove.
6567         (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl.
6568
6569 2004-05-30  Andreas Jaeger  <aj@suse.de>
6570
6571         * lang-specs.h: Add missing initializers for .ii.
6572
6573 2004-05-28  Aldy Hernandez  <aldyh@redhat.com>
6574
6575         * decl.c (cp_make_fname_decl): Free return value from
6576         fname_as_string.
6577
6578 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
6579
6580         PR c++/15083
6581         * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
6582         even in a templat.e
6583         * init.c (build_new): Likewise.
6584
6585         PR c++/15640
6586         * name-lookup.c (arg_assoc): Robustify.
6587
6588         PR c++/15471
6589         * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
6590         when determining the scope to use for a pointer to member.
6591         (lookup_anon_field): Give it external linkage.
6592         * cp-tree.h (lookup_anon_field): Declare it.
6593         * expr.c (cplus_expand_constant): Use it.
6594
6595 2004-05-28  Mark Mitchell  <mark@codesourcery.com>
6596
6597         PR c++/14668
6598         * parser.c (cp_parser_simple_type_specifier): Call
6599         maybe_note_name_used_in_class.
6600
6601 2004-05-28  Tom Marshall  <tmarshall@real.com>
6602
6603         PR c++/15214
6604         * class.c (finish_struct_1): Warn only if the dtor is non-private or
6605         the class has friends.
6606
6607 2004-05-27  Adam Nemet  <anemet@lnxw.com>
6608
6609         PR c++/12883
6610         * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and
6611         TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type.
6612
6613 2004-05-24  Geoffrey Keating  <geoffk@apple.com>
6614
6615         * method.c (implicitly_declare_fn): Don't call defer_fn; abort
6616         if it might be needed.
6617         * pt.c (mark_decl_instantiated): Only call defer_fn if
6618         the function actually needs processing in finish_file.
6619         * decl2.c (finish_file): Add check that elements in
6620         deferred_fns_used are really needed there.  Remove unnecessary
6621         test of DECL_SAVED_TREE.
6622
6623 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
6624
6625         * Make-lang.in: No need to specify $(LIBCPP).
6626
6627 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
6628
6629         PR c++/15044
6630         * parser.c (cp_parser_class_head): Robustify.
6631
6632         PR c++/15317
6633         * parser.c (cp_parser_decl_specifier_seq): Correct error in
6634         comment.
6635         (cp_parser_constructor_declarator_p): Treat attributes
6636         as decl-specifiers.
6637
6638         PR c++/15329
6639         * typeck.c (build_unary_op): Do not attempt to resolve casts to
6640         base classes in templates.
6641
6642 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
6643
6644         PR c++/15165
6645         * pt.c (instantiate_template): Robustify.
6646
6647 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
6648
6649         PR c++/15025
6650         * decl.c (xref_tag): Issue errors about redeclaring template
6651         classes as non-template classes.
6652
6653 2004-05-23  Mark Mitchell  <mark@codesourcery.com>
6654
6655         PR c++/14821
6656         * name-lookup.c (supplement_binding): Allow redefinitions of
6657         namespace aliases.
6658
6659         PR c++/14883
6660         * parser.c (cp_parser_template_argument): Robustify.
6661
6662 2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6663
6664         * class.c (alter_access): Use %E format specifier to print an
6665         identifier node.  Avoid looking at the IDENTIFIER_POINTER.
6666         (push_lang_context): Likewise.
6667         * decl.c (lookup_label): Likewise.
6668         (grokdeclarator): Likewise.
6669         * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
6670         * pt.c (do_type_instantiation): Likewise.
6671         * tree.c (handle_java_interface_attribute): Likewise.
6672         (handle_com_interface_attribute): Likewise.
6673         (handle_init_priority_attribute): Likewise.
6674
6675 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
6676
6677         PR c++/15285
6678         PR c++/15299
6679         * pt.c (build_non_dependent_expr): Expand the set of tree nodes
6680         recognized as overloaded functions.
6681
6682 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
6683
6684         PR c++/15507
6685         * class.c (layout_nonempty_base_or_field): Do not try to avoid
6686         layout conflicts for unions.
6687
6688         PR c++/15542
6689         * typeck.c (build_x_unary_op): Instantiate template class
6690         specializations before looking for "operator &".
6691
6692         PR c++/15427
6693         * typeck.c (complete_type): Layout non-dependent array types, even
6694         in templates.
6695
6696         PR c++/15287
6697         * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a
6698         template.
6699
6700 2004-05-22  Roger Sayle  <roger@eyesopen.com>
6701
6702         * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
6703         returning when TREE_TYPE is error_mark_node.
6704         * typeck.c (require_complete_type): Return error_mark_node if
6705         value's type is an error_mark_node.
6706
6707 2004-05-20  Andrew Pinski  <pinskia@physics.uc.edu>
6708
6709         * optimize.c (calls_setjmp_r): Remove.
6710         (calls_setjmp_p): Remove.
6711         * cp-tree.c (calls_setjmp_p): Remove.
6712         * decl.c (finish_function): Do not call calls_setjmp_p.
6713
6714 2004-05-18  Zack Weinberg  <zack@codesourcery.com>
6715
6716         * decl.c (cp_finish_decl): Use mark_decl_referenced.
6717         * decl2.c (maybe_make_one_only): Likewise.
6718         * method.c (use_thunk): Likewise.
6719
6720 2004-05-18  Jason Merrill  <jason@redhat.com>
6721
6722         * class.c (build_base_path): Tidy a bit.
6723
6724 2004-05-14  Geoffrey Keating  <geoffk@apple.com>
6725
6726         * name-lookup.c (struct scope_binding): New.
6727         (EMPTY_SCOPE_BINDING): New.
6728         (lookup_using_namespace): Take a scope_binding instead of a
6729         cxx_binding.
6730         (qualified_lookup_using_namespace): Likewise.
6731         (cxx_binding_clear): Delete.
6732         (do_nonmember_using_decl): Use a scope_binding instead of a
6733         cxx_binding.
6734         (lookup_tag): Don't call select_decl.
6735         (ambiguous_decl): Don't return anything (and change callers to match).
6736         Take a scope_binding as the second parameter.
6737         (lookup_namespace_name): Use a scope_binding instead of a
6738         cxx_binding.
6739         (unqualified_namespace_lookup): Likewise.
6740         (lookup_qualified_name): Likewise.
6741         (select_decl): Take a scope_binding instead of a cxx_binding.
6742         Use macros rather than hand-coding tests for type-ness.
6743
6744 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
6745
6746         * cp-gimplify.c: Rename from cp-simplify.c.
6747         * Make-lang.in, optimize.c: Update.
6748
6749 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
6750
6751         Merge from tree-ssa-20020619-branch.  See
6752         ChangeLog.tree-ssa for details.
6753
6754         * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def,
6755         cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c,
6756         expr.c, init.c, name-lookup.h, optimize.c, parser.c,
6757         pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c:
6758         Merged.
6759         * cp-mudflap.c: New file.
6760         * cp-simplify.c:: New file.
6761
6762 2004-05-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6763
6764         PR c++/14389
6765         * decl2.c (check_classfn): For member templates, compare also the
6766         template parameters to match the declaration.
6767         * cp-tree.h: Adjust declaration of check_classfn.
6768         * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
6769         * friend.c (do_friend): Likewise.
6770         * pt.c (tsubst_friend_function): Likewise.
6771
6772 2004-05-01  Zack Weinberg  <zack@codesourcery.com>
6773
6774         * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE.
6775         Instead, dig into the representation type to find the array bound.
6776
6777 2004-04-30  Jason Merrill  <jason@redhat.com>
6778
6779         Refer to base members using COMPONENT_REFs where possible.
6780         * class.c (build_simple_base_path): New fn.
6781         (build_base_path): Use it for non-virtual base references.
6782         (layout_class_type): Change base fields to their real type
6783         after layout is done.
6784         * cp-tree.h (IS_FAKE_BASE_TYPE): New macro.
6785         * cp-lang.c (cxx_get_alias_set): Use it.
6786
6787 2004-04-30  Kazu Hirata  <kazu@cs.umass.edu>
6788
6789         * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
6790         comment typos.
6791
6792 2004-04-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
6793
6794         PR c++/15064
6795         * parser.c (cp_parser_postfix_expression): typeid operator cannot be
6796         used in integral constant expressions.
6797
6798 2004-04-22  Mark Mitchell  <mark@codesourcery.com>
6799
6800         * init.c (build_aggr_init): Fix accidental use of C99 construct in
6801         previous change.
6802
6803         * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on
6804         braced initializer.
6805         * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro.
6806         * decl.c (reshape_init): Use it.
6807         * init.c (perform_member_init): Remove redundant condition.
6808         (build_aggr_init): Adjust to handle brace-enclosed initializers
6809         correctly.
6810         (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P.
6811
6812         * parser.c (cp_parser_initializer_clause): Do not set
6813         TREE_HAS_CONSTRUCTOR on the initializer.
6814         * rtti.c (tinfo_base_init): Likewise.
6815         (generic_initializer): Likewise.
6816         (ptr_initializer): Likewise.
6817         (ptm_initializer): Likewise.
6818         (class_initializer): Likewise.
6819         (get_pseudo_ti_init): Likewise.
6820         * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P.
6821
6822 2004-04-22  Alan Modra  <amodra@bigpond.net.au>
6823
6824         * name-lookup.c (anonymous_namespace_name): Make static.
6825
6826 2004-04-19  Roger Sayle  <roger@eyesopen.com>
6827
6828         PR middle-end/14531
6829         * class.c (build_base_path): Call fold whilst building the NULL
6830         pointer check expression trees.
6831
6832 2004-04-15  Bryce McKinlay  <mckinlay@redhat.com>
6833
6834         * init.c (build_new_1): Don't use type size argument for Java
6835         _Jv_AllocObject call.
6836
6837 2004-04-09  Danny Smith  <dannysmith@users.sourceforge.net>
6838
6839         * method.c (make_alias_for_thunk): Remove preprocessor guard on
6840         declaration and definition.
6841
6842 2004-04-08  Danny Smith  <dannysmith@users.sourceforge.net>
6843
6844         PR c++/14808
6845         * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather
6846         than ASM_OUTPUT_DEF.
6847
6848 2004-04-08  Jakub Jelinek  <jakub@redhat.com>
6849
6850         * decl2.c (mark_used): Don't segfault if cfun != NULL but
6851         current_function_decl == NULL.
6852
6853 2004-04-05  Nathan Sidwell  <nathan@codesourcery.com>
6854
6855         PR c++/3518
6856         * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer
6857         level.
6858
6859 2004-04-05  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
6860
6861         * init.c (decl_constant_value): Don't look at DECL_INITIAL
6862         of PARM_DECL.
6863         * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT
6864         or TREE_SIDE_EFFECTS of a type.
6865
6866 2004-04-02  Nathan Sidwell  <nathan@codesourcery.com>
6867
6868         PR c++/14007
6869         * pt.c (check_cv_quals_for_unify): Correct logic for disallowed
6870         cv-qualifier unification.
6871         * tree.c (cp_build_qualified_type_real): Renable DR295 logic.
6872
6873 2004-04-02  Jan Hubicka  <jh@suse.cz>
6874
6875         * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
6876         * cp-tree.h (cp_update_decl_after_saving): Declare.
6877         * tree.c (cp_update_decl_after_saving): Define.
6878
6879 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
6880
6881         PR c++/14803
6882         * typeck.c (get_delta_difference): Call fold before returning the
6883         value.
6884
6885 2004-04-01  Richard Henderson  <rth@redhat.com>
6886
6887         PR c++/14804
6888         * decl.c (cp_finish_decl): Preserve TREE_READONLY more often.
6889         * typeck2.c (split_nonconstant_init): Clear TREE_READONLY.
6890
6891 2004-04-01  Mark Mitchell  <mark@codesourcery.com>
6892
6893         PR c++/14810
6894         * name-lookup.c (maybe_push_cleanup_level): Robustify.
6895
6896 2004-04-01  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
6897
6898         * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
6899
6900 2004-03-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
6901
6902         * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
6903         * class.c (check_bitfield_decl): Likewise.
6904         * cvt.c (type_promotes_to): Likewise.
6905         * decl.c (finish_enum): Likewise.
6906         * mangle.c (write_builtin_type): Likewise.
6907         * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise.
6908         * typeck.c (type_after_usual_arithmetic_conversions): Likewise.
6909         (build_binary_op): Likewise.
6910
6911 2004-03-31  Jan Hubicka  <jh@suse.cz>
6912
6913         * tree.h (optimize_function): Kill prototype.
6914         * optimize.c (dump_function, optimize_function, dump_finction): Kill.
6915         * semantics.c (expand_body): Kill.
6916
6917 2004-03-30  Mark Mitchell  <mark@codesourcery.com>
6918
6919         PR c++/14724
6920         * decl.c (start_decl_1): Do not decide whether or not to create a
6921         new cleanup level until after the type has been completed.
6922
6923         PR c++/14763
6924         * pt.c (tsubst_default_argument): Clear current_function_decl.
6925
6926 2004-03-30  Zack Weinberg  <zack@codesourcery.com>
6927
6928         * name-lookup.c, parser.c: Use new shorter form of GTY markers.
6929
6930 2004-03-29  Zack Weinberg  <zack@codesourcery.com>
6931
6932         * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC
6933         is null, just print the literal name and return.
6934
6935 2004-03-25  Kazu Hirata  <kazu@cs.umass.edu>
6936
6937         * cxx-pretty-print.c: Fix comment typos.
6938
6939 2004-03-24  Kazu Hirata  <kazu@cs.umass.edu>
6940
6941         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c:
6942         Update copyright.
6943
6944 2004-03-23  Ziemowit Laski  <zlaski@apple.com>
6945
6946         * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H).
6947         * mangle.c (write_type): Add call to 'mangle_fundamental_type'
6948         target hook.
6949
6950 2004-03-23  Zack Weinberg  <zack@codesourcery.com>
6951
6952         PR 12267, 12391, 12560, 13129, 14114, 14133
6953         * cp-lang.c (c_reset_state): Delete.
6954         (push_file_scope, pop_file_scope): New stubs.
6955         * parser.c (c_parse_file): Call sorry() here if called more than once.
6956
6957 2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
6958
6959         * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
6960         for INTEGER_CST.
6961
6962 2004-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6963
6964         * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare.
6965
6966 2004-03-21  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6967
6968         * error.c (enum pad): Remove.
6969         (dump_qualifiers): Likewise.
6970         (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq.
6971         (dump_aggr_type): Likewise.
6972         (dump_type_suffix): Likewise.
6973         (dump_simple_decl): Likewise.
6974         (dump_function_decl): Likewise.
6975         (cv_to_string): Likewise.
6976         (dump_type_prefix): Likewise.  Adjust return void.
6977         * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to
6978         cxx_pretty_print.h.
6979         (pp_cxx_template_keyword_if_needed): Document.
6980         (pp_cxx_qualified_id): Document case FUNCTION_DECL.  Tidy.
6981         (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and
6982         MUST_NOT_THROW_EXPR.
6983
6984 2004-03-21  Mark Mitchell  <mark@codesourcery.com>
6985
6986         PR c++/14616
6987         * decl.c (cp_finish_decl): Compute the size of arrays declared in
6988         templates, if their type is non-dependent.
6989
6990 2004-03-19  Mark Mitchell  <mark@codesourcery.com>
6991
6992         * call.c (build_op_delete_call): Do not forget the placement
6993         arguments when iterating through mutiple delete operators.
6994
6995         * cp-tree.h (svaed_scope): Remove last_parms.
6996         (NEW_DELETE_OPNAME_P): New macro.
6997         (last_function_parms): Remove.
6998         (do_friend): Adjust prototype.
6999         * decl.c (grokparms): Return the PARM_DECLs directly, rather than
7000         using last_function_parms.
7001         (grokfndecl): Take the PARM_DECLs as an argument, rather than
7002         using last_function_parms.
7003         (grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
7004         for class-specific operator new and operator delete.
7005         (grok_op_properties): Do not look for allocation functions with
7006         METHOD_TYPEs.
7007         (start_function): Use DECL_ARGUMENTS instead of
7008         last_function_parms.
7009         * decl.h (last_function_parms): Do not declare.
7010         * decl2.c (grokclassfn): Do not use last_function_parms.
7011         * friend.c (do_friend): Remove parmdecls parameter.
7012         * name-lookup.c (push_to_top_level): Do not save last_function_parms.
7013         (pop_from_top_level): Do not restore it.
7014         * pt.c (check_explicit_specialization): Do not adjust
7015         last_function_parms.
7016
7017         * name-lookup.c (do_local_using_decl): Create a local binding for
7018         types brought in via using declarations.
7019
7020         * name-lookup.c (lookup_arg_dependent): Handle block-scope
7021         function declarations correctly.
7022
7023         * semantics.c (finish_id_expression): Correct handling of
7024         conversion operators to dependent types.
7025
7026         * typeck.c (lookup_destructor): Allow the use of destructors from
7027         base classes.
7028
7029 2004-03-19  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
7030
7031         * cxx-pretty-print.c (pp_cxx_unqualified_id): Use
7032         TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS.
7033         * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean
7034         the field is named TEMPLATE_TYPE_PARM_INDEX.
7035
7036 2004-03-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7037
7038         PR c++/14545
7039         * parser.c (cp_parser_functional_cast): A cast to anything
7040         but integral or enumaration type is not an integral constant
7041         expression.
7042         * pt.c (value_dependent_expression_p): Handle cast expressions
7043         without operands (such as "int()").
7044
7045 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
7046
7047         * semantics.c (finish_pseudo_destructor_expr): Allow differing
7048         cv-qualification between the type named by the
7049         pseudo-destructor-name and the object-type.
7050
7051         * search.c (accessible_base_p): Handle non-proper bases.
7052
7053         * name-lookup.c (do_nonmember_using_decl): If a using declaration
7054         refers to a single overloaded function, set the type of the
7055         function.
7056         * tree.c (lvalue_type): Simplify.
7057         * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an
7058         unknown type.
7059         (build_unary_op): Handle OVERLOADs with known types.
7060
7061         * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for
7062         function templates.
7063
7064         * parser.c (cp_parser_postfix_expression): Handle the use of
7065         "typename" in non-dependent contexts.  Convert appropriately when
7066         when using a qualified name after "->" or ".".
7067
7068         * call.c (conditional_conversion): Honor the requirement that some
7069         conversions refer to the original object.
7070
7071 2004-03-18  Mark Mitchell  <mark@codesourcery.com>
7072
7073         * call.c (build_conditional_expr): Do not call force_rvalue for
7074         operands of void_type when the conditional expression itself has
7075         void type.
7076         * name-lookup.c (pushdecl): Don't consider a declaration of a
7077         function named "main" to be an overload of a type named "main".
7078         * parser.c (cp_parser_template_name): Perform name lookup when the
7079         template name is proceeded by "template" if the qualifying scope
7080         is non-dependent.
7081         * typeck.c (composite_pointer_type_r): Correctly handle
7082         pointer-to-member types.
7083         (build_const_cast): Likewise.
7084
7085 2004-03-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
7086
7087         * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments.
7088         * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check.
7089         (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise.
7090         (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise.
7091         (TYPENAME_TYPE_FULLNAME): Add check and use type.values.
7092         (TYPEOF_TYPE_EXPR): New macro.
7093         * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS.
7094         * error.c (dump_type): Use TYPEOF_TYPE_EXPR.
7095         * pt.c (tsubst): Likewise.
7096         * semantics.c (finish_typeof): Likewise.
7097         * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE,
7098         and TEMPLATE_TYPE_PARM.
7099         * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN.
7100         (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES.
7101
7102 2004-03-16  Mark Mitchell  <mark@codesourcery.com>
7103
7104         PR c++/14586
7105         * cp-tree.h (build_new_op): Change prototype.
7106         (build_x_binary_op): Likewise.
7107         * call.c (build_new_op): Add overloaded_p parameter.
7108         * decl2.c (grok_array_decl): Adjust call to build_new_op.
7109         * parser.c (cp_parser_binary_expression): Note that uses of
7110         overloaded operators prevents an expression from being considered
7111         an integral constant.
7112         * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
7113         build_x_binary_op.
7114         * semantics.c (finish_call_expr): Likewise.
7115         * typeck.c (rationalize_conditional_expr): Likewise.
7116         (build_x_indirect_ref): Likewise.
7117         (build_x_binary_op): Likewise.
7118         (build_x_unary_op): Likewise.
7119         (build_x_compound_expr): Likewise.
7120         (build_modify_expr): Likewise.
7121         * typeck2.c (build_x_arrow): Likewise.
7122
7123 2004-03-15  Kazu Hirata  <kazu@cs.umass.edu>
7124
7125         * cp-lang.c, ptree.c: Update copyright.
7126
7127 2004-03-13  Mark Mitchell  <mark@codesourcery.com>
7128
7129         PR c++/14550
7130         * parser.c (cp_parser_non_integral_constant_expression): Encode
7131         more of the idiom that surrounded calls to this function within
7132         the function itself
7133         (cp_parser_primary_expression): Adjust accordingly.
7134         (cp_parser_postfix_expression): Likewise.
7135         (cp_parser_unary_expression): Likewise.
7136         (cp_parser_cast_expression): Likewise.
7137         (cp_parser_assignment_expression): Likewise.
7138         (cp_parser_expression): Likewise.
7139         (cp_parser_new_expression): Note that new-expressions are not
7140         allowed in integral constant expressions.
7141         (cp_parser_delete_expression): Likewise.
7142
7143 2004-03-12  Matt Austern  <austern@apple.com>
7144
7145         * decl2.c (maybe_make_one_only): Look at
7146         TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
7147         to make an explicit instantiation weak.
7148         * method.c (use_thunk): Make sure we call comdat_linkage
7149         when appropriate.
7150         * pt.c (do_type_instantiation): On systems where weak symbols
7151         don't go in a static archive's TOC, explicit instantiation of a
7152         class must imply *explicit* instantiation of its memeber.
7153
7154 2004-03-11  Kazu Hirata  <kazu@cs.umass.edu>
7155
7156         * call.c, cp-tree.h, pt.c: Fix comment typos.
7157
7158 2004-03-10  Mark Mitchell  <mark@codesourcery.com>
7159
7160         PR c++/14510
7161         * decl.c (xref_tag): Disregard non-type declarations when
7162         looking up a tagged type.
7163
7164 2004-03-09  Nathan Sidwell  <nathan@codesourcery.com>
7165
7166         PR c++/14397
7167         * call.c (convert_like_real): Build a const qualified temporary,
7168         when testing ctor access.
7169
7170 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
7171
7172         * call.c (initialize_reference): Fix typo.
7173
7174 2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7175
7176         PR c++/14409
7177         * pt.c (determine_specialization): For member templates, match also
7178         constness.
7179
7180         PR c++/14448
7181         * parser.c (cp_parser_initializer_clause): Fold initializer if it is
7182         non-dependent.
7183         * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs.
7184
7185 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
7186
7187         PR c++/14230
7188         * call.c (initialize_reference): Handle initializers that are
7189         class-member access expressions applies to rvalues.
7190
7191 2004-03-09  Mark Mitchell  <mark@codesourcery.com>
7192
7193         PR c++/14432
7194         * name-lookup.c (supplement_binding): Ignore functions that are
7195         marked DECL_ANTICIPATED.
7196
7197 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
7198
7199         PR c++/14401
7200         * class.c (check_field_decls): Complain about non-static data
7201         members of reference type in unions.  Propagate
7202         CLASSTYPE_REF_FIELDS_NEED_INIT and
7203         CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
7204         data members.
7205         * init.c (perform_member_init): Complain about mbmers with const
7206         type that are not explicitly initialized.
7207
7208 2004-03-08  Mark Mitchell  <mark@codesourcery.com>
7209
7210         * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS.
7211         * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro.
7212         (lang_identifier): Remove implicit_decl and error_locus.
7213         (IDENTIFIER_IMPLICIT_DECL): Remove.
7214         (SET_IDENTIFIER_IMPLICTI_DECL): Likewise.
7215         (IDENTIFIER_ERROR_LOCUS): Likewise.
7216         (SET_IDENTIFIER_ERROR_LOCUS): Likewise.
7217         (TYPE_ASSEMBLER_NAME_STRING): Likewise.
7218         (TYPE_ASSEMBLER_NAME_LENGTH): Likewise.
7219         (implicitly_declare): Remove.
7220         * decl.c (warn_extern_redeclared_static): Remove check of
7221         IDENTIFIER_IMPLICIT_DECL.
7222         (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS.
7223         (implicitly_declare): Remove.
7224         (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS.
7225         (start_function): Don't check IDENTIFIER_IMPLICIT_DECL.
7226         (start_method): Don't check IDENTIFIER_ERROR_LOCUS.
7227         * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL
7228         in the innermost scope, rather than at namespace scope.
7229         * name-lookup.c (push_local_binding): Give it external linkage.
7230         (pushdecl): Remove dead code.
7231         * name-lookup.h (push_local_binding): Declare it.
7232         * ptree.c (cxx_print_identifier): Don't print
7233         IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS.
7234         * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P,
7235         not IDENTIFIER_ERROR_LOCUS.
7236         * typeck.c (build_function_call): Remove dead code.
7237
7238 2004-03-08  Jason Merrill  <jason@redhat.com>
7239
7240         PR c++/13170
7241         * decl.c (xref_tag): Remove attribute handling.
7242         * cp-tree.h: Adjust prototype.
7243         * decl.c, parser.c, rtti.c: Adjust callers.
7244         * parser.c (cp_parser_class_head): Pass back attributes in the
7245         class head.
7246         (cp_parser_class_specifier): Adjust.
7247
7248 2004-03-08  Matt Austern  <austern@apple.com>
7249
7250         PR debug/14079
7251         * name-lookup.c (add_decl_to_level): Add extern variables, as well
7252         as static, to static_decls array.
7253
7254 2004-03-05  Jason Merrill  <jason@redhat.com>
7255
7256         * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/.
7257
7258 2004-03-04  Geoffrey Keating  <geoffk@apple.com>
7259
7260         * decl.c (grokfndecl): Update old incorrect comment.
7261         (grokvardecl): Diagnose C++ variables of type with no linkage.
7262
7263 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
7264
7265         PR c++/14369
7266         * pt.c (build_non_dependent_expr): Do not create a
7267         NON_DEPENDENT_EXPR for a THROW_EXPR.
7268
7269 2004-03-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
7270
7271         PR c++/14369
7272         * error.c (dump_expr): Handle THROW_EXPR.
7273
7274 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
7275
7276         PR c++/14360
7277         * parser.c (cp_parser_postfix_expression): Do not perform Koenig
7278         lookup if ordinary name-lookup finds a non-function.
7279         * pt.c (tsubst_copy_and_build): Likewise.
7280
7281         PR c++/14361
7282         * parser.c (cp_parser_late_parsing_default_args): Check that there
7283         are no extra tokens after the end of the default-argument
7284         expression.
7285
7286 2004-03-01  Mark Mitchell  <mark@codesourcery.com>
7287
7288         PR c++/14324
7289         * lex.c (retrofit_lang_decl): Treat entities with no linkage as
7290         having C++ linkage for name-mangling purposes.
7291
7292         PR c++/14260
7293         * parser.c (cp_parser_direct_declarator): Recognize constructor
7294         declarators that use a template-id to name the class being
7295         constructed.
7296
7297         PR c++/14337
7298         * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes.
7299         (tsubst_expr): Do not call tsubst_copy, even when
7300         processing_template_decl.
7301
7302 2004-03-01  Jeff Law  <law@redhat.com>
7303
7304         * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to
7305         the proper type.
7306
7307 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
7308
7309         PR c++/14138
7310         * name-lookup.h (push_scope): Change prototype.
7311         * name-lookup.c (push_scope): Do not reenter the current class
7312         scope.
7313         * decl.c (grokfndecl): Check return code from push_scope before
7314         calling pop_scope.
7315         * decl2.c (check_classfn): Likewise.
7316         * parser.c (cp_parser_conversion_function_id): Likewise.
7317         (cp_parser_init_declarator): Likewise.
7318         (cp_parser_direct_declarator): Likewise.
7319         (cp_parser_class_specifier): Likewise.
7320         (cp_parser_class_head): Likewise.
7321         (cp_parser_lookup_name): Likewise.
7322         (cp_parser_constructor_declarator_p): Likewise.
7323         * pt.c (instantiate_class_template): Likewise.
7324         (resolve_typename_type): Likewise.
7325
7326 2004-02-29  Mark Mitchell  <mark@codesourcery.com>
7327
7328         PR c++/14267
7329         * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue
7330         extension.
7331
7332         PR debug/12103
7333         * class.c (update_vtable_entry_for_fn): Do not go through
7334         covariance machinery if the type returned by an overrider is the
7335         same as the original.
7336
7337 2004-02-29  Kazu Hirata  <kazu@cs.umass.edu>
7338
7339         * call.c: Fix a comment typo.
7340
7341 2004-02-27  Ziemowit Laski  <zlaski@apple.com>
7342
7343         * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs.
7344
7345 2004-02-26  Mark Mitchell  <mark@codesourcery.com>
7346
7347         PR c++/14278
7348         * parser.c (cp_parser_parameter_declaration_list): Commit
7349         to fewer tentative parses.
7350
7351 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7352
7353         PR c++/14284
7354         * pt.c (dependent_type_p_r): A template template parameter is a
7355         dependent type.
7356
7357 2004-02-26  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7358
7359         PR c++/14246
7360         * mangle.c (write_template_arg_literal): Don't rely on identity for
7361         boolean constants.
7362
7363 2004-02-24  Jason Merrill  <jason@redhat.com>
7364
7365         * tree.c (build_exception_variant): Use check_qualified_type.
7366
7367 2004-02-23  Zack Weinberg  <zack@codesourcery.com>
7368             Kazu Hirata  <kazu@cs.umass.edu>
7369
7370         * decl.c (cxx_init_decl_processing): Don't check
7371         flag_writable_strings.
7372
7373 2004-02-23  Andrew Pinski  <pinskia@physics.uc.edu>
7374
7375         PR c++/14156
7376         * typeck.c (maybe_warn_about_returning_address_of_location):
7377         Change check for VAR_DECL to use DECL_P instead.
7378
7379 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7380
7381         PR c++/14250
7382         * cvt.c (build_expr_type_conversion): Type must be complete before
7383         looking up for conversions.
7384
7385 2004-02-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7386
7387         PR c++/14143
7388         * name-lookup.c (arg_assoc_class): Don't look into template
7389         arguments if it is not a primary template.
7390
7391 2004-02-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
7392
7393         PR c++/12007
7394         * method.c (use_thunk): Always clone function argument tree.
7395
7396 2004-02-20  Mark Mitchell  <mark@codesourcery.com>
7397
7398         PR c++/14199
7399         * pt.c (tsubst_copy): Call mark_used for a PARM_DECL.
7400
7401         PR c++/14173
7402         * semantics.c (begin_class_definition): Set TYPE_PACKED correctly
7403         for all type variants.
7404
7405 2004-02-19  Mark Mitchell  <mark@codesourcery.com>
7406
7407         PR c++/13927
7408         * decl.c (duplicate_decls): Return error_mark_node for invalid
7409         redeclarations.
7410         * name-lookup.c (push_namespace): Ignore the return value from
7411         pushdecl.
7412         * pt.c (push_template_decl_real): Robustify.
7413
7414         PR c++/14186
7415         * name-lookup.c (push_class_level_binding): Do not complain about
7416         adding a binding for a member whose name is the same as the
7417         enclosing class if the member is located in a base class of the
7418         current class.
7419
7420 2004-02-19  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7421
7422         PR c++/14181
7423         * parser.c (cp_parser_new_expression): Parse an ill-formed
7424         direct-new-declarator after a parenthesized type-id to emit good
7425         diagnostic.
7426
7427 2004-02-18  Kazu Hirata  <kazu@cs.umass.edu>
7428
7429         * cp-tree.def, cvt.c: Update copyright.
7430
7431 2004-02-17  Mark Mitchell  <mark@codesourcery.com>
7432
7433         PR c++/11326
7434         * cp-tree.h (abi_version_at_least): Remove.
7435         * mangle.c: Include flags.h.
7436
7437 2004-02-15  Mark Mitchell  <mark@codesourcery.com>
7438
7439         PR c++/13971
7440         * call.c (build_conditional_expr): Handle conversions between
7441         class types which result in differently cv-qualified type
7442         variants.
7443
7444         PR c++/14086
7445         * class.c (delete_duplicate_fields_1): Remove.
7446         (delete_duplicate_fields): Likewise.
7447         (finish_struct_anon): Remove check for members with the same name
7448         as their enclosing class.
7449         (check_field_decls): Do not call duplicate_fields.
7450         * decl.c (grokdeclarator): Remove check for static data members
7451         with the same name as their enclosing class.
7452         * name-lookup.c (push_class_level_binding): Check for members with
7453         the same name as their enclosing class.
7454
7455 2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
7456
7457         PR c++/14085
7458         * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
7459
7460 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
7461
7462         PR c++/13635
7463         * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL
7464         has full set of arguments.
7465
7466 2004-02-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7467
7468         PR c++/13927
7469         * error.c (dump_decl) <ALIAS_DECL>: Dump as simple declarations.
7470
7471 2004-02-13  Mark Mitchell  <mark@codesourcery.com>
7472
7473         PR c++/14122
7474         * cp-tree.h (delete_sanity): Change prototype.
7475         * decl2.c (delete_sanity): Make doing_vec a bool, not an int.
7476         Remove dead code.  Adjust code to warn about deleting an array.
7477         * typekc.c (decay_conversion): Use build_address and build_nop.
7478
7479         PR c++/14108
7480         * search.c (accessible_p): Do not check access in thunks.
7481
7482         PR c++/14083
7483         * call.c (build_conditional_expr): Call force_rvalue on the
7484         non-void operand in the case that one result is a throw-expression
7485         and the other is not.
7486
7487 2004-02-13  Ian Lance Taylor  <ian@wasabisystems.com>
7488
7489         PR c++/9851
7490         * parser.c (cp_parser_pseudo_destructor_name): Check for errors on
7491         the type name and look ahead for ::~, and bail out early with a
7492         better error message if the parse is going to fail.
7493
7494 2004-02-12  Mark Mitchell  <mark@codesourcery.com>
7495
7496         * call.c (conversion_kind): New type.
7497         (conversion_rank): Likewise.
7498         (conversion): Likewise.
7499         (CONVERSION_RANK): New macro.
7500         (conversion_obstack): New variable.
7501         (obstack_initialized): Likewise.
7502         (z_candidate): Change type of convs and second_conv.
7503         (candidate_warning): New type.
7504         (IDENTITY_RANK): Remove.
7505         (EXACT_RANK): Likewise.
7506         (PROMO_RANK): Likewise.
7507         (STD_RANK): Likewise.
7508         (PBOOL_RANK): Likewise.
7509         (USER_RANK): Likewise.
7510         (ELLIPSIS_RANK): Likewise.
7511         (BAD_RANK): Likewise.
7512         (ICS_RANK): Likewise.
7513         (ICS_STD_RANK): Likewise.
7514         (ICS_USER_FLAG): Likewise.
7515         (ICS_ELLIPSIS_FLAG): Likewise.
7516         (ICS_THIS_FLAG): Likewise.
7517         (ICS_BAD_FLAG): Likewise.
7518         (NEED_TEMPORARY_P): Likewise.
7519         (CHECK_COPY_CONSTRUCTOR_P): Likewise.
7520         (USER_CONV_CAND): Likewise.
7521         (USER_CONV_FN): Likewise.
7522         (conversion_obstack_alloc): New function.
7523         (alloc_conversion): Likewise.
7524         (validate_conversion_obstack): Likewise.
7525         (alloc_conversions): Likewise.
7526         (build_conv): Adjust to deal with new conversion data structures.
7527         (build_identity_conv): New function.
7528         (build_ambiguous_conv): Likewise.
7529         (standard_conversion): Adjust to deal with new conversion data
7530         structures.
7531         (convert_class_to_reference): Likewise.
7532         (direct_reference_binding): Likewise.
7533         (reference_binding): Likewise.
7534         (implicit_conversion): Likewise.
7535         (add_candidate): Likewise.
7536         (add_function_candidate): Likewise.
7537         (add_conv_candidate): Likewise.
7538         (build_builtin_candidate): Likewise.
7539         (print_z_candidate): Likewise.
7540         (merge_conversion_sequences): Likewise.
7541         (build_user_type_conversion_1): Likewise.
7542         (build_user_type_conversion): Likewise.
7543         (build_new_function_call): Likewise.
7544         (build_object_call): Likewise.
7545         (conditional_conversion): Likewise.
7546         (build_conditional_expr): Likewise.
7547         (build_new_op): Likewise.
7548         (build_op_delete_call): Likewise.
7549         (convert_like_real): Likewise.
7550         (build_over_call): Likewise.
7551         (build_new_method_call): Likewise.
7552         (is_subseq): Likewise.
7553         (maybe_handle_implicit_object): Likewise.
7554         (maybe_handle_ref_bind): Likewise.
7555         (compare_ics): Likewise.
7556         (source_type): Likewise.
7557         (add_warning): Likewise.
7558         (joust): Likewise.
7559         (can_convert_arg): Likewise.
7560         (can_convert_arg_bad): Likewise.
7561         (perform_implicit_conversion): Likewise.
7562         (perform_direct_initialization_if_possible): Likewise.
7563         (initialize_reference): Likewise.
7564         * cp-lang.c (cp_tree_size): Do not handle WRAPPER.
7565         * cp-tree.def (WRAPPER): Likewise.
7566         (IDENTITY_CONV): Remove.
7567         (LVALUE_CONV): Likewise.
7568         (QUAL_CONV): Likewise.
7569         (STD_CONV): Likewise.
7570         (PTR_CONV): Likewise.
7571         (PMEM_CONV): Likewise.
7572         (BASE_CONV): Likewise.
7573         (REF_BIND): Likewise.
7574         (USER_CONV): Likewise.
7575         (AMBIG_CONV): Likewise.
7576         (RVALUE_CONV): Likewise.
7577         * cp-tree.h (tree_wrapper): Remove.
7578         (WRAPPER_ZC): Remove.
7579         (lang_tree_node): Remove wrapper.
7580         (LOOKUP_SPECULATIVELY): Remove.
7581         (build_op_delete_call): Adjust prototype.
7582         (validate_conversion_obstack): Declare.
7583         (build_zc_wrapper): Remove.
7584         * cvt.c (convert_to_reference): Remove dead code.
7585         (ocp_convert): Likewise.
7586         * decl.c (redeclaration_error_message): Correct handling of
7587         templates.
7588         (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
7589         (cp_tree_node_structure): Remove WRAPPER case.
7590         * decl2.c (finish_file): Call validate_conversion_obstack.
7591         * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
7592         (build_op_delete_call): Likewise.
7593         (build_x_delete): Likewise.
7594         (build_delete): Adjust call to build_op_delete_call.
7595         * pt.c (tsubst_friend_declaration): Adjust code to determine
7596         whether or not a friend template is a definition.
7597         (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
7598         * tree.c (build_zc_wrapper): Remove.
7599
7600 2004-02-12  Zack Weinberg  <zack@codesourcery.com>
7601
7602         * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
7603         * cp-tree.h: Don't declare cxx_builtin_type_decls.
7604         * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
7605         (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
7606
7607 2004-02-10  Mark Mitchell  <mark@codesourcery.com>
7608
7609         * typeck.c (lookup_destructor): Fix typo in error message.
7610
7611 2004-02-09  Kazu Hirata  <kazu@cs.umass.edu>
7612
7613         * call.c, parser.c, tree.c: Fix comment typos.
7614
7615 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
7616
7617         Bug 13856
7618         * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS.
7619         * decl.c (duplicate_decls, start_function): Likewise.
7620
7621 2004-02-07  Zack Weinberg  <zack@codesourcery.com>
7622
7623         * name-lookup.c (pushdecl): Issue shadow warnings directly.
7624         * parser.c (free_parser_stacks): Delete.
7625
7626 2004-02-07  Kazu Hirata  <kazu@cs.umass.edu>
7627
7628         * rtti.c: Update copyright.
7629
7630 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7631
7632         PR c++/14033
7633         * decl.c (require_complete_types_for_parms): Do not insert
7634         error_mark_node in the parameter list.
7635
7636 2004-02-06  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7637
7638         PR c++/14028
7639         * parser.c (cp_parser_enclosed_template_argument_list): Emit straight
7640         error when terminator can not be found.
7641
7642 2004-02-05  Kelley Cook  <kcook@gcc.gnu.org>
7643
7644         Make-lang.in (po-generated):  Delete.
7645
7646 2004-02-05  Kazu Hirata  <kazu@cs.umass.edu>
7647
7648         * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with
7649         targetm.calls.promote_prototypes.
7650
7651 2004-02-05  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
7652
7653         PR middle-end/13750
7654         Revert:
7655         2004-01-15  Geoffrey Keating  <geoffk@apple.com>
7656         PR pch/13361
7657         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
7658         (handle_pragma_implementation): Likewise.
7659
7660 2004-02-05  Mark Mitchell  <mark@codesourcery.com>
7661
7662         PR c++/13714
7663         * typeck.c (lookup_destructor): Tweak error message.
7664
7665 2004-02-05  Jan Hubicka  <jh@suse.cz>
7666
7667         * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
7668         functions.
7669
7670 2004-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7671
7672         PR c++/14008
7673         * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing
7674         code, only emits the diagnostic now. Added lookup of the identifier
7675         and support for qualified ids.
7676         (cp_parser_parse_and_diagnose_invalid_type_name): New function.
7677         Parse an (invalid) type name as id-expression within a declarator.
7678         (cp_parser_simple_declaration): Use it.
7679         (cp_parser_member_declaration): Likewise.
7680         (cp_parser_make_typename_type): New function. Handle errors through
7681         cp_parser_diagnose_invalid_typename.
7682         (cp_parser_elaborated_type_specifier): Use it.
7683
7684 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
7685
7686         PR c++/13932
7687         * call.c (convert_like_real): Use "converting" rather than
7688         "argument" as the descriptive keyword to
7689         dubious_conversion_warnings.
7690         * typeck.c (convert_for_assignment): Do not call
7691         dubious_conversion_warnings.
7692
7693 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7694
7695         PR c++/13086
7696         * init.c (build_delete): Emit a more informative error message in
7697         case of an incomplete type, and on the correct source line.
7698
7699 2004-02-04  Kazu Hirata  <kazu@cs.umass.edu>
7700
7701         * error.c, search.c: Update copyright.
7702
7703 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
7704
7705         PR c++/9941
7706         * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
7707         linkage for the typeinfo name string.
7708
7709 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
7710
7711         PR c++/13969
7712         * cp-tree.h (fold_non_dependent_expr): New function.
7713         * parser.c (cp_parser_fold_non_dependent_expr): Remove.
7714         (cp_parser_template_argument): Use fold_non_dependent_expr.
7715         (cp_parser_direct_declarator): Likewise.
7716         * pt.c (fold_non_dependent_expr): New function.
7717         (convert_nontype_argument): Use it.
7718         (tsubst_qualified_id): Simplify.
7719         (tsubst_copy_and_build): Likewise.
7720
7721 2004-02-04  Mark Mitchell  <mark@codesourcery.com>
7722
7723         * decl.c (cxx_push_function_context): Do not set
7724         current_function_is_thunk.
7725         * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
7726         actual function.
7727
7728 2004-02-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7729
7730         PR c++/13997
7731         * pt.c (more_specialized_class): Increase processing_template_decl
7732         while partial ordering.
7733
7734 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
7735
7736         PR c++/13925
7737         * decl.c (start_function): Do not call pushdecl for any
7738         instantiation or specialization of a primary template.
7739
7740 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
7741
7742         PR c++/13950
7743         * parser.c (cp_parser_class_name): Robustify.
7744
7745         PR c++/13970
7746         * parser.c (cp_parser_cache_group): Do not consume the EOF token.
7747
7748         PR c++/14002
7749         * semantics.c (finish_id_expression): Do not return an
7750         IDENTIFIER_NODE when lookup finds a PARM_DECL.
7751
7752 2004-02-03  Mark Mitchell  <mark@codesourcery.com>
7753
7754         PR c++/13978
7755         * pt.c (build_non_dependent_expr): Do not build
7756         NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
7757
7758         PR c++/13968
7759         * semantics.c (finish_id_expression): Do not return an
7760         IDENTIFIER_NODE when lookup finds a VAR_DECL.
7761
7762         PR c++/13975
7763         * parser.c (cp_parser_simple_declaration): When skipping to the
7764         end of the statement swallow the terminating semicolon.
7765
7766 2004-02-02  Mark Mitchell  <mark@codesourcery.com>
7767
7768         PR c++/13113
7769         * init.c (build_offset_ref): Improve error recovery for invalid
7770         uses of non-static member functions.
7771
7772         PR c++/13854
7773         * cp-tree.h (cp_build_type_attribute_variant): New function.
7774         * class.c (build_clone): Use cp_build_type_attribute_variant.
7775         * decl.c (duplicate_decls): Likewise.
7776         * pt.c (copy_default_args_to_explicit_spec): Likewise.
7777         (tsubst_function_type): Likewise.
7778         * tree.c (build_exception_variant): Check attributes before
7779         concluding that two types are the same.
7780         (cp_build_type-attribute_variant): New method.
7781         * typeck.c (merge_types): Use cp_build_type_attribute_variant.
7782
7783         PR c++/13907
7784         * call.c (convert_class_to_reference): Keep better track of
7785         pedantically invalid user-defined conversions.
7786
7787 2004-02-01  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7788
7789         PR c++/13957
7790         * pt.c (tsubst_qualified_id): Improved error message when a type
7791         is expected but not found.
7792
7793 2004-01-31  Kazu Hirata  <kazu@cs.umass.edu>
7794
7795         * class.c: Fix comment typos.
7796         * decl.c: Likewise.
7797         * error.c: Likewise.
7798         * parser.c: Likewise.
7799         * pt.c: Likewise.
7800         * search.c: Likewise.
7801         * typeck.c: Likewise.
7802
7803 2004-01-30  Richard Henderson  <rth@redhat.com>
7804
7805         PR c++/13693
7806         * method.c (use_thunk): Don't force_target_expr for void thunks.
7807         * tree.c (build_target_expr_with_type): Assert non-void type.
7808         (force_target_expr): Likewise.
7809
7810 2004-01-30  Michael Matz  <matz@suse.de>
7811
7812         * parser.c (cp_parser_labeled_statement): Accept case ranges.
7813
7814 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7815
7816         DR206
7817         PR c++/13813
7818         * decl.c (grokdeclarator): Check immediatly type completeness for
7819         non-dependent types.
7820
7821 2004-01-30  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7822
7823         PR c++/13683
7824         * call.c (convert_arg_to_ellipsis): Don't emit a warning if within
7825         a sizeof expression.block
7826
7827 2004-01-29  Mark Mitchell  <mark@codesourcery.com>
7828
7829         PR c++/13883
7830         * mangle.c (write_encoding): Correct encoding of member template
7831         constructors.
7832
7833 2004-01-28  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7834
7835         * parser.c (cp_parser_template_id): Parse tentatively `[:' after a
7836         template name as it was `<::' (digraph typo).
7837         (cp_parser_nth_token_starts_template_argument_list_p): New function.
7838         (cp_parser_id_expression): Use it.
7839         (cp_parser_nested_name_specifier_opt): Likewise.
7840         (cp_parser_template_name): Likewise.
7841         (cp_parser_class_name): Likewise.
7842         (cp_lexer_get_preprocessor_token): Use c_lex_with_flags.
7843
7844 2004-01-28  Mark Mitchell  <mark@codesourcery.com>
7845
7846         PR c++/13791
7847         * typeck.c (merge_types): Do not merge attributes into
7848         TYPENAME_TYPEs.
7849
7850         PR c++/13736
7851         * parser.c (cp_parser_direct_declarator): Do not prevent
7852         backtracking inside a parenthesized declarator.
7853         (cp_parser_parameter_declaration): Fix typo in comment.
7854
7855 2004-01-28  Jan Hubicka  <jh@suse.cz>
7856
7857         * semantics.c (expand_body)  Do emit_associated_thunks before
7858         expansion.
7859
7860 2004-01-27  Devang Patel  <dpatel@apple.com>
7861
7862         * name-lookup.c: Include "debug.h"
7863         (do_namespace_alias): Invoke debug_hooks to emit debug info
7864         for namespace alias.
7865         (do_local_using_decl): Invoke debug_hooks to emit debug info
7866         for using decl.
7867         (do_class_using_decl): Same.
7868         (do_toplevel_using_decl): Same.
7869         (do_using_directive): Same.
7870         (cp_emit_debug_info_for_using): New function.
7871         * Make-lang.in (cp/parser.o): Depend on debug.h
7872         (cp/name-lookup.o): Same.
7873
7874 2004-01-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
7875
7876         * cp-tree.h (language_function, lang_type_header): Use
7877         BOOL_BITFIELD.
7878         * name-lookup.h (cp_binding_level): Likewise.
7879
7880 2004-01-26  Mark Mitchell  <mark@codesourcery.com>
7881
7882         PR c++/13663
7883         * semantics.c (finish_for_expr): Check for unresolved overloaded
7884         functions.
7885
7886         * class.c (add_method): Just check processing_template_decl to
7887         determine whether or not we are within a template.
7888         * decl2.c (maybe_retrofit_in_chrg): Likewise.
7889         * init.c (decl_constant_value): Check the type of the declaration,
7890         not TREE_READONLY.
7891         * name-lookup.c (maybe_push_to_top_level): Rename to ...
7892         (push_to_top_level): ... this.
7893         * name-lookup.h (maybe_push_to_top_level): Do not declare it.
7894         * pt.c (push_template_decl_real): Reorder condition for speed.
7895         (convert_template_argument): Use dependency-checking functions in
7896         place of uses_template_parms.
7897         (lookup_template_class): Avoid calling uses_template_parms more
7898         than once.
7899         (uses_template_parms): Reimplement, using dependency-checking
7900         functions.
7901         (instantiate_class_template): Use push_to_top_level, not
7902         maybe_push_to_top_level.
7903         (type_unification_real): Simplify.
7904         (type_dependent_expression_p): Handle OFFSET_REFs and
7905         TEMPLATE_DECLs.
7906         (any_dependent_template_arguments_p): Handle multiple levels of
7907         template argument.
7908         * semantics.c (expand_or_defer_fn): Do not check
7909         uses_template_parms for template instantiations.
7910         * typeck.c (comptypes): Avoid calling cp_type_quals.
7911
7912 2004-01-25  Mark Mitchell  <mark@codesourcery.com>
7913
7914         PR c++/13833
7915         * call.c (build_over_call): Do not convert arguments when
7916         processing a template.
7917         * pt.c (build_non_dependent_expr): Do not build a
7918         NON_DEPENDENT_EXPR for arithmetic constants.
7919
7920 2004-01-25  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
7921
7922         PR c++/13810
7923         * parser.c (cp_parser_type_parameter): When cp_parser_id_expression
7924         returns a TYPE_DECL. no further lookup is required.
7925         * semantics.c (check_template_template_default_arg): A TYPE_DECL
7926         is invalid. Rework to give better diagnostics.
7927
7928 2004-01-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
7929
7930         PR c++/13797
7931         * pt.c (instantiate_class_template): Add an error_mark_node
7932         check.
7933         (tsubst_decl) <TEMPLATE_DECL case>: Likewise.
7934
7935 2004-01-23  Andrew Pinski  <pinskia@physics.uc.edu>
7936
7937         PR c++/13701
7938         * decl.c (finish_function): Move the call to
7939         finish_fname_decls below the call to
7940         finish_eh_spec_block.
7941
7942 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
7943
7944         * optimize.c, typeck2.c: Update copyright.
7945
7946 2004-01-21  Kazu Hirata  <kazu@cs.umass.edu>
7947
7948         * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
7949         init.c, mangle.c, typeck.c: Update copyright.
7950
7951 2004-01-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
7952
7953         * parser.c (cp_parser_class_specifier): Prevent garbage collection.
7954
7955 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
7956
7957         * Make-lang.in: Replace $(docdir) with doc.
7958         (c++.info, c++.srcinfo): Dummy entry.
7959         (c++.man, c++.srcman): New rules.
7960         (c++.install-man): Revamp rule.
7961
7962 2004-01-20  Kelley Cook  <kcook@gcc.gnu.org>
7963
7964         * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME,
7965         CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a
7966         immediate $(shell) instead of deferred backquote.
7967
7968 2004-01-19  Mark Mitchell  <mark@codesourcery.com>
7969
7970         PR c++/13651
7971         * parser.c (cp_parser_postfix_expression): When encountering
7972         incomplete type on left-hand side of "->" or ".", treat the entire
7973         expression as erroneous.
7974
7975         PR c++/13592
7976         * call.c (build_field_call): Remove.
7977         (n_build_method_call): Likewise.
7978         (build_method_call): Likewise.
7979         (build_new_method_call): Do not call build_field_call.
7980         * class.c (n_build_method_call): Remove.
7981         (print_class_statistics): Do not print it.
7982         * cp-tree.h (build_method_call): Remove declaration.
7983         (finish_object_call_expr): Likewise.
7984         (build_new_1): Do not use build_method_call.
7985         * parser.c (cp_parser_postfix_expression): Use finish_call_expr
7986         when the function appearing on the right-hand-side of "." or "->"
7987         is not actually a function.
7988         * pt.c (tsubst_copy_and_build): Likewise.
7989         * semantics.c (finish_object_call_expr): Remove.
7990
7991 2004-01-18  Mark Mitchell  <mark@codesourcery.com>
7992
7993         PR c++/13710
7994         * pt.c (tsubst): Use finish_typeof.
7995
7996 2004-01-18  Jason Merrill  <jason@redhat.com>
7997
7998         PR c++/11725
7999         * except.c (build_throw): In a template, set
8000         current_function_returns_abnormally.
8001
8002 2004-01-17  Fred Fish  <fnf@intrinsity.com>
8003
8004         PR c++/11895
8005         * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
8006         except don't call array_type_nelts() with a VECTOR_TYPE.
8007
8008 2004-01-16  Jan Hubicka  <jh@suse.cz>
8009
8010         * mangle.c (write_mangled_name): Remove inline modifier.
8011
8012 2004-01-16  Mark Mitchell  <mark@codesourcery.com>
8013
8014         PR c++/13574
8015         * decl.c (compute_array_index_type): Fix grammar in comment.
8016         * init.c (build_zero_init): Handle zero-sized arrays correctly.
8017
8018         PR c++/13178
8019         * call.c (name_as_c_string): Print conversion operator names
8020         correctly.
8021
8022         PR c++/13478
8023         * call.c (initialize_reference): Pass -1 for inner parameter to
8024         convert_like_real.
8025
8026 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8027
8028         PR c++/13407
8029         * parser.c (cp_parser_base_specifier): Check for an invalid
8030         keyword `typename' and emit an user-friendly error message.
8031
8032 2004-01-15  Geoffrey Keating  <geoffk@apple.com>
8033
8034         PR pch/13361
8035         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
8036         (handle_pragma_implementation): Likewise.
8037
8038 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8039
8040         PR c++/9259
8041         * typeck.c (build_class_member_access_expr): Allow to access members
8042         of the currently open class.
8043         (finish_class_member_access_expr): Likewise.
8044
8045 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
8046
8047         PR c++/13659
8048         * name-lookup.c (validate_nonmember_using_decl): Take scope and
8049         name by value, instead of computing them.
8050         (do_local_using_decl, do_toplevel_using_decl): Add scope and name
8051         arguments.  Pass them to validate_nonmember_using_decl.
8052         * name-lookup.h (do_local_using_decl): Adjust.
8053         (do_toplevel_using_decl): Likewise.
8054         * parser.c (cp_parser_using_declaration): Likewise.
8055         * pt.c (tsubst_expr): Likewise.
8056
8057 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
8058
8059         PR c++/13594
8060         PR c++/13658
8061         * name-lookup.c (qualified_lookup_using_namespace): Search
8062         strongly-associated namespaces first, and only then try other
8063         namespaces.
8064
8065 2004-01-15  Kelley Cook  <kcook@gcc.gnu.org>
8066
8067         * Make-lang.in (c++.srcextra): Dummy entry.
8068
8069 2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8070
8071         PR c++/8856
8072         * parser.c (cp_parser_template_name): Don't try to parse a
8073         conversion-function-id, as it cannot be a template-name.
8074         (cp_parser_simple_type_specifier): Check for invalid template-ids
8075         even after a built-in type.
8076
8077 2004-01-14  Jan Hubicka  <jh@suse.cz>
8078
8079         PR c++/12850
8080         * pt.c (instantiate_decl):  Do not increase function_depth.
8081
8082 2004-01-14  Danny Smith  <dannysmith@users,sourceforge.net>
8083
8084         PR c++/9021
8085         PR c++/11005
8086         * parser.c (cp_parser_elaborated_type_specifier): Warn about
8087         attributes and discard.
8088         * decl.c (xref_tag): Don't overwite existing attributes with
8089         NULL_TREE.
8090
8091 2004-01-14  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8092
8093         PR c++/12335
8094         * parser.c (cp_parser_lookup_name): Return error_mark_node if there
8095         is no destructor while looking up a BIT_NOT_EXPR.
8096
8097 2004-01-13  Ian Lance Taylor  <ian@wasabisystems.com>
8098
8099         * cxxfilt.c: Remove unused file.
8100
8101 2004-01-14  Jan Hubicka  <jh@suse.cz>
8102
8103         Partial fix to PR c++/12850
8104         * decl2.c (mark_used): Do not proactively instantiate templates
8105         when compiling in unit-at-a-time or not optimizing.
8106         * optimize.c (maybe_clone_body): Do not increase function depth.
8107
8108 2004-01-13  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8109
8110         PR c++/13474
8111         * pt.c (tsubst) <INTEGER_TYPE>: Remove obsolete array index tweaking.
8112
8113 2004-01-12  Steven Bosscher  <stevenb@suse.de>
8114
8115         PR c++/13558
8116         * parser.c (cp_parser_member_declaration): Any non-type is also
8117         not a class or a function.
8118
8119 2004-01-12  Jason Merrill  <jason@redhat.com>
8120
8121         PR c++/12815
8122         * class.c (build_base_path): Do not mark vtable references as
8123         TREE_CONSTANT.
8124         (build_vtbl_ref_1): Likewise.
8125
8126 2004-01-12  Richard Henderson  <rth@redhat.com>
8127
8128         PR opt/10776
8129         * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
8130         (store_init_value): Use it.
8131         * decl.c (check_initializer): Expect full initialization code
8132         from store_init_value.
8133         * init.c (expand_aggr_init_1): Likewise.
8134         * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
8135
8136 2004-01-12  Mark Mitchell  <mark@codesourcery.com>
8137
8138         * class.c (layout_class_type): For non-POD class types, also copy
8139         the DECL_SIZE and DECL_MODE of fields to the base class type.
8140
8141 2004-01-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
8142
8143         PR c++/13289
8144         * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
8145         calling regenerate_decl_from_template.
8146
8147 2004-01-12  Scott Brumbaugh  <scottb.lists@verizon.net>
8148
8149         PR c++/4100
8150         * parser.c (cp_parser_decl_specifier_seq): Add check for a friend
8151         decl-specifier occurring along with a class definition.
8152
8153 2004-01-12  Ian Lance Taylor  <ian@wasabisystems.com>
8154
8155         * parser.c (cp_parser_decl_specifier_seq): Add parenthetical
8156         clauses to comments describing declares_class_or_enum.
8157         (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not
8158         false.
8159
8160 2004-01-12  Jan Hubicka  <jh@suse.cz>
8161
8162         * pt.c (for_each_template_parm): Do not check for duplicates.
8163         (for_each_template_parm): Use walk_tree duplicate checking code.
8164
8165 2004-01-11  Ian Lance Taylor  <ian@wasabisystems.com>
8166
8167         PR c++/3478
8168         * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec
8169         is error_mark_node, don't add any more decl_specs.
8170         (cp_parser_init_declarator): After committing to a declaration, if
8171         the decl_specifiers start with error_mark_node, issue an error and
8172         change the type to "int".
8173
8174 2004-01-09  Nathanael Nerode  <neroden@gcc.gnu.org>
8175
8176         PR bootstrap/7817
8177         * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so.
8178
8179 2004-01-10  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8180
8181         DR 337
8182         PR c++/9256
8183         * pt.c (tsubst): Substitution must fail if we are attempting to
8184         create an array with element type that is an abstract class type.
8185         * decl.c (cp_finish_decl): Strip pointers and array types recursively
8186         before calling abstract_virtuals_error.
8187
8188 2004-01-09  Alexandre Oliva  <aoliva@redhat.com>
8189
8190         * name-lookup.c (qualified_lookup_using_namespace): Consider
8191         strong using directives even if we've already found a binding.
8192
8193 2004-01-09  Mark Mitchell  <mark@codesourcery.com>
8194
8195         * cp-tree.h (cxx_expand_expr): Change prototype.
8196         * expr.c (cxx_expand_expr): Add alt_rtl parameter.
8197
8198 2004-01-08  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
8199
8200         PR c++/12573
8201         * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
8202         looking into them recursively. They can be there because of the
8203         new __offsetof__ extension.
8204
8205 2004-01-07  Zack Weinberg  <zack@codesourcery.com>
8206
8207         * parser.c (cp_parser_save_member_function_body): Mark the
8208         definition static.
8209
8210 2004-01-05  Mark Mitchell  <mark@codesourcery.com>
8211
8212         PR c++/13057
8213         * class.c (build_clone): Copy type attributes from the original
8214         function to the clone.
8215
8216         PR c++/12815
8217         * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable
8218         references as constant.
8219
8220         PR c++/12132
8221         * parser.c (cp_parser_explicit_instantiation): Improve error
8222         recovery.
8223         (cp_parser_require): Improve indication of the error location.
8224
8225         PR c++/13451
8226         * parser.c (cp_parser_class_head): Reorder logic to check for
8227         invalid qualification.
8228
8229 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
8230
8231         PR c++/13157
8232         * name-lookup.c (lookup_using_namespace): Remove spacesp
8233         parameter.
8234         (unqualified_namespace_lookup): Likewise.
8235         (lookup_qualified_name): Adjust accordingly.
8236         (lookup_name_real): Likewise.
8237         (lookup_arg_dependent): Do not eliminate the namespace of the
8238         functions found by unqualified name lookup unless that is the
8239         current namespace.
8240
8241 2004-01-04  Andrew Pinski  <pinskia@physics.uc.edu>
8242
8243         * semantics.c (push_deferring_access_checks): Fix format.
8244         (resume_deferring_access_checks): Likewise.
8245         (stop_deferring_access_checks): Likewise.
8246         (pop_deferring_access_checks): Likewise.
8247         (get_deferred_access_checks): Likewise.
8248         (pop_to_parent_deferring_access_checks): Likewise.
8249         (perform_deferred_access_checks): Likewise.
8250         (perform_or_defer_access_check): Likewise.
8251
8252 2004-01-04  Richard Henderson  <rth@redhat.com>
8253
8254         * call.c (build_over_call): Don't create a save_expr of an
8255         aggregate, but rather its address.
8256
8257 2004-01-04  Mark Mitchell  <mark@codesourcery.com>
8258
8259         PR c++/13529
8260         * parser.c (cp_parser_postfix_expression): Allow "." to appear in
8261         an offsetof expression.
8262
8263         * parser.c (cp_parser_parameter_declaration): Fix comment.
8264
8265         PR c++/12226
8266         * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro.
8267         (reference_binding): Set it when appropriate.
8268         (build_temp): New function, split out from ...
8269         (convert_like_real): ... here.  Honor CHECK_COPY_CONSTRUCTOR_P.
8270         (initialize_reference): Likewise.
8271
8272         PR c++/13536
8273         * parser.c (cp_parser): Add in_type_id_in_expr_p.
8274         (cp_parser_new): Initialize it.
8275         (cp_parser_postfix_expression): Set it.
8276         (cp_parser_sizeof_operand): Likewise.
8277         (cp_parser_parameteR_declaration): Do not commit early to tenative
8278         parsers when in_type_id_in_expr_p is set.
8279
8280 2004-01-03  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
8281
8282         PR c++/13094
8283         * parser.c (cp_parser_template_argument): Don't call
8284         make_unbound_class_template directly.
8285         (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from
8286         UNBOUND_CLASS_TEMPLATE tree node.
8287
8288 2004-01-02  Richard Sandiford  <rsandifo@redhat.com>
8289
8290         PR target/12729
8291         * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr.
8292
8293 2004-01-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
8294
8295         PR c++/13520
8296         * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro.
8297         (DECL_FUNCTION_TEMPLATE_P): Use it.
8298         (DECL_CLASS_TEMPLATE_P): Likewise.
8299         * parser.c (cp_parser_lookup_name): Add is_template parameter.
8300         (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name.
8301         (cp_parser_template_name): Likewise.
8302         (cp_parser_elaborated_type_specifier): Likewise.
8303         (cp_parser_namespace_name): Likewise.
8304         (cp_parser_class_name): Likewise.
8305         (cp_parser_lookup_name_simple): Likewise.
8306
8307 See ChangeLog.3 for earlier changes.