OSDN Git Service

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