OSDN Git Service

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