OSDN Git Service

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