OSDN Git Service

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