OSDN Git Service

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