OSDN Git Service

e67d716d007cd15123305bf3da4041e04302f81e
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2005-05-17  Mike Stump  <mrs@apple.com>
2
3         Yet more Objective-C++...
4         
5         * cp-objcp-common.h (cxx_get_alias_set): Move from
6         here...
7         (cxx_warn_unused_global_decl): Likewise.
8         (cp_expr_size): Likewise.
9         (cp_tree_size): Likewise.
10         (cp_var_mod_type_p): Likewise.
11         (cxx_initialize_diagnostics): Likewise.
12         (cxx_types_compatible_p): Likewise.
13         * cp-tree.h: to here.
14         (do_poplevel): Add.
15         * lex.c (D_OBJC): Add.
16         (init_reswords): Add.
17         * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h.
18         * parser.c: Add c-common.h include.
19         * pt.c: Add c-common.h and cp-objcp-common.h includes.
20         (template_args_equal): Use objc_comptypes as well.
21         (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well.
22         * semantics.c (do_poplevel): Remove static.
23
24         * decl.c (objc_mark_locals_volatile): Don't change decls that are
25         already ok.
26         * decl2.c (generate_ctor_or_dtor_function): Add code to initialize
27         Objective C++ early enough.
28         * lex.c (struct resword reswords): Add Objective-C++ support.
29         * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++.
30         (cp_parser_objc_message_receiver): Add.
31         (cp_parser_objc_message_args): Likewise.
32         (cp_parser_objc_message_expression): Likewise.
33         (cp_parser_objc_encode_expression): Likewise.
34         (cp_parser_objc_defs_expression): Likewise.
35         (cp_parser_objc_protocol_expression): Likewise.
36         (cp_parser_objc_selector_expression): Likewise.
37         (cp_parser_objc_expression): Likewise.
38         (cp_parser_objc_visibility_spec): Likewise.
39         (cp_parser_objc_method_type): Likewise.
40         (cp_parser_objc_protocol_qualifiers): Likewise.
41         (cp_parser_objc_typename): Likewise.
42         (cp_parser_objc_selector_p): Likewise.
43         (cp_parser_objc_selector): Likewise.
44         (cp_parser_objc_method_keyword_params): Likewise.
45         (cp_parser_objc_method_tail_params_opt): Likewise.
46         (cp_parser_objc_interstitial_code): Likewise.
47         (cp_parser_objc_method_signature): Likewise.
48         (cp_parser_objc_method_prototype_list): Likewise.
49         (cp_parser_objc_method_definition_list): Likewise.
50         (cp_parser_objc_class_ivars): Likewise.
51         (cp_parser_objc_identifier_list): Likewise.
52         (cp_parser_objc_alias_declaration): Likewise.
53         (cp_parser_objc_class_declaration): Likewise.
54         (cp_parser_objc_protocol_declaration): Likewise.
55         (cp_parser_objc_protocol_refs_opt): Likewise.
56         (cp_parser_objc_superclass_or_category): Likewise.
57         (cp_parser_objc_class_interface): Likewise.
58         (cp_parser_objc_class_implementation): Likewise.
59         (cp_parser_objc_end_implementation): Likewise.
60         (cp_parser_objc_declaration): Likewise.
61         (cp_parser_objc_try_catch_finally_statement): Likewise.
62         (cp_parser_objc_synchronized_statement): Likewise.
63         (cp_parser_objc_throw_statement): Likewise.
64         (cp_parser_objc_statement): Likewise.
65         (cp_parser_primary_expression): Add Objective-C++.
66         (cp_parser_statement): Likewise.
67         (cp_parser_declaration): Likewise.
68         (cp_parser_simple_type_specifier): Likewise.
69         (cp_parser_type_name): Likewise.
70         (cp_parser_parameter_declaration_list): Likewise.
71         (cp_parser_member_declaration) Likewise.
72         * tree.c: Include debug.h.
73         * typeck.c (composite_pointer_type): Add Objective-C++ support.
74         (finish_class_member_access_expr): Likewise.
75         (build_function_call): Allow objc to rewrite FUNCTION_DECLs.
76         (build_modify_expr): Allow objc to generate write barriers.
77
78         * Make-lang.in (cp/tree.o): Add debug.h.
79         * tree.c (lvalue_p_1, case CONST_DECL): Add.
80
81 2005-05-17  Jakub Jelinek  <jakub@redhat.com>
82
83         PR c++/21454
84         * decl.c (maybe_deduce_size_from_array_init): Call
85         cp_apply_type_quals_to_decl after completing array type.
86
87 2005-05-16  Richard Henderson  <rth@redhat.com>
88
89         * decl.c (build_library_fn_1): Move setting TREE_NOTHROW ...
90         (build_library_fn): ... here.
91
92 2005-05-12  Ian Lance Taylor  <ian@airs.com>
93
94         * cp-tree.h (cp_stmt_codes): Don't define.
95         (statement_code_p): Declare.
96         (STATEMENT_CODE_P): Define.
97         * lex.c (statement_code_p): Define.
98         (cxx_init): Use actual codes in stmt_codes initializer, not
99         cp_stmt_codes macro.  Initialize statement_code_p directly, rather
100         than using INIT_STATEMENT_CODES.
101
102 2005-05-09  Mark Mitchell  <mark@codesourcery.com>
103
104         * typeck.c (build_unary_op): Do not resort to address arithmetic
105         when taking the address of a COMPONENT_REF.
106         
107 2005-05-08  Kazu Hirata  <kazu@cs.umass.edu>
108
109         * class.c (vtbl_init_data_s): Change the type of fns to
110         VEC(tree,gc)*.
111         (build_vtbl_initializer, add_vcall_offset, add_vcall_offset):
112         Use VEC instead of VARRAY.
113
114 2005-05-07  Richard Sandiford  <rsandifo@redhat.com>
115
116         * mangle.c: Remove a reference to the MIPS -mint64 option.
117
118 2005-05-07  Kazu Hirata  <kazu@cs.umass.edu>
119
120         * decl.c (wrapup_globals_for_namespace): Use VEC instead of
121         VARRAY.
122         * name-lookup.c (add_decl_to_level, begin_scope): Likewise.
123         * name-lookup.h (cp_binding_level): Change the type of
124         static_decls to VEC(tree,gc)*.
125
126         * mangle.c (globals): Change the type of substitutions to
127         VEC(tree,gc)*.
128         (dump_substitution_candidates, add_substitution,
129         find_substitution, finish_mangling, init_mangle): Use VEC
130         instead of VARRAY.
131
132 2005-05-06  Kazu Hirata  <kazu@cs.umass.edu>
133
134         * decl2.c (spew_debug): Remove.
135
136         * decl2.c (ssdf_decls, start_static_storage_duration_function,
137         generate_ctor_or_dtor_function): Use VEC instead of VARRAY.
138
139         * decl2.c (pending_statics, note_vague_linkage_var,
140         cp_finish_file): Use VEC instead of VARRAY.
141         (pending_statics_used): Remove.
142
143 2005-05-05  Kazu Hirata  <kazu@cs.umass.edu>
144
145         * decl2.c (deferred_fns, note_vague_linkage_fn,
146         cp_finish_file): Use VEC instead of VARRAY.
147
148 2005-05-05  Mark Mitchell  <mark@codesourcery.com>
149
150         PR c++/21352
151         * pt.c (build_non_dependent_expr): Use is_overloaded_fn.
152
153 2005-05-05  Kazu Hirata  <kazu@cs.umass.edu>
154
155         * pt.c: Fix a comment typo.
156
157 2005-05-04  Kazu Hirata  <kazu@cs.umass.edu>
158
159         * cp-tree.h (language_function): Change the type of
160         x_local_names to VEC.
161         * decl.c (push_local_name): Adjust uses of local_names.
162
163 2005-05-03  Kazu Hirata  <kazu@cs.umass.edu>
164
165         * friend.c, lex.c, mangle.c, repo.c: Update copyright.
166
167 2005-05-02  Kazu Hirata  <kazu@cs.umass.edu>
168
169         * class.c (local_classes, init_class_processing): Use VEC
170         instead of VARRAY.
171         * cp-tree.h (local_classes): Likewise.
172         * mangle.c (discriminator_for_local_entity): Likewise.
173         * name-lookup.c (pushtag): Likewise.
174
175         * class.c (current_lang_depth, push_lang_context,
176         pop_lang_context): Use VEC instead of VARRAY.
177         * cp-tree.h (saved_scope): Use VEC for lang_base instead of
178         VARRAY.
179         * name-lookup.c (push_to_top_level): Use VEC instead of
180         VARRAY.
181
182 2005-05-02  Paolo Bonzini  <bonzini@gnu.org>
183
184         * semantics.c (finish_call_expr): Call resolve_overloaded_builtin
185         for BUILT_IN_MD built-ins.
186
187 2005-05-02  Michael Matz  <matz@suse.de>
188
189         PR c++/19542
190         * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C
191         common frontend.
192         (null_node): Remove.
193         * lex.c (cxx_init): Move null_node initialisation to C common frontend.
194
195 2005-04-25  Ian Lance Taylor  <ian@airs.com>
196
197         * cp-tree.def: Add EXPR_STMT.
198         * cp-tree.h (cp_stmt_codes): Add EXPR_STMT.
199         (EXPR_STMT_EXPR): Define.
200         * cp-gimplify.c: Include "flags.h".
201         (gimplify_expr_stmt): New static function.
202         (cp_gimplify_expr): Handle EXPR_STMT.
203         * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression
204         rather than pp_expression.
205         (pp_cxx_statement): Handle EXPR_STMT.
206         * dump.c (cp_dump_tree): Handle EXPR_STMT.
207         * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes
208         initializer.
209
210 2005-04-25  Andrew Pinski  <pinskia@physics.uc.edu>
211
212         PR C++/21188
213         * rtti.c (ifnonnull): Cast the zero comparison operand
214         to the correct type.
215
216 2005-04-24  Jakub Jelinek  <jakub@redhat.com>
217
218         PR middle-end/20991
219         * class.c: Include cgraph.h.
220         (cp_fold_obj_type_ref): Set node->local.vtable_method.
221         * Make-lang.in (cgraph.o): Depend on $(CGRAPH_H).
222
223 2005-04-12  Markus F.X.J. Oberhumer  <markus@oberhumer.com>
224
225         * mangle.c (write_builtin_type): Handle integer types which are
226         not one of the shared integer type nodes and emit a "vendor
227         extended builtin type" with an encoding in the form of "u5int96".
228
229 2005-04-24  Ian Lance Taylor  <ian@airs.com>
230
231         * cp-tree.def (USING_STMT): Change class to tcc_statement.
232         (TRY_BLOCK, EH_SPEC_BLOCK, HANDLER, CLEANUP_STMT): Likewise.
233         (IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT): Likewise.
234         (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise.
235
236 2005-04-23  DJ Delorie  <dj@redhat.com>
237
238         * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c,
239         init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c,
240         repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning()
241         callers.
242
243 2005-04-22  Per Bothner  <per@bothner.com>
244
245         * decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if
246         input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__.
247
248 2005-04-22  Alexandre Oliva  <aoliva@redhat.com>
249
250         PR c++/21087
251         * name-lookup.c (push_overloaded_decl): Do not overload with
252         non-duplicate anticipated built-in.
253
254 2005-04-21  Kazu Hirata  <kazu@cs.umass.edu>
255
256         * cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT,
257         VTABLE_BASE, VTABLE_NAME_PREFIX, STATIC_NAME_FORMAT): Remove.
258
259 2005-04-21  Nathan Sidwell  <nathan@codesourcery.com>
260
261         * cp-tree.h: Adjust for new VEC API.
262         Define VEC(tree_pair_s,gc).
263         (struct save_scope): Adjust.
264         (struct lang_type_class): Adjust.
265         (unemitted_tinfo_decls): Adjust.
266         * class.c (add_method, resort_type_method_vec,
267         finish_struct_methods, struct find_final_overrider_data,
268         dfs_find_final_overrider_pre, find_final_overrider,
269         get_vcall_index, warn_hidden, walk_subobject_offsets,
270         check_methods, fixup_inline_methods, end_of_class,
271         warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
272         add_vcall_offset): Adjust.
273         * decl.c (xref_basetypes, finish_method): Adjust.
274         * decl2.c (check_classfn): Adjust.
275         * init.c (sort_mem_initializers, push_base_cleanups): Adjust.
276         * method.c (do_build_copy_constructor): Adjust.
277         * name-lookup.c (new_class_binding, store_binding, 
278         store_bindings, store_class_bindings): Adjust.
279         * name-lookup.h: Define VEC(cxx_saved_binding,gc),
280         VEC(cp_class_binding,gc).
281         (struct cp_binding_level): Adjust.
282         * parser.c: Define VEC(cp_token_position,heap).
283         (struct cp_lexer): Adjust.
284         (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
285         cp_lexer_save_tokens): Adjust.
286         * pt.c (retrieve_specialization,
287         check_explicit_specialization): Adjust.
288         * rtti.c (unemitted_tinfo_decls): Adjust.
289         (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
290         get_pseudo_ti_desc): Adjust.
291         * search.c (dfs_access_in_type, lookup_conversion_operator,
292         lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
293         dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
294         * semantics.c: Define VEC(deferred_access,gc).
295         (push_deferring_access_checks): Adjust.
296         * typeck2.c (abstract_virtuals_error): Adjust.
297
298 2005-04-20  Ian Lance Taylor  <ian@airs.com>
299
300         * cp-tree.def: Add STMT_EXPR.
301         * cp-tree.h (STMT_EXPR_NO_SCOPE): Define.
302         (STMT_EXPR_STMT): Define.
303         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
304         STMT_EXPR.
305         (pp_cxx_expression): Likewise.
306         (pp_cxx_statement): Call pp_cxx_statement, not pp_statement.
307         * dump.c (cp_dump_tree): Handle STMT_EXPR.
308
309 2005-04-18  Kazu Hirata  <kazu@cs.umass.edu>
310
311         * decl.c (expand_static_init): Call build2 and build3 instead
312         of build.
313
314         * cp-tree.h (VPTR_NAME, VPTR_NAME_P): Remove.
315
316 2005-04-17  Ian Lance Taylor  <ian@airs.com>
317
318         * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR.
319         * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle
320         ARROW_EXPR.
321         (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR.
322         (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and
323         ALIGNOF_EXPR.
324         * typeck.c (cxx_sizeof_or_alignof_type): Update call to
325         c_sizeof_or_alignof_type for change in parameter type.
326
327 2005-04-16  Mark Mitchell  <mark@codesourcery.com>
328
329         PR c++/21025
330         * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
331         which sizeof/alignof is dependent, rather than just whether we are
332         processing_template_decl.
333         
334 2005-04-17  Kazu Hirata  <kazu@cs.umass.edu>
335
336         * cp-tree.h (LOOKUP_GLOBAL): Remove.
337         (LOOKUP_ONLYCONVERTING, DIRECT_BIND, LOOKUP_NO_CONVERSION,
338         LOOKUP_DESTRUCTOR, LOOKUP_NO_TEMP_BIND, LOOKUP_PREFER_TYPES,
339         LOOKUP_PREFER_NAMESPACES, LOOKUP_CONSTRUCTOR_CALLABLE): Adjust
340         their values.
341
342 2005-04-15  Richard Henderson  <rth@redhat.com>
343
344         PR middle-end/14311
345         * semantics.c (finish_call_expr): Call resolve_overloaded_builtin.
346
347 2005-04-15  Kazu Hirata  <kazu@cs.umass.edu>
348
349         * cp-tree.h (lang_type_class): Remove redefined.  Move
350         java_interface into where redefined was.  Increment the width
351         of dummy.
352         (TYPE_REDEFINED): Remove.
353
354 2005-04-14  Kazu Hirata  <kazu@cs.umass.edu>
355
356         * cp-tree.h (SET_TMPL_ARG, ENUM_TI_TEMPLATE, ENUM_TI_ARGS,
357         CLASSTYPE_TEMPLATE_LEVEL): Remove.
358
359 2005-04-11  Mark Mitchell  <mark@codesourcery.com>
360
361         * decl2.c (determine_visibility): Don't use export_class_data.
362         (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
363         TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. 
364
365 2005-04-09  Kazu Hirata  <kazu@cs.umass.edu>
366
367         * cp-tree.h (cxx_alignof): Remove.
368
369         * cp-tree.h (DECL_ARRAY_DELETE_OPERATOR_P): Remove.
370
371         * cp-tree.h (EXCEPTION_CLEANUP_NAME, B_SET, B_CLR, B_TST,
372         CONV_STATIC_CAST): Remove.
373
374         * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Remove.
375
376         * cp-tree.h (VF_BINFO_VALUE, VF_BASETYPE_VALUE): Remove.
377
378         * cp-tree.h (cp_deprecated): Remove.
379
380 2005-04-08  Ian Lance Taylor  <ian@airs.com>
381
382         * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT,
383         CONTINUE_STMT, SWITCH_STMT.
384         * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT,
385         BREAK_STMT, CONTINUE_STMT, SWITCH_STMT.
386         (WHILE_COND, WHILE_BODY): Define.
387         (DO_COND, DO_BODY): Define.
388         (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define.
389         (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define.
390         * cp-gimplify.c (enum bc_t): Define.
391         (struct cp_gimplify_ctx, ctxp): Define.
392         (push_context, pop_context): New static functions.
393         (begin_bc_block, finish_bc_block): New static functions.
394         (build_bc_goto): New static function.
395         (gimplify_cp_loop, gimplify_for_stmt): New static functions.
396         (gimplify_while_stmt, gimplify_do_stmt): Likewise.
397         (gimplify_switch_stmt): Likewise.
398         (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT,
399         SWITCH_STMT, CONTINUE_STMT, BREAK_STMT.
400         (cp_genericize): Call push_context and pop_context.
401         * semantics.c (finish_break_stmt): Just call build_stmt
402         (BREAK_STMT) rather than build_break_stmt.
403         (finish_continue_stmt): Corresponding change.
404         * decl.c (pop_switch): Update call to c_do_switch_warnings for new
405         parameters.
406         * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT,
407         WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT.
408         * dump.c (cp_dump_tree): Likewise.
409
410 2005-04-08  Mark Mitchell  <mark@codesourcery.com>
411
412         PR c++/20905
413         * parser.c (cp_parser_type_specifier_seq): Add is_condition
414         parameter.
415         (cp_parser_new_type_id): Pass it.
416         (cp_parser_condition): Likewise.
417         (cp_parser_conversion_type_id): Likewise.
418         (cp_parser_type_id): Likewise.
419         (cp_parser_type_specifier_seq): In a condition, do not allow
420         invalid type-specifier combinations.
421         (cp_parser_exception_declaration): Adjust call to
422         cp_parser_type_specifier_seq. 
423
424         * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P.
425         * cp-tree.h (struct tinst_level): Add in_system_header_p.
426         (TINST_IN_SYSTEM_HEADER_P): New macro.
427         (make_tinst_level): Remove.
428         * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on
429         the instantiated class.
430         (push_tinst_level): Do not use make_tinst_level.  Set
431         TINST_IN_SYSTEM_HEADER_P.
432         (pop_tinst_level): Likewise.
433         (instantiate_class_template): Set in_system_header.
434         (instantiate_pending_templates): Likewise.
435         * tree.c (make_tinst_level): Remove.
436
437 2005-04-06  Joseph S. Myers  <joseph@codesourcery.com>
438
439         * decl.c (start_decl): Apply pending #pragma weak regardless of
440         scope.
441
442 2005-04-06  Mark Mitchell  <mark@codesourcery.com>
443
444         PR c++/20212
445         * pt.c (regenerate_decl_from_template): Copy attributes for
446         parameters from the pattern to the instantiation.
447
448 2005-04-05  Mark Mitchell  <mark@codesourcery.com>
449
450         PR c++/20734
451         * cp-tree.def (OFFSET_REF): Correct comments.
452         * init.c (build_offset_ref): Remove misleading comment.
453         * typeck.c (build_unary_op): Handle pointer-to-member creation
454         here, rather than ...
455         (unary_complex_lvalue): ... here.
456
457 2005-04-06  Jason Merrill  <jason@redhat.com>
458
459         PR c++/19312
460         * tree.c (stabilize_init): Don't bother trying to stabilize
461         something with no side-effects.
462
463 2005-04-05  Mark Mitchell  <mark@codesourcery.com>
464
465         PR c++/20763
466         * decl.c (grokdeclarator): Correct attribute handling.
467
468 2005-04-05  Mark Mitchell  <mark@codesourcery.com>
469
470         PR c++/19159
471         * decl2.c (import_export_decl): Use non-COMDAT external linkage
472         for virtual tables, typeinfo, etc. that will be emitted in only
473         one translation unit on systems without weak symbols.
474
475 2005-04-04  Mark Mitchell  <mark@codesourcery.com>
476
477         PR c++/20679
478         * parser.c (cp_parser_template_name): Fix thinko.
479
480 2005-04-04  Nathan Sidwell  <nathan@codesourcery.com>
481
482         PR c++/20746
483         * method.c (use_thunk): Protect covariant pointer return
484         adjustments from NULL pointers.
485
486 2005-04-04  Jan Hubicka  <jh@suse.cz>
487
488         * decl2.c (finish_objects): Revert my previous patch.
489         (cp_finish_file): Likewise.
490
491 2005-04-03  Kazu Hirata  <kazu@cs.umass.edu>
492
493         * pt.c: Fix comment typos.
494
495 2005-04-03  Nathan Sidwell  <nathan@codesourcery.com>
496
497         PR c++/20723
498         * pt.c (more_specialized_fn): Member functions are unordered wrt
499         non-members.  Conversion operators are unordered wrt other
500         functions.
501
502 2005-04-01  Nathan Sidwell  <nathan@codesourcery.com>
503
504         * call.c (add_template_candidates_real): Remove length parameter
505         from fn_type_unification call.
506         * class.c (resolve_address_of_overloaded_function): Likewise
507         * cp-tree.h (fn_type_unification): Remove length parameter.
508         * pt.c (get_bindings_overload): Remove.
509         (get_bindings_real): Rename to ...
510         (get_bindings): ... here.  Remove length and strict
511         parameters. Change return type flag to boolean.  Remove original
512         forwarding function.
513         (determine_specialization): Adjust get_bindings call.
514         (fn_type_unification): Remove length parameter.  Adjust.
515         (type_unification_real): Remove length parameter.  Adjust.
516         (resolve_overloaded_unification): Adjust get_bindings call.
517         (try_one_overload): Simplify confusing cascaded if control flow.
518         (unify): Remove length paramter from type_unification_real call.
519         (most_specialized_instantiation): Adjust get_bindings calls.
520         (most_specialized): Likewise.
521
522 2005-03-31  Nathan Sidwell  <nathan@codesourcery.com>
523
524         PR c++/19203, implement DR 214
525         * call.c (joust): Use more_specialized_fn.
526         * cp-tree.h (DEDUCE_ORDER): Remove.
527         (more_specialized): Replace with ...
528         (more_specialized_fn): ... this.
529         * pt.c (maybe_adjust_types_for_deduction): Remove DEDUCE_ORDER
530         case.
531         (type_unification_real): Remove DEDUCE_ORDER case.
532         (more_specialized): Replace with ...
533         (more_specialized_fn): ... this.  Implement DR 214.
534         (most_specialized_instantiation): Use get_bindings_real directly.
535
536 2005-03-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
537
538         PR c++/18644
539         * call.c (build_new_op): Remove check for -Wsynth.
540
541 2005-03-31  Jan Hubicka  <jh@suse.cz>
542
543         * decl2.c (finish_objects): Mark ctor as needed.
544         (cp_finish_file): Output variables only in nonunit-at-a-time.
545
546 2005-03-29  Richard Henderson  <rth@redhat.com>
547
548         PR c/20519
549         * decl.c (cp_complete_array_type): Rename from complete_array_type.
550         Use the new complete_array_type in c-common.c.  Update all callers.
551         * cp-tree.h (cp_complete_array_type): Update to match.
552
553 2005-03-24  Geoffrey Keating  <geoffk@apple.com>
554
555         * typeck.c (build_static_cast_1): Allow scalar_cast between
556         any integral, floating, or enumeration type.
557
558 2005-03-24  Steven Bosscher  <stevenb@suse.de>
559
560         * typeck.c (comptypes): First determine if the types are compatible
561         from a target-independent point of view.  Check target attributes
562         last.
563
564         * class.c (build_base_path):
565         (build_vbase_offset_vtbl_entries):
566         (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN.
567         * error.c (dump_expr): Likewise.
568         * init.c (build_zero_init, expand_cleanup_for_base,
569         build_vec_delete_1): Likewise.
570         * mangle.c (write_integer_cst): Likewise.
571         * method.c (thunk_adjust): Likewise.
572         * pt.c (convert_nontype_argument, tsubst, unify): Likewise.
573         * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise.
574         * typeck.c (build_ptrmemfunc_access_expr,
575         (get_member_function_from_ptrfunc): Likewise.
576
577 2005-03-23  Joseph S. Myers  <joseph@codesourcery.com>
578
579         * cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
580
581 2005-03-23  Joseph S. Myers  <joseph@codesourcery.com>
582
583         * cp-tree.h (perform_integral_promotions): Remove.
584         (default_conversion): Add.
585
586 2005-03-22  Mark Mitchell  <mark@codesourcery.com>
587
588         * parser.c (cp_parser_warn_min_max): New function.
589         (cp_parser_binary_expression): Use it.
590         (cp_parser_assignment_operator_opt): Likewise.
591         (cp_parser_operator): Likewise.
592
593 2005-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
594
595         PR c++/19980
596         * decl.c (start_preparsed_function): Robustify.
597
598 2005-03-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
599
600         PR c++/20499
601         * parser.c (cp_parser_class_head): Return NULL_TREE when
602         encountering a redefinition.
603
604 2005-03-22  Nathan Sidwell  <nathan@codesourcery.com>
605
606         PR c++/20465
607         PR c++/20381
608         * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a
609         template.
610
611 2005-03-21  Paolo Carlini  <pcarlini@suse.de>
612
613         PR c++/20461
614         PR c++/20536
615         * init.c (emit_mem_initializers): Don't crash on undefined
616         types.
617
618 2005-03-21  Paolo Carlini  <pcarlini@suse.de>
619
620         PR c++/20147
621         * semantics.c (finish_stmt_expr_expr): Return immediately
622         if error_operand_p (expr).
623
624 2005-03-21  Joseph S. Myers  <joseph@codesourcery.com>
625
626         * cp-tree.h (lvalue_or_else, lvalue_p): New.
627         * typeck.c (lvalue_or_else): New.  Call lvalue_error.
628
629 2005-03-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
630
631         PR c++/20240
632         * decl.c (decls_match): Compare context of VAR_DECL.
633
634 2005-03-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
635
636         PR c++/20333
637         * parser.c (cp_parser_postfix_expression) <case RID_TYPENAME>:
638         Check the return value of cp_parser_nested_name_specifier.
639
640 2005-03-18  Dale Johannesen <dalej@apple.com>
641
642         * cp/tree.c (cp_tree_equal):  Handle SSA_NAME.
643
644 2005-03-18  Paolo Carlini  <pcarlini@suse.de>
645
646         PR c++/20463
647         * parser.c (cp_parser_diagnose_invalid_type_name):
648         Check TYPE_BINFO (current_class_type) before attempting
649         to emit inform messages.
650
651 2005-03-17  Paolo Carlini  <pcarlini@suse.de>
652
653         PR c++/19966
654         * cp-tree.h (grok_op_properties): Change return type to void.
655         * decl.c (grok_op_properties): Return early - don't check the
656         arity - in case of a static member or an operator that cannot
657         be non-member; tidy a bit.
658
659 2005-03-17  Nathan Sidwell  <nathan@codesourcery.com>
660
661         PR c++/20186
662         * pt.c (contains_dependent_cast_p): Remove.
663         (fold_non_dependent_expr): Don't use it.
664         (value_dependent_expression_p): Use a switch statement.
665         reference_exprs can be dependent.
666
667 2005-03-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
668
669         PR c++/4403
670         PR c++/9783, DR433
671         * name-lookup.c (pushtag): Skip template parameter scope when
672         scope is ts_global.  Don't push tag into template parameter
673         scope.
674         * pt.c (instantiate_class_template): Reorder friend class
675         template substitution to handle non-dependent friend class
676         that hasn't been previously declared.
677
678 2005-03-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
679
680         Friend class name lookup 5/n
681         PR c++/1016
682         * cp-tree.h (pushtag): Adjust declaration.
683         * decl.c (lookup_and_check_tag): Call lookup_type_scope if
684         lookup_name fails.
685         (xref_tag): Adjust call to pushtag.  Make hidden class visible.
686         (start_enum): Adjust call to pushtag.
687         * name-lookup.c (ambiguous_decl): Ignore hidden names.
688         (qualify_lookup): Change return type to bool.
689         (hidden_name_p): New function.
690         (lookup_namespace_name, unqualified_namespace_lookup,
691         lookup_name_real): Use it.
692         (lookup_type_scope): Update comments.
693         (maybe_process_template_type_declaration): Change parameter name
694         from globalize to is_friend.
695         (pushtag): Change globalize parameter of type int to tag_scope.
696         Hide name if introduced by friend declaration.
697         * name-lookup.h (hidden_name_p): Add declaration.
698         * parser.c (cp_parser_lookup_name): Don't deal with hidden name
699         here.
700         * pt.c (push_template_decl_real): Make hidden class template
701         visible.
702         (lookup_template_class, instantiate_class_template): Adjust call
703         to pushtag.
704         * semantics.c (begin_class_definition): Likewise.
705         * rtti.c (init_rtti_processing, build_dynamic_cast_1, 
706         tinfo_base_init, emit_support_tinfos): Use ts_current instead of
707         ts_global.
708
709 2005-03-13  Mark Mitchell  <mark@codesourcery.com>
710
711         PR c++/20157
712         * pt.c (determine_specialization): Reject non-specializations. 
713
714 2005-03-11  Per Bothner  <per@bothner.com>
715
716         * cp-tree.h (struct cp_declarator): New id_loc field.
717         * cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's
718         location using c_lex_with_flags, instead of input_location.
719         (cp_parser_direct_declarator): Set declarator's id_loc from
720         cp_token's id_loc.
721
722 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
723
724         PR c++/18384, c++/18327
725         * decl.c (reshape_init_array): Use UHWI type for max_index_cst
726         and index.  Convert max_index to size_type_node if it isn't
727         host_integerp (, 1).
728
729 2005-03-09  Mark Mitchell  <mark@codesourcery.com>
730
731         PR c++/20208
732         * pt.c (tsubst_decl): Apply array-to-pointer and
733         function-to-pointer conversions to function arguments.
734         (regenerate_decl_from_template): Likewise.
735
736 2005-03-09  Paolo Carlini  <pcarlini@suse.de>
737
738         PR c++/16859    
739         * decl.c (complete_array_type): In pedantic mode, return
740         3 for an empty initializer list as the initializer for an
741         array of unknown bound (8.5.1/4).
742         (maybe_deduce_size_from_array_init): Fix final test to use
743         the above.
744
745 2005-03-08  Nathan Sidwell  <nathan@codesourcery.com>
746
747         PR c++/20186
748         * pt.c (contains_dependent_cast_p): New.
749         (fold_non_dependent_expr): Call it.
750
751 2005-03-08  Mark Mitchell  <mark@codesourcery.com>
752
753         PR c++/20142
754         * cp-tree.h (target_type): Remove.
755         * decl.c (layout_var_decl): Remove #if 0'd code.
756         (cp_finish_decl): Remove dead code.
757         * init.c (build_vec_init): When determining whether or not the
758         element type has an asignment operator, look through all array
759         dimensions. 
760         * typeck.c (target_type): Remove.
761
762 2005-03-07  Mark Mitchell  <mark@codesourcery.com>
763
764         * class.c (finish_struct_1): Do not warn about non-virtual
765         destructors in Java classes.
766
767 2005-03-05  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
768
769         PR c++/19311
770         * init.c (build_offset_ref): Don't build non-dependent SCOPE_REF.
771         * pt.c (build_non_dependent_expr): Don't build NON_DEPENDENT_EXPR
772         for OFFSET_TYPE.
773         * typeck.c (build_x_unary_op): Don't build non-dependent SCOPE_REF.
774         Also set PTRMEM_OK_P for NON_DEPENDENT_EXPR.
775         (build_unary_op): Handle building ADDR_EXPR of OFFSET_REF inside
776         template.
777
778 2005-03-02  Alexandre Oliva  <aoliva@redhat.com>
779
780         * name-lookup.c (push_overloaded_decl): Don't error if the new
781         decl matches the old one.
782         * decl.c (redeclaration_error_message): Likewise.
783
784 2005-03-01  Per Bothner  <per@bothner.com>
785
786         * decl.c (finish_function): Use SET_EXPR_LOCATION instead of
787         unavailable annotate_with_file_line, if USE_MAPPED_LOCATION.
788
789 2005-03-01  Nathan Sidwell  <nathan@codesourcery.com>
790
791         PR c++/20232
792         * class.c (update_vtable_entry_for_fn): Don't crash on invalid
793         covariancy. 
794
795         * cp-tree.g (THUNK_TARGET): Expand comment.
796         * method.c (use_thunk): Make sure we also use the target, if that
797         is a thunk.
798
799 2005-02-27  Jakub Jelinek  <jakub@redhat.com>
800
801         PR c++/20206
802         * decl.c (cxx_comdat_group): Put thunks for
803         TARGET_USE_LOCAL_THUNK_ALIAS_P (function) functions into the same
804         comdat group as the thunk target.
805
806 2005-02-24  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
807
808         * call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c,
809         parser.c: Fix comment typo(s).
810
811 2005-02-24  Jakub Jelinek  <jakub@redhat.com>
812
813         PR c++/20175
814         * decl.c (reshape_init): Don't warn about missing braces if STRING_CST
815         initializes a char/wchar_t array.
816
817 2005-02-23  Mark Mitchell  <mark@codesourcery.com>
818
819         PR c++/19878
820         * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
821         with internal linkage.
822
823 2005-02-23  Alexandre Oliva  <aoliva@redhat.com>
824
825         * decl.c (grokvardecl): Don't exempt anonymous types from having
826         linkage for variables that have linkage other than "C".
827
828 2005-02-23  Kazu Hirata  <kazu@cs.umass.edu>
829
830         * cp-objcp-common.h, error.c: Update copyright.
831
832 2005-02-22  Mark Mitchell  <mark@codesourcery.com>
833
834         PR c++/20073
835         * decl.c (start_decl_1): Don't clear TREE_READONLY.
836         (cp_finish_decl): Likewise.
837         (complete_vars): Call cp_apply_type_quals_to_decl.
838         * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in
839         cases where that's not valid.
840
841         PR c++/19991
842         * init.c (integral_constant_value): Iterate if the value of a decl
843         is itself a constant.
844
845         PR c++/20152
846         * parser.c (cp_parser_class_head): Check for redefintions here.
847         * semantics.c (begin_class_definition): Not here.
848         
849         PR c++/20153
850         * decl2.c (build_anon_union_vars): Add type parameter.
851         (finish_anon_union): Pass it.
852
853         PR c++/20148
854         * error.c (dump_expr): Do not print the body of a BIND_EXPR.
855         Handle STATEMENT_LIST.
856
857         PR c++/19883
858         * parser.c (cp_parser_direct_declarator): Always complain about
859         non-constant array bounds when in a function scope.
860         * semantics.c (finish_id_expression): Do not mark dependent names
861         as non-constant. 
862
863 2005-02-21  Douglas Gregor  <dgregor@cs.indiana.edu>
864         
865         PR c++/19076
866         PR c++/6628
867         * cp-tree.h (cp_apply_type_quals_to_decl): Declared.
868         * decl.c (grokdeclarator): Pedwarn about qualifying a function
869         type. 
870         Add qualifiers when declaring a typedef of a function type.
871         Member function pointers pick up the qualifiers of the typedef
872         used to declare them.
873         Don't complain about creating cv-qualified function types.
874         Complain about qualified function typedefs that are used to
875         declare non-static member functions or free functions.
876         Use cp_apply_type_quals_to_decl.
877         (start_preparsed_function): Use cp_apply_type_quals_to_decl.
878         (grokclassfn): Use cp_apply_type_quals_to_decl.
879         * error.c (dump_type_suffix): Print qualifiers for function
880         types. 
881         * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
882         (tsubst): When substituting a function type into a member
883         pointer type, pass along the qualifiers.
884         (unify): Unify member pointers to member function pointers.
885         * tree.c (cp_build_qualified_type_real): Function types may be
886         qualified. This includes restrict qualifiers.
887         * typeck.c (cp_apply_type_quals_to_decl): New function to replace
888         use of c_apply_type_quals_to_decl. Drops qualifiers that are being
889         added to function types.
890
891 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
892
893         PR 18785
894         * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
895         c_common_to_target_charset.  Delete bogus comment.
896
897 2005-02-18  Richard Henderson  <rth@redhat.com>
898
899         PR libstdc++/10606
900         * except.c (do_get_exception_ptr): New.
901         (expand_start_catch_block): Use it.
902
903 2005-02-19  Jakub Jelinek  <jakub@redhat.com>
904
905         * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING
906         if type is not error_mark_node.
907
908 2005-01-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
909
910         PR c++/19508
911         * decl2.c (grokfield): Do not apply attributes to template parameters
912         as they are ignored by tsubst anyway.
913
914 2005-02-18  Jakub Jelinek  <jakub@redhat.com>
915
916         PR c++/19813
917         * decl.c (start_decl_1): Clear TREE_READONLY flag if
918         its type has TYPE_NEEDS_CONSTRUCTING.
919         (complete_vars): Likewise.
920
921 2005-02-17  Alexandre Oliva  <aoliva@redhat.com>
922
923         PR c++/20028
924         * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a
925         template along with TYPE_SIZE.
926
927         PR c++/20022
928         * semantics.c (perform_deferred_access_checks): Use
929         get_deferred_access_checks to get the top of the stack.
930
931 2005-02-15  Alexandre Oliva  <aoliva@redhat.com>
932
933         PR c++/17788
934         * class.c (add_implicitly_declared_members, check_field_decl)
935         (check_field_decls, check_bases): Remove arguments, tests and
936         assignments of cant_have_default_ctor-related variables.
937
938 2005-02-15  Alexandre Oliva  <aoliva@redhat.com>
939
940         * decl2.c (mark_used): Set the source location of the used decl to
941         the current input location here...
942         * method.c (synthesize_method): ... not here.  Set input_location
943         from the decl instead.
944
945 2005-02-14  Nathan Sidwell  <nathan@codesourcery.com>
946
947         PR c++/19608
948         * parser.c (cp_parser_late_parsing_for_member): Use
949         current_function_decl as scope to push to and from.
950
951         PR c++/19884
952         * pt.c (check_explicit_specialization): Make sure namespace
953         binding lookup found an overloaded function.
954         (lookup_template_function): Just assert FNS is an overloaded
955         function.
956
957         PR c++/19895
958         * decl.c (grokdeclarator): Check for error mark node in ptrmem
959         construction.
960
961 2005-02-14  Alexandre Oliva  <aoliva@redhat.com>
962
963         PR c++/17816
964         * decl.c (redeclaration_error_message): Report redefinition of
965         pure virtual function.
966
967 2005-02-14  Nathan Sidwell  <nathan@codesourcery.com>
968
969         PR c++/19891
970         * class.c (build_simple_base_path): Build the component_ref
971         directly.
972         (update_vtable_entry_for_fn): Walk the covariant's binfo chain
973         rather than using lookup_base.
974         * search.c (dfs_walk_once): Add non-recursive assert check.
975         * typeck.c (build_class_member_access_expr): It is possible for
976         the member type to be both const and volatile.
977
978 2005-02-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
979
980         PR c++/14479
981         PR c++/19487
982         * pt.c (maybe_check_template_type): Remove.
983         * cp-tree.h (maybe_check_template_type): Remove prototype.
984         * name-lookup.c (maybe_process_template_type_declaration): Don't
985         use maybe_check_template_type.
986
987 2005-02-11  Richard Henderson  <rth@redhat.com>
988
989         PR c++/19632
990         * pt.c (get_mostly_instantiated_function_type): Save and restore
991         flag_access_control instead of push/pop_access_scope.
992
993 2005-02-10  Mark Mitchell  <mark@codesourcery.com>
994
995         PR c++/19755
996         * decl.c (reshape_init): Issue warnings about missing braces.
997
998 2005-02-11  Kazu Hirata  <kazu@cs.umass.edu>
999
1000         * cp-tree.def, except.c, ptree.c: Update copyright.
1001
1002 2005-02-09  Mark Mitchell  <mark@codesourcery.com>
1003
1004         PR c++/19811
1005         * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
1006         attempting name lookup.
1007
1008         * parser.c (cp_parser_unqualified_id): Initialize type_decl.
1009
1010         PR c++/19787
1011         * call.c (initialize_reference): Robustify.
1012
1013         PR ++/19732
1014         * decl.c (grokdeclarator): Check for invalid use of destructor
1015         names.
1016
1017         PR c++/19762
1018         * parser.c (cp_parser_unqualified_id): Avoid creating destructor
1019         names with invalid types.
1020
1021         PR c++/19826
1022         * parser.c (cp_parser_direct_declarator): Allow type-dependent
1023         expressions as array bounds.
1024
1025         PR c++/19739
1026         * parser.c (cp_parser_attributes_list): Allow empty lists.
1027
1028 2005-02-08  Mark Mitchell  <mark@codesourcery.com>
1029
1030         PR c++/19733
1031         * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR.
1032         (check_bases): Give warnings about a base class with a
1033         non-virtual destructor, even if it is implicit.
1034         (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR.
1035         (maybe_warn_about_overly_private_class): Don't use
1036         TYPE_HAS_DESTRUCTOR.
1037         (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR.
1038         (check_for_override): Give it external linkage.
1039         (add_implicitly_declared_members): Generate destructors lazily.
1040         (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
1041         TYPE_HAS_DESTRUCTOR.
1042         (check_bases_and_members): Call check_methods before
1043         check_field_decls.
1044         (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
1045         TYPE_HAS_DESTRUCTOR.
1046         (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR.
1047         * cp-tree.def (PSEUDO_DTOR_EXPR): Document.
1048         * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove.
1049         (lang_type_class): Add lazy_destructor.
1050         (CLASSTYPE_LAZY_DESTRUCTOR): New macro.
1051         (CLASSTYPE_DESTRUCTORS): Robustify.
1052         (TYPE_HAS_DESTRUCTOR): Remove.
1053         (check_for_override): Declare.
1054         (build_vbase_delete): Remove.
1055         * cvt.c (convert_to_void): Issue errors about pseudo-destructor
1056         expressions.
1057         * decl.c (cxx_maybe_build_cleanup): Remove dead code.
1058         * except.c (dtor_nothrow): Lazily create destructors if necessary.
1059         (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
1060         * init.c (build_delete): Lazily create destructors, if necessary.
1061         (build_vbase_delete): Remove.
1062         * method.c (locate_dtor): Simplify.
1063         (implicitly_declare_fn): Add support for destructors.
1064         * parser.c (cp_parser_lookup_name): Lazily create destructors, if
1065         necessary.
1066         * pt.c (check_explicit_specialization): Don't use
1067         TYPE_HAS_DESTRUCTOR.
1068         (instantiate_class_template): Likewise.
1069         * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR.
1070         * rtti.c (emit_support_tinfos): Robustify.
1071         * search.c (lookup_fnfields_1): Lazily create destructors.
1072         * typeck.c (build_class_member_access_expr): Remove
1073         PSEUDO_DTOR_EXPR handling.
1074         (lookup_destructor): Likewise.
1075
1076 2005-02-08  Kazu Hirata  <kazu@cs.umass.edu>
1077
1078         * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update
1079         copyright.
1080
1081 2005-02-07  Mark Mitchell  <mark@codesourcery.com>
1082
1083         * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations
1084         on boolean variables.
1085         (cp_lexer_stop_debugging): Likewise.
1086
1087 2005-02-03  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1088
1089         PR c++/17401
1090         * parser.c (cp_parser_pure_specifier): Emit a specific error
1091         message with an invalid pure specifier.
1092         * decl2.c (grok_function_init): Remove.
1093         (grokfield): An initializer for a method is a always a pure
1094         specifier.
1095
1096 2005-02-02  Matt Austern  <austern@apple.com>
1097
1098         PR c++/19628
1099         * cp-tree.h (builtin_valid_in_constant_expr_p): Declare.
1100         * parser.c (cp_parser_postfix_expression): Accept function call in
1101         constant expression if builtin_valid_in_constant_expr_p is true
1102         for that function.
1103         * pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly.
1104         * semantics.c (finish_id_expression): Accept function call in constant
1105         expression if builtin_valid_in_constant_expr_p is true for that
1106         function.
1107         * tree.c (builtin_valid_in_constant_expr_p): New.
1108
1109 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1110
1111         PR c++/17413
1112         * pt.c (check_instantiated_args): Improve error message.
1113         Fix logic when to print its second part.
1114
1115 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1116
1117         * cp-tree.h (complete_type_or_else): Remove macro.
1118         (complete_type_or_diagnostic): Rename to complete_type_or_else
1119         and remove last argument.
1120         * typeck.c (complete_type_or_diagnostic): Rename to
1121         complete_type_or_else and remove last argument.
1122
1123 2005-02-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1124
1125         * cp-tree.h (commonparms): Remove prototype.
1126         (convert_arguments): Likewise.
1127         (PFN_FROM_PTRMEMFUNC): Remove.
1128         * typeck.c (commonparms): Make static.
1129         (convert_arguments): Add prototype. Make static.
1130         (PFN_FROM_PTRMEMFUNC): Replace by pfn_from_ptrmemfunc.
1131
1132 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1133
1134         * parser.c (cp_parser_primary_expression): Don't complain about
1135         floating-point literals in integral constant expressions when
1136         !pedantic.
1137
1138 2005-02-01  Alexandre Oliva  <aoliva@redhat.com>
1139
1140         * parser.c (cp_parser_template_id): Revert comment patch too.
1141
1142         PR c++/18757
1143         PR c++/19366
1144         PR c++/19499
1145         * parser.c (cp_parser_template_id): Revert 2004-12-09's patch.
1146         Issue an error when creating the template id.
1147         * pt.c (fn_type_unification): Return early if the explicit
1148         template arg list is an error_mark_node.
1149
1150 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1151
1152         * decl.c (build_enumerator): Do not issue duplicate error messages
1153         about invalid enumeration constants.
1154         * parser.c (cp_parser_non_integral_constant_expression): Always
1155         set parser->non_integral_constant_expression_p.
1156         (cp_parser_primary_expression): Add cast_p parameter.  Issue
1157         errors about invalid uses of floating-point literals in
1158         cast-expressions.
1159         (cp_parser_postfix_expression): Add cast_p parameter.
1160         (cp_parser_open_square_expression): Pass it.
1161         (cp_parser_parenthesized_expression_list): Add cast_p parameter.
1162         (cp_parser_unary_expression): Likewise.
1163         (cp_parser_new_placement): Pass it.
1164         (cp_parser_direct_new_declarator): Likewise.
1165         (cp_parser_new_initializer): Likewise.
1166         (cp_parser_cast_expression): Add cast_p parameter.
1167         (cp_parser_binary_expression): Likewise.
1168         (cp_parser_question_colon_clause): Likewise.
1169         (cp_parser_assignment_expression): Likewise.
1170         (cp_parser_expression): Likewise.
1171         (cp_parser_constant_expression): If an integral constant
1172         expression is invalid, return error_mark_node.
1173         (cp_parser_expression_statement): Pass cast_p.
1174         (cp_parser_condition): Likewise.
1175         (cp_parser_iteration_statement): Likewise.
1176         (cp_parser_jump_statement): Likewise.
1177         (cp_parser_mem_initializer): Likewise.
1178         (cp_parser_template_argument): Likewise.
1179         (cp_parser_parameter_declaration): Likewise.
1180         (cp_parser_initializer): Likewise.
1181         (cp_parser_throw_expression): Likewise.
1182         (cp_parser_attribute_list): Likewise.
1183         (cp_parser_simple_cast_expression): Likewise.
1184         (cp_parser_functional_cast): Likewise.
1185         (cp_parser_late_parsing_default_args): Likewise.
1186         (cp_parser_sizeof_operand): Save/restore
1187         non_integral_constant_expression_p.
1188
1189 2005-01-31  Mike Stump  <mrs@apple.com>
1190
1191         * parser.c (cp_lexer_new_main): Get the first token, first, before
1192         doing anything.
1193
1194 2005-01-31  Mark Mitchell  <mark@codesourcery.com>
1195
1196         * decl.c (start_decl): Add missing parentheses.
1197
1198 2005-01-30  Mark Mitchell  <mark@codesourcery.com>
1199
1200         PR c++/19555
1201         * cp-tree.h (DECL_USE_TEMPLATE): Expand documentation.
1202         * decl.c (duplicate_decls): Do not discard
1203         DECL_IMPLICIT_INSTANTIATION when merging declarations.
1204         (start_decl): Do not SET_DECL_TEMPLATE_SPECIALIZATION for
1205         variables that do not have DECL_USE_TEMPLATE.
1206
1207         PR c++/19395
1208         * decl.c (grokdeclarator): Refactor code so that qualified names
1209         are never allowed as the declarator in a typedef.
1210
1211         PR c++/19367
1212         * name-lookup.c (do_nonmember_using_decl): Avoid overloading
1213         builtin declarations.
1214
1215         PR c++/19457
1216         * call.c (convert_like_real): Inline call to
1217         dubious_conversion_warnings here.
1218         * cp-tree.h (dubious_conversion_warnings): Remove.
1219         * semantics.c (finish_unary_op_expr): Copy INTEGER_CSTs before
1220         setting TREE_NEGATED_INT.
1221         * typeck.c (dubious_conversion_warnings): Remove.
1222
1223         PR c++/19349
1224         * name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
1225         memory.
1226
1227 2005-01-28  Mark Mitchell  <mark@codesourcery.com>
1228
1229         PR c++/19253
1230         * parser.c (cp_parser_diagnose_invalid_type_name): Commit to
1231         tentative parses.
1232
1233         PR c++/19667
1234         * pt.c (redeclare_class_template): Robustify.
1235
1236 2005-01-27  Steven Bosscher  <stevenb@suse.de>
1237
1238         * decl.c (finish_case_label): Use SWITCH_STMT accessor macros
1239         instead of SWITCH_EXPR ones.
1240         * pt.c (tsubst_expr): Likewise.
1241         * semantics.c (begin_switch_stmt, finish_switch_cond,
1242         finish_switch_stmt): Likewise.
1243
1244 2005-01-26  J"orn Rennecke <joern.rennecke@st.com>
1245
1246         PR c++/18370
1247         * parser.c (cp_parser_initializer_clause): Initialize *non_constant_p.
1248
1249 2005-01-25  Andrew Pinski  <pinskia@physics.uc.edu>
1250
1251         * class.c (abort_fndecl_addr): New variable.
1252         (build_vtbl_initializer): If we have a pure virtual function
1253         share the abort function's address.
1254         Include gt-cp-class.h at the end.
1255         * config-lang.in (gtfiles): Add cp/class.c.
1256
1257 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1258
1259         * cxx-pretty-print.c (pp_cxx_statement): Add prototype. Make static.
1260         (pp_cxx_function_definition): Make static.
1261         * cxx-pretty-print.h (pp_cxx_statement): Remove prototype.
1262         (pp_cxx_function_definition): Likewise.
1263
1264 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1265
1266         * name-lookup.c (print_binding_level): Make static.
1267         (constructor_name_full): Make static inline.
1268         (current_decl_namespace): Make static.
1269         * name-lookup.h (constructor_name_full): Remove prototype.
1270         (print_binding_level): Likewise.
1271         (current_decl_namespace): Likewise.
1272
1273 2005-01-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1274
1275         * decl.h (debug_bindings_indentation): Remove.
1276
1277 2005-01-23  Kazu Hirata  <kazu@cs.umass.edu>
1278
1279         * typeck.c: Fix a comment typo.
1280
1281 2005-01-21  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1282
1283         PR c++/19208
1284         * pt.c (fold_decl_constant_value): Always call fold_non_dependent_expr
1285         at least once.
1286         (tsubst): Use fold_decl_constant_value in place of a bare call to
1287         integral_constant_value.
1288
1289 2005-01-20  Kazu Hirata  <kazu@cs.umass.edu>
1290
1291         * typeck.c (more_qualified_p): Remove.
1292         * cp-tree.h: Remove the corresponding prototype.
1293
1294 2005-01-19  Matt Austern  <austern@apple.com>
1295
1296         * typeck.c (comptypes): Handle return code from objc_comptypes
1297         correctly.
1298
1299 2005-01-19  Kazu Hirata  <kazu@cs.umass.edu>
1300
1301         * cp-tree.h, name-lookup.h: Remove unused prototypes.
1302
1303 2005-01-19  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1304
1305         PR c++/19375
1306         * semantics.c (finish_id_expression): Disable access checking for
1307         already lookuped FIELD_DECL.
1308
1309 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
1310
1311         * decl.c (delete_block): Remove.
1312         * cp-tree.h: Remove the corresponding prototype.
1313
1314         * decl.c (vtable_decl_p, vtype_decl_p, walk_globals_data,
1315         walk_vtables_r, walk_vtables, walk_globals_r, walk_globals):
1316         Remove.
1317         * cp-tree.h: Remove the corresponding prototypes.
1318
1319         * tree.c (count_functions, bound_pmf_p, cp_is_overload_p,
1320         cp_update_decl_after_saving, name_p): Remove.
1321         * cp-tree.h: Remove the corresponding prototypes.
1322
1323 2005-01-18  Andrew Pinski  <pinskia@physics.uc.edu>
1324
1325         PR c/19472
1326         * semantics.c (finish_asm_stmt): Strip nops off
1327         input memory operands.
1328
1329 2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>
1330
1331         * Make-lang.in, call.c, cvt.c, init.c, rtti.c, tree.c,
1332         typeck2.c: Update copyright.
1333
1334 2005-01-16  Kazu Hirata  <kazu@cs.umass.edu>
1335
1336         * class.c (get_enclosing_class): Remove.
1337         * cp-tree.h: Remove the corresponding prototypes.
1338
1339         * cvt.c (convert_lvalue): Remove.
1340         * cp-tree.h: Remove the corresponding prototype.
1341
1342         * pt.c (tinst_for_decl): Remove.
1343         * cp-tree.h: Remove the corresponding prototypes.
1344
1345         * tree.c (hash_chainon): Remove.
1346         * cp-tree.h: Remove the corresponding prototypes.
1347
1348 2005-01-15  Jakub Jelinek  <jakub@redhat.com>
1349
1350         PR c++/19263
1351         * typeck2.c (split_nonconstant_init_1) <case VECTOR_TYPE>: Put a copy
1352         of CONSTRUCTOR's node into MODIFY_EXPR, as the original is modified.
1353
1354 2005-01-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1355
1356         * Make-lang.in (cp-warn): Don't append $(WERROR).
1357
1358 2005-01-10  Kazu Hirata  <kazu@cs.umass.edu>
1359
1360         * cp-tree.h: Fix a comment typo.
1361
1362 2005-01-07  Nathan Sidwell  <nathan@codesourcery.com>
1363
1364         PR c++/19298
1365         * pt.c (tsubst_qualified_id): Call convert_from_reference.
1366
1367 2005-01-06  Mark Mitchell  <mark@codesourcery.com>
1368
1369         PR c++/19244
1370         * class.c (add_implicitly_declared_members): Remove dead code.
1371         * decl.c (grokfndecl): Add sfk parameter.  Use it do set
1372         DECL_CONSTRUCTOR_P.
1373         (grokdeclarator): Adjust calls to grokfndecl.
1374         * method.c (implicitly_declare_fn): Improve documentation.
1375         * parser.c (cp_parser_direct_declarator): Do not consider a
1376         function to be a constructor if the containing class was
1377         originally anonymous.
1378
1379 2005-01-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1380
1381         PR c++/17154
1382         * search.c (lookup_field_1): Handle using declaration in
1383         class template partial specialization.
1384
1385 2005-01-06  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1386
1387         PR c++/19258
1388         * pt.c (push_access_scope): Handle friend defined in class.
1389         (pop_access_scope): Likewise.
1390
1391 2005-01-06  Nathan Sidwell  <nathan@codesourcery.com>
1392
1393         PR c++/19270
1394         * pt.c (tsubst_copy) <ARRAY_REF case>: Handle separately.
1395         (tsubst_copy_and_build) <ARRAY_REF case>: Remove obsolete
1396         array-new handling code.  Use build_x_binary_op.
1397
1398 2005-01-05  Nathan Sidwell  <nathan@codesourcery.com>
1399
1400         PR c++/19030
1401         * cp-tree.h (start_decl): Take pointer to pushed scope, not bool.
1402         * name-lookup.h (push_scope): Return pushed scope, not flag.
1403         * name-lookup.c (push_scope): Return scope that should be popped,
1404         not a flag.
1405         * decl.c (start_decl): Adjust.
1406         (grokfndecl): Adjust scope push and pop.
1407         * decl2.c (check_classfn): Likewise.
1408         * parser.c (cp_parser_condition, cp_parser_conversion_function_id,
1409         cp_parser_init_declarator, cp_parser_direct_declarator,
1410         cp_parser_class_specifier, cp_parser_class_head,
1411         cp_parser_lookup_name,
1412         cp_parser_constructor_declarator_p): Likewise.
1413         * pt.c (instantiate_class_template,
1414         resolve_typename_type): Likewise.
1415
1416 2005-01-03  Volker Reichelt  <reichelt@igpm.rwth-aaachen.de>
1417
1418         PR c++/14136
1419         * parser.c (cp_parser_unqualified_id): Do not issue error message
1420         for typedef-name as destructor declarator when performing an
1421         uncommitted tentative parse.
1422
1423 2005-01-01  Steven Bosscher  <stevenb@suse.de>
1424
1425         PR middle-end/17544
1426         * decl.c (finish_function): Fix comment.  Annotate the compiler
1427         generated return with the current file name and line 0.
1428
1429 2004-12-31  Richard Henderson  <rth@redhat.com>
1430
1431         PR middle-end/17799
1432         * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P.
1433         * class.c (build_vtable): Don't conditionallize setting it
1434         based on DWARF2_DEBUG.
1435         (layout_class_type): Set DECL_IGNORED_P.
1436         * decl2.c (get_guard): Likewise.
1437         * rtti.c (get_tinfo_decl, build_lang_decl): Likewise.
1438         * tree.c (build_local_temp): Likewise.
1439
1440 2004-12-30  Mark Mitchell  <mark@codesourcery.com>
1441
1442         * cp-tree.h (cp_declarator): Split "name" field into
1443         qualifying_scope and unqualified_name.
1444         * decl.c (get_scope_of_declarator): Adjust accordingly.
1445         (grokdeclarator): Likewise.
1446         * decl2.c (grokfield): Likewise, and adjust call to
1447         do_class_using_decl.
1448         * name-lookup.c (do_class_using_decl): Split "decl" into
1449         "scope" and "name".  Remove unnecessary code.
1450         * name-lookup.h (do_class_using_decl): Adjust declaration.
1451         * parser.c (make_id_declarator): Split "id" into qualifying_scope
1452         and unqualified_name.
1453         (cp_parser_using_declaration): Adjust call to do_class_using_decl.
1454         (cp_parser_direct_declarator): Adjust to handle the fact that
1455         cp_parser_declarator_id no longer returns a SCOPE_REF.
1456         (cp_parser_direct_declarator): Likewise.
1457         (cp_parser_declarator_id): Do not create a SCOPE_REF for qualified
1458         names.
1459         (cp_parser_member_declaration): Adjust call to make_id_declarator.
1460         (cp_parser_check_declarator_template_parameters): Do not expect a
1461         SCOPE_REF.
1462
1463         * decl.c (duplicate_decls): Call ggc_free on declarations we will
1464         not be needing any longer.
1465
1466         PR c++/19190
1467         * cvt.c (convert_to_void): Do not use STRIP_NOPs.
1468
1469 2004-12-28  Richard Henderson  <rth@redhat.com>
1470
1471         PR inline-asm/15740
1472         * semantics.c (finish_asm_stmt): Resolve asm names.  Validate input
1473         constraints.  Mark memory inputs addressable.
1474
1475 2004-12-27  Jason Merrill  <jason@redhat.com>
1476
1477         * decl.c (expand_static_init): Don't use shortcut if
1478         targetm.relaxed_ordering.
1479
1480 2004-12-27  Mark Mitchell  <mark@codesourcery.com>
1481
1482         PR c++/19149
1483         * decl.c (check_tag_decl): Robustify.
1484
1485 2004-12-23  Mark Mitchell  <mark@codesourcery.com>
1486
1487         PR c++/17595
1488         * parser.c (cp_parser_error): Issue better messages about
1489         #pragma in locations where it is not permitted.
1490
1491         PR c++/17413
1492         * pt.c (check_instantiated_args): Remove bogus SFINAE code.
1493
1494         * cvt.c (convert_to_void): Fix typo in comment.
1495
1496 2004-12-23  Alexandre Oliva  <aoliva@redhat.com>
1497
1498         PR c++/18962
1499         * pt.c (check_explicit_specialization): Use the argument list from
1500         the definition in a template function specialization definition.
1501
1502 2004-12-23  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
1503
1504         PR c++/18733
1505         * pt.c (check_explicit_specialization): Use special logic to validate
1506         befriended specializations.
1507
1508 2004-12-22  Mark Mitchell  <mark@codesourcery.com>
1509
1510         * rtti.c (emit_support_tinfos): Avoid using C99 semantics.
1511
1512         PR c++/18464
1513         * call.c (build_this): In templates, do not bother with
1514         build_unary_op.
1515         * typeck.c (unary_complex_lvalue): In a template, always refuse
1516         simplifications.
1517
1518         PR c++/18492
1519         * cp-gimplify.c (cp_genericize): Relax assertion.
1520
1521         PR c++/11224
1522         * cvt.c (convert_to_void): Warn about unused values.
1523
1524         PR c++/18257
1525         * rtti.c (emit_support_tinfos): On systems without weak symbols,
1526         emit the runtime library type-info objects as non-COMDAT.
1527
1528 2004-12-21  Mark Mitchell  <mark@codesourcery.com>
1529
1530         PR c++/18378
1531         * call.c (convert_like_real): Do not permit the use of a copy
1532         constructor to copy a packed field.
1533
1534         PR c++/19063
1535         * decl.c (grokdeclarator): Return error_mark_node, not
1536         void_type_node, to indicate errors.
1537         * parser.c (cp_parser_template_parameter_list): Robustify.
1538         (cp_parser_template_parameter): Likewise.
1539
1540         PR c++/19034
1541         * tree.c (cp_tree_equal): Handle OVERLOAD.
1542
1543 2004-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1544
1545         * decl.c (define_label): Use POP_TIMEVAR_AND_RETURN.
1546         * name-lookup.c (pushdecl_class_level): Likewise.
1547
1548 2004-12-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1549
1550         * name-lookup.c (pushtag): Add missing POP_TIMEVAR_AND_RETURN.
1551
1552 2004-12-21  Andrew Pinski  <pinskia@physics.uc.edu>
1553
1554         PR c++/18984
1555         * cp-gimplify.c (cp_genericize_r): Don't insert first but instead
1556         check to see if contains the pointer.  Insert the statement before
1557         returning.
1558
1559 2004-12-21  Nathan Sidwell  <nathan@codesourcery.com>
1560
1561         PR c++/14075
1562         * decl.c (check_initializer): Check string initializer of array is
1563         not parenthesized.
1564         * cp-tree.h (PAREN_STRING_LITERAL_P): New.
1565         * semantics.c (finish_parenthesized_expr): Mark a STRING_CST.
1566         * error.c (dump_expr): <STRING_CST case> Add parens, if needed.
1567
1568         * cp-tree.def (TEMPLATE_TYPE_PARM,
1569         BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder
1570         for better code efficiency.
1571         * cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check.
1572         (CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization.
1573         (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P,
1574         INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P,
1575         CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P,
1576         TYPE_PTROBV_P): Likewise.
1577
1578         PR c++/18975
1579         * method.c (do_build_copy_constructor): Refactor. Don't const
1580         qualify a mutable field.
1581         (do_build_assign_ref): Likewise.
1582
1583 2004-12-20  Matt Austern <austern@apple.com>
1584
1585         PR c++/19044
1586         * decl.c (make_rtl_for_nonlocal_decl): Use
1587         set_builtin_user_assembler_name.
1588
1589 2004-12-19  Mark Mitchell  <mark@codesourcery.com>
1590
1591         * cp-tree.h (note_decl_for_pch): New function.
1592         * class.c (build_clone): Call note_decl_for_pch.
1593         * semantics.c (finish_member_declaration): Likewise.
1594         (note_decl_for_pch): New function.
1595
1596 2004-12-17  Steven Bosscher  <stevenb@suse.de>
1597
1598         * init.c (build_zero_init): max_index is the number of
1599         elements, minus 1.
1600
1601 2004-12-17  Nathan Sidwell  <nathan@codesourcery.com>
1602
1603         PR c++/18721
1604         * class.c (add_method): Do not push conversion operators into a
1605         binding level.
1606
1607         * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE_TYPE): Reformat.
1608         * error.c (dump_decl): <TYPE_DECL case> Remove extraneous braces.
1609
1610 2004-12-16  Nathan Sidwell  <nathan@codesourcery.com>
1611
1612         PR c++/18905
1613         * cp-tree.h (integral_constant_value): Declare.
1614         * call.c (null_ptr_cst_p): Use integral_constant_value, not
1615         decl_constant_value.
1616         (convert_like_real): Likewise.
1617         * class.c (check_bitfield_decl): Likewise.
1618         * cvt.c (ocp_convert): Likewise.
1619         (convert): Remove unnecessary decl_constant_value call.
1620         * decl.c (compute_array_index_type): Use integral_constant_value,
1621         not decl_constant_value.
1622         (build_enumerator): Likewise.
1623         * decl2.c (grokfield): Likewise.
1624         * init.c (decl_constant_value): Simplify.
1625         (integral_constant_value): New.
1626         * pt.c (fold_decl_constant_value): Use integral_constant_value,
1627         remove subsequent check.
1628         (tsubst): Use integral_constant_value, not decl_constant_value.
1629         (tsubst_copy, unify): Likewise.
1630         * typeck.c (decay_conversion): Likewise.
1631         (build_compound_expr): Remove unnecessary decl_constant_value
1632         calls.
1633         (build_static_cast_1, build_reinterpret_cast_1):
1634         (convert_for_assignment): Remove comment about not calling
1635         decl_constant_value.
1636
1637 2004-12-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1638
1639         PR c++/18825
1640         * pt.c (instantiate_class_template): Set input_location for
1641         friend function.
1642         (tsubst_friend_function): Don't set input_location here.
1643         Make sure the context is complete if necessary.
1644
1645 2004-12-15  Nathan Sidwell  <nathan@codesourcery.com>
1646
1647         PR c++/18981
1648         * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE
1649         flag setting.
1650
1651 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
1652
1653         PR c++/18738
1654         * decl.c (make_typename_type): Do not handle namespace-scoped
1655         names here.
1656         (tag_name): Handle typename_type.
1657         (check_elaborated_type_specifier): Handle typenames.
1658         * parser.c (cp_parser_diagnose_invalid_type_name): Improve
1659         comment.
1660         (cp_parser_elaborated_type_specifier): Use
1661         cp_parser_diagnose_invalid_type_name.
1662
1663 2004-12-14  Andrew Pinski  <pinskia@physics.uc.edu>
1664
1665         PR c++/18965
1666         * init.c (build_zero_init): If the max_index is 0, there is no
1667         need to create a RANGE_EXPR.
1668
1669 2004-12-14  Mark Mitchell  <mark@codesourcery.com>
1670
1671         PR c++/18793
1672         * cp-objcp-common.c (cp_expr_size): Loosen assertion.
1673
1674 2004-12-14  Nathan Sidwell  <nathan@codesourcery.com>
1675
1676         PR c++/18949
1677         * pt.c (tsubst_copy_and_build): <INDIRECT_REF case> Check that a
1678         REFERENCE_REF_P is dereferencing a reference type.
1679         * typeck.c (build_static_cast): Convert from reference even in a
1680         template.
1681         (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise.
1682
1683 2004-12-14  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1684
1685         * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function.
1686         (cp_parser_name_lookup_error): Use it.
1687         (cp_parser_check_for_invalid_template_id): Likewise.
1688         (cp_parser_skip_to_closing_parenthesis): Likewise.
1689         (cp_parser_nested_name_specifier_opt): Likewise.
1690         (cp_parser_simple_declaration, cp_parser_template_id): Likewise.
1691         (cp_parser_parameter_declaration_list): Likewise.
1692         (cp_parser_parameter_declaration): Likewise.
1693         (cp_parser_template_name): Let cp_parser_simulate_error perform
1694         the checking.
1695         (cp_parser_committed_to_tentative_parse): Remove.
1696
1697 2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>
1698
1699         PR c++/18968
1700         * class.c (build_base_path): Convert the zero constant to the correct
1701         type when comparing.
1702
1703 2004-12-13  Mark Mitchell  <mark@codesourcery.com>
1704
1705         PR c++/18925
1706         * class.c (layout_class_type): Determine the visibility of static
1707         data members.
1708
1709 2004-12-12  Roger Sayle  <roger@eyesopen.com>
1710
1711         PR middle-end/12454
1712         * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the
1713         condition is a constant and the unexecuted clause is empty.
1714
1715 2004-12-10  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1716
1717         PR c++/18731
1718         * parser.c (cp_parser_class_head): Reject typedef-name in class head.
1719
1720 2004-12-09  Matt Austern  <austern@apple.com>
1721
1722         PR c++/18514
1723         * name-lookup.c (do_nonmember_using_decl): A real function
1724         declaration takes precedence over an anticipated declaration.
1725
1726 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1727
1728         * parser.c (cp_parser_member_declaration): Fix comment typo.
1729
1730 2004-12-09  Alexandre Oliva  <aoliva@redhat.com>
1731
1732         PR c++/18757
1733         * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID
1734         if parsing failed.
1735
1736 2004-12-09  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
1737
1738         PR c++/18073
1739         * typeck.c (build_reinterpret_cast_1): Allow cast from vector type.
1740
1741 2004-12-09  Nathan Sidwell  <nathan@codesourcery.com>
1742
1743         PR c++/16681
1744         * init.c (build_zero_init): Build a RANGE_EXPR for an array
1745         initializer.
1746
1747 2004-12-08  Kelley Cook  <kcook@gcc.gnu.org>
1748
1749         * typeck.c: Remove DOS line endings.
1750
1751 2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1752
1753         PR c++/18100
1754         * decl.c (lookup_and_check_tag): Diagnose nested class with
1755         the same name as enclosing class.
1756
1757 2004-12-08  Nathan Sidwell  <nathan@codesourcery.com>
1758
1759         PR c++/18803
1760         * cp-tree.h (REFERENCE_REF_P): New.
1761         (CPTI_TYPE_INFO_TYPE): Rename to ...
1762         (CPTI_CONST_TYPE_INFO_TYPE): ... here.
1763         (CPTI_TYPE_INFO_REF_TYPE): Remove.
1764         (type_info_type_node): Rename to ...
1765         (const_type_info_type_node): ... here.
1766         (type_info_ref_type): Remove.
1767         * call.c (build_user_type_conversion): Reformat.
1768         (resolve_args): Do not convert_from_reference.
1769         (build_object_call): Call convert_from_reference.
1770         (prep_operand): Do not convert_from_reference.
1771         (build_new_method_call): Likewise.
1772         * class.c (build_vfield_ref): Likewise.
1773         * cvt.c (convert_to_reference): Likewise.
1774         (convert_from_reference): Build INDIRECT_REF here, not with
1775         build_indirect_ref.
1776         (convert_force): Do not convert_from_reference.
1777         (build_expr_type_conversion): Likewise.
1778         * decl.c (grok_reference_init): Likewise.
1779         * decl2.c (delete_sanity): Likewise.
1780         * except.c (initialize_handler_parm): Use POINTER_TYPE_P.
1781         * init.c (build_dtor_call): Do not convert_from_reference.
1782         * parser.c (cp_parser_template_argument): Unwrap indirected
1783         reference. Allow TEMPLATE_PARM_INDEX as an object parm.
1784         * pt.c (tsubst_copy_and_build) <case INDIRECT_REF>: Use
1785         convert_from_reference, if indicated.
1786         <case CALL_EXPR>: Do not convert_from_reference.
1787         <case PARM_DECL, VAR_DECL>: Convert_from_reference if needed.
1788         (tsubst_initializer_list): Do not convert_from_reference.
1789         * rtti.c (init_rtti_processing): Adjust node creation.
1790         (throw_bad_typeid): Use const_type_info_type_node.
1791         Do not convert_from_reference.
1792         (typeid_ok_p): Use const_type_info_type_node.
1793         (build_typeid, get_typeid): Always return type_info typed node.
1794         (build_dynamic_cast_1): Dont convert_from_reference. Refactor.
1795         * semantics.c (finish_stmt_expr_expr): Do not
1796         convert_from_reference.
1797         (finish_id_expression): Convert_from_reference as appropriate.
1798         * typeck.c (decay_conversion): Do not convert_from_reference.
1799         (finish_class_member_access_expr): Likewise.
1800         (build_indirect_ref): Use POINTER_TYPE_P.
1801         (convert_arguments): Do not convert_from_reference.
1802         (build_modify_expr): Likewise.
1803         (convert_for_initialization): Likewise.
1804         * typeck2.c (build_x_arrow): Likewise.
1805
1806 2004-12-07  Ziemowit Laski  <zlaski@apple.com>
1807
1808         * cp-tree.h (struct lang_type_class): Rename 'objc_protocols'
1809         field to 'objc_info'.
1810
1811 2004-12-07  Kazu Hirata  <kazu@cs.umass.edu>
1812
1813         * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH.
1814
1815 2004-12-07  Roger Sayle  <roger@eyesopen.com>
1816
1817         * name-lookup.c (leave_scope): We only need to update
1818         class_binding_level when leaving a class scope.
1819
1820 2004-12-06  Ziemowit Laski  <zlaski@apple.com>
1821
1822         * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field.
1823
1824 2004-12-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1825
1826         PR c++/17011, c++/17971
1827         * pt.c (tsubst_copy) <FIELD_DECL case>: Check and diagnose
1828         invalid field.
1829         (tsubst_copy_and_build) <COMPONENT_REF case>: Check
1830         error_mark_node after member substitution.
1831         * semantics.c (finish_id_expression): Call
1832         finish_non_static_data_member for non-dependent FIELD_DECL.
1833
1834 2004-12-03  Nathan Sidwell  <nathan@codesourcery.com>
1835
1836         PR c++/18782
1837         * decl.c (grokdeclarator): Make sure class in pointer to member is
1838         not a namespace.
1839
1840 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
1841
1842         PR c++/18318
1843         * parser.c (cp_parser_new_type_id): Move array size expression
1844         checks from here ...
1845         * init.c (build_new): ... to here.
1846
1847 2004-12-02  Nathan Sidwell  <nathan@codesourcery.com>
1848
1849         PR c++/18758
1850         * parser.c (cp_parser_class_head): Return NULL_TREE when
1851         push_template_decl fails.  Update comment.
1852
1853 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1854
1855         PR c++/15664, c++/18276
1856         * pt.c (tsubst_decl) <TEMPLATE_DECL case>: Reorganize.  Correctly
1857         tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM.
1858
1859 2004-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1860
1861         PR c++/18123
1862         * parser.c (cp_parser_type_specifier): Catch template declaration
1863         of enum.
1864
1865 2004-12-01  Matt Austern  <austern@apple.com>
1866
1867         * name-lookup.c (namespace_binding): Omit alias check for global
1868         namespace.
1869
1870 2004-12-01  Nathan Sidwell  <nathan@codesourcery.com>
1871
1872         PR c++/18729
1873         * parser.c (cp_parser_class_name): Check decl's type is not
1874         error_mark_node.
1875
1876         PR c++/17431
1877         * call.c (standard_conversion): Add FLAGS parameter. Do not allow
1878         derived to base conversion when checking constructor
1879         accessibility.
1880         (implicit_conversion): Pass FLAGS to standard_conversion.
1881         (check_constructir_callable): Disallow conversion functions.
1882
1883 2004-11-30  Kazu Hirata  <kazu@cs.umass.edu>
1884
1885         * parser.c: Fix comment typos.
1886
1887 2004-11-27  Mark Mitchell  <mark@codesourcery.com>
1888
1889         PR c++/18368
1890         * parser.c (cp_parser_check_for_definition_in_return_type): Take
1891         the defined type as a parameter, and inform the user about the
1892         possibility of a missing semicolon.
1893         (cp_parser_explicit_instantiation): Adjust call to
1894         cp_parser_check_for_definition_in_return_type.
1895         (cp_parser_init_declarator): Likewise.
1896         (cp_parser_member_declaration): Likewise.
1897
1898         PR c++/18674
1899         * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit
1900         typename from comments.
1901         * cp-tree.h (TYPENAME_IS_ENUM_P): New macro.
1902         (TYPENAME_IS_CLASS_P): Likewise.
1903         (make_typename_type): Change prototype.
1904         * decl.c (struct_typename_info): New type.
1905         (typename_compare): Expect the second argument to be a
1906         typename_info, not a tree.
1907         (build_typename_type): Add tag_type parameter.  Do not create a
1908         new type until necessary.
1909         (make_typename_type): Add tag_type parameter.
1910         * error.c (TYPENAME_TYPE): Print tags other than "typename" if
1911         appropriate.
1912         * friend.c (make_friend_class): Adjust call to make_typename_type.
1913         * parser.c (cp_parser_make_typename_type): Likewise.
1914         (cp_parser_primary_expression): Adjust call to
1915         cp_parser_lookup_name.
1916         (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name.
1917         (cp_parser_class_or_namespace_name): Likewise.
1918         (cp_parser_postfix_expression): Adjust calls to
1919         make_typename_type.
1920         (cp_parser_mem_initializer_id): Adjust calls to
1921         cp_parser_class_name.
1922         (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name.
1923         (cp_parser_template_name): Likewise.
1924         (cp_parser_template_argument): Likewise.
1925         (cp_parser_type_name): Adjust call to cp_parser_class_name.
1926         (cp_parser_elaborated_type_specifier): Adjust calls to
1927         make_typename_type and cp_parser_lookup_name.
1928         (cp_parser_namespace_name): Likewise.
1929         (cp_parser_class_name): Replace type_p parameter with tag_type.
1930         Adjust calls to make_typename_type and cp_parser_lookup_name.
1931         (cp_parser_class_head): Adjust calls to cp_parser_class_name.
1932         (cp_parser_base_specifier): Likewise.
1933         (cp_parser_lookup_name): Replace is_type parameter with tag_type.
1934         Adjust calls to make_typename_type and lookup_qualified_name.
1935         (cp_parser_lookup_name_simple): Adjust call to
1936         cp_parser_lookup_name.
1937         (cp_parser_constructor_declarator_p): Adjust call to
1938         cp_parser_class_name.
1939         * pt.c (convert_template_argument): Adjust all to
1940         make_typename_type.
1941         (tsubst_decl): Do not pre-substitute the type of the declaration.
1942         (tsubst): Hand off declarations more quickly.  Adjust call to
1943         make_typename_type.
1944
1945         PR c++/18512
1946         * parser.c (cp_parser_postfix_dot_deref_expression): Robustify.
1947
1948 2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>
1949
1950         PR c/7544
1951         * Make-lang.in (cp/decl2.o): Update dependencies.
1952         * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.
1953
1954 2004-11-29  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1955
1956         PR c++/18652
1957         * name-lookup.c (pushtag): Change return type to tree.
1958         * cp-tree.h (pushtag): Adjust declaration.
1959         * decl.c (xref_tag, start_enum): Use return value of pushtag.
1960         * pt.c (push_template_decl_real): Return immediately if
1961         pushdecl_namespace_level returns error_mark_node.
1962
1963 2004-11-27  Kazu Hirata  <kazu@cs.umass.edu>
1964
1965         * pt.c: Fix a comment typo.
1966
1967 2004-11-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
1968
1969         Friend class name lookup 4/n
1970         * class.c (pushclass): Don't call cxx_remember_type_decls.
1971         * cp-tree.h (clear_anon_tags): Remove declaration.
1972         * decl.c (grokdeclarator): Don't call lookup_tag_reverse.
1973         * name-lookup.c (binding_entry_free, binding_table_free): Comment
1974         out functions.
1975         (binding_table_find_anon_type, binding_table_reverse_maybe_remap,
1976         binding_table_remove_anonymous_types, cxx_remember_type_decls,
1977         bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag,
1978         lookup_tag_reverse): Remove
1979         (begin_scope, leave_scope, kept_level_p, print_binding_level):
1980         Don't use type_decls field in cp_binding_level.
1981         (maybe_process_template_type_declaration, pushtag): Set
1982         CLASSTYPE_NESTED_UTDS directly.
1983         * name-lookup.h (binding_table_remove_anonymous_types,
1984         cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove
1985         declaration.
1986         (cp_binding_level): Remove type_decls field.
1987
1988 2004-11-26  Kazu Hirata  <kazu@cs.umass.edu>
1989
1990         * typeck.c: Fix a comment typo.
1991
1992 2004-11-25  Mark Mitchell  <mark@codesourcery.com>
1993
1994         PR c++/18445
1995         * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
1996         unknown_type as non matching.  Tidy up.
1997         * pt.c (build_non_dependent_expr): Do not build a
1998         NON_DEPENDENT_EXPR for a VAR_DECL.
1999
2000         PR c++/18001
2001         * cp-tree.h (lvalue_or_else): Remove declaration.
2002         * tree.c (lvalue_or_else): Remove.
2003         * typeck.c (build_unary_op): Adjust call to lvalue_or_else.
2004         (build_modify_expr): Likewise.
2005
2006         PR c++/18625
2007         * decl.c (duplicate_decls): Return error_mark_node on error, as
2008         specified.
2009
2010         PR c++/18466
2011         * decl.c (grokvardecl): Keep track of whether or not a there was
2012         explicit qualification.
2013         * name-lookup.c (set_decl_namespace): Complain about explicit
2014         qualification of a name within its own namespace.
2015
2016         PR c++/18545
2017         * typeck.c (check_return_expr): Robustify.
2018
2019 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2020
2021         Friend class name lookup 3/n, PR c++/3332
2022         * name-lookup.c (push_inner_scope, pop_inner_scope): New functions.
2023         (lookup_type_scope): Don't deal with name from user declaration
2024         specially.
2025         * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations.
2026         * parser.c (cp_parser_class_specifier): Use push_inner_scope and
2027         pop_inner_scope.
2028
2029 2004-11-25  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2030
2031         Friend class name lookup 2/n, PR c++/14513, c++/15410
2032         * name-lookup.c (lookup_name_real): Simplify.
2033         (lookup_type_scope): Add SCOPE parameter.  Handle friend class
2034         lookup.
2035         * name-lookup.h (tag_scope): New enum type.
2036         (lookup_type_scope): Adjust declaration.
2037         * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
2038         Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
2039         (start_enum): Likewise.  Add assertion test that NAME is
2040         IDENTIFIER_NODE.  Use anonymous name for dummy ENUMERAL_TYPE in
2041         case of error.
2042         * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
2043         * parser.c (cp_parser_elaborated_type_specifier,
2044         cp_parser_class_head): Adjust call to xref_tag.
2045         * pt.c (lookup_template_class, instantiate_class_template):
2046         Likewise.
2047         * rtti.c (init_rtti_processing, build_dynamic_cast_1,
2048         tinfo_base_init, emit_support_tinfos): Likewise.
2049
2050 2004-11-25  Joseph S. Myers  <joseph@codesourcery.com>
2051
2052         * g++spec.c, lex.c: Avoid ` as left quote in diagnostics.
2053
2054 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
2055
2056         PR c++/17473
2057         * name-lookup.c (supplement_binding): Do not allow typedefs to be
2058         redefined in class scope.
2059
2060         PR c++/18285
2061         * parser.c (cp_parser_set_decl_type_spec): Do not try to allow
2062         redefinitions of builtin types other that "bool" or "wchar_t".
2063
2064 2004-11-24  Steven Bosscher  <stevenb@suse.de>
2065
2066         * decl.c (cxx_init_decl_processing): Don't clear
2067         flag_inline_functions.
2068
2069 2004-11-24  Mark Mitchell  <mark@codesourcery.com>
2070
2071         * pt.c (tsubst_function_type): Do not permit function types which
2072         return arrays or functions.
2073
2074         PR c++/18586
2075         * parser.c (cp_parser_init_declarator): Do not pop scope twice.
2076
2077         PR c++/18530
2078         * cp-tree.h (CTOR_NAME): Remove.
2079         (DTOR_NAME): Remove.
2080         * decl.c (initialize_predefined_identifiers): Add spaces to the
2081         end of constructor and destructor names.
2082
2083 2004-11-24  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2084
2085         PR c++/8929
2086         * decl.c (start_decl): Check for invalid specialization headers.
2087
2088 2004-11-24  Paolo Bonzini  <bonzini@gnu.org>
2089
2090         PR c++/16882
2091
2092         * call.c (standard_conversion): Move check for conversions between
2093         vector pointers...
2094         * typeck.c (ptr_reasonably_similar): ... here.
2095
2096 2004-11-23  Ben Elliston  <bje@au.ibm.com>
2097
2098         * cp-tree.h (context_as_string): Remove extern.
2099         * error.c (context_as_string): Remove.
2100
2101         * cp-tree.h (cp_type_qual_from_rid): Remove extern.
2102         * lex.c (cp_type_qual_from_rid): Remove.
2103
2104         * cp-tree.h (do_poplevel): Remove extern.
2105         (check_multiple_declarators): Likewise.
2106         * semantics.c (do_poplevel): Make static.
2107         (check_multiple_declarators): Remove.
2108
2109         * cp-tree.h (check_final_overrider): Remove extern.
2110         * search.c (check_final_overrider): Make static.
2111
2112         * cp-tree.h (build_artificial_parm): Remove extern.
2113         * decl2.c (build_artificial_parm): Make static.
2114
2115 2004-11-22  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2116
2117         PR c++/18354
2118         * typeck.c (build_unary_op) <CONVERT_EXPR, NEGATE_EXPR>: Unify code.
2119         Make sure the result is always a rvalue.
2120
2121 2004-11-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2122
2123         * decl.c (start_preparsed_function): Call check_function_type even
2124         in templates.
2125         (require_complete_types_for_parms): Skip dependent types.
2126         (check_function_type): Likewise.
2127
2128 2004-11-16  Steven Bosscher  <stevenb@suse.de>
2129
2130         * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h.
2131         * search.c: Don't include it.
2132
2133 2004-11-15  Andrew Pinski  <pinskia@physics.uc.edu>
2134
2135         * cp-gimplify.c: Include pointer-set.h
2136         (cp_genericize_r): Use pointer_sets instead of a hashtable.
2137         Also instert the new statement for CLEANUP_STMT.
2138         (cp_genericize): Use pointer_sets instead of a hashtable.
2139         * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h.
2140
2141 2004-11-15  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2142
2143         Friend class name lookup 1/n, PR c++/18471
2144         * decl.c (lookup_and_check_tag): New function.
2145         (xref_tag, start_enum): Use it.
2146         (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check
2147         before !DECL_IMPLICIT_TYPEDEF_P.  Also display previously declared
2148         location.
2149         * name-lookup.c (lookup_name_current_level): Rename to ...
2150         (lookup_name_innermost_nonclass_level): ... this.
2151         (lookup_type_scope): New function.
2152         * name-lookup.h (lookup_name_current_level): Rename to ...
2153         (lookup_name_innermost_nonclass_level): ... this.
2154         (lookup_type_scope): Add declaration.
2155
2156 2004-11-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2157
2158         PR c++/17344
2159         * pt.c (coerce_template_parms): Only emit error message about
2160         invalid template argument when TF_ERROR.
2161
2162 2004-11-12  Mark Mitchell  <mark@codesourcery.com>
2163
2164         PR c++/18389
2165         * decl.c (start_decl): Make sure to set *pop_scope_p.  Return
2166         error_mark_node to indicate errors.
2167
2168         PR c++/18429
2169         * parser.c (cp_parser_direct_declarator): Disallow non-constant
2170         array bounds when not inside a function.
2171
2172         PR c++/18436
2173         * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
2174         unqualified name resolves to a member function.
2175
2176         PR c++/18407
2177         * pt.c (tsubst_copy_and_build): Handle qualified names used from a
2178         derived class correctly.
2179
2180         * decl2.c (import_export_decl): Fix typo in comment.
2181         * tree.c (pod_type_p): Likewise.
2182
2183 2004-11-10  Andrew Pinski  <pinskia@physics.uc.edu>
2184
2185         * typeck.c (cxx_mark_addressable): Add braces around the first if.
2186
2187 2004-11-10  Adam Nemet  <anemet@lnxw.com>
2188
2189         PR middle-end/18160
2190         * typeck.c (cxx_mark_addressable): Issue an error if address of an
2191         explicit register variable is requested.
2192
2193 2004-11-10  Nathan Sidwell  <nathan@codesourcery.com>
2194
2195         PR c++/18143
2196         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New.
2197         (struct lang_decl_flags): Add thunk_p flag.
2198         (struct lang_decl): Remove separate fixed_offset. Place
2199         cloned_function and fixed_offset into union.
2200         (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust.
2201         (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust.
2202         (THUNK_FIXED_OFFSET): Adjust.
2203         * method.c (make_thunk): Adjust.
2204
2205 2004-11-09  Mark Mitchell  <mark@codesourcery.com>
2206
2207         PR c++/18369
2208         * init.c (build_new_1): Handle parenthesized type-ids that name an
2209         array type.  Tidy.
2210
2211 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
2212
2213         * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
2214         pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
2215         quoting in diagnostics.
2216         * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
2217         quoting in printf format.
2218         * decl.c (duplicate_decls, start_decl): Use %qD instead of
2219         unquoted %D.
2220
2221 2004-11-08  Kazu Hirata  <kazu@cs.umass.edu>
2222
2223         * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c,
2224         search.c, typeck2.c: Fix comment formatting.
2225
2226 2004-11-04  Ulrich Weigand  <uweigand@de.ibm.com>
2227
2228         PR tree-optimization/18184
2229         * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
2230         of different modes or alias-all flags as equivalent.
2231         * typeck.c (comptypes): Likewise.
2232
2233 2004-11-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2234
2235         DR 49, 100
2236         * cp-tree.h (TYPE_REF_OBJ_P): New macro.
2237         (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P,
2238         TYPE_REFFN_P): Document.
2239         (fold_decl_constant_value): New prototype.
2240         * pt.c (convert_nontype_argument_function): Rewrite and extract
2241         parts into...
2242         (fold_decl_constant_value, convert_nontype_argument_function): New.
2243         (lookup_template_class): Add comment about useless double call.
2244         * mangle.c (write_expression): Strip conversions before lowering
2245         pointer to members.
2246         * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow
2247         enum to enum conversion.
2248
2249 2004-11-02  Mark Mitchell  <mark@codesourcery.com>
2250
2251         PR c++/18124
2252         * parser.c (cp_parser_type_parameter): Robustify.
2253
2254         PR c++/18155
2255         * parser.c (cp_parser_single_declaration): Disallow template
2256         typedefs.
2257
2258         PR c++/18177
2259         * typeck.c (build_const_cast): Use error_operand_p.
2260
2261 2004-11-02  Ziemowit Laski  <zlaski@apple.com>
2262
2263         * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
2264         (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
2265         * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
2266         from cp-lang.c.
2267         * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
2268         from cp-lang.c.
2269         (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
2270
2271 2004-11-01  Nathan Sidwell  <nathan@codesourcery.com>
2272
2273         PR c++/18064
2274         * search.c (check_final_overrider): Deprecate gnu covariant extension.
2275
2276 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2277
2278         Convert diagnostics to use quoting flag q 9/n
2279         * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
2280         get_delta_difference):  Use new quotation style.
2281         * repo.c (reopen_repo_file_for_write): Likewise.
2282         * pt.c (do_type_instantiation): Likewise.
2283         * parser.c (cp_parser_diagnose_invalid_type_name):
2284         * name-lookup.c (push_overloaded_decl, set_decl_namespace):
2285         * error.c (cp_print_error_function,
2286         print_instantiation_full_context): Likewise.
2287         * decl.c (define_label, grok_reference_init,
2288         maybe_deduce_size_from_array_init, revert_static_member_fn):
2289         * decl2.c (check_classfn): Likewise.
2290         * class.c (add_method, check_field_decls, layout_class_type,
2291         resolve_address_of_overloaded_function): Likewise.
2292         * call.c (build_x_va_arg, build_over_call): Likewise.
2293
2294 2004-10-31  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2295
2296         Convert diagnostics to use quoting flag q 8/n
2297         * cvt.c (cp_convert_to_pointer, warn_ref_binding,
2298         convert_to_reference, ocp_convert, convert_to_void
2299         cp_convert_to_pointer): Use new quotation style.
2300
2301 2004-10-31  Mark Mitchell  <mark@codesourcery.com>
2302
2303         PR c++/15172
2304         * typeck2.c (store_init_value): Use split_nonconstant_init even
2305         for types that require construction.
2306
2307 1004-10-28  Matt Austern  <austern@apple.com>
2308
2309         PR c++/17542
2310         * cp-tree.h (class_key_or_enum_as_string): Declare.
2311         * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string
2312         and remove static qualifier.
2313         * decl.c (shadow_tag): Warn about ignored attributes in class/struct/
2314         union/enum declaration.
2315
2316 2004-10-29  Kazu Hirata  <kazu@cs.umass.edu>
2317
2318         * pt.c: Fix a comment typo.
2319
2320 2004-10-28  Nathan Sidwell  <nathan@codesourcery.com>
2321
2322         * typeck.c (composite_pointer_type): Remove comment about DR 195.
2323         (build_reinterpret_cast_1): Revert DR195 patch. Only emit a
2324         warning when being pedantic.
2325         (build_reinterpet_cast, build_c_cast): Adjust.
2326
2327 2004-10-29  Mark Mitchell  <mark@codesourcery.com>
2328
2329         PR c++/17695
2330         * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they
2331         appear in a constructor/destructor that will be cloned.
2332
2333 1004-10-28  Matt Austern  <austern@apple.com>
2334
2335         PR c++/14124
2336         * decl.c (finish_enum): Handle packed attribute.
2337         * parser.c (cp_parser_enum_specifier): Process trailing attributes.
2338
2339 2004-10-28  Mark Mitchell  <mark@codesourcery.com>
2340
2341         PR c++/17132
2342         * pt.c (instantiate_class_template): Increment
2343         processing_template_decl when substituting into a member class
2344         template.
2345
2346 2004-10-27  Mark Mitchell  <mark@codesourcery.com>
2347
2348         PR c++/17435
2349         * call.c (convert_like_real): Fix formatting.
2350         (initialize_reference): When binding a temporary to a base class,
2351         ensure that the nominal copy made is to the derived class, not the
2352         base class.
2353
2354         PR c++/18140
2355         * parser.c (cp_parser_next_token_ends_template_argument_p): Do not
2356         include ">>".
2357
2358 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
2359
2360         * decl.c (bad_specifiers): Move the q after the %.
2361
2362 2004-10-27  Andrew Pinski  <pinskia@physics.uc.edu>
2363
2364         * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after
2365         the %.
2366
2367 2004-10-26  Mark Mitchell  <mark@codesourcery.com>
2368
2369         * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT.
2370         * search.c (current_scope): Fix prototype.
2371
2372         PR c++/18093
2373         * search.c (current_scope): Return the innermost non-block scope,
2374         not the innermost non-block, non-namespace scope.
2375         (at_namespace_scope_p): Adjust accordingly.
2376         (dfs_accessible_post): Do not pass namespaces to is_friend.
2377         (dfs_walk_once_accessible_r): Likewise.
2378         * decl.c (grokvardecl): Adjust call to current_scope.
2379         (build_enumerator): Likewise.
2380         * parser.c (cp_parser_using_declaration): Likewise.
2381         (cp_parser_direct_declarator): Use at_namespace_scope_p instead of
2382         current_scope.
2383         (cp_parser_class_head): Adjust call to current_scope.
2384         * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the
2385         alias.
2386
2387         PR c++/18020
2388         * pt.c (tusbst_copy_and_build): Resolve enumeration constants to
2389         their underlying values.
2390
2391         PR c++/18161
2392         * typeck.c (build_binary_op): Honor build_type, even when in a
2393         template.
2394
2395 2004-10-26  Nathan Sidwell  <nathan@codesourcery.com>
2396
2397         * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
2398         padding token checking.
2399
2400 2004-10-25  Andrew Pinski  <pinskia@physics.uc.edu>
2401
2402         PR c++/18121
2403         * decl.c (grokdeclarator) <case cdk_array>: Remove the call
2404         layout_type as it is already done by create_array_type_for_decl.
2405
2406 2004-10-22  Nathan Sidwell  <nathan@codesourcery.com>
2407
2408         PR c++/18095
2409         * parser.c (eof_token): Make const, correctly initialize rid and
2410         location fields.
2411         (struct cp_lexer): Replace buffer_end pointer with buffer_length
2412         count. Adjust.
2413         (cp_lexer_new_main): Directly grow lexer's buffer here.  Don't
2414         zero it out.
2415         (cp_lexer_new_from_tokens): Adjust.
2416         (cp_lexer_grow_buffer): Remove.
2417         (cp_lexer_peek_nth_token, cp_lexer_consume_token,
2418         cp_lexer_purge_token): Add const casts.
2419
2420 2004-10-21  Mark Mitchell  <mark@codesourcery.com>
2421
2422         PR c++/18073
2423         PR c++/10841
2424         * cp-tree.h (convert_to_base): Change prototype.
2425         (build_ptrmemfunc): Likewise.
2426         (convert_ptrmem): New function.
2427         * call.c (struct conversion): Adjust documentation for base_p.
2428         (standard_conversion): Set base_p for ck_pmem conversions as
2429         appropriate.
2430         (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr
2431         conversions.
2432         * class.c (convert_to_base): Handle both pointers and objects.
2433         Add nonnull parameter.
2434         (build_vfield_ref): Adjust call to convert_to_base.
2435         * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc.
2436         (convert_force): Likewise.
2437         * typeck.c (build_unary_op): Likewise.
2438         (convert_ptrmem): New function.
2439         (build_static_cast_1): Use it.
2440         (build_reinterpret_cast): Allow conversions to vector types.
2441         (get_delta_difference): Add c_cast_p parameter.
2442         (build_ptrmemfunc): Likewise.  Adjust calls to
2443         get_delta_difference.
2444
2445 2004-10-21  Andrew Pinski  <pinskia@physics.uc.edu>
2446
2447         PR c++/13560
2448         * error.c (cp_error_at): Output the context as it might be
2449         different file as the other location.
2450
2451 2004-10-21  Kazu Hirata  <kazu@cs.umass.edu>
2452
2453         * typeck.c: Fix a comment typo.
2454
2455 2004-10-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
2456
2457         PR c++/13495
2458         * decl.c (make_unbound_class_template): Add PARM_LIST parameter.
2459         * cp-tree.h (make_unbound_class_template): Adjust prototype.
2460         * parser.c (cp_parser_lookup_name): Adjust call to
2461         make_unbound_class_template.
2462         (cp_parser_single_declaration): Handle member class of class
2463         template as template friend parsing correctly.
2464         * friend.c (is_friend): Call is_specialization_of_friend for
2465         template friend class.
2466         (make_friend_class): Handle member class of class template as
2467         template friend.
2468         * pt.c (is_specialization_of_friend): Likewise.
2469         (instantiate_class_template): Likewise.
2470         (tsubst): Adjust call to make_unbound_class_template.
2471
2472 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
2473
2474         * typeck.c (composite_pointer_type): Add comment about DR 195
2475         (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
2476         Allow function pointer conversions that DR195 suggests.
2477         (build_reinterpret_cast, build_c_cast): Update
2478         build_reinterpret_cast_1 calls.
2479
2480 2004-10-20  Kazu Hirata  <kazu@cs.umass.edu>
2481
2482         * call.c, typeck.c: Fix comment typos.
2483
2484 2004-10-20  Nathan Sidwell  <nathan@codesourcery.com>
2485
2486         * parser.c (cp_token_position): New typedef. Define VEC thereof.
2487         (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make
2488         next_token and last_token cp_token_position. Make saved_tokens a
2489         VEC(cp_token_position).
2490         (eof_token): New static variable.
2491         (CP_SAVED_TOKENS_SIZE): Rename to ...
2492         (CP_SAVED_TOKEN_STACK): ... here.
2493         (cp_lexer_new_main): Adjust main lexer creation and buffer
2494         filling.
2495         (cp_lexer_new_from_tokens): Do not copy the tokens, merely point
2496         to the parent buffer.  Do not append eof token.
2497         (cp_lexer_destroy): Only free buffer if non-NULL. Free token
2498         stack.
2499         (cp_lexer_next_token, cp_lexer_prev_token): Remove.
2500         (cp_lexer_token_position, cp_lexer_token_at): New.
2501         (cp_lexer_saving_tokens): Adjust. Make inline.
2502         (cp_lexer_advance_token, cp_lexer_token_difference): Remove.
2503         (cp_lexer_peek_token_emit_debug_info): Fold into ...
2504         (cp_lexer_peek_token): ... here.
2505         (cp_lexer_peek_nth_token): Don't peek past EOF.
2506         (cp_lexer_consume_token): Set next_token to eof_token, if reaching
2507         EOF.
2508         (cp_lexer_purge_token): Adjust eof setting.
2509         (cp_lexer_purge_tokens_after): Likewise.
2510         (cp_lexer_save_tokens): Push next_token directly.
2511         (cp_lexer_commit_tokens): Adjust.
2512         (cp_lexer_rollback_tokens): Pop next_token directly.
2513         (cp_parser_check_for_invalid_template_id): Adjust token purging.
2514         (cp_parser_translation_unit): Do not consume the EOF.
2515         (cp_parser_nested_name_specifier_opt): Adjust token purging.
2516         (cp_parser_template_id, cp_parser_template_name): Likewise.
2517
2518 2004-10-19  Mark Mitchell  <mark@codesourcery.com>
2519
2520         PR c++/14035
2521         * call.c (struct conversion): Add base_p.
2522         (convert_like): Add c_cast_p argument.
2523         (convert_like_with_conversion): Likewise.
2524         (build_conv): Clear base_p.
2525         (standard_conversion): Set it, for derived-to-base conversions.
2526         (convert_like_real): Add c_cast_p parameter.  Handle pointer
2527         conversions directly rather than relying on ocp_convert.
2528         (perform_direct_initialization_if_possible): Add c_cast_p
2529         parameter.
2530         * cp-tree.h (perform_direct_initialization_if_possible): Change
2531         prototype.
2532         (convert_member_func_to_ptr): New function.
2533         * typeck.c (check_for_casting_away_constness): Add diag_fn
2534         parameter.
2535         (build_static_cast_1): New function, split out from ...
2536         (build_static_cast): ... here.  Use build_static_cast_1.
2537         (build_reinterpret_cast_1): New function, split out from ...
2538         (build_reinterpret_cast): ... here.  Use build_reinterpret_cast_1.
2539         (build_const_cast_1): New function, split out from ...
2540         (build_const_cast): ... here.  Use build_const_cast_1.
2541         (build_c_cast): Rewrite to use build_const_cast_1,
2542         build_static_cast_1, and build_reinterpret_cast_1.
2543         (convert_member_func_to_ptr): New function.
2544
2545 2004-10-19  Paolo Bonzini  <bonzini@gnu.org>
2546
2547         PR c++/18047
2548         * parser.c (enum cp_parser_prec): Give relational expressions
2549         a higher precedence than equality expressions.
2550
2551 2004-10-15  Nathan Sidwell  <nathan@codesourcery.com>
2552
2553         * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
2554         (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
2555         (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
2556         (enum base_access): Reorganize.
2557         (accessible_base_p, accessible_p): Add consider_local_p parameter.
2558         * call.c (standard_conversion): Update comment about
2559         DERIVED_FROM_P.
2560         (enforce_access): Adjust accessible_p call.
2561         (build_over_call): Adjust accessible_base_p call.
2562         * class.c (convert_to_base): Adjust lookup_base call.
2563         (build_vtbl_ref_1): Likewise.
2564         (warn_about_ambiguous_bases): Likewise. Add early exit.
2565         * cvt.c (convert_to_pointer_force) Adjust lookup_base call.
2566         * search.c (accessible_base_p): Add consider_local_p parameter.
2567         (lookup_base): Pass consider_local_p to accessible_base_p call.
2568         (friend_accessible_p): Check whether scope is a class member.
2569         Remove unnecessary class template check.
2570         (accessible_p): Add consider_local_p parameter. Use it.
2571         (adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
2572         * tree.c (maybe_dummy_object): Likewise.
2573         * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
2574         (build_class_member_access_expr): Adjust lookup_base call.
2575         * typeck2.c (binfo_or_else): Likewise.
2576         * rtti.c (build_dynamic_cast_1): Access can consider friendship
2577         and current scope.
2578
2579 2004-10-17  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2580
2581         PR c++/17743
2582         * decl2.c (grokfield): Apply attributes also to TYPE_DECLs.
2583
2584 2004-10-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
2585
2586         PR c++/10479
2587         * parser.c (cp_parser_parenthesized_expression_list): Fold
2588         non-dependent expressions in attribute lists.
2589
2590 2004-10-15  Mark Mitchell  <mark@codesourcery.com>
2591
2592         PR c++/17042
2593         * decl.c (declare_global_var): Use the return value from pushdecl.
2594
2595         PR c++/14667
2596         * parser.c (cp_parser_simple_declaration): Do not diagnose invalid
2597         type names if we have already found a valid type.
2598         (cp_parser_member_declaration): Likewise.
2599
2600         PR c++/17916
2601         * parser.c (cp_parser_member_specification_opt): Handle
2602         CPP_PRAGMA.
2603
2604 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
2605
2606         * dump.c, g++spec.c, repo.c: Update copyright.
2607
2608 2004-10-15  Kazu Hirata  <kazu@cs.umass.edu>
2609
2610         * decl.c: Fix a comment typo.
2611
2612 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
2613
2614         PR c++/16301
2615         * name-lookup.c (parse_using_directive): If we have a
2616         error_mark_node, do not set the decl namespace associations
2617         on it.
2618
2619 2004-10-14  Mark Mitchell  <mark@codesourcery.com>
2620
2621         PR c++/17976
2622         * decl.c (cp_finish_decl): Do not call expand_static_init more
2623         than once for a single variable.
2624
2625 2004-10-14  Matt Austern  <austern@apple.com>
2626
2627         * Make-lang.in (pt.o): depends on pointer-set.h
2628         * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
2629         * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
2630         (for_each_template_parm): Convert from htab_t to pointer_set_t.
2631         * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
2632
2633 2004-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
2634
2635         PR c++/17661
2636         * semantics.c (finish_for_expr): Convert expression to void
2637         so that we don't create temporaries for a?b:c.
2638
2639 2004-10-13  Kazu Hirata  <kazu@cs.umass.edu>
2640
2641         * search.c: Fix a comment typo.
2642
2643 2004-10-12  Nathan Sidwell  <nathan@codesourcery.com>
2644
2645         * class.c (dfs_modify_vtables): Simplify condition. Return
2646         dfs_skip_bases as appropriate.
2647         (modify_all_vtables): Walk in pre-order.
2648         * search.c (dfs_walk_all, dfs_walk_once_r,
2649         dfs_walk_once_accessible_r): Assert post order function never
2650         returns dfs_skip_bases.
2651
2652         * search.c (struct lookup_base_data_s): New.
2653         (lookup_base_r): Replace with ...
2654         (dfs_lookup_base): ... this.
2655         (lookup_base): Use dfs_walk_all.
2656
2657 2004-10-12  Kazu Hirata  <kazu@cs.umass.edu>
2658
2659         * search.c: Fix comment typos.
2660
2661 2004-10-11  Mark Mitchell  <mark@codesourcery.com>
2662
2663         PR c++/15786
2664         * parser.c (cp_parser_declarator): Add member_p parameter.
2665         (cp_parser_condition): Adjust calls to cp_parser_declarator.
2666         (cp_parser_explicit_instantiation): Likewise.
2667         (cp_parser_init_declarator): Likewise.
2668         (cp_parser_direct_declarator): Add member_p parameter.  Do not
2669         parse tentatively when parsing the parameters to a member.
2670         (cp_parser_type_id): Adjust calls to cp_parser_declarator.
2671         (cp_parser_parameter_declaration): Likewise.
2672         (cp_parser_member_declaration): Likewise.
2673         (cp_parser_exception_declaration): Likewise.
2674
2675         PR c++/17936
2676         * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment.
2677         * pt.c (optimize_specialization_lookup_p): Do not optimize lookups
2678         for members of partial or explicit specializations.
2679
2680         PR c++/17929
2681         * decl2.c (finish_anon_union): Robustify.
2682
2683 2004-10-11  Nathan Sidwell  <nathan@codesourcery.com>
2684
2685         * cp-tree.h (get_dynamic_cast_base_type): Rename to ...
2686         (dcast_base_hint): ... here.
2687         * rtti.c (build_dynamic_cast_1): Use dcast_base_hint.
2688         * search.c (struct dcast_data_s): New.
2689         (dynamic_cast_base_recurse): Remove. Replace with ...
2690         (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New.
2691         (get_dynamic_cast_base_type): Rename to ...
2692         (dcast_base_hint): ... here.  Use dfs_walk_once_accessible.
2693         (accessible_r): Remove.
2694         (dfs_accessible_post): New, broken out of accessible_r.
2695         (accessible_p): Use dfs_walk_once_accessible.
2696         (dfs_walk_once_accessible_r): New. From accessible_r.
2697         (dfs_walk_once_accessible): New. From acessible_p.
2698
2699         * cp-tree.h (SAME_BINFO_TYPE_P): New.
2700         * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare
2701         binfo types.
2702         (convert_to_base_statically, determine_primary_bases,
2703         update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits,
2704         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
2705         accumulate_vtbl_inits, dfs_accumulate_vtbl_inits,
2706         build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise.
2707         * init.c (expand_member_init): Likewise.
2708         * search.c (lookup_base_r, dynamic_cast_base_recurse,
2709         binfo_via_virtual, copied_binfo, binfo_for_vbase,
2710         original_binfo): Likewise.
2711         * tree.c (copy_binfo): Likewise.
2712
2713 2004-10-11  Kazu Hirata  <kazu@cs.umass.edu>
2714
2715         * semantics.c: Fix comment typos.
2716
2717 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
2718
2719         PR c++/17554
2720         part of c++/17657
2721         middle-end/17703
2722         * semantics.c (maybe_cleanup_point_expr): Call
2723         fold_build_cleanup_point_expr.
2724         (maybe_cleanup_point_expr_void): New function.
2725         (add_decl_expr): Call maybe_cleanup_point_expr_void.
2726         (finish_expr_stmt): Likewise.
2727         (finish_return_stmt): Likewise.
2728         (finish_for_expr): Likewise.
2729         (finish_asm_stmt): Likewise.
2730         * typeck.c (condition_conversion): Call
2731         fold_build_cleanup_point_expr.
2732
2733 2004-10-10  Andrew Pinski  <pinskia@physics.uc.edu>
2734
2735         PR c++/17907
2736         * semantics.c (add_decl_expr): If the decl has a size which
2737         has side effects then the decl expression needs a cleanup point.
2738
2739 2004-10-10  Mark Mitchell  <mark@codesourcery.com>
2740
2741         PR c++/17393
2742         * decl.c (grokdeclarator): Robustify error-recovery on invalid
2743         declarations.
2744
2745 2004-10-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2746
2747         Convert diagnostics to use quoting flag q 7/n
2748         * typeck.c (composite_pointer_type_r, composite_pointer_type,
2749         cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr,
2750         string_conv_p, build_class_member_access_expr,
2751         build_class_member_access_expr, lookup_destructor,
2752         finish_class_member_access_expr, build_indirect_ref,
2753         get_member_function_from_ptrfunc, build_function_call,
2754         convert_arguments, build_binary_op, pointer_diff, build_unary_op,
2755         check_for_casting_away_constness, build_static_cast,
2756         build_reinterpret_cast, build_const_cast, build_c_cast,
2757         build_modify_expr, get_delta_difference, build_ptrmemfunc,
2758         dubious_conversion_warnings, convert_for_assignment,
2759         convert_for_initialization,
2760         maybe_warn_about_returning_address_of_local, check_return_expr):
2761         Use quoting marks.
2762
2763         * typeck2.c (error_not_base_type, readonly_error,
2764         abstract_virtuals_error, cxx_incomplete_type_diagnostic,
2765         store_init_value, digest_init, build_x_arrow,
2766         build_m_component_ref, require_complete_eh_spec_types): Likewise.
2767
2768         * tree.c (cp_build_qualified_type_real,
2769         handle_java_interface_attribute, handle_init_priority_attribute):
2770         Likewise.
2771
2772         * semantics.c (finish_asm_stmt, finish_non_static_data_member,
2773         finish_pseudo_destructor_expr,
2774         check_template_template_default_arg, begin_class_definition,
2775         finish_base_specifier, qualified_name_lookup_error,
2776         finish_id_expression, finish_typeof): Likewise.
2777
2778         * search.c (lookup_base, check_final_overrider,
2779         look_for_overrides_r): Likewise.
2780
2781         * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise.
2782
2783 2004-10-09  Mark Mitchell  <mark@codesourcery.com>
2784
2785         PR c++/17867
2786         * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a
2787         constructor.
2788
2789         PR c++/17670
2790         * init.c (build_new): Correct comments.
2791         * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in
2792         the non-array case.
2793
2794         PR c++/17821
2795         * parser.c (cp_parser_postfix_dot_deref_expression): If the
2796         pseduo-destructor-name production does not work, fall back to the
2797         ordinary production.
2798
2799         PR c++/17826
2800         * tree.c (cp_tree_equal): Handle a BASELINK.
2801
2802         PR c++/17524
2803         * cp-tree.h (check_var_type): New function.
2804         * decl.c (check_var_type): New function, split out from ...
2805         (grokdeclarator): ... here.
2806         * pt.c (tsubst_decl): Use check_var_type.
2807
2808         PR c++/17685
2809         * decl.c (grokdeclarator): Disallow declarations of operators as
2810         non-functions.
2811
2812 2004-10-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
2813
2814         PR c++/17868
2815         * error.c (dump_expr): Add missing case for RDIV_EXPR.
2816
2817 2004-10-08  Kazu Hirata  <kazu@cs.umass.edu>
2818
2819         * pt.c, search.c: Fix comment typos.
2820
2821 2004-10-08  Nathan Sidwell  <nathan@codesourcery.com>
2822
2823         * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp,
2824         unmarkedp): Remove.
2825         (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New.
2826         * class.c (struct find_final_overrider_data): Remove most_derived,
2827         vpath_list and vpath fields.  Add path field.
2828         (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust.
2829         (dfs_find_final_overrider): Rename to ...
2830         (dfs_find_final_overrider_pre): ... here. Adjust.
2831         (dfs_find_final_overrider_post): Adjust.
2832         (dfs_find_final_overrider_q): Fold into
2833         dfs_find_final_overrider_pre.
2834         (find_final_overrider): Adjust dfs searching.
2835         (dfs_modify_vtables): Don't mark binfo here.
2836         (modify_all_vtables): Use dfs_walk_once.
2837         (build_vtt_inits): Likwise. Use dfs_walk_all.
2838         (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here.
2839         Return dfs_skip_bases as appropriate.
2840         (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate.
2841         * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as
2842         appropriate. Don't mark binfo here.
2843         (initialize_vtbl_ptrs): Use dfs_walk_once.
2844         * search.c (struct vbase_info): Remove unused struct.
2845         (access_in_type): Use dfs_walk_once.
2846         (dfs_access_in_type): Don't mark binfo here.
2847         (dfs_accessible_queue_p, dfs_accessible_p) Remove.
2848         Fold into ...
2849         (accessible_r): ... here. New. Specialize dfs_walk_once.
2850         (accessible_p): Use accessible_r.
2851         (lookup_field_queue_p): Remove. Fold into ...
2852         (lookup_field_r): ... here. Adjust.
2853         (lookup_member): Use dfs_walk_all.
2854         (dfs_walk_real, dfs_walk): Replace with ...
2855         (dfs_walk_all, dfs_walk_once): ... these.
2856         (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once.
2857         (dfs_unmark, unmarkedp, markedp): Remove.
2858         (dfs_get_pure_virtuals): Don't mark binfo here.
2859         (get_pure_virtuals): Use dfs_walk_once.
2860         (dfs_debug_unmarked_p): Remove. Fold into ...
2861         (dfs_debug_mark): ... here.
2862         (note_debug_info_needed): Use dfs_walk_all.
2863
2864 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
2865
2866         * pt.c (tsubst_expr) <case ASM_EXPR>: Look passed the
2867         CLEANUP_POINT_EXPR to get the asm expression.
2868
2869 2004-10-07  Mark Mitchell  <mark@codesourcery.com>
2870
2871         * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
2872         (DECL_MEMBER_TEMPLATE_P): New macro.
2873         (is_member_template): Remove.
2874         (class_method_index_for_fn): New function.
2875         * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
2876         * class.c (finish_struct_methods): Remove out-of-date comment.
2877         * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
2878         * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
2879         class_method_index_for_fn.
2880         * pt.c (is_member_template): Remove.
2881         (is_member_template_class): Likewise.
2882         (optimize_specialization_lookup_p): New function.
2883         (retrieve_specialization): Optimize lookups for members that are
2884         not member templates.
2885         (register_specialization): Adjust accordingly.
2886         (build_template_decl): Add member_template_p parameter.  Set
2887         DECL_MEMBER_TEMPLATE_P.
2888         (process_partial_specialization): Adjust call to
2889         retrieve_specialization.
2890         (push_template_decl_real): Determine whether the template is a
2891         member template.
2892         (lookup_template_class): Use retrieve_specialization.
2893         (tsubst_decl): Adjust call to retrieve_specialization.
2894         (tsubst_exception_specification): New function.
2895         (tsubst): Use it.
2896         (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
2897         (instantiate_template): Adjust call to retrieve_specialization.
2898         (regenerate_decl_from_template): Do not actually generate a new
2899         DECL.
2900         (instantiate_decl): Adjust call to retrieve_specialization.
2901         (class_method_index_for_fn): New method.
2902
2903 2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>
2904
2905         * parser.c (cp_parser_asm_definition): Look passed the
2906         CLEANUP_POINT_EXPR to get the asm expression.
2907
2908 2004-10-06  Andrew Pinski  <pinskia@physics.uc.edu>
2909
2910         PR c++/17368
2911         * semantics.c (finish_asm_stmt): Asm expressions need cleanup
2912         also.
2913
2914 2004-10-05  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2915
2916         Convert diagnostics to use quoting flag q 6/n
2917         * pt.c (finish_member_template_decl, check_specialization_scope,
2918         maybe_process_partial_specialization, determine_specialization,
2919         check_explicit_specialization, maybe_check_template_type,
2920         process_partial_specialization, check_default_tmpl_args,
2921         push_template_decl_real, redeclare_class_template,
2922         convert_nontype_argument, coerce_template_parms,
2923         lookup_template_class, push_tinst_level,
2924         instantiate_class_template, tsubst_arg_types,
2925         tsubst_function_type, tsubst, tsubst_qualified_id,
2926         tsubst_copy_and_build, check_instantiated_args,
2927         do_decl_instantiation, do_type_instantiation,
2928         invalid_nontype_parm_type_p, check_specialization_namespace,
2929         convert_template_argument, determine_specialization,
2930         check_template_shadow, tsubst_decl
2931         instantiate_pending_templates): Use quoting marks.
2932
2933 2004-10-05  Nathan Sidwell  <nathan@codesourcery.com>
2934
2935         PR c++/17829
2936         * parser.c (cp_parser_postfix_expression): Inhibit Koenig when
2937         unqualified lookup finds a member function.
2938
2939 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2940
2941         Convert diagnostics to use quoting flag q 5/n
2942         * parser.c (cp_parser_name_lookup_error,
2943         cp_parser_diagnose_invalid_type_name,
2944         cp_parser_primary_expression, cp_parser_unqualified_id,
2945         cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement,
2946         cp_parser_jump_statement, cp_parser_simple_declaration,
2947         cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
2948         cp_parser_type_parameter, cp_parser_template_id,
2949         cp_parser_template_name, cp_parser_direct_declarator,
2950         cp_parser_parameter_declaration_list, cp_parser_class_head,
2951         cp_parser_base_specifier, cp_parser_lookup_name,
2952         cp_parser_late_parsing_default_args,
2953         cp_parser_optional_template_keyword
2954         cp_parser_elaborated_type_specifier, cp_parser_check_class_key,
2955         cp_parser_check_access_in_redeclaration): Use quoting marks.
2956
2957         * name-lookup.c (supplement_binding, pushdecl,
2958         check_for_out_of_scope_variable, validate_nonmember_using_decl,
2959         do_nonmember_using_decl, lookup_tag, set_decl_namespace,
2960         push_namespace, do_namespace_alias, do_using_directive,
2961         ambiguous_decl, lookup_namespace_name, add_function): Likewise.
2962
2963         * method.c (use_thunk): Likewise.
2964
2965         * lex.c (unqualified_name_lookup_error,
2966         unqualified_fn_lookup_error): Likewise.
2967
2968 2004-10-04  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2969
2970         Convert diagnostics to use quoting flag q 4/n
2971         * except.c (decl_is_java_type, build_throw,
2972         is_admissible_throw_operand, check_handlers_1, check_handlers):
2973         Use quoting formats.
2974         * friend.c (add_friend, make_friend_class, do_friend): Likewise.
2975         * init.c (sort_mem_initializers, emit_mem_initializers,
2976         member_init_ok_or_else, expand_member_init, is_aggr_type,
2977         build_offset_ref, build_java_class_ref): Likewise.
2978
2979 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
2980
2981         Convert diagnostics to use quoting flag q 3/n
2982         * decl.c (pop_label, duplicate_decls, redeclaration_error_message,
2983         redeclaration_error_message, lookup_label, check_goto,
2984         make_typename_type, make_unbound_class_template,
2985         fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1,
2986         grok_reference_init, layout_var_decl, maybe_commonize_var,
2987         check_for_uninitialized_const_var, reshape_init_array,
2988         reshape_init, check_initializer, cp_finish_decl,
2989         member_function_or_else, bad_specifiers, grokfndecl, grokvardecl,
2990         check_static_variable_definition, compute_array_index_type,
2991         create_array_type_for_decl, check_special_function_return_type,
2992         grokdeclarator, check_default_argument, grokparms,
2993         grok_ctor_properties, grok_op_properties,
2994         check_elaborated_type_specifier, xref_tag, finish_enum,
2995         build_enumerator, check_function_type, start_preparsed_function,
2996         store_parm_decls): Use quoting formats.
2997         * decl2.c (grok_array_decl, delete_sanity, check_member_template,
2998         check_java_method, check_classfn, finish_static_data_member_decl,
2999         grokfield, grokbitfield, grok_function_init,
3000         build_anon_union_vars, coerce_new_type, coerce_delete_type,
3001         check_default_args): Likewise.
3002         * parser.c (cp_parser_decl_specifier_seq): Likewise.
3003
3004 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3005
3006         Convert diagnostics to use quoting flag q 2/n
3007         * class.c (build_base_path, add_method, alter_access,
3008         handle_using_decl, check_bases,
3009         maybe_warn_about_overly_private_class, find_final_overrider,
3010         warn_hidden, finish_struct_anon, add_implicitly_declared_members,
3011         check_bitfield_decl, check_field_decls, layout_empty_base,
3012         build_base_field, check_methods, layout_virtual_bases,
3013         warn_about_ambiguous_bases, layout_class_type, finish_struct_1,
3014         resolve_address_of_overloaded_function, instantiate_type,
3015         note_name_declared_in_class): Use format flag "q" for quoting.
3016
3017 2004-10-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
3018
3019         Convert diagnostics to use quoting flag q 1/n
3020         * error.c (locate_error): Ignore quoting flag q.
3021         * call.c (build_user_type_conversion_1, build_operator_new_call,
3022         build_object_call, op_error, build_conditional_expr,
3023         build_new_op, build_op_delete_call, enforce_access,
3024         convert_like_real, convert_arg_to_ellipsis, build_x_va_arg,
3025         convert_default_arg, build_over_call, build_new_method_call,
3026         joust, perform_implicit_conversion, initialize_reference): Use the
3027         quoting flag q.
3028
3029 2004-10-03  Andrew Pinski  <pinskia@physics.uc.edu>
3030
3031         PR c++/17797
3032         * typeck.c (build_reinterpret_cast): Return if the inner type
3033         is error_mark_node.
3034
3035 2004-10-01  Jan Hubicka  <jh@suse.cz>
3036
3037         * semantics.c (expand_body): Update call of tree_rest_of_compilation.
3038
3039 2004-09-30  Nathan Sidwell  <nathan@codesourcery.com>
3040
3041         * cp-tree.h (struct lang_decl): Shrink by reordering fields and
3042         turning operator_code and fixed_offset into bitfields.
3043
3044 2004-09-29  Joseph S. Myers  <jsm@polyomino.org.uk>
3045
3046         * decl.c (duplicate_decls): Merge TREE_DEPRECATED.
3047
3048 2004-09-29  Jason Merrill  <jason@redhat.com>
3049
3050         PR tree-optimization/17697
3051         * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl.
3052
3053 2004-09-28  Jason Merrill  <jason@redhat.com>
3054
3055         PR middle-end/17525
3056         * class.c (build_base_field): Set TYPE_MODE.
3057
3058 2004-09-28  Roger Sayle  <roger@eyesopen.com>
3059
3060         PR driver/17537
3061         * g++spec.c (lang_specific_driver): Unrecognized libraries, other
3062         than -lc and -lm, may require linking against libstc++.
3063
3064 2004-09-28  Kazu Hirata  <kazu@cs.umass.edu>
3065
3066         * tree.c: Fix a comment typo.
3067
3068 2004-09-28  Nathan Sidwell  <nathan@codesourcery.com>
3069
3070         * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove.
3071         (struct secondary_vptr_vtt_init_data_s): New.
3072         (build_vtt_inits): Adjust dfs_walkers.
3073         (dfs_build_secondary_vptr_vtt_inits): Caller data is a
3074         secondary_vptr_vtt_init_data_s structure. Adjust.
3075         (dfs_ctor_vtable_bases_queue_p): Remove.
3076         (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify.
3077
3078         * pt.c (struct get_template_base_data_s): Remove.
3079         (get_template_base_r): Fold into get_template_base.
3080         (get_template_base): Walk base binfos directly in inheritance
3081         graph order.
3082
3083 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
3084
3085         PR c++/17642
3086         * cp-tree.h (fold_if_not_in_template): New function.
3087         * call.c (build_conditional_expr): Use fold_if_not_in_template.
3088         (build_cxx_call): Likewise.
3089         * cvt.c (convert_to_complex): Likewise.
3090         (ocp_convert): Likewise.
3091         (convert): Likewise.
3092         (convert_force): Likewise.
3093         * decl.c (compute_array_index_type): Clear
3094         processing_template_decl while folding array bounds.
3095         * pt.c (convert_nontype_argument): Clear
3096         processing_template_decl while processing non-type argument
3097         initialization.
3098         * tree.c (fold_if_not_in_template): New function.
3099         * typeck.c (build_class_member_access_expr): Use
3100         fold_if_not_in_template.
3101         (build_array_ref): Likewise.
3102         (build_binary_op): Likewise.  Do not try to optimize computations
3103         when processing templates.
3104         (cp_pointer_int_sum): Use fold_if_not_in_template.
3105         (pointer_diff): Likewise.
3106         (build_unary_op): Likewise.
3107         (build_reinterpret_cast): Likewise.
3108         (get_delta_difference): Likewise.
3109         (expand_ptrmemfunc_cst): Likewise.
3110         (dubious_conversion_warnings): Likewise.
3111
3112 2004-09-27  Matt Austern  <austern@apple.com>
3113
3114         * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c
3115         (cp_lexer_get_preprocessor_token): Set implicit_extern_c for
3116         tokens that come from headers that are implicitly extern "C".
3117         (struct cp_parser): new one-bit field, implicit_extern_c.
3118         (cp_parser_new): Set parser's implicit_extern_c to false.
3119         (cp_parser_translation_unit): Pop lang context if we were in a
3120         header that was implicitly extern "C".
3121         (cp_parser_declaration_seq_opt): Push/pop lang context as
3122         required by the token's and parser's implicit_extern_c.
3123
3124 2004-09-27  Mark Mitchell  <mark@codesourcery.com>
3125
3126         PR c++/17585
3127         * cp-tree.h (shared_member_p): Declare.
3128         * search.c (shared_member_p): Give it external linkage.
3129         * semantics.c (finish_qualified_id_expr): Use it.
3130         (finish_id_expression): Likewise.
3131
3132         PR c++/17585
3133         * semantics.c (finish_id_expression): Do not add "this->" to
3134         static member functions.
3135
3136 2004-09-27  Nathan Sidwell  <nathan@codesourcery.com>
3137
3138         PR c++/17681
3139         * error.c (dump_type): Change TREE_VEC case into TREE_BINFO.
3140
3141         * class.c (struct count_depth_data): Remove.
3142         (dfs_depth_post, dfs_depth_q): Remove.
3143         (find_final_overrider): Use number of vbase classes as depth
3144         bound.
3145
3146         * cp-tree.h (types_overlap_p): Remove.
3147         * search.c (struct overlap_info): Remove.
3148         (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
3149
3150         * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
3151         (get_template_base_recursive): Remove. Replace with ...
3152         (get_template_base_r): ... this.
3153         (struct get_template_base_data_s): New.
3154         (get_template_base): Use get_template_base_r via dfs_walk.  Always
3155         return NULL on failure.
3156         (unify): Remove error_mark_node check from get_template_base result.
3157
3158 2004-09-24  Paolo Bonzini  <bonzini@gnu.org>
3159
3160         * parser.c (cp_parser_expression_stack): Clarify why it is
3161         an array of NUM_PREC_VALUES elements.
3162         (cp_parser_binary_expression): Clarify why we do not need to
3163         handle stack overflow.
3164
3165 2004-09-24  Nathan Sidwell  <nathan@codesourcery.com>
3166
3167         PR c++/16889
3168         * search.c (lookup_field_queue_p): Correct check for hidden base.
3169
3170         * search.c (bfs_walk): Remove.
3171         (lookup_member): Use dfs_walk_real.
3172         (dfs_walk_real): Move and adjust documentation from bfs_walk.
3173
3174 2004-09-23  Zack Weinberg  <zack@codesourcery.com>
3175
3176         * decl.c (grokfndecl): If ::main is found not to return int,
3177         correct it after issuing a diagnostic.
3178         (grokdeclarator): If the incoming type was error_mark_node, do
3179         not complain about declaring something with no type.
3180         (start_function): Change check for ::main not returning int to
3181         an assertion, as grokfndecl now catches this when the user did it.
3182         * init.c (perform_member_init, sort_mem_initializers)
3183         (emit_mem_initializers): Make most diagnostics be issued on
3184         the line of current_function_decl, not whatever the current
3185         input line is.
3186         * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
3187         definition and declaration with #ifdef ENABLE_CHECKING.
3188         Avoid unnecessary use of fprintf.
3189         (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
3190         definitions to avoid warnings.
3191         (cp_lexer_new_main): Add assertion that first token is not a
3192         padding token.
3193         (cp_lexer_new_from_token_array): Fold into ...
3194         (cp_lexer_new_from_tokens): ... here.  Add assertion that
3195         first token is not a padding token.
3196         (cp_lexer_set_source_position_from_token): Move nearer to callers.
3197         Remove unused lexer argument.
3198         (cp_lexer_peek_token): Just print debugging report (if enabled)
3199         and return lexer->next_token.
3200         (cp_lexer_skip_purged_tokens): Delete.
3201         (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
3202         inline, simplify bodies.
3203         (cp_lexer_peek_nth_token): Add debugging report a la
3204         cp_lexer_peek_token.
3205         (cp_lexer_consume_token): Correct commentary.  Advance over
3206         purged tokens here.  Set current source position here, from
3207         token to be returned.  Avoid unnecessary use of fprintf.
3208         (cp_lexer_purge_token): Advance next_token pointer over this and
3209         subsequent purged tokens.
3210         (cp_parser_error): Adjust source position to that of the
3211         peeked token.
3212         (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
3213         (cp_parser_string_literal): Remove some excessive cleverness.
3214         (cp_parser_enum_specifier): Call start_enum before consuming
3215         the opening brace.
3216         (cp_parser_member_declaration): Make the "extra semicolon"
3217         diagnostic consistently-worded with the other place this is
3218         diagnosed.  Explicitly set the diagnostic location to the
3219         location of the offending semicolon.
3220         (cp_parser_enclosed_template_argument_list): Use %</%> quoting
3221         in diagnostics.  Do not use cp_parser_require.  Set location
3222         of diagnostics about improper use of '>>' to location of
3223         offending token.
3224         (cp_parser_late_parsing_for_member):
3225         Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
3226         (cp_parser_late_parsing_default_args): Likewise.  Manually
3227         move some logic outside the loop.
3228
3229 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
3230
3231         PR c++/17618
3232         * cvt.c (cp_convert_to_pointer): Return early when the type is
3233         an error_mark_node.
3234
3235 2004-09-21 Fariborz Jahanian <fjahanian@apple.com>
3236
3237         PR c++/13989
3238         PR c++/9844
3239         * decl.c (grokfndecl): Add new argument "attrlist", use it
3240         to call cplus_decl_attributes.
3241         (start_function): Remove call to cplus_decl_attributes.
3242         * cvt.c (ocp_convert): Add support to use type conversion
3243         function to vector type.
3244         * parser.c (cp_parser_conversion_type_id): Add attributes, if any,
3245         to the parsed type.
3246
3247 2004-09-23  Paolo Bonzini  <bonzini@gnu.org>
3248
3249         PR c++/17596
3250
3251         * parser.c (cp_parser_token_tree_map_node,
3252         cp_parser_pm_expression, cp_parser_additive_expression,
3253         cp_parser_multiplicative_expression, cp_parser_shift_expression,
3254         cp_parser_relational_expression, cp_parser_equality_expression,
3255         cp_parser_and_expression, cp_parser_exclusive_or_expression,
3256         cp_parser_inclusive_or_expression,
3257         cp_parser_logical_and_expression,
3258         cp_parser_logical_or_expression): Removed.
3259         (enum cp_parser_prec, struct cp_parser_token_tree_map_node,
3260         binops, binops_by_token): New.
3261         (cp_parser_assignment_expression): Use cp_parser_binary_expression.
3262         (cp_parser_new): Initialize binops_by_token.
3263         (cp_parser_binary_expression): Rewritten.
3264         (N_CP_TTYPES): New.
3265
3266 2004-09-23  Kazu Hirata  <kazu@cs.umass.edu>
3267
3268         * parser.c: Fix a comment typo.
3269
3270 2004-09-23  Nathan Sidwell  <nathan@codesourcery.com>
3271
3272         PR c++/17620
3273         * decl.c (xref_basetypes): Look through typedefs before checking
3274         for duplicate base.
3275
3276 2004-09-22  Nathan Sidwell  <nathan@codesourcery.com>
3277
3278         * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
3279         * decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
3280         * rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
3281         (init_rtti_processing): Initialize it to something realistic.
3282         (get_tinfo_decl): Adjust pushing the new decl.
3283
3284         * cp-tree.h (struct lang_type_class): Remove marked flags, add
3285         diamond_shaped and repeated_base flags.  Reorder to keep 8-bit blocks.
3286         (TYPE_MARKED_P): New.
3287         (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New.
3288         (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
3289         CLEAR_CLASSTYPE_MARKED_N): Remove.
3290         (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*,
3291         CLEAR_CLASSTYPE_MARKED_*): Remove.
3292         * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond
3293         shaped and repeated base properties.
3294         * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET.
3295         * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark,
3296         class_hint_flags): Remove.
3297         (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
3298         CLASSTYPE_DIAMOND_SHAPED_P.
3299
3300 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
3301
3302         * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
3303         cp-objcp-common.h.
3304         (objcp_tsubst_copy_and_build): Reformat function signature.
3305         * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise.
3306         (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c.
3307
3308 2004-09-21  Zack Weinberg  <zack@codesourcery.com>
3309
3310         * parser.c (cp_lexer_peek_token, cp_lexer_consume_token):
3311         Don't handle CPP_PRAGMA tokens specially.
3312         (cp_lexer_handle_pragma): Use cp_lexer_consume_token.  Don't
3313         purge the token; do clear token->value after processing.  Add
3314         assertion at beginning that token->value is nonzero.
3315         (cp_parser_statement, cp_parser_declaration_seq_opt): Handle
3316         CPP_PRAGMA as a full statement or declaration in its own right.
3317
3318 2004-09-21  Matt Austern  <austern@apple.com>
3319
3320         PR c++/15049
3321         * decl.c (grokvardecl): Accept declarations of global variables
3322         using anonymous types.
3323
3324 2004-09-21  Roger Sayle  <roger@eyesopen.com>
3325
3326         PR c++/7503
3327         * tree.c (lvalue_p_1):  Disallow MIN_EXPR and MAX_EXPR as lvalues
3328         if either operand has side-effects.
3329         * typeck.c (rationalize_conditional_expr): Assert that neither
3330         operand of MIN_EXPR or MAX_EXPR has side-effects.
3331         (build_modify_expr):  Add support for MIN_EXPR and MAX_EXPR.
3332         Check that the "lhs" is a valid lvalue, i.e. that neither operand
3333         of a MIN_EXPR or MAX_EXPR has a side-effect.
3334
3335 2004-09-21  Nathan Sidwell  <nathan@codesourcery.com>
3336
3337         * cp-tree.h (struct lang_type_header): Remove
3338         uses_multiple_inheritance field.
3339         (TYPE_USES_MULTIPLE_INHERITANCE): Remove.
3340         (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
3341         (TYPE_USES_VIRTUAL_BASECLASSES): Remove.
3342         (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
3343         (TYPE_CONTAINS_VPTR_P): Likewise.
3344         * call.c (add_template_candidate_real): Use
3345         CLASSTYPE_VBASECLASSES.
3346         (build_special_member_call): Likewise.
3347         * class.c (finish_struct_bits): Remove
3348         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
3349         bookkeeping.
3350         (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
3351         (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
3352         bookkeeping.
3353         (build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
3354         (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
3355         Likewise.
3356         * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
3357         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
3358         bookkeeping.
3359         (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
3360         * decl2.c (maybe_retrofit_in_chrg): Likewise.
3361         * init.c (expand_member, push_base_cleanups): Likewise.
3362         * pt.c (instantiate_class_template): Remove
3363         TYPE_USES_MULTIPLE_INHERITANCE,
3364         TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
3365         bookkeeping.
3366         * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
3367         check.
3368         * typeck2.c (process_init_constructor): Replace some sorrys with
3369         asserts.
3370
3371 2004-09-21  Andreas Tobler  <a.tobler@schweiz.ch>
3372
3373         * decl.c (reshape_init_array): Initialize max_index_cst to fix
3374         bootstrap failure.
3375
3376 2004-09-20  Mark Mitchell  <mark@codesourcery.com>
3377
3378         PR c++/17530
3379         * pt.c (tsubst): Fix parentheses to accomodate emacs.
3380         (tsubst_baselink): If we get a single function, mark it as used.
3381
3382 2004-09-20  Matt Austern <austern@apple.com>
3383             Zack Weinberg  <zack@codesourcery.com>
3384
3385         * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function):
3386         Apply lbasename to input_filename before passing to get_fileinfo.
3387         * semantics.c (begin_class_definition): Likewise.
3388         * lex.c (handle_pragma_interface): Apply get_fileinfo to the
3389         correct filename.  Rename variables to be less confusing.
3390         (handle_pragma_implementation): Likewise.  Disable "appears
3391         after file is included" diagnostic.
3392
3393         * parser.c (struct cp_token): Add in_system_header fiag.
3394         (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block)
3395         (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token)
3396         (CPP_NONE, cp_lexer_read_token): Delete.
3397         (struct cp_lexer): Remove first_token, string_tokens,
3398         main_lexer_p fields.  Clarify comments.
3399         (struct cp_token_cache): Now just a pair of pointers.
3400         (CP_LEXER_BUFFER_SIZE): New #define.
3401         (CPP_PURGED): New fake token type.
3402         (cp_lexer_new_from_token_array, cp_lexer_destroy)
3403         (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens)
3404         (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal):
3405         New functions.
3406         (cp_lexer_new_from_tokens): Now a simple wrapper around
3407         cp_lexer_new_from_token_array.
3408         (cp_lexer_set_source_position_from_token): Also update
3409         in_system_header.
3410         (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token):
3411         Don't wrap round.
3412         (cp_lexer_token_difference): Dont handle wrapping round.
3413         (cp_lexer_new_main): Enable pragma deferral and raw strings,
3414         read the entire translation unit through c_lex_with_flags into
3415         this lexer's buffer, then turn raw strings back off again.
3416         (cp_lexer_grow_buffer): Adjust for buffer no longer being circular.
3417         (cp_lexer_get_preprocessor_token): No need to handle not being
3418         the main lexer.  Set token->in_system_header too.
3419         (cp_lexer_peek_token): Skip purged tokens.  Feed pragma tokens
3420         to cp_lexer_handle_pragma.  No need to call cp_lexer_read_token.
3421         (cp_lexer_peek_nth_token): Likewise.
3422         (cp_lexer_purge_token): Mark the token PURGED, don't shift all
3423         the other tokens down.
3424         (cp_lexer_purge_tokens_after): Likewise.
3425         (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry
3426         about there being no tokens.
3427         (cp_lexer_print_token): Revise to give useful information on
3428         all tokens.
3429         (struct cp_parser): Add field translate_strings_p.
3430         (cp_parser_new): Initialize it.
3431         (cp_parser_translation_unit): Destroy the lexer when done.
3432         (cp_parser_parameter_declaration): Restructure saving of
3433         default arguments.
3434         (cp_parser_save_member_function_body): Likewise.
3435         (cp_parser_check_for_invalid_template_id)
3436         (cp_parser_nested_name_specifier_opt, cp_parser_template_id):
3437         Adjust calls to cp_lexer_advance_token.
3438         (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration):
3439         No need to fiddle c_lex_string_translate.
3440         (cp_parser_primary_expression, cp_parser_linkage_specification)
3441         (cp_parser_asm_definition, cp_parser_asm_specification_opt)
3442         (cp_parser_asm_operand_list, cp_parser_asm_clobber_list)
3443         Use cp_parser_string_literal.
3444         (cp_parser_attribute_list): Save and restore
3445         parser->translate_strings_p, not c_lex_string_translate.
3446         (cp_parser_cache_group): Delete.
3447         (cp_parser_cache_group_1): Rename cp_parser_cache_group.  Do
3448         not take a cache argument.
3449
3450 2004-09-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
3451
3452         PR c++/14179
3453         * decl.c (reshape_init): Extract array handling into...
3454         (reshape_init_array): New function. Use integers instead of trees
3455         for indices. Handle out-of-range designated initializers.
3456
3457 2004-09-20  Steven Bosscher  <stevenb@suse.de>
3458
3459         * lex.c (cxx_init): Don't set the ridpointer for RID_NULL
3460         to null_node.
3461
3462 2004-09-19  Mark Mitchell  <mark@codesourcery.com>
3463
3464         * decl2.c (determine_visibility): Allow class visibility
3465         directives to override targetm.cxx.export_class_data.
3466
3467 2004-09-18  Kazu Hirata  <kazu@cs.umass.edu>
3468
3469         * call.c, semantics.c: Follow spelling conventions.
3470         * class.c: Fix a comment typo.
3471
3472 2004-09-16  Geoffrey Keating  <geoffk@apple.com>
3473
3474         PR pch/13361
3475         * cp/lex.c (handle_pragma_interface): Duplicate string from tree.
3476         (handle_pragma_implementation): Likewise.
3477
3478 2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
3479             Zack Weinberg  <zack@codesourcery.com>
3480
3481         * cp-tree.def: Use tree_code_class enumeration constants
3482         instead of code letters.
3483         * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
3484         * mangle.c, pt.c, semantics.c, tree.c, typeck.c:
3485         Update for new tree-class enumeration constants.
3486
3487 2004-09-16  Mark Mitchell  <mark@codesourcery.com>
3488
3489         PR c++/16002
3490         * parser.c (cp_parser_simple_declaration): Commit to tentative
3491         parses after seeing a decl-specifier.
3492         (cp_parser_simple_declaration): Eliminate spurious message.
3493         (cp_parser_init_declarator): Adjust error message.
3494
3495         PR c++/16029
3496         * lex.c (unqualified_name_lookup_error): Mark the dummy
3497         declaration as used.
3498
3499         PR c++/17501
3500         * parser.c (cp_parser_nested_name_specifier): Do not resolve
3501         typename types if the user explicitly said "typename".
3502
3503 2004-09-16  Andrew MacLeod  <amacleod@redhat.com>
3504
3505         * error.c (dump_decl): Make sure there is lang_specific info before
3506         checking for DTOR and CTOR decls.
3507
3508 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
3509
3510         * class.c (copy_virtuals): Remove.
3511         (build_primary_vtable): Use copy_list directly.
3512         (build_secondary_vtable): Likewise.
3513         (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here.
3514         (create_vtable_ptr): Likewise.
3515
3516 2004-09-16  Kazu Hirata  <kazu@cs.umass.edu>
3517
3518         * search.c: Follow spelling conventions.
3519
3520 2004-09-16  Nathan Sidwell  <nathan@codesourcery.com>
3521
3522         * cp-tree.h (struct lang_type_class): Make pure_virtuals a
3523         VEC(tree).
3524         (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update
3525         comments.
3526         * call.c (build_new_method_call): Don't confirm a pure virtual is
3527         in CLASSTYPE_PURE_VIRTUALS.  Reorder checks. Make it a warning.
3528         * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree).
3529         (fixup_inline_methods, finish_struct): Likewise.
3530         * decl.c (finish_method): Likewise.
3531         * search.c (dfs_get_pure_virtuals, get_pure_virtuals):
3532         CLASSTYPE_PURE_VIRTUALS is a VEC(tree).
3533         * typeck2.c (abstract_virtuals_error): Likewise. Truncate the
3534         vector to avoid repeating the list in error messages.
3535
3536 2004-09-15  Mark Mitchell  <mark@codesourcery.com>
3537
3538         * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define.
3539         * cp-tree.h (cxx_comdat_group): Declare.
3540         * decl.c (cxx_comdat_group): New function.
3541
3542 2004-09-15  Nathan Sidwell  <nathan@codesourcery.com>
3543
3544         * search.c (get_pure_virtuals): Remove unused variables.
3545
3546         * cp-tree.h (struct lang_decl_flags): Remove
3547         needs_final_overrider.
3548         (DECL_NEEDS_FINAL_OVERRIDER_P): Remove.
3549         * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P.
3550         * class.c (finish_struct_bits): Correct comment about
3551         CLASSTYPE_PURE_VIRTUALS.
3552         * search.c (get_pure_virtuals): Remove useless loop.
3553
3554 2004-09-14  Mark Mitchell  <mark@codesourcery.com>
3555
3556         PR c++/17324
3557         * mangle.c (partially_mangled_name): New variable.
3558         (partially_mangled_name_len): Likewise.
3559         (save_partially_mangled_name): New function.
3560         (restore_partially_mangled_name): Likewise.
3561         (write_encoding): Save and restore partially mangled names around
3562         calls to get_mostly_instantiated_function_type.
3563         (write_unqualified_name): Likewise.
3564
3565 2004-09-14  Nathan Sidwell  <nathan@codesourcery.com>
3566
3567         * pt.c (unify): Replace gcc_unreachable with gcc_assert.
3568
3569 2004-09-13  Mark Mitchell  <mark@codesourcery.com>
3570
3571         PR c++/16162
3572         * parser.c (cp_parser_id_expression): Correct value for
3573         is_declarator.
3574         (cp_parser_nested_name_specifier_opt): Look through typenames as
3575         necessary.
3576         (cp_parser_template_name): Honor check_dependency_p.
3577
3578         PR c++/16716
3579         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name):
3580         Robustify.
3581
3582         PR c++/17327
3583         * pt.c (unify): Add ENUMERAL_TYPE case.  Replace sorry with
3584         gcc_unreacable.
3585
3586 2004-09-12  Richard Henderson  <rth@redhat.com>
3587
3588         PR c++/16254
3589         * semantics.c (maybe_cleanup_point_expr): Don't call fold.
3590         * typeck.c (condition_conversion): Likewise.
3591
3592 2004-09-11  Richard Henderson  <rth@redhat.com>
3593
3594         PR c++/17404
3595         * pt.c (cur_stmt_expr): Move from tsubst_expr.
3596         (tsubst_expr) <case STMT_EXPR>: Move ...
3597         (tsubst_copy_and_build): ... here.
3598
3599 2004-09-10  Zack Weinberg  <zack@codesourcery.com>
3600
3601         * cp-tree.h (interface_only, interface_unknown): Delete declarations;
3602         comment explaining them moved to c-common.h.
3603         * lex.c (interface_only, interface_unknown, extract_interface_info):
3604         Delete definitions.
3605         (cxx_finish): Don't reset interface_unknown.
3606         (handle_pragma_interface): Don't set interface_only and
3607         interface_unknown; just the like-named fields in finfo.
3608         (handle_pragma_implementation): Adjust comment.
3609         * decl2.c (cp_finish_file): Don't reset interface_only and
3610         interface_unknown.
3611         * method.c (synthesize_method): Don't reset interface_unknown or
3612         call extract_interface_info.
3613         * pt.c (pop_tinst_level): Don't call extract_interface_info.
3614         * decl.c (start_cleanup_fn): Don't save or restore interface_only
3615         and interface_unknown.
3616         (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
3617         and use the result instead of the interface_only/interface_unknown
3618         globals.
3619         (start_preparsed_function): Likewise.
3620         * lex.c (cxx_make_type): Likewise.
3621         * semantics.c (begin_class_definition): Likewise.
3622         (expand_body): Don't call extract_interface_info.
3623
3624 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
3625
3626         * decl.c (objc_mark_locals_volatile): Make description of
3627         routine more descriptive; only mark VAR_DECLs at each
3628         binding level.
3629
3630 2004-09-10  Richard Henderson  <rth@redhat.com>
3631
3632         PR c++/17386
3633         * call.c (build_vfield_ref): Move...
3634         * class.c (build_vfield_ref): ... here.  Convert datum to the
3635         primary base containing the vptr.
3636         (make_new_vtable): Simplify build_primary_vtable arguments.
3637         (finish_struct_1): Do not duplicate TYPE_VFIELD.
3638         * typeck.c (build_class_member_access_expr): Don't warn for
3639         null object access to base fields.
3640
3641 2004-09-10  Ziemowit Laski  <zlaski@apple.com>
3642
3643         * decl.c (objc_get_current_scope, objc_mark_locals_volatile):
3644         New functions, to be called from ObjC++.
3645
3646 2004-09-10  Kazu Hirata  <kazu@cs.umass.edu>
3647
3648         * class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
3649         name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
3650         comment typos.
3651
3652 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
3653
3654         * typeck.c (build_c_cast): Preserve the cast if casting
3655         to and from an Objective-C type.
3656
3657 2004-09-09  Ziemowit Laski  <zlaski@apple.com>
3658
3659         * Make-lang.in (cp/typeck.o): Depend on c-common.h.
3660         * typeck.c: Include c-common.h.
3661         (comptypes): For RECORD_TYPEs, call objc_comptypes() and
3662         return the result if nonnegative.
3663
3664 2004-09-09  Zack Weinberg  <zack@codesourcery.com>
3665
3666         * decl2.c (import_export_class)
3667         * lex.c (handle_pragma_interface):
3668         Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.
3669
3670 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
3671
3672         * Make-lang.in (cp/semantics.o): Depend on c-common.h.
3673         * semantics.c: Include c-common.h.
3674         (finish_compound_stmt): Call objc_clear_super_receiver().
3675
3676 2004-09-08  Ziemowit Laski  <zlaski@apple.com>
3677
3678         * cp-tree.h (do_poplevel): New prototype.
3679         * semantics.c (do_poplevel): Make externally visible.
3680
3681 2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>
3682
3683         * cp-tree.h (tree_pair_s): Define a GC'd vector.
3684         * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise.
3685         * semantics.c (deferred_access): Likewise.
3686
3687 2004-09-06  Daniel Jacobowitz  <dan@debian.org>
3688
3689         * semantics.c (expand_body): Assert that we are not nested.
3690
3691 2004-09-06  Zack Weinberg  <zack@codesourcery.com>
3692
3693         * decl.c (build_enumerator): Use add_double and int_fits_type_p
3694         instead of cp_build_binary_op, to avoid creating short-lived trees.
3695         * parser.c (cp_parse_type_specifier <RID_ENUM>): Use two-token
3696         lookahead instead of backtracking.  Move some code to avoid a
3697         conditional branch.
3698         (cp_parser_enum_specifier): Avoid duplication of effort with caller.
3699         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
3700         (cp_parser_enumerator_list, cp_parser_enumerator_definition):
3701         Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate.
3702
3703 2004-09-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
3704
3705         * decl.c (grok_declarator): Remove a redundant semicolon.
3706
3707         * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier):
3708         Correct comments describing function parameters.
3709
3710 2004-09-03  Matt Austern  <austern@apple.com>
3711         Compile speed improvement.
3712         * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set.
3713         Otherwise define a stub macro that expands to nothing.
3714         (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set.  Otherwise
3715         define a stub macro that expands to 0.
3716         (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set.
3717         (cp_lexer_stop_debugging): Likewise.
3718         (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set.  Otherwise
3719         define a stub macro that expands to NULL.
3720         (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set.
3721         (cp_lexer_new_from_tokens): Likewise.
3722
3723 2004-09-03  Jan Hubicka  <jh@suse.cz>
3724
3725         * decl.c (finish_function): Clean out pointers we no longer need.
3726
3727 2004-09-03  Jan Beulich  <jbeulich@novell.com>
3728
3729         * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather
3730         than "-lm".
3731
3732 2004-09-02  Paul Brook  <paul@codesourcery.com>
3733
3734         * decl2.c (determine_visibility): Only check data visibility
3735         for VAR_DECLS.
3736
3737 2004-08-31  Mark Mitchell  <mark@codesourcery.com>
3738
3739         * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
3740         * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
3741         * decl2.c (determine_visibility): Honor
3742         TARGET_CXX_EXPORT_CLASS_DATA.
3743
3744         * class.c (key_method): Rename to ...
3745         (determine_key_method): ... this.
3746         (finish_struct_1): Adjust accordingly.
3747         * cp-tree.h (key_method): Declare.
3748         * decl2.c (maybe_emit_vtables): Determine the key method here if
3749         it has not already been done.
3750
3751 2004-08-31  Ziemowit Laski  <zlaski@apple.com>
3752
3753         * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
3754         (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
3755         (cp/cp-decl.c): Do not depend on gtype-cp.h.
3756         (cp/cp-objcp-common.o): New target.
3757         * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
3758         (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
3759         cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
3760         prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
3761         respectively.
3762         (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
3763         LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
3764         LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
3765         LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
3766         LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
3767         LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
3768         LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
3769         LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
3770         LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
3771         LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
3772         LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
3773         LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
3774         LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
3775         LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
3776         LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
3777         LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
3778         LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
3779         LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
3780         LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
3781         LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
3782         LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
3783         LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
3784         LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
3785         LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
3786         LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
3787         LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
3788         LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
3789         LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
3790         LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
3791         LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
3792         LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
3793         hooks to cp-objcp-common.h.
3794         (finish_file): New function.
3795         * cp-objcp-common.c: New file.
3796         * cp-objcp-common.h: New file.
3797         * cp-tree.h (cp_finish_file): New prototype.
3798         * decl.c: Do not include gtype-cp.h.
3799         * decl2.c (finish_file): Rename to cp_finish_file.
3800
3801 2004-08-31  Richard Henderson  <rth@redhat.com>
3802
3803         PR c++/17221
3804         * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ...
3805         (tsubst_copy_and_build): ... here.
3806
3807 2004-08-30  Mark Mitchell  <mark@codesourcery.com>
3808
3809         * cp-tree.h (initialize_artificial_var): Declare.
3810         * decl.c (initialize_artifical_var): New function.
3811         * class.c (initialize_array): Remove.
3812         (initialize_vtable): Use initialize_artificial_var.
3813         (build_vtt): Likewise.
3814         (build_ctor_vtbl_group): Likewise.
3815
3816 2004-08-30  Richard Henderson  <rth@redhat.com>
3817
3818         * class.c (build_base_path): Use build_address directly.
3819         * typeck.c (build_unary_op): Don't lower &a.b to pointer
3820         arithmetic directly.
3821         * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT
3822         means !initializer_constant_valid_p.
3823
3824 2004-08-30  Richard Henderson  <rth@redhat.com>
3825
3826         * class.c (fixed_type_or_null): Use get_base_address before
3827         assuming an ADDR_EXPR is non-null.
3828
3829 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3830
3831         * name-lookup.c (pop_binding, pushdecl,
3832         set_identifier_type_value_with_scope, push_overloaded_decl,
3833         arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable.
3834         * parser.c (cp_parser_diagnose_invalid_type_name,
3835         cp_parser_postfix_expression, cp_parser_unary_expression,
3836         cp_parser_check_declarator_template_para): Likewise.
3837         * pt.c (push_inline_template_parms_recursive,
3838         check_explicit_specialization, convert_nontype_argument,
3839         coerce_template_template_parms, uses_template_parms,
3840         instantiate_class_template, tsubst_decl, tsubst, tsubst_copy,
3841         tsubst_expr, instantiate_template,
3842         maybe_adjust_types_for_deduction, type_unification_real,
3843         resolve_overloaded_unification, template_decl_level,
3844         type_dependent_expression_p): Likewise.
3845         * search.c (lookup_base_r): Likewise.
3846         * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise.
3847         * tree.c (lvalue_p_1, count_functions, cxx_printable_name,
3848         verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise.
3849         * typeck.c (common_type, get_member_function_from_ptrfunc,
3850         build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise.
3851         * typeck2.c (cxx_incomplete_type_diagnostic,
3852         split_nonconstant_init_1, store_init_value,
3853         process_init_constructor): Likewise.
3854
3855 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3856
3857         * call.c (check_dtor_name): Replace abort with gcc_assert or
3858         gcc_unreachable.
3859         (build_call, add_builtin_candidate, build_new_op,
3860         convert_like_real, build_over_call, in_charge_arg_for_name,
3861         source_type, joust): Likewise.
3862         * class.c (build_simple_base_path, get_vcall_index,
3863         finish_struct_1, instantiate_type, get_enclosing_class,
3864         add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
3865         * cp-gimplify.c (cp_genericize): Likewise.
3866         * cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
3867         * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
3868         * decl.c (poplevel, make_unbound_class_template, reshape_init,
3869         check_special_function_return_type, grokdeclarator,
3870         grok_op_properties, tag_name, xref_tag, start_preparsed_function,
3871         finish_function): Likewise.
3872         * decl2.c (grokfield, maybe_emit_vtables):Likewise.
3873         * error.c (dump_global_iord, dump_decl, dump_template_decl,
3874         language_to_string): Likewise.
3875         * except.c (choose_personality_routine): Likewise.
3876         * friend.c (do_friend): Likewise.
3877         * g++spec.c (lang_specific_driver): Likewise.
3878         * init.c (build_zero_init, expand_default_init, build_new_1,
3879         build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
3880         * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
3881         * mangle.c (add_substitution, write_unscoped_name,
3882         write_template_prefix, write_identifier,
3883         write_special_name_destructor, write_type, write_builtin_type,
3884         write_expression, write_template_param,
3885         write_java_integer_type_codes): Likewise.
3886         * method.c (implicitly_declare_fn): Likewise.
3887
3888 2004-08-30  Nathan Sidwell  <nathan@codesourcery.com>
3889
3890         * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
3891         (BINFO_INDIRECT_PRIMARY_P): Remove.
3892         * class.c (determine_primary_base): Rename to ...
3893         (determine_primary_bases): ... here.  Set all primary bases.
3894         (set_primary_base): Remove.
3895         (mark_primary_bases): Remove.
3896         (build_simple_base_path, walk_subobject_offsets,
3897         propagate_binfo_offsets, end_of_class): Adjust.
3898         (layout_class_type): Rename determine_primary_base call.
3899         (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo
3900         to type_as_string.
3901         (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits,
3902         build_rtti_vtbl_entries): Adjust.
3903         * init.c (build_vtbl_address): Adjust.
3904
3905         * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert.
3906
3907 2004-08-28  Ziemowit Laski  <zlaski@apple.com>
3908
3909         * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
3910         CXX_AND_OBJCXX_OBJS.
3911         (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
3912         separately on the link line.
3913
3914 2004-08-28  Jason Merrill  <jason@redhat.com>
3915
3916         * decl.c (expand_static_init): Avoid bogus warnings.
3917
3918 2004-08-27  Jason Merrill  <jason@redhat.com>
3919
3920         PR c++/16851
3921         * tree.c (stabilize_init): See through a COMPOUND_EXPR.
3922
3923         PR c++/13684
3924         * decl.c (expand_static_init): Use thread-safety API.
3925         (register_dtor_fn): Return the call, don't expand it.
3926         * tree.c (add_stmt_to_compound): New fn.
3927         (stabilize_call): Use it.
3928
3929 2004-08-27  Richard Henderson  <rth@redhat.com>
3930
3931         * cp-tree.def (OFFSETOF_EXPR): New.
3932         * parser.c (cp_parser_builtin_offsetof): Either built an
3933         OFFSETOF_EXPR, or call fold_offsetof immediately.
3934         * pt.c (tsubst_expr): Handle OFFSETOF_EXPR.
3935
3936 2004-08-27  Nathan Sidwell  <nathan@codesourcery.com>
3937
3938         * call.c (validate_conversion_obstack): Replace
3939         my_friendly_assert with gcc_assert or gcc_unreachable.
3940         (direct_reference_binding, merge_conversion_sequences,
3941         build_user_type_conversion_1, perform_overload_resolution,
3942         build_op_delete_call, enforce_access, call_builtin_trap,
3943         build_over_call, build_special_member_call, build_new_method_call,
3944         initialize_reference): Likewise.
3945         * class.c (build_base_path, build_primary_vtable, alter_access,
3946         check_bases, update_vtable_entry_for_fn, layout_empty_base,
3947         clone_function_decl, adjust_clone_args,
3948         type_requires_array_cookie, include_empty_classes,
3949         finish_struct_1, resolve_address_of_overloaded_function,
3950         instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
3951         dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
3952         accumulate_vtbl_inits, build_vtbl_initializer,
3953         build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
3954         * cvt.c (build_up_reference, convert_to_reference): Likewise.
3955         * decl.c (poplevel, duplicate_decls, make_typename_type,
3956         cxx_init_decl_processing, reshape_init, check_initializer,
3957         make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
3958         expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
3959         grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
3960         xref_basetypes, start_preparsed_function, save_function_data,
3961         finish_function, finish_method, maybe_register_incomplete_var,
3962         complete_vars): Likewise.
3963         * decl2.c (grok_array_decl, check_member_template,
3964         check_classfn, finish_static_data_member_decl, coerce_new_type,
3965         coerce_delete_type, import_export_class, decl_needed_p,
3966         determine_visibility, import_export_decl, build_cleanup,
3967         start_static_initialization_or_destructi, do_static_destruction,
3968         prune_vars_needing_no_initialization,
3969         build_offset_ref_call_from_tree): Likewise.
3970         * error.c (dump_decl, dump_expr): Likewise.
3971         * init.c (finish_init_stmts, build_zero_init,
3972         expand_virtual_init, expand_default_init, expand_aggr_init_1,
3973         build_offset_ref, build_new_1, build_delete, build_vbase_delete):
3974         Likewise.
3975         * mangle.c (write_method_parms, write_template_args,
3976         write_expression, write_template_arg): Likewise.
3977         * method.c (make_thunk, finish_thunk, use_thunk): Likewise.
3978         * name-lookup.c (pop_binding, begin_scope, leave_scope,
3979         resume_scope, push_using_decl, validate_nonmember_using_decl,
3980         is_ancestor, poplevel_class, set_inherited_value_binding_p,
3981         push_class_level_binding, do_class_using_decl, push_namespace,
3982         pop_namespace, add_using_namespace, ambiguous_decl,
3983         lookup_namespace_name, lookup_type_current_level,
3984         maybe_process_template_type_declaration): Likewise.
3985         * parser.c (cp_lexer_peek_nth_token,
3986         cp_parser_parse_and_diagnose_invalid_typ,
3987         cp_parser_translation_unit, cp_parser_template_id,
3988         cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
3989         * pt.c (push_access_scope, finish_member_template_decl,
3990         push_inline_template_parms_recursive, add_outermost_template_args,
3991         get_innermost_template_args, begin_explicit_instantiation,
3992         end_explicit_instantiation, retrieve_specialization,
3993         is_specialization_of, is_specialization_of_friend,
3994         register_specialization, check_explicit_specialization,
3995         comp_template_parms, process_template_parm,
3996         process_partial_specialization, convert_nontype_argument,
3997         coerce_template_template_parms, coerce_template_parms,
3998         mangle_class_name_for_template, lookup_template_function,
3999         lookup_template_class, instantiate_class_template, tsubst_decl,
4000         tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
4001         instantiate_template, fn_type_unification, type_unification_real,
4002         get_template_base, regenerate_decl_from_template,
4003         template_for_substitution, instantiate_decl,
4004         get_mostly_instantiated_function_type, dependent_scope_ref_p,
4005         value_dependent_expression_p, resolve_typename_type): Likewise.
4006         * repo.c (repo_emit_p): Likewise.
4007         * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
4008         create_tinfo_types, emit_tinfo_decl): Likewise.
4009         * search.c (lookup_base_r, lookup_base, lookup_field_1,
4010         dfs_access_in_type, build_baselink, lookup_member,
4011         adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
4012         * semantics.c (perform_or_defer_access_check,
4013         finish_non_static_data_member, finish_stmt_expr_expr,
4014         finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
4015         finish_template_template_parm, finish_member_declaration,
4016         emit_associated_thunks): Likewise.
4017         * tree.c (build_target_expr_with_type, force_target_expr,
4018         copy_binfo, get_first_fn, cp_tree_equal): Likewise.
4019         * typeck.c (type_after_usual_arithmetic_conversions, comptypes,
4020         cxx_sizeof_or_alignof_type, perform_integral_promotions,
4021         build_class_member_access_expr, finish_class_member_access_expr,
4022         build_ptrmemfunc_access_expr, build_unary_op,
4023         unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
4024         build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr