OSDN Git Service

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